Skip to content

fix(lit-query): migrate to standard tsdown build so 'build' output is cached by nx and 'test:build' passes - #10943

Merged
sukvvon merged 9 commits into
mainfrom
fix/lit-query-standard-tsup-build
Aug 20, 2026
Merged

fix(lit-query): migrate to standard tsdown build so 'build' output is cached by nx and 'test:build' passes#10943
sukvvon merged 9 commits into
mainfrom
fix/lit-query-standard-tsup-build

Conversation

@sukvvon

@sukvvonsukvvon commented Jun 14, 2026

Copy link
Copy Markdown
Member

🎯 Changes

lit-query was the only package building with a non-standard tsc two-pass setup (dist/ ESM + dist-cjs/ CJS via build:cjs + write-cjs-package.mjs). Its dist-cjs/ output is not part of nx's build.outputs ({projectRoot}/build, {projectRoot}/dist), so on a CI cache-hit dist-cjs/ is not restored and publint --strict fails with dist-cjs/index.js does not exist, breaking @tanstack/lit-query:test:build.

This migrates lit-query to the standard tsdown build used by the other adapters (react-query as the reference), producing a single build/ directory (build/modern + build/legacy, each with .js/.cjs/.d.ts/.d.cts). build/ is already in nx's build.outputs, so the cache-hit failure is resolved without touching nx.json. While here, the rest of the package config is aligned with react-query for consistency.

Build migration:

  • Add tsdown.config.ts and tsconfig.prod.json, and add root.tsdown.config.js as a symlink to the shared scripts/getTsdownConfig.js (matching every other adapter).
  • Standardize tsconfig.json to extend the root config (drop the per-package NodeNext override — this also fixes @tanstack/lit-query:test:types failing to typecheck @tanstack/query-test-utils's extension-less relative imports).
  • Update package.json: buildtsdown --tsconfig tsconfig.prod.json, point main/module/types/exports/files at build/, drop the test:build cjs-smoke step.
  • Remove the now-obsolete tsconfig.build.json, tsconfig.build.cjs.json, scripts/write-cjs-package.mjs, scripts/check-cjs-types-smoke.mjs.
  • Point eslint.config.js ignores and the perf scripts (scripts/measure-bundle.mjs, scripts/l3-stress.mjs) at build/modern, and drop the stale dist-cjs entry from .gitignore.

Config alignment with react-query:

  • Reorder package.json fields (scripts block first, then type/types/main/module/exports/sideEffects/files/deps).
  • Normalize scripts: clean also removes ./dist-ts, compiletsc --build, test:eslint/lint:fix use --concurrency=auto, test:libvitest, test:lib:devpnpm run test:lib --watch. lit-specific scripts (test:types single-tsc --noEmit, measure:bundle*, perf:l3*, test:watch) are kept as-is.
  • Rename vitest.config.tsvite.config.ts and add test.name plus the standard istanbul coverage block (enabled on CI).
  • Drop the now-obsolete packages/lit-querysrc/tests ignore from the root knip.json (the renamed vite.config.ts lets knip detect the test entry automatically, like the other adapters).

Runtime output is unchanged: the named exports are identical (52), attw passes on node10/node16 (CJS/ESM)/bundler, and publint --strict reports All good!.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Build & Packaging

    • Migrated @tanstack/lit-query to a standardized build process.
    • Updated package entry points and published artifacts for modern and legacy module formats.
    • Added consistent build, testing, cleanup, bundle measurement, and performance commands.
  • Testing

    • Improved CI coverage configuration and test project identification.
    • Updated performance and bundle measurement tooling to use the new build outputs.

@coderabbitai

coderabbitaiBot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fc85fcb6-9338-4f82-b655-cbb2ec0a4467

📥 Commits

Reviewing files that changed from the base of the PR and between 0f92519 and ff591a0.

📒 Files selected for processing (1)
  • .changeset/lit-query-standard-tsdown-build.md

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The @tanstack/lit-query package now uses standard tsdown builds with modern and legacy outputs under build. Package exports, scripts, TypeScript configuration, tooling paths, coverage behavior, and release metadata were updated. Legacy CommonJS packaging scripts and configurations were removed.

Changes

lit-query tsup build migration

Layer / File(s)Summary
tsdown and TypeScript build configs
packages/lit-query/tsdown.config.ts, packages/lit-query/root.tsdown.config.js, packages/lit-query/tsconfig*.json
Adds modern and legacy tsdown configurations. Updates TypeScript includes and production build settings. Removes the previous build configurations.
Package scripts and entrypoints
packages/lit-query/package.json, packages/lit-query/scripts/check-cjs-types-smoke.mjs, packages/lit-query/scripts/write-cjs-package.mjs, .changeset/lit-query-standard-tsdown-build.md
Replaces separate build and CommonJS packaging scripts with tsdown, TypeScript, lint, test, clean, measurement, and performance commands. Changes package exports and published files to use build. Removes obsolete CommonJS scripts and adds a patch changeset.
Tooling and build-path alignment
packages/lit-query/eslint.config.js, packages/lit-query/vite.config.ts, packages/lit-query/scripts/l3-stress.mjs, packages/lit-query/scripts/measure-bundle.mjs, knip.json, .gitignore
Updates ignored paths and workspace analysis. Aligns stress testing and bundle measurement with build/modern. Uses the package name for Vitest and enables coverage in CI.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk:⚪ Minimal · up to ff591

This change standardizes lit-query’s build output and updates related package configuration without any identified current-head merge-blocking risk; it is merge-ready after normal checks and review.

Possibly related PRs

  • TanStack/query#11222: Both changes migrate @tanstack/lit-query build tooling to tsdown and update package build outputs.

Suggested reviewers:tkdodo, schiller-manuel

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly and concisely describes the migration to the standard tsdown build and its cache and test benefits.
Description check✅ PassedThe description explains the motivation, implementation, validation, checklist status, and release impact, including a changeset.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/lit-query-standard-tsup-build

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actionsBot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

9 package(s) bumped directly, 16 bumped as dependents.

🟨 Minor bumps

PackageVersionReason
@tanstack/angular-query-experimental5.101.4 → 5.102.0Changeset
@tanstack/eslint-plugin-query5.101.4 → 5.102.0Changeset
@tanstack/preact-query5.101.4 → 5.102.0Changeset
@tanstack/query-core5.101.4 → 5.102.0Changeset
@tanstack/react-query5.101.4 → 5.102.0Changeset
@tanstack/solid-query5.101.4 → 5.102.0Changeset
@tanstack/vue-query5.101.4 → 5.102.0Changeset
@tanstack/angular-query-persist-client5.101.4 → 5.102.0Dependent
@tanstack/preact-query-devtools5.101.4 → 5.102.0Dependent
@tanstack/preact-query-persist-client5.101.4 → 5.102.0Dependent
@tanstack/query-async-storage-persister5.101.4 → 5.102.0Dependent
@tanstack/query-broadcast-client-experimental5.101.4 → 5.102.0Dependent
@tanstack/query-devtools5.101.4 → 5.102.0Dependent
@tanstack/query-persist-client-core5.101.4 → 5.102.0Dependent
@tanstack/query-sync-storage-persister5.101.4 → 5.102.0Dependent
@tanstack/react-query-devtools5.101.4 → 5.102.0Dependent
@tanstack/react-query-next-experimental5.101.4 → 5.102.0Dependent
@tanstack/react-query-persist-client5.101.4 → 5.102.0Dependent
@tanstack/solid-query-devtools5.101.4 → 5.102.0Dependent
@tanstack/solid-query-persist-client5.101.4 → 5.102.0Dependent

🟩 Patch bumps

PackageVersionReason
@tanstack/lit-query0.2.11 → 0.2.12Changeset
@tanstack/svelte-query6.1.38 → 6.1.39Changeset
@tanstack/svelte-query-devtools6.1.38 → 6.1.39Dependent
@tanstack/svelte-query-persist-client6.1.38 → 6.1.39Dependent
@tanstack/vue-query-devtools6.1.38 → 6.1.39Dependent

@nx-cloud

nx-cloudBot commented Jun 14, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0f92519

CommandStatusDurationResult
nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded1m 7sView ↗

☁️ Nx Cloud last updated this comment at 2026-08-19 01:18:42 UTC

@sukvvonsukvvon self-assigned this Jun 14, 2026
@pkg-pr-new

pkg-pr-newBot commented Jun 14, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10943

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10943

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@10943

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10943

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10943

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10943

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10943

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10943

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10943

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10943

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10943

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10943

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10943

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10943

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10943

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10943

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10943

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10943

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10943

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10943

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10943

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10943

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10943

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10943

commit: ff591a0

@github-actions

github-actionsBot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
react full12.29 KB (0%)
react minimal9.23 KB (0%)

@sukvvon
sukvvonforce-pushed the fix/lit-query-standard-tsup-build branch from 22891f4 to 703f2f7CompareJune 14, 2026 11:10
@sukvvon
sukvvonforce-pushed the fix/lit-query-standard-tsup-build branch from 703f2f7 to 5dae012CompareJune 14, 2026 11:28
…to 'vite.config.ts' to match react-query, drop obsolete knip 'src/tests' ignore
@sukvvon
sukvvonforce-pushed the fix/lit-query-standard-tsup-build branch from 0dac11a to f8f010cCompareJune 14, 2026 13:02
@sukvvon
sukvvon marked this pull request as ready for review June 14, 2026 13:14
@sukvvon
sukvvon requested a review from a team as a code ownerJune 14, 2026 13:14
@sukvvon
sukvvon requested a review from TkDodoJune 14, 2026 13:18
@coderabbitai

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@sukvvonsukvvon changed the title fix(lit-query): migrate to standard tsup build so 'build' output is cached by nx and 'test:build' passesfix(lit-query): migrate to standard tsdown build so 'build' output is cached by nx and 'test:build' passesAug 19, 2026
@sukvvon
sukvvon merged commit 64a8035 into mainAug 20, 2026
11 of 12 checks passed
@sukvvon
sukvvon deleted the fix/lit-query-standard-tsup-build branch August 20, 2026 00:34
@github-actionsgithub-actionsBot mentioned this pull request Aug 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@sukvvon@TkDodo