Skip to content

feat(ttsc): add TtscCompiler.transform() for 3rd parties.#38

Merged
samchon merged 3 commits into
masterfrom
feat/transform
May 1, 2026
Merged

feat(ttsc): add TtscCompiler.transform() for 3rd parties.#38
samchon merged 3 commits into
masterfrom
feat/transform

Conversation

@samchon

@samchon samchon commented May 1, 2026

Copy link
Copy Markdown
Owner

This pull request removes the single-file transform command from the ttsc CLI, deprecating the CLI interface for per-file transforms in favor of a new JS API method, TtscCompiler.transform. The change clarifies the separation between project-wide builds (the main use case for the CLI) and single-file transformations (now accessible via the JS API), and updates related documentation, test references, and code paths accordingly.

CLI and API changes:

  • Removed the transform command and all related CLI flags, documentation, and code from the Go CLI (packages/ttsc/cmd/ttsc/main.go, packages/ttsc/cmd/platform/main.go, and deleted packages/ttsc/cmd/ttsc/transform.go). The CLI now only supports project-wide build and check commands. [1] [2] [3] [4] [5] [6]
  • Added a new transform method to the TtscCompiler JS API, which provides single-file transformation functionality for plugin authors and matches the shape of embed-typescript's API. [1] [2] [3]
  • Updated the JS internals to rename and clarify the single-file emit logic, changing runTransform to runSingleFileEmit and updating related error messages and temporary directory names. [1] [2] [3] [4]
  • Removed the transform command handling from the JS launcher and related argument parsing. [1] [2]

Documentation and test updates:

  • Updated documentation and test references to remove or rename references to the old transform CLI and clarify the new approach (including AGENTS.md and smoke suite test lists). [1] [2] [3]
  • Updated internal comments and option types to reflect the removal of the CLI-based single-file transform and clarify the use of ForceEmit.
  • Minor update to the @ttsc/lint article title for clarity.

@samchon samchon self-assigned this May 1, 2026
Copilot AI review requested due to automatic review settings May 1, 2026 16:46
@samchon samchon added the enhancement New feature or request label May 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the ttsc transform single-file CLI command and shifts that “single-file / embed-style transform” use case to a new programmatic JS API (TtscCompiler.transform()), while renaming internal single-file emit plumbing and updating smoke tests/fixtures accordingly.

Changes:

  • Remove ttsc transform from the Go CLI/platform helper and delete related smoke corpus projects/tests.
  • Add TtscCompiler.transform() and a new public ITtscCompilerTransformation result type (embed-typescript-style union).
  • Rename/refactor internal single-file emit logic (runTransformrunSingleFileEmit) and update tests/docs references.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/smoke/test/utility-plugins.test.cjs Removes transform-mode coverage and reformats a few assertions; keeps build-path utility plugin coverage.
tests/smoke/test/transform-projects.test.cjs Deletes the transform CLI project corpus tests.
tests/smoke/test/toolchain.test.cjs Updates toolchain smoke tests to assert transform is rejected; formatting refactors.
tests/smoke/test/plugin-corpus.test.cjs Replaces transform CLI usage with build/emit assertions; removes transform-specific source-plugin test.
tests/smoke/test/native-transformer.test.cjs Adds a focused smoke test for the Go native transformer in project build mode.
tests/projects/transform-tsx/tsconfig.json Removes transform CLI fixture.
tests/projects/transform-tsx/src/view.tsx Removes transform CLI fixture source.
tests/projects/transform-space/tsconfig.json Removes transform CLI fixture.
tests/projects/transform-space/src/throw error.ts Removes transform CLI fixture source (space-in-path coverage).
tests/projects/transform-mts/tsconfig.json Removes transform CLI fixture.
tests/projects/transform-mts/src/main.mts Removes transform CLI fixture source.
tests/projects/transform-hello/tsconfig.json Removes transform CLI fixture.
tests/projects/transform-hello/src/hello.ts Removes transform CLI fixture source.
tests/projects/transform-extends/tsconfig.json Removes transform CLI fixture.
tests/projects/transform-extends/tsconfig.base.json Removes transform CLI fixture.
tests/projects/transform-extends/src/main.ts Removes transform CLI fixture source.
tests/projects/transform-diagnostic/tsconfig.json Removes transform CLI fixture.
tests/projects/transform-diagnostic/src/main.ts Removes transform CLI fixture source.
tests/projects/transform-cts/tsconfig.json Removes transform CLI fixture.
tests/projects/transform-cts/src/main.cts Removes transform CLI fixture source.
tests/projects/go-source-plugin/go-plugin/main.go Removes transform command support from the Go source-plugin fixture.
tests/projects/go-source-plugin-tsgo/go-plugin/main.go Removes transform command support from the Go source-plugin fixture.
tests/projects/go-source-plugin-properties/go-plugin/main.go Removes transform command support from the Go source-plugin fixture.
tests/projects/go-source-plugin-entry/go-plugin/cmd/transformer/main.go Removes transform command support from the Go source-plugin fixture entry binary.
tests/projects/go-source-plugin-checker/go-plugin/main.go Updates comments and removes transform path from checker fixture.
packages/ttsc/test/compiler.test.ts Adds tests for TtscCompiler.transform() success/failure behavior.
packages/ttsc/src/structures/internal/TtscSingleFileEmitOptions.ts Renames internal options interface for single-file emit path.
packages/ttsc/src/structures/internal/TtscCommonOptions.ts Updates internal options comment to reflect removal of transform CLI path.
packages/ttsc/src/structures/index.ts Exports the new ITtscCompilerTransformation public type.
packages/ttsc/src/structures/ITtscCompilerTransformation.ts Introduces a new public transformation result union type.
packages/ttsc/src/launcher/internal/runTtsc.ts Removes transform command handling; routes single-file emit via renamed helper.
packages/ttsc/src/compiler/internal/runSingleFileEmit.ts Renames/refines the internal helper that emits one file via temp build output.
packages/ttsc/src/TtscCompiler.ts Adds transform() API and result-mapping helper from compile → transformation shape.
packages/ttsc/driver/program.go Updates ForceEmit comment to remove mention of ttsc transform.
packages/ttsc/cmd/ttsc/transform.go Deletes the Go CLI single-file transform implementation.
packages/ttsc/cmd/ttsc/main.go Removes transform command and its help/docs from the Go CLI entrypoint.
packages/ttsc/cmd/platform/main.go Removes transform from platform helper’s recognized JS-provided commands list.
articles/lint.md Tweaks article title text.
AGENTS.md Updates smoke test list and CLI/API parity checklist to reflect new API surface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ttsc/src/structures/ITtscCompilerTransformation.ts
Comment thread packages/ttsc/src/TtscCompiler.ts Outdated
Comment thread articles/lint.md
@samchon
samchon merged commit bc0e3fc into master May 1, 2026
10 of 11 checks passed
@samchon
samchon deleted the feat/transform branch May 1, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants