Yes, pnpm and changesets work with workspace:* dependencies, but there are some important considerations to ensure everything functions smoothly.
When you use:
"@nodeboot/context": "workspace:*"PNPM resolves @nodeboot/context from within your workspace instead of fetching it from the registry.
Key benefits of workspace:*:
- Ensures local packages are always used.
- Keeps all internal dependencies in sync.
- Prevents version mismatches.
Changesets will:
- Detect internal changes.
- Automatically bump dependent packages when a change is made to a workspace package.
- Ensure version updates propagate correctly.
Let's say your monorepo has:
/packages/core (version 1.0.0)
/packages/app (depends on @nodeboot/context with "workspace:*")
If packages/core (which provides @nodeboot/context) gets a minor bump:
- Changesets updates
packages/coreto 1.1.0. - Changesets ensures
packages/appis updated to reference1.1.0.
This prevents mismatches where one package is using an outdated version.
workspace:* locks the dependency to any version inside the workspace, which can lead to unexpected behaviors.
✅ Instead, prefer:
"@nodeboot/context": "workspace:^"This ensures that @nodeboot/context follows semver rules (^1.0.0 → allows updates to 1.x.x but not 2.x.x).
In .changeset/config.json, confirm:
"updateInternalDependencies": "patch"This makes sure internal dependencies always get updated when another workspace package changes.
Before publishing, run:
pnpm changeset versionCheck that:
package.jsonversions are updated correctly.workspace:*dependencies point to the new versions.
If needed, manually adjust the dependency versions before publishing.
If using a private monorepo, use:
pnpm changeset publish --tag betaFor public packages, run:
pnpm changeset publishThis ensures the latest workspace versions are published.
| Command | Description |
|---|---|
pnpm changeset |
Creates a new changeset |
pnpm changeset status |
Shows pending changesets |
pnpm changeset version |
Applies version bumps |
pnpm changeset publish |
Publishes updated packages |
With this setup, pnpm + Changesets will properly manage versioning and publishing across your monorepo workspace.
The Node-Boot parent package.jon provides some scripts to help in the release process by using pnpm + changesets.
| Command | Description |
|---|---|
pnpm release:changeset |
Creates a new changeset for the monorepo workspaces by detecting changed packages automatically |
pnpm release:status |
Shows pending changesets to be released |
pnpm release:version |
Applies version bumps for changed packages in the monorepo, according to pending changesets |
pnpm release:publish |
Publishes updated packages |
pnpm release |
Applies version bumps for changed packages in the monorepo and publishes them to NPM |