Skip to content

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

Open
sukvvon wants to merge 9 commits into
mainfrom
fix/lit-query-standard-tsup-build
Open

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

Conversation

@sukvvon

@sukvvon sukvvon 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-query src/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

coderabbitai Bot 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 name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring 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 name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the migration to the standard tsdown build and its cache and test benefits.
Description check ✅ Passed The description explains the motivation, implementation, validation, checklist status, and release impact, including a changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check 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-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

🟨 Minor bumps

Package Version Reason
@tanstack/angular-query-experimental 5.101.4 → 5.102.0 Changeset
@tanstack/eslint-plugin-query 5.101.4 → 5.102.0 Changeset
@tanstack/preact-query 5.101.4 → 5.102.0 Changeset
@tanstack/query-core 5.101.4 → 5.102.0 Changeset
@tanstack/react-query 5.101.4 → 5.102.0 Changeset
@tanstack/solid-query 5.101.4 → 5.102.0 Changeset
@tanstack/vue-query 5.101.4 → 5.102.0 Changeset
@tanstack/angular-query-persist-client 5.101.4 → 5.102.0 Dependent
@tanstack/preact-query-devtools 5.101.4 → 5.102.0 Dependent
@tanstack/preact-query-persist-client 5.101.4 → 5.102.0 Dependent
@tanstack/query-async-storage-persister 5.101.4 → 5.102.0 Dependent
@tanstack/query-broadcast-client-experimental 5.101.4 → 5.102.0 Dependent
@tanstack/query-devtools 5.101.4 → 5.102.0 Dependent
@tanstack/query-persist-client-core 5.101.4 → 5.102.0 Dependent
@tanstack/query-sync-storage-persister 5.101.4 → 5.102.0 Dependent
@tanstack/react-query-devtools 5.101.4 → 5.102.0 Dependent
@tanstack/react-query-next-experimental 5.101.4 → 5.102.0 Dependent
@tanstack/react-query-persist-client 5.101.4 → 5.102.0 Dependent
@tanstack/solid-query-devtools 5.101.4 → 5.102.0 Dependent
@tanstack/solid-query-persist-client 5.101.4 → 5.102.0 Dependent

🟩 Patch bumps

Package Version Reason
@tanstack/lit-query 0.2.11 → 0.2.12 Changeset
@tanstack/svelte-query 6.1.38 → 6.1.39 Changeset
@tanstack/svelte-query-devtools 6.1.38 → 6.1.39 Dependent
@tanstack/svelte-query-persist-client 6.1.38 → 6.1.39 Dependent
@tanstack/vue-query-devtools 6.1.38 → 6.1.39 Dependent

@nx-cloud

nx-cloud Bot commented Jun 14, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0f92519

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 1m 7s View ↗

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

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

pkg-pr-new Bot 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-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.29 KB (0%)
react minimal 9.23 KB (0%)

@sukvvon
sukvvon force-pushed the fix/lit-query-standard-tsup-build branch from 22891f4 to 703f2f7 Compare June 14, 2026 11:10
@sukvvon
sukvvon force-pushed the fix/lit-query-standard-tsup-build branch from 703f2f7 to 5dae012 Compare June 14, 2026 11:28
…to 'vite.config.ts' to match react-query, drop obsolete knip 'src/tests' ignore
@sukvvon
sukvvon force-pushed the fix/lit-query-standard-tsup-build branch from 0dac11a to f8f010c Compare June 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 owner June 14, 2026 13:14
@sukvvon
sukvvon requested a review from TkDodo June 14, 2026 13:18
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

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.

@sukvvon sukvvon changed the title fix(lit-query): migrate to standard tsup build so 'build' output is cached by nx and 'test:build' passes fix(lit-query): migrate to standard tsdown build so 'build' output is cached by nx and 'test:build' passes Aug 19, 2026
Sign up for free to 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.

1 participant