Summary
packages/agent-bundle/package.json depends on "typescript-5": "npm:typescript@5.6.1-rc" (since #135, a7d42cf; used by src/routes/{contract,config-extract,input-schema}.ts). Under npm, an aliased package still contributes its bin entries, and npm hoists typescript-5 into the consumer's top-level node_modules and links node_modules/.bin/tsc -> ../typescript-5/bin/tsc. The consumer's own typescript devDependency (5.9.x) loses the bin race, so npx tsc / npm run typecheck (tsc -p tsconfig.json --noEmit) silently runs TypeScript 5.6.1-rc.
Observed on framework main af1c185 (agent-bundle@0.0.0-preview-af1c185) installed with npm 12.0.2 / Node 22.23.2 into a plain (non-workspace) consumer project. It did not happen at preview 28830bd5, which predates the alias.
Repro
mkdir repro && cd repro && npm init -y >/dev/null
printf 'allow-remote=root\n' > .npmrc # npm 12 refuses tarball deps otherwise
npm i -D typescript@^5.9.0 https://pkg.pr.new/ScriptedAlchemy/agent-bundle/agent-bundle@af1c185
readlink node_modules/.bin/tsc # -> ../typescript-5/bin/tsc
npx tsc --version # Version 5.6.1-rc
node node_modules/typescript/bin/tsc --version # Version 5.9.3
With a modern tsconfig ("lib": ["ES2024"], "target": "ES2024") the shadowed tsc fails:
tsconfig.json(7,7): error TS6046: Argument for '--lib' option must be: 'es5', ... 'es2023', 'esnext', ...
tsconfig.json(17,15): error TS6046: Argument for '--target' option must be: ... 'es2023', 'esnext'.
Expected
Consumers' tsc should resolve to their own TypeScript. Options: depend on the alias without exposing bins (e.g. move the extraction to the consumer-resolved typescript the way lib.dts already does — docs/entry-conventions.md says declaration generation "resolves typescript from the project"), pin the alias as an optionalDependency/bundledDependency that npm does not bin-link, or at least document the collision and a node ./node_modules/typescript/bin/tsc workaround in docs/preview-packages.md.
Context
Hit while re-porting ScriptedAlchemy/movie-library onto af1c185; the consumer worked around it by changing its typecheck script to node ./node_modules/typescript/bin/tsc -p tsconfig.json --noEmit.
Summary
packages/agent-bundle/package.jsondepends on"typescript-5": "npm:typescript@5.6.1-rc"(since #135,a7d42cf; used bysrc/routes/{contract,config-extract,input-schema}.ts). Under npm, an aliased package still contributes itsbinentries, and npm hoiststypescript-5into the consumer's top-levelnode_modulesand linksnode_modules/.bin/tsc -> ../typescript-5/bin/tsc. The consumer's owntypescriptdevDependency (5.9.x) loses the bin race, sonpx tsc/npm run typecheck(tsc -p tsconfig.json --noEmit) silently runs TypeScript 5.6.1-rc.Observed on framework main
af1c185(agent-bundle@0.0.0-preview-af1c185) installed with npm 12.0.2 / Node 22.23.2 into a plain (non-workspace) consumer project. It did not happen at preview28830bd5, which predates the alias.Repro
With a modern tsconfig (
"lib": ["ES2024"],"target": "ES2024") the shadowedtscfails:Expected
Consumers'
tscshould resolve to their own TypeScript. Options: depend on the alias without exposing bins (e.g. move the extraction to the consumer-resolvedtypescriptthe waylib.dtsalready does —docs/entry-conventions.mdsays declaration generation "resolvestypescriptfrom the project"), pin the alias as anoptionalDependency/bundledDependencythat npm does not bin-link, or at least document the collision and anode ./node_modules/typescript/bin/tscworkaround indocs/preview-packages.md.Context
Hit while re-porting
ScriptedAlchemy/movie-libraryontoaf1c185; the consumer worked around it by changing itstypecheckscript tonode ./node_modules/typescript/bin/tsc -p tsconfig.json --noEmit.