chore: migrate builds to tsdown and upgrade all deps#304
Conversation
|
View your CI Pipeline Execution ↗ for commit 936d771
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview7 package(s) bumped directly, 0 bumped as dependents. 🟨 Minor bumps
|
@tanstack/angular-store
@tanstack/preact-store
@tanstack/react-store
@tanstack/solid-store
@tanstack/store
@tanstack/svelte-store
@tanstack/vue-store
commit: |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughMigrates many framework-specific store packages from ng-packagr/Vite to tsdown, consolidates package entrypoints/exports to unified Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR upgrades repository dependencies and migrates multiple TanStack Store adapter packages from Vite library builds to tsdown, while splitting test config into dedicated vitest.config.ts files and standardizing outputs under dist/.
Changes:
- Replace Vite library build pipelines with
tsdownfor most packages (keeping@tanstack/svelte-storeonsvelte-package). - Introduce per-package
tsdown.config.tsandtsconfig.build.json, and rename test configs tovitest.config.ts. - Upgrade toolchain and framework dependencies across packages and examples.
Reviewed changes
Copilot reviewed 45 out of 47 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vue-store/vitest.config.ts | Removes merged Vite library build config from test config; keeps Vitest-only config. |
| packages/vue-store/tsdown.config.ts | Adds tsdown build configuration for vue-store. |
| packages/vue-store/tsconfig.json | Updates include list to reference vitest.config.ts. |
| packages/vue-store/tsconfig.build.json | Adds build-focused tsconfig for publish-time builds. |
| packages/vue-store/tests/index.test.tsx | Refactors tests to avoid JSX transform dependence. |
| packages/vue-store/package.json | Switches build script to tsdown and updates package entrypoints/exports. |
| packages/svelte-store/package.json | Updates Svelte-related dependencies (package remains on svelte-package build). |
| packages/svelte-store/eslint.config.js | Adds a targeted ESLint override for *.svelte.ts files. |
| packages/store/vitest.config.ts | Adds a dedicated Vitest config for store tests. |
| packages/store/vite.config.ts | Removes prior combined Vite/Vitest config (previously used for library build + test). |
| packages/store/tsdown.config.ts | Adds tsdown build configuration for @tanstack/store. |
| packages/store/tsconfig.json | Updates include list to reference vitest.config.ts. |
| packages/store/tsconfig.build.json | Adds build-focused tsconfig for publish-time builds. |
| packages/store/package.json | Switches build script to tsdown and updates package entrypoints/exports. |
| packages/solid-store/vitest.config.ts | Removes merged Vite library build config from test config; keeps Vitest-only config. |
| packages/solid-store/tsdown.config.ts | Adds tsdown config with custom exports to preserve solid condition. |
| packages/solid-store/tsconfig.json | Updates include list to reference vitest.config.ts. |
| packages/solid-store/tsconfig.build.json | Simplifies build tsconfig to extend package tsconfig and clear paths. |
| packages/solid-store/package.json | Switches build script to tsdown and updates exports/entrypoints. |
| packages/react-store/vitest.config.ts | Removes merged Vite library build config from test config; keeps Vitest-only config. |
| packages/react-store/tsdown.config.ts | Adds tsdown build configuration for react-store. |
| packages/react-store/tsconfig.json | Updates include list to reference vitest.config.ts. |
| packages/react-store/tsconfig.build.json | Adds build-focused tsconfig for publish-time builds. |
| packages/react-store/package.json | Switches build script to tsdown and updates package entrypoints/exports. |
| packages/react-store/eslint.config.js | Adjusts ESLint config typing to accommodate newer TS/Vitest/types. |
| packages/preact-store/vitest.config.ts | Removes merged Vite library build config from test config; keeps Vitest-only config. |
| packages/preact-store/tsdown.config.ts | Adds tsdown build configuration for preact-store. |
| packages/preact-store/tsconfig.json | Updates include list to reference vitest.config.ts. |
| packages/preact-store/tsconfig.build.json | Adds build-focused tsconfig for publish-time builds. |
| packages/preact-store/package.json | Switches build script to tsdown and updates package entrypoints/exports. |
| packages/angular-store/vitest.config.ts | Adds dedicated Vitest config for angular-store tests. |
| packages/angular-store/tsdown.config.ts | Adds tsdown build configuration for angular-store. |
| packages/angular-store/tsconfig.json | Updates include list to reference vitest.config.ts. |
| packages/angular-store/tsconfig.build.json | Switches build tsconfig away from ng-packagr config to standard TS build config. |
| packages/angular-store/package.json | Replaces ng-packagr build with tsdown and updates exports/entrypoints. |
| packages/angular-store/ng-package.json | Removes ng-packagr packaging config. |
| package.json | Upgrades repo-wide toolchain deps and adds tsdown. |
| nx.json | Enables Nx analytics and keeps build/test target defaults aligned with new build outputs. |
| knip.json | Updates knip dependency ignore rules. |
| examples/vue/simple/package.json | Updates Vue example dependencies/tooling to match workspace upgrades. |
| examples/svelte/simple/package.json | Updates Svelte example dependencies/tooling to match workspace upgrades. |
| examples/solid/simple/package.json | Updates Solid example dependencies/tooling to match workspace upgrades. |
| examples/react/simple/package.json | Updates React example dependencies/tooling to match workspace upgrades. |
| examples/preact/simple/package.json | Updates Preact example dependencies/tooling to match workspace upgrades. |
| examples/angular/simple/package.json | Updates Angular example dependencies/tooling to match workspace upgrades. |
| .changeset/petite-actors-lie.md | Adds changeset covering minor bumps for all affected packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (5)
nx.json (1)
64-65: Consider making Nx analytics opt-in for CI environments.Line 65 enables telemetry globally. If your org treats CI telemetry as restricted, prefer environment-gated opt-in to avoid unintentional data collection.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nx.json` around lines 64 - 65, The nx.json currently sets "analytics": true which enables telemetry globally; change this to opt-in for CI by setting "analytics": false in nx.json and gate enabling telemetry via an environment variable in CI (e.g., set NX_ENABLE_ANALYTICS=true or a repo-specific NX_ANALYTICS variable only in permitted pipelines), and update any CI pipeline templates/scripts to set that env var when telemetry is allowed; reference the "analytics" property in nx.json to locate the setting and update CI config/templates to conditionally enable analytics via the chosen env var.examples/svelte/simple/package.json (1)
18-19: Consider using consistent version pinning for TypeScript.Vite 8.0.8 is valid and exists on npm. However, TypeScript is pinned to
6.0.2without a caret, whereas other dependencies use^. For consistency, consider using^6.0.2unless an exact version pin is intentional.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/svelte/simple/package.json` around lines 18 - 19, The TypeScript dependency in package.json is pinned as "typescript": "6.0.2" while other deps use caret ranges; update the TypeScript entry to use a caret range (e.g., change "typescript": "6.0.2" to "typescript": "^6.0.2") in the package.json dependencies so versioning is consistent with Vite and other packages.packages/preact-store/package.json (1)
36-45: Consider adding explicittypesconditions in exports.The exports map doesn't include explicit
typesconditions for TypeScript resolution. While the top-leveltypesfield provides a fallback, modern TypeScript (4.7+) withmoduleResolution: "bundler"or"node16"prefers explicit type conditions in exports:".": { "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }, "require": { "types": "./dist/index.d.cts", "default": "./dist/index.cjs" } }This is consistent with the pattern used across other packages in this PR, so it may be an intentional simplification relying on tsdown's
exports: trueto handle this. Verify thatpublint --strictpasses without warnings about missing type conditions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/preact-store/package.json` around lines 36 - 45, The exports map lacks explicit TypeScript "types" conditions—update the package.json "exports" entry for "." to provide a "types" condition for both ESM and CJS branches (pointing to the compiled declaration files like ./dist/index.d.ts for import/ESM and ./dist/index.d.cts for require/CJS) alongside the existing "import"/"require" defaults, so TypeScript bundler/node16 resolution picks up types correctly and pulint --strict stops warning about missing type conditions.packages/solid-store/package.json (1)
39-46: Consider reordering export conditions for Solid bundlers.Export conditions are evaluated in order by bundlers. The
solidcondition should typically come beforeimportto ensure Solid-aware bundlers (like those usingsolidcondition) resolve it correctly before falling back to the genericimportcondition:".": { "solid": "./dist/index.js", "import": "./dist/index.js", "require": "./dist/index.cjs" }In this case, both
solidandimportpoint to the same file, so the current ordering won't cause functional issues. However, placing framework-specific conditions first is the conventional pattern and makes the intent clearer.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/solid-store/package.json` around lines 39 - 46, Reorder the export condition keys in the package.json exports for the "." entry so that the "solid" condition appears before "import" (i.e., change the order of "import", "require", "solid" to "solid", "import", "require") to ensure Solid-aware bundlers resolve the framework-specific "solid" condition first; update the exports object (the "." entry) accordingly so the paths remain the same but the condition order is changed.packages/store/package.json (1)
36-43: Add explicittypesinexportsto align with ESM-first package.The package declares
"type": "module"(ESM) but currently has"types": "./dist/index.d.cts"(CJS format) at the top level. Additionally,exports["."]lacks an explicittypesfield, which TypeScript toolchains may struggle to resolve correctly. For ESM-focused packages using conditional exports, both the top-leveltypesandexports["."]["types"]should point to.d.ts.Proposed package.json adjustment
- "types": "./dist/index.d.cts", + "types": "./dist/index.d.ts", "main": "./dist/index.cjs", "module": "./dist/index.js", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.js", "require": "./dist/index.cjs" },Note: If the build generates separate declaration files (
.d.tsfor ESM and.d.ctsfor CJS), consider also adding an explicittypesfield within therequireconditional pointing to.d.ctsfor full type-resolution clarity.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/store/package.json` around lines 36 - 43, The package.json currently sets a top-level "types" to "./dist/index.d.cts" and the exports["."] conditional lacks a "types" entry; update the top-level "types" to point to the ESM declaration file (e.g., "./dist/index.d.ts"), and add a "types" field inside exports["."] alongside "import"/"require" that points to the correct declaration for the corresponding conditional (e.g., "types": "./dist/index.d.ts" under the default/import branch and, if you emit CJS declarations, add a "types" entry under the "require" conditional pointing to "./dist/index.d.cts"); ensure the declared filenames match your build output and keep the existing "import"/"require" mappings unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/preact/simple/package.json`:
- Around line 15-20: The dev dependency mismatch between "eslint" and
"eslint-config-preact" must be resolved: either upgrade "eslint-config-preact"
to a release that declares compatibility with ESLint 10 (replace
"eslint-config-preact": "^2.0.0" with the newer compatible version) or pin
"eslint" to a 9.x version (replace "eslint": "^10.2.0" with "^9.x.x"), then run
your package manager to reinstall; update package.json entries for "eslint" or
"eslint-config-preact" accordingly and verify linting works (run the "eslint"
script) before finalizing the change.
In `@packages/react-store/package.json`:
- Around line 36-43: The package.json currently sets "types":
"./dist/index.d.cts" and omits a "types" conditional under "exports", causing
TypeScript bundler resolution and publint (TYPES_NOT_EXPORTED) failures; update
package.json so the top-level "types" points to the actual emitted file
"./dist/index.d.ts" and add a nested "types" condition inside the "exports"
entry for "." alongside "import" and "require" (use the conditional mapping
structure rather than placing "types" as a sibling), ensuring the exported
conditions reference "./dist/index.d.ts" for TypeScript consumers while keeping
"import" -> "./dist/index.js" and "require" -> "./dist/index.cjs".
---
Nitpick comments:
In `@examples/svelte/simple/package.json`:
- Around line 18-19: The TypeScript dependency in package.json is pinned as
"typescript": "6.0.2" while other deps use caret ranges; update the TypeScript
entry to use a caret range (e.g., change "typescript": "6.0.2" to "typescript":
"^6.0.2") in the package.json dependencies so versioning is consistent with Vite
and other packages.
In `@nx.json`:
- Around line 64-65: The nx.json currently sets "analytics": true which enables
telemetry globally; change this to opt-in for CI by setting "analytics": false
in nx.json and gate enabling telemetry via an environment variable in CI (e.g.,
set NX_ENABLE_ANALYTICS=true or a repo-specific NX_ANALYTICS variable only in
permitted pipelines), and update any CI pipeline templates/scripts to set that
env var when telemetry is allowed; reference the "analytics" property in nx.json
to locate the setting and update CI config/templates to conditionally enable
analytics via the chosen env var.
In `@packages/preact-store/package.json`:
- Around line 36-45: The exports map lacks explicit TypeScript "types"
conditions—update the package.json "exports" entry for "." to provide a "types"
condition for both ESM and CJS branches (pointing to the compiled declaration
files like ./dist/index.d.ts for import/ESM and ./dist/index.d.cts for
require/CJS) alongside the existing "import"/"require" defaults, so TypeScript
bundler/node16 resolution picks up types correctly and pulint --strict stops
warning about missing type conditions.
In `@packages/solid-store/package.json`:
- Around line 39-46: Reorder the export condition keys in the package.json
exports for the "." entry so that the "solid" condition appears before "import"
(i.e., change the order of "import", "require", "solid" to "solid", "import",
"require") to ensure Solid-aware bundlers resolve the framework-specific "solid"
condition first; update the exports object (the "." entry) accordingly so the
paths remain the same but the condition order is changed.
In `@packages/store/package.json`:
- Around line 36-43: The package.json currently sets a top-level "types" to
"./dist/index.d.cts" and the exports["."] conditional lacks a "types" entry;
update the top-level "types" to point to the ESM declaration file (e.g.,
"./dist/index.d.ts"), and add a "types" field inside exports["."] alongside
"import"/"require" that points to the correct declaration for the corresponding
conditional (e.g., "types": "./dist/index.d.ts" under the default/import branch
and, if you emit CJS declarations, add a "types" entry under the "require"
conditional pointing to "./dist/index.d.cts"); ensure the declared filenames
match your build output and keep the existing "import"/"require" mappings
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 50848b47-9e90-4f74-bc79-e2ddd6de6aa9
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (46)
.changeset/petite-actors-lie.mdexamples/angular/simple/package.jsonexamples/preact/simple/package.jsonexamples/react/simple/package.jsonexamples/solid/simple/package.jsonexamples/svelte/simple/package.jsonexamples/vue/simple/package.jsonknip.jsonnx.jsonpackage.jsonpackages/angular-store/ng-package.jsonpackages/angular-store/package.jsonpackages/angular-store/tsconfig.build.jsonpackages/angular-store/tsconfig.jsonpackages/angular-store/tsdown.config.tspackages/angular-store/vitest.config.tspackages/preact-store/package.jsonpackages/preact-store/tsconfig.build.jsonpackages/preact-store/tsconfig.jsonpackages/preact-store/tsdown.config.tspackages/preact-store/vitest.config.tspackages/react-store/eslint.config.jspackages/react-store/package.jsonpackages/react-store/tsconfig.build.jsonpackages/react-store/tsconfig.jsonpackages/react-store/tsdown.config.tspackages/react-store/vitest.config.tspackages/solid-store/package.jsonpackages/solid-store/tsconfig.build.jsonpackages/solid-store/tsconfig.jsonpackages/solid-store/tsdown.config.tspackages/solid-store/vitest.config.tspackages/store/package.jsonpackages/store/tsconfig.build.jsonpackages/store/tsconfig.jsonpackages/store/tsdown.config.tspackages/store/vite.config.tspackages/store/vitest.config.tspackages/svelte-store/eslint.config.jspackages/svelte-store/package.jsonpackages/vue-store/package.jsonpackages/vue-store/tests/index.test.tsxpackages/vue-store/tsconfig.build.jsonpackages/vue-store/tsconfig.jsonpackages/vue-store/tsdown.config.tspackages/vue-store/vitest.config.ts
💤 Files with no reviewable changes (3)
- packages/angular-store/ng-package.json
- knip.json
- packages/store/vite.config.ts
🎯 Changes
This PR upgrades the repo dependencies and migrates the JS package build pipeline from Vite library builds to
tsdown, bringing this repo in line with other TanStack projects.Dependency updates
tsdown@tanstack/vite-configfrom the package build flowBuild migration
Migrated these packages from Vite library builds to
tsdown:@tanstack/store@tanstack/react-store@tanstack/preact-store@tanstack/vue-store@tanstack/solid-store@tanstack/angular-storeLeft unchanged:
@tanstack/svelte-storestays onsvelte-packageConfig cleanup
vite.config.tsfiles used for tests tovitest.config.tstsconfig.build.jsonfiles for publish-time buildsng-packagrpackaging in favor oftsdowntsdown.config.tsfilesPackaging/output changes
dist/tsdownnow owns standard package entry generation for migrated packagessolidexport condition for@tanstack/solid-storeFollow-up fixes included
react-storeESLint config typingvue-storetests to avoid JSX transform dependence in Vitestknip,sherif, and ESLint sopnpm testpassesNotes
@tanstack/angular-storenow builds as a standard TS library instead of Angular Package Format outputpublintstill reports non-blockingrepository.urlsuggestions in some packages, but they do not fail CI✅ Checklist
pnpm test:pr.🚀 Release Impact
Summary by CodeRabbit