Repository navigation
test(build): check published declarations with skipLibCheck off - #9032
schiller-manuel wants to merge 3 commits into
Conversation
…le-routes The published declarations of both packages refer to `@tanstack/virtual-file-routes` types through the router generator's config. Neither package listed it, so the import resolved to nothing and `virtualRouteConfig` was typed as `any` (in start-plugin-core's declarations it was emitted as `any` outright). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`scripts/check-published-types.mjs` compiles each package's published declarations the way a user's project sees them and runs at the end of every package's `test:build`, after publint and attw. With `skipLibCheck: true` a broken reference in a published `.d.ts` silently becomes `any`; this makes such defects fail CI. - One TypeScript program per declaration tree under `dist` (esm, cjs, source, ...), every declaration file a root. - `skipLibCheck: false`, strict, Bundler resolution, Node types, the package's JSX settings and nothing else from its tsconfig, so `paths` never apply. Dependencies resolve through node_modules to their dist. - Only diagnostics located in the package under test count. - Fails on relative specifiers that leave the package's dist and on any specifier containing `dist-ts`. - A named per-package list of specifiers that cannot resolve by design (react-start-rsc's virtual modules); an unused entry fails. The script's tests run as the root project's `test:unit` target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`rsbuild/browser-decode` re-exported `createFromReadableStream` and `createFromFetch` from `react-server-dom-rspack/client.browser`, which ships no declarations. The ambient declarations in `src` are not published, so the exports were `any` for users and the published declaration failed with TS7016 under `skipLibCheck: false`. Export the same functions through annotated constants, so the published declaration carries the signatures and no import of the untyped module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: fa61d01 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
View your CI Pipeline Execution ↗ for commit fa61d01
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview11 package(s) bumped directly, 17 bumped as dependents. 🟩 Patch bumps
|
Bundle Size Benchmarks
The following scenarios have bundle-size changes compared with the baseline:
Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better. |
Merging this PR will regress 1 benchmarkWarning TanStack has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 13, 2026 to keep using CodSpeed. 2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
🎯 Changes
Stacked on #9031.
With
skipLibCheck: true, a broken reference in a published.d.tssilently becomesany(the #8203 shape). Neitherpublintnorattwreports it. This adds a check that does.scripts/check-published-types.mjscompiles a package's published declarations the way a user's project sees them:skipLibCheck: false, nopaths, dependencies throughnode_modules, one program perdisttree (esm,cjs,source), every declaration file a root. It reports diagnostics in the package's own files only, plus any relative specifier that leavesdist.test:buildin all 41 packages (about 0.3 to 1.1 s each).test:unit.Defects it found in declarations published today, fixed here:
@tanstack/router-pluginand@tanstack/start-plugin-corerefer to types from@tanstack/virtual-file-routeswithout depending on it, sovirtualRouteConfigwasany. Both now list the dependency.@tanstack/react-start-rsc/rsbuild/browser-decodere-exported fromreact-server-dom-rspack/client.browser, which ships no types, so both exports wereany. They are now typed constants; same function objects at runtime.Defects that need TanStack/config#443 and stay red until a
@tanstack/vite-configrelease with that fix is installed:router-plugin:import { HmrStyle } from '../hmr.js'wherehmris a directory (10 files).react-router,solid-router:dist/cjs/index.dev.d.ctsre-exports from./HeadContent.dev, which does not resolve.Draft until then. With #443 applied locally,
test:buildpasses for all packages (82 of 82 tasks).Written with AI assistance (Claude Code).
✅ Checklist
🚀 Release Impact
🤖 Generated with Claude Code