Accepted by the owner on 2026-10-28 (design-system session c6, STA-1072). It writes down one rule
for every session; it changes no version.
Context
TypeScript 7 (the native compiler) checks and builds every member fromcatalog:build (7.0.2). It does not ship the
JavaScript compiler API yet, so a tool that loads typescript as a library fails on it
(ts.TypeFlags is undefined). Four places need that API today: the Expo CLI, tools/scripts/doc-standard.mjs,
@stackra/gen discovery (0294 decision 26,
0263) and the @stackra/showcase generator. Each session has solved
this on its own, so the rule needs to be stated once.
Decision
- TypeScript 7 for every typecheck and build. Every member takes
typescriptfromcatalog:build.tsc, the presets (0300), tsdown declarations and CI run TypeScript 7. No member downgrades its compiler. - TypeScript 6 only as a library, under the alias
typescript6. Code that calls the compiler API importstypescript6(catalog:tooling,npm:typescript@6.0.3), nevertypescript, so the TypeScript 7 binary stays the one on PATH. Today:@stackra/gen(its fallback host) and@stackra/showcase(scripts/props.reader.ts,scripts/omitted-names.function.ts). typescriptat 6.0.3 only where a third-party tool requires that name. The root tooling (doc-standard.mjs) and the mobile app (the Expo CLI) taketypescriptfromcatalog:tooling; a code comment beside each entry says why. A new entry of this kind names its tool in the catalog comment.- No ts-morph and no third version. Nothing pins TypeScript 5 or a nightly.
- Exit. When TypeScript 7 ships its JS API,
typescript6and the 6.0.3catalog:toolingentries are removed in one change, and gen’s TypeScript 7 host becomes the only one.
Consequences
- A tool that crashes on
typescriptwith an undefinedts.*member is moved totypescript6, not the member’s compiler. - Two TypeScript versions stay in the lockfile until the exit in decision 5.
Enforcement
Planned: avalidate-repository.mjs row that refuses import … from "typescript" in a file that also reads
ts.TypeFlags, ts.createProgram or ts.createSourceFile, outside the catalog:tooling members named in decision 3.
Until then, review.