-
Notifications
You must be signed in to change notification settings - Fork 120
Use versions in examples for workspace packages along with pnpm overrides #771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use versions in examples for workspace packages along with pnpm overrides #771
Conversation
- Add all workspace packages to root package.json overrides to ensure local packages are always used during development - Update example package.json files to use ^0.0.0 version ranges instead of workspace: protocol - This allows gitpick installations to work while pnpm overrides ensure examples use local workspace packages during development
- Update all remaining examples to use ^0.0.0 version ranges - Replaces workspace:* and workspace:^ with version ranges that accept any 0.x version - Ensures gitpick installations work while pnpm overrides force local workspace packages during development
|
kevin-dp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^0.0.0 does not work as you expect. It restricts to exactly version 0.0.0.
From the docs:
Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4
Allows changes that do not modify the left-most non-zero element in the [major, minor, patch] tuple. In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for versions 0.X >=0.1.0, and no updates for versions 0.0.X.
I think you want * or latest
Replace ^0.0.0 with >=0.0.0 <1.0.0 in all examples. ^0.0.0 only matches exactly 0.0.0, not any 0.x version. The explicit range >=0.0.0 <1.0.0 correctly matches any 0.x version while preventing major version bumps.
|
Ok this looks good then https://jubianchi.github.io/semver-check/#/%3E%3D0.0.0%20%3C1.0.0/1.0.0 — then we can update to
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 79.8 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 3.34 kB ℹ️ View Unchanged
|

When running examples in the monorepo, we want to ensure they use they actual workspace code and don't pull from npm — we use pnpm overrides for this. This PR adds all workspace packages to the overrides list.
When running examples outside of the monorepo (we suggest
gitpickfor this). We want proper versions that have the example pull the latest published version from npm. We had some packages withworkspace:*versions which wouldn't work anymore outside of the monorepo. So this PR moves all versions to use ^0.0.0 to get the latest version in the 0 range.