Skip to content

feat(plugin-js): js_typecheck driver, per-package tsc - #363

Draft
raphaelvigee wants to merge 1 commit into
raphaelvigee/feat-plugin-js-m2-import-graphfrom
raphaelvigee/feat-plugin-js-m3-typecheck
Draft

feat(plugin-js): js_typecheck driver, per-package tsc#363
raphaelvigee wants to merge 1 commit into
raphaelvigee/feat-plugin-js-m2-import-graphfrom
raphaelvigee/feat-plugin-js-m3-typecheck

Conversation

@raphaelvigee

@raphaelvigee raphaelvigee commented Aug 5, 2026

Copy link
Copy Markdown
Member

M3 of the JS/TS heph plugin plan (part 3/6 of the stack).

A cacheable js_typecheck ManagedDriver running tsc --noEmit per package, fed by the M2 import graph rather than blind package.json declarations.

  • Toolchain: tstool=host (only supported mode) resolves tsc from node_modules/.bin or PATH, queried once per Provider lifetime and hashed alongside the tsconfig content — disclosed non-hermetic escape hatch.
  • Input scoping fixed through review to actually match what tsc reads: plain (non-type-only) cross-package imports, not just import type; third-party .d.ts inputs resolved via the same lockfile mechanism as js_install; tsconfig include/exclude honored; the full tsconfig extends chain declared and hashed; a shared/ancestor tsconfig with unscoped include is now a loud Provider::get error instead of a silently unsound cache key.

Reviewed by feature-quality/code-quality/hermeticity — five BLOCKERs found (all variations on "the declared Input set doesn't match what tsc actually reads") and fixed, each with a regression test proving the specific divergence. Tests requiring a real tsc binary are #[ignore]d with a named reason rather than silently skipping and reading as a pass.

Test plan

  • cargo build -p plugin-js -p plugin-js-cdylib
  • cargo test -p plugin-js
  • cargo clippy -p plugin-js -p plugin-js-cdylib --all-targets -- -D warnings
  • cargo fmt --check -p plugin-js -p plugin-js-cdylib

Stack created with GitHub Stacks CLIGive Feedback 💬

M3 of the JS/TS plugin: a cacheable js_typecheck ManagedDriver running
tsc --noEmit per package, fed by the M2 import graph rather than blind
package.json declarations.

- Toolchain: tstool=host (only supported mode) resolves tsc from
  node_modules/.bin or PATH, queried once per Provider lifetime and hashed
  alongside the tsconfig content — disclosed non-hermetic escape hatch,
  same shape as the design doc's stated M1+ gap.
- Input scoping fixed through review to actually match what tsc reads:
  plain (non-type-only) cross-package imports, not just `import type`;
  third-party .d.ts inputs resolved via the same lockfile mechanism as
  js_install (works with no ambient node_modules, not just when one
  happens to exist on disk); tsconfig include/exclude honored for
  first-party sources; the full tsconfig extends chain declared and
  hashed; a shared/ancestor tsconfig with unscoped include is now a loud
  Provider::get error instead of a silently unsound cache key.

Reviewed by feature-quality/code-quality/hermeticity — five BLOCKERs found
(all variations on "the declared Input set doesn't match what tsc actually
reads") and fixed, each with a regression test proving the specific
divergence. Tests requiring a real tsc binary are #[ignore]d with a named
reason rather than silently skipping and reading as a pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M3wZfyPsG8stfRQuybLRjN
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