Skip to content

A compiler that writes a pipeline as plain TypeScript - #6

Merged
JoshuaWink merged 1 commit into
betafrom
typescript-compile
Oct 10, 2026
Merged

JoshuaWink merged 1 commit into
betafrom
typescript-compile

Conversation

@JoshuaWink

Copy link
Copy Markdown
Member

What is added

packages/codeupipe-compile-ts. It reads the source of a pipeline class and writes one module with no import of codeupipe: a function for each step and an async run(input).

The rule

Code that compiles gives the same output as the pipeline. A pipeline for which the compiler cannot keep that rule is refused, with the place named and the fix. Nothing is written for a refused pipeline.

Checks

  • The conformance target typescript:static: 11 cases pass, and the 16 cases that also check State or Hooks pass on what plain code can show. This is the same result as the Python fast mode.
  • Tests for each refusal, and a strict type check of the code that is written.

Limits

No State, no Hooks, one layout. A step is made in the call that adds it, with literal arguments.

This pull request is part of a stack. Merge the stack in order, with a merge commit: step-labels, typescript-runtime, typescript-lint, typescript-compile, python-compile-rename, version-2-beta. Each one shows only its own change.

🤖 Generated with Claude Code

packages/codeupipe-compile-ts reads the source of a pipeline class and
writes one module with no import of codeupipe: a function for each step
and an async run(input). The data is a Map, each operation of the
Payload is an operation of the Map, and each setting of an instance is
a constant.

A pipeline for which the compiled code cannot give the same output is
refused, with the place named and the fix: Hooks, a constructor that
does more than add steps, settings that are not literals, a step that
keeps state, a Payload that is copied or given to other code, a Tap or
a Predicate that writes. Nothing is written for a refused pipeline.

The conformance suite has the target typescript:static. The runner
writes each case as a pipeline class, compiles it, imports the file and
runs it. 11 cases pass, and the 16 cases that also check State or Hooks
pass on what plain code can show, as for the Python fast export.

The compiler is a codeupipe pipeline. The Taps of the TypeScript runner
now record to a module, so that compiled code can do the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JoshuaWink
JoshuaWink changed the base branch from typescript-lint to beta October 10, 2026 21:19
@JoshuaWink
JoshuaWink merged commit 8aeeed2 into beta Oct 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant