Skip to content

fix(ci): use bun pm pack to resolve workspace:^ deps on publish#36

Open
47PADO47 wants to merge 4 commits into
mainfrom
fix/publish-workspace-deps
Open

fix(ci): use bun pm pack to resolve workspace:^ deps on publish#36
47PADO47 wants to merge 4 commits into
mainfrom
fix/publish-workspace-deps

Conversation

@47PADO47

@47PADO47 47PADO47 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Problem

changeset publish calls npm pack internally, which ships workspace:^ dependency references as-is in the tarball's package.json. Consumers then get install failures like:

error: @padosoft/utilities@workspace:^ failed to resolve

Affected packages: @padosoft/react, @padosoft/logger, @padosoft/cli, @padosoft/openapi-client, @padosoft/utilities, @padosoft/zod-to-openapi-client.

Fix

Replace changeset publish with a custom scripts/publish.sh that:

  1. Loops over packages/*/
  2. Skips private packages and already-published versions (same logic changeset publish uses)
  3. Runs bun pm pack inside each package directory — this resolves workspace:^ to real semver before creating the tarball
  4. Publishes the tarball with npm publish <file>.tgz
  5. Calls changeset tag to create git tags (previously done by changeset publish)

The GitHub Packages publishing step in release.yml is fixed with the same pattern.

Test plan

  • Merge and let CI run on the next changeset release PR merge
  • Verify npm view @padosoft/react dependencies shows real semver (e.g. ^1.3.2) not workspace:^

🤖 Generated with Claude Code

changeset publish uses npm pack internally which ships workspace:^ references
as-is, causing install failures for consumers. bun pm pack resolves them to
actual semver versions before creating the tarball.

- Add scripts/publish.sh: replaces changeset publish with a loop that
  runs bun pm pack per-package then npm publish <tarball>
- Call changeset tag at the end to create git tags (was done by changeset publish)
- Update GitHub Packages step in release.yml with the same bun pm pack pattern
- Update publish-packages script to call the new script
Copilot AI review requested due to automatic review settings July 1, 2026 20:26
@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cf2fb1d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@padosoft/logger Patch
@padosoft/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@padosoft/react 1.0.0 and @padosoft/logger 1.4.0 were published with
workspace:^ dep references due to the npm pack bug. These changesets
trigger new versions (1.1.0 / 1.4.1) that will be published cleanly
once the bun pm pack CI fix is in place.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the release/publish flow to avoid publishing tarballs whose package.json still contains workspace:^ dependency specifiers by packing with bun pm pack and publishing the resulting .tgz artifacts.

Changes:

  • Add scripts/publish.sh to pack each workspace package with bun pm pack, then npm publish the produced tarball and run changeset tag.
  • Update the root publish-packages script to use the new publish script (instead of changeset publish).
  • Update the GitHub Packages publish step in release.yml to publish tarballs produced by bun pm pack.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

File Description
scripts/publish.sh New publish script that packs via Bun (resolving workspace:^) before publishing to npm.
package.json Switch publish-packages script to use scripts/publish.sh.
.github/workflows/release.yml Publish to GitHub Packages via Bun-packed tarballs instead of publishing directories.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/publish.sh Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
47PADO47 and others added 2 commits July 2, 2026 13:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants