Repository navigation
Run tests from source, persist the ttsc cache in CI, and export only the root entry - #103
Merged
Merged
Conversation
ttsx propagates its source loader to child processes via NODE_OPTIONS, so forked and threaded workers can execute .ts files directly. Drop the test/node/runtime.ts shim that mapped source paths onto emitted JavaScript and the cwd-dependent path branches in TestBundler, and run the browser harness through ttsx as well so both suites share one execution mode. Normalize test runner paths with path.join so the entry file comparison holds on Windows, and remove the now unused source-map-support dependency. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PYz2NPPRFDMR6CMoCeArb9
Restore and save node_modules-independent ttsc plugin binaries with actions/cache after installation, keyed by OS, architecture, and lockfile hash per the ttsc documentation, and warm them with ttsc prepare before building. Pin TTSC_CACHE_DIR to one workspace path so ttsc, ttsx, and the rollup plugin share a single cache, working around samchon/ttsc#1469 where ttsx's runtime directory under test/ redirects the cache root. Drop the pnpm version duplicated from packageManager, align action majors, and trigger builds on tsconfig, rollup, and workflow changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PYz2NPPRFDMR6CMoCeArb9
The public API is identical on every platform; the browser, react-native, and node conditions on "." already select the matching build, so the ./node and ./browser subpaths and the typesVersions block that existed only to type them add surface without purpose. Nothing has shipped with them yet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PYz2NPPRFDMR6CMoCeArb9
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.
Follow-up review of #102. Everything here came out of a "review until dry" pass over that PR's toolchain changes, with the goal that nothing depends on cwd, execution mode, or duplicated configuration.
Tests run from source only
ttsxinjects its loader intoNODE_OPTIONS, sochild_process.fork()andworker_threads.Workerchildren execute.tsfiles directly (verified for both). That removes the need for:test/node/runtime.ts, which rewrotetest/**/*.tstobin/test/**/*.jsbased onprocess.cwd();__filename.endsWith(".ts")/process.cwd()branches inTestBundlerandtest_worker_compiler;.ts/.jsextension switch intest/node/index.ts.test:browsernow runs throughttsx --project test/tsconfig.jsontoo, so both suites share one execution mode and every path is__dirname-relative.build:testremains because browserify consumes the emitted JavaScript.Also fixed while there: the test runner built paths with
"/"on Windows, solocation === __filenamenever matched; it now usespath.join. A leftover debugconsole.login the runner is gone, as is the unusedsource-map-supportdependency.ttsc cache in CI
Per the ttsc build-cache docs:
actions/cacheafterpnpm install, pathplugins/only (28 MB; the 1.6 GBgo-buildaccelerator is skipped), keyos-arch-ttsc-<lockfile hash>withrestore-keys, thenttsc preparebefore the build.TTSC_CACHE_DIRis pinned to one workspace path. This works around samchon/ttsc#1469:ttsxcreatestest/node_modules/.cache/ttsc/ttsxunder the nested tsconfig, which makes the plugin cache resolve totest/node_modules/...and rebuilds the Go plugin cold a second time. With the env var set,ttsc prepare→ttsxwas verified locally to reuse the warmed binary (nobuilding linked plugin hostline). Once the upstream fix lands the env line can be removed.CI hygiene in the same files: the pnpm version duplicated from
packageManageris dropped, action majors are aligned (checkout@v7,setup-node@v7,pnpm/action-setup@v6,cache@v5), andbuild.ymlnow also triggers ontsconfig*.json,rollup.config.js, and itself.Exports
./nodeand./browsersubpaths and thetypesVersionsblock are removed. The API is identical across platforms and thebrowser/react-native/nodeconditions on"."already select the right build; the subpaths only widened the surface. They have not been published (npm still has 1.2.1 with the old exports). Resolution verified for node/browser × CJS/ESM.Validation
pnpm build,pnpm run test:node(18 tests),pnpm run test:browser(3 pages) locally on WindowsTTSC_CACHE_DIRwarm/reuse cycle verified locally from an empty directory🤖 Generated with Claude Code
https://claude.ai/code/session_01PYz2NPPRFDMR6CMoCeArb9