Skip to main content

Developing with TypeScript

Assets for the Script Development Model can be written in TypeScript as well as in JavaScript (JSSP).
The mechanism of writing function containers in TypeScript and running them after converting them to JSSP JavaScript with the tssp CLI is called tssp.

This page explains how things differ from the previous pages when you choose TypeScript when creating a project.
The mechanisms of skill sets and hooks, and the approach to the AI-native development workflow, are the same as for JavaScript.

Caution

tssp is available on iAP 2026 Autumn or later.
For projects for iAP 2026 Spring or earlier, do not choose TypeScript; develop in JavaScript (JSSP) instead.

What Is tssp?​

tssp is a CLI that converts intra-mart SSJS written in TypeScript into JSSP JavaScript that Rhino 1.7.15.1 (the SSJS execution engine of intra-mart) can run.
Running bun run tssp:build (or bun run tssp:dev during development) performs type checking, linting for Rhino, conversion to JavaScript, and copying of .html files.

Creating a Project​

If you answer No to "Use JavaScript instead of TypeScript?" in the Accel CLI init command, a project for TypeScript is created.
For the steps to create a project, see Creating a New Project.

In a project for TypeScript, the following files differ from those in a project for JavaScript.

FileContents in a project for TypeScript
Instruction files for the AI agent (CLAUDE.md, copilot-instructions.md, AGENTS.md)Instruction files for TypeScript are deployed. They state that .ts and .html files are placed under src/main/tssp/src, that bun run tssp:dev must succeed before reporting completion, that the skills for tssp are used, and that the other jssp-* skills and rules are applied to TypeScript
Rules filesThe TypeScript rules file tssp-typescript.md is added. For details, see Rules Files
SkillsTypeScript versions are deployed in place of some skills. For details, see Differences in Skill Sets
package.jsontssp:dev and tssp:build are added to scripts, and @intra-mart/tssp is added to devDependencies
src/main/tssp/tsconfig.jsonSettings for type checking the .ts files under src/main/tssp/src in the editor. bun run tssp:build does not read this file; it type checks with the settings bundled with tssp

The src/main/tssp directory is included in the template, but the src directory under it is not. Create src/main/tssp/src when you place your first .ts file.

File Placement​

Place .ts and .html files under src/main/tssp/src. Place a .ts file and its paired .html file in the same directory with the same name.
bun run tssp:build writes its output under src/main/jssp/src, keeping the directory structure. .ts files are converted to .js, and .html files are copied as is.

Input fileOutput file
src/main/tssp/src/sample/hello.tssrc/main/jssp/src/sample/hello.js
src/main/tssp/src/sample/hello.htmlsrc/main/jssp/src/sample/hello.html

Files under src/main/jssp/src are written by tssp, so do not create or edit them by hand.
To make a fix, correct the .ts file under src/main/tssp/src and build again.

bun run tssp:build outputs only .js and .html files. Place files that bun run tssp:build does not output, such as 2WaySQL .sql files, directly in the same location as for JSSP (under src/main/jssp/src).

Differences in Skill Sets​

In a project for TypeScript, TypeScript versions are deployed in place of the following three skills described in Skill Sets.
In addition, tssp-usage, which summarizes how to use tssp, is added.

For JavaScriptFor TypeScriptPurpose
jssp-page-generatortssp-page-generatorGenerate new business screens (.html + .ts) and routing XML
jssp-page-verifiertssp-page-verifierVerification of generated screens. Runs bun run tssp:dev and verifies the build output
jssp-code-reviewtssp-code-reviewAutomated code review. Adds checks of types and of attempts to bypass type checking
(none)tssp-usageWhere to place .ts / .html files, the processing order of bun run tssp:build, type checking, what the lint for Rhino prohibits, and how to resolve output conflicts

The skills other than those above are the same as in a project for JavaScript.
For tasks that have no tssp skill, the AI agent rewrites the JavaScript code examples shown by the jssp-* skills into TypeScript.

Rules Files​

The rules files are the same jssp-*.md files as in a project for JavaScript, plus the following one.

FileKey points
tssp-typescript.mdDefines what changes in how you write code when applying the rules in jssp-*.md to .ts files (type annotations, interface, and the types in d.ts)

The rules in jssp-*.md also apply to the .ts and .html files under src/main/tssp/src.

Hooks​

The hooks settings are the same as in a project for JavaScript.

AI-native Development Workflow​

Conversion with bun run tssp:build is added to the basic flow of the AI-native development workflow.

  1. When you instruct the AI agent, the artifacts are generated under src/main/tssp/src
  2. Convert them into src/main/jssp/src with bun run tssp:dev (tssp-page-generator builds and verifies with tssp-page-verifier after generation)
  3. Deploy the artifacts to the intra-mart verification environment and confirm they work
  4. If there are issues, fix the .ts file under src/main/tssp/src and build again

Run the following commands in the project root. tssp is installed when the project is created. If you use npm, read bun run as npm run.

CommandOutputUse
bun run tssp:dev.js (not minified) and .js.mapChecking and debugging during development
bun run tssp:buildMinified .js. No source maps are outputProduction

Build Failures​

bun run tssp:build processes in the order of type checking, linting, conversion, conflict checking, and writing.
If it fails at any point before writing, it exits without writing anything.

FailureHow to fix
Type errorThere is an API that is not in the d.ts files, or a call that does not match the types. Include the error message in your prompt and ask the AI agent to fix it
Lint violationThere is code that Rhino does not accept (class, async, default parameters, and so on). Include the error message in your prompt and ask the AI agent to fix it
ConflictThe output location contains a file that tssp did not write. If it is tssp output, delete it and run again; if it is a hand-written file, rename the .ts or .html file

Debugging​

Using the .js.map output with --dev, you can set breakpoints in the original .ts file in the debugger.

Coding Constraints​

Because the JavaScript generated by tssp runs on Rhino, there are the following constraints on how you write TypeScript.
For details, see the tssp-usage skill deployed in the project.

  • Write bind variables as export let $data = ... and the entry point as export function init(request: Request): void
  • Read only types from other .ts files with import type. Load common modules used at run time with load(), as in JSSP
  • Code that Rhino does not accept, such as class, async, and default parameters, is reported as an error by the lint
  • Using an API that is not in the d.ts files stops the build at type checking