fix(libs): pin the type-tests compiler; document the tsconfig baseUrl blocker - #1066
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
blove
enabled auto-merge (squash)
September 8, 2026 18:20
blove
force-pushed
the
blove/drop-tsconfig-baseurl
branch
from
September 8, 2026 18:57
13b40a6 to
a1b71c5
Compare
Contributor
The three `type-tests` targets invoked `npx tsc`, which does not resolve to the workspace compiler. `@dawn-ai/core` pulls in `@typescript/old` (npm:typescript@6.0.2), whose `tsc` bin wins the hoist at `node_modules/.bin/tsc`, so those targets type-checked the public API with TypeScript 6.0.2 while every other target compiles with the declared 5.9.3. That mismatch is what produced the TS5101 `baseUrl` deprecation error, which #1064 silenced with `ignoreDeprecations: "6.0"`. Invoke `node ./node_modules/typescript/bin/tsc` so the targets use the compiler the workspace declares, and drop the `ignoreDeprecations` holding action. The `rootDir` lines stay: they solve the unrelated problem of type-specs importing sibling libraries through path mappings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
TypeScript 7 removes `baseUrl`, and since TypeScript 5.0 the `paths` map no longer needs it. Removing it from `tsconfig.base.json` nonetheless breaks every library that depends on another library: Nx's buildable-library executors write a generated tsconfig under `tmp/<projectRoot>/build/` whose `paths` re-declare dependency entries as workspace-root-relative dist outputs (`dist/libs/telemetry/browser`). Without a `baseUrl` those non-relative values raise TS5090 and TypeScript discards the whole `paths` map, so `render:build` and `cockpit-shell:build` fail to resolve `@threadplane/telemetry/browser` and `@threadplane/cockpit-registry`. Leave the option in place and record the blocker next to it so the next attempt starts from the Nx side rather than re-deriving this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
blove
force-pushed
the
blove/drop-tsconfig-baseurl
branch
from
September 8, 2026 19:27
a1b71c5 to
1b092e6
Compare
Contributor
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.
What changed
Two things, both downstream of trying to remove
baseUrlfromtsconfig.base.json.1. The
type-teststargets now run the workspace TypeScript.They invoked
npx tsc, which does not resolve to the workspace compiler here.@dawn-ai/coredepends on@typescript/typescript6, which depends on@typescript/old(npm:typescript@6.0.2); that package'stscbin wins the hoist atnode_modules/.bin/tsc. Sonpx tscis TypeScript 6.0.2 while every other target compiles with the declared 5.9.3:That mismatch is what raised
TS5101on the inheritedbaseUrl, which #1064 silenced with"ignoreDeprecations": "6.0". The targets now invokenode ./node_modules/typescript/bin/tsc, so they type-check the public API with the compiler the workspace actually declares, and theignoreDeprecationsholding action is gone from all three configs.The
"rootDir": "../.."lines stay — they solve the unrelated problem of type-specs importing sibling libraries through path mappings.2.
baseUrlstays intsconfig.base.json, with the reason recorded next to it.Why
baseUrlcould not be removedThe premise checks out: since TypeScript 5.0 the
pathsentries resolve against the directory of the tsconfig that declares them, and--traceResolutionconfirms it against the installed compilers — withbaseUrlgone,@threadplane/chatstill resolves tolibs/chat/src/public-api.ts, now viapathsBasePathrather thanbaseUrl. No source file relies onbaseUrlfor bare-specifier resolution either (there are nofrom 'libs/…'-style imports anywhere in the repo).What breaks is Nx.
@nx/angular:packageand@nx/js:tsccallcreateTmpTsConfig, which writes a generated tsconfig totmp/<projectRoot>/build/that re-declares the wholepathsmap with dependency entries remapped to their dist outputs:The first entry comes from
dep.outputsand is workspace-root-relative, i.e. non-relative. With nobaseUrlanywhere in the chain, TypeScript raisesTS5090and discards the entirepathsmap, and the generated config's directory is the wrong base for the remaining entries regardless. Every library with a workspace library dependency then fails:render:build:production(ng-packagr) andcockpit-shell:build(@nx/js:tsc) both fail this way;chat,ag-uiandlanggraphbuilds are then skipped as dependents.createTmpTsConfigdoes take auseWorkspaceAsBaseUrlflag that would fix it, but the executors call it with the defaultfalseand it is not reachable fromproject.json. Prefixing the basepathsvalues with./does not help — Nx's own injecteddist/…entry is still non-relative.So this needs an Nx-side fix (or migrating to the Nx TS-solution setup, which drops
pathsfor project references) beforebaseUrlcan go. The comment intsconfig.base.jsonrecords that so the next attempt starts there.Other
baseUrldeclarations, and why they are left alonelibs/{cockpit-runtime-bridge,growth,example-layouts,cockpit-registry}/tsconfig.jsonset"baseUrl": "."(the library directory). BecausebaseUrloutrankspathsBasePath, these already redirect the inherited basepathsinto the library folder —@threadplane/design-tokensinexample-layoutstrieslibs/example-layouts/libs/design-tokens/src/index.ts, misses, and only resolves because the npm workspace symlink undernode_moduleshappens to point at the same source. That is a pre-existing latent bug, unchanged by this PR, and removing those lines changes resolution for those builds — worth its own change rather than riding along here.libs/growth-capture,apps/growth-researchpair"baseUrl": "."with"paths": {}, sobaseUrlis doing real directory-resolution work for those NodeNext projects. Not redundant.apps/websitedeclares its own completepaths(including the Next.js@/*convention) alongsidebaseUrl. Self-contained and a separate decision.cockpit/**/{python,angular/e2e}andexamples/**/e2econfigs either declarebaseUrlplus their ownpathstogether, or do not extendtsconfig.base.jsonat all. Unaffected by this change.Verification
npx nx run-many -t lint,test,build --projects=chat,ag-ui,langgraph,render,a2ui,telemetry,middleware,cockpit-registry,cockpit-shell,scripts --skip-nx-cache— green (0 lint errors; warnings only)chat:type-tests,ag-ui:type-tests,langgraph:type-tests— all green on TypeScript 5.9.3 with noignoreDeprecationsconst x: number = "s"tolibs/ag-ui/src/lib/provide-agent.type-spec.tsfails the target withTS2322, so it is not passing vacuouslynpx vitest run --root apps/website --reporter=dot— 138 files, 1394 tests passedGROWTH_FORM_POLICY=growth_v1 npx nx build website— greennpx nx run-many -t build --projects=examples-chat-angular,cockpit-render-repeat-loops-angular,cockpit-chat-debug-angular— greennpx nx run e2e-harness:lint(the one other bare-tsctarget) — green; its tsconfig is standalone and declares nobaseUrlnpx tsc --noEmit -p tsconfig.base.jsonis not meaningful here: the file has noinclude/files, so it would sweep every.tsin the workspace. The equivalent editor-facing surfaces are covered by the website build (Next.js) and the library builds.🤖 Generated with Claude Code