Repository navigation
Conversation
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
The changes in this PR have been fully implemented and verified locally (including compatibility testing with TypeScript 7 and regression tests). Everything is ready, and I'm just awaiting further review. Please keep this PR open! |
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
This PR was closed because it has been inactive for 1 day since being marked as stale. |
|
Rechecked after the stale closure against main I also noticed #4877 now addresses the same issue. This earlier PR includes a dedicated regression for help/version, non-transpiling circuit output, and explicit/config-driven transpilation errors, without dependency changes. Happy to consolidate the approaches during review; no new commit was needed for this recheck. GitHub is not allowing me to reopen this from my side. Could a maintainer reopen it for review if this is still the preferred fix? |
Addresses #4706.
With TypeScript 7 installed, eagerly importing the Rollup TypeScript plugin throws at
ModuleKind.ES2015before any CLI command can run. Defer the compiler and Rollup imports until transpilation is requested, and check for the traditional JavaScript compiler API before initializing the plugins. Circuit builds that do not enable transpilation,--help, and--versioncan run;transpileandbuild --transpileexit with an actionable compatibility message that recommends TypeScript 5.9.3.Add a subprocess regression that reproduces TypeScript 7's version-only main export without changing the compiler used by other tests. It checks successful non-transpiling builds and board/component output, successful help/version commands, and nonzero exits with the compatibility diagnostic for both explicit transpilation commands and
build.typescriptLibrary: trueconfiguration.Validation on Windows x64, Bun 1.4.2:
ModuleKind.ES2015startup error.tests/cli/transpile/transpile.test.tsandtests/cli/build/build-transpile.test.ts: 11 tests, 55 assertions passed, including ESM, CommonJS, declarations and explicit.ts/.tsxextension handling.bun run build,bun x --no-install tsc --noEmit, formatting of both changed files, dependency policy check, andgit diff --checkpassed.dist/cli/main.jswith the actual npm TypeScript 7.0.2 package, not a mock. Eager plugin import reproduced the original error. Help, version and a one-resistor circuit build exited 0; the circuit output contained a board and R1. Both transpilation commands exited 1 with the compatibility/install message. Restored TypeScript 5.9.3 afterward.This protects startup and non-transpiling circuit builds; it does not port transpilation or other compiler-API-dependent features to TypeScript 7. In particular,
tsci devstill has dependency-analysis code that uses the old compiler API and remains outside this fix.build --cienables transpilation on its normal build path (a custombuildCommandcan handle the command earlier), andbuild.typescriptLibrary: trueenables it through configuration; these paths still require a compatible compiler. Full end-to-enddevand--ciruns were not performed. No new dependencies or lockfile changes.Validation caveat: one existing Windows test embeds an unescaped absolute path into generated TSX and does not assert its child exit code. Its test assertions passed although that child circuit build reported an import error. The new compatibility regression asserts exit codes explicitly. The entire repository suite and Linux CI have not been run locally.
AI assistance: implementation and verification were coordinated with Codex, with an independent source review by Claude. The review's suggestions were checked against the repository and verified behavior before finalizing this patch.