mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
Node runs TypeScript with verbatimModuleSyntax semantics: `import type` and
`export type … from` vanish, while `import { type A }` and
`export { type A } from` keep an empty clause and still load their module.
- Package selection skipped nothing: `import type { X } from "type-fest"`
selected type-fest and failed with SC2013, and type imports pulled whole
packages into the compile. Erased edges no longer select packages.
- Files reached only through erased edges are no longer program modules,
so their imports (a `node:vm` import, say) no longer fence the build.
- Inline type-only clauses are real module edges again (their modules'
side effects ran under Node but not in the binary); a cycle closed by
one binds nothing and is admitted like a side-effect import.
- Interfaces, type aliases and type literals from an installed package's
declarations map structurally, so values the program builds with a
type-only package's types compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>