Repository navigation
A compiler that writes a pipeline as plain TypeScript - #6
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asyncrun(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
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.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