Repository navigation
fix(release): verify packed workspace dep versions before publishing - #61
Conversation
On Bun 1.4.3, `bun pm pack` writes each `workspace:*` dep at the version recorded in bun.lock, not the one in that package's package.json. release-please bumps package.json only, so @pleaseai/emulate@0.4.0 shipped pinned to 0.3.1/0.3.0 deps, and two of those versions were never published. 0.3.1 has the same defect. Neither can be installed. The publish job now runs a non-frozen `bun install` to sync the workspace versions into bun.lock. It also packs every released package first and fails before any publish if a packed in-repo dep differs from its package.json version. Re-release @pleaseai/emulate as 0.4.1 through `release-as`, and add the package README that npm has been missing.
Up to standards ✅🟢 Issues
|
[Medium impact] The PR appears safe to merge; the earlier README issue is fixed. SummaryThe PR syncs workspace versions before packing and checks every released tarball before publishing.
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Architecture diagram
sequenceDiagram
participant GH as GitHub Actions
participant RJ as release-please
participant Pkg as Package Directory (packages/*)
participant BL as bun.lock
participant Pack as bun pm pack
participant Verify as Verify Script
participant NPM as npmjs.com
Note over GH,NPM: Release Pipeline with Workspace Version Sync and Verification
GH->>RJ: trigger release (main commit)
RJ->>RJ: bump package.json versions (release-as: 0.4.1)
RJ-->>GH: paths_released JSON output
GH->>GH: checkout, bun install --frozen-lockfile
GH->>BL: CHANGED: sync workspace versions (bun install)
GH->>Pack: for each released package
Pack->>Pkg: read package.json (workspace:* deps)
Pack->>BL: read workspace version entries (Bun 1.4.3)
Pack-->>GH: packed tarball with concrete dep versions
GH->>Verify: CHANGED: verify packed deps
Verify->>Pack: extract packed package.json
Verify->>Pkg: read all workspace package.json versions
alt all deps match
Verify-->>GH: success, add tarball to list
else any mismatch
Verify-->>GH: fail with mismatch details
GH->>GH: exit, nothing published
end
Note over GH,NPM: Publish step runs only if all tarballs verified
GH->>NPM: publish verified tarball(s)
NPM-->>GH: provenance attached via OIDC
GH-->>GH: complete release
Note over GH,RJ: Follow-up manual actions after 0.4.1 (not in PR)
GH->>NPM: deprecate @pleaseai/emulate@0.4.0 and 0.3.1
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|



Summary
@pleaseai/emulate@0.4.0cannot be installed. Its tarball pins the service packages to their previous versions, and two of those were never published:0.3.1 has the same defect: it pins every service package to 0.3.0, which was never published.
Cause: on Bun 1.4.3, the version pinned in
mise.tomland used by the publish job,bun pm packwrites eachworkspace:*dep at the version in that package's bun.lock workspace entry, not the one in its package.json. release-please bumps package.json only, andbun install --frozen-lockfiledoes not flag the drift. So every release packs the versions from the release before it. Bun 1.4.4 reads package.json instead, which is why a local pack on 1.4.4 looks correct.This PR changes the
publishjob:bun installruns after the frozen one. On the release commit it rewrites only the 16 workspaceversionlines in bun.lock.package.jsonagainst that package's package.json version. If any differ, the step fails, and because publishing is now a separate step that runs only after every tarball passes, nothing is published.It also re-releases only
@pleaseai/emulateas 0.4.1:release-as: 0.4.1forpackages/emulateinrelease-please-config.json.packages/emulate/README.md: the npm page has no README. It also says to install 0.4.1 or later. This file is also what makes release-please pick uppackages/emulate: a path with no commits is skipped even when it hasrelease-as.Verification
bun install --frozen-lockfile, then packpackages/emulate:runblock and ran it withbash -eo pipefailon Bun 1.4.3, withPATHS_RELEASED='["packages/asana","packages/emulate"]':bun install: exit 1, with all 15 mismatches listed (@pleaseai/emulate-jira: packed 0.3.0, package.json 0.3.1, ...).bun install: exit 0. Both tarballs are listed for the publish step. The bun.lock diff is 16versionlines.actionlintandshellcheckpass on the workflow and the extracted script.eslintpasses on the changed files.release-please@17.6.0 release-pr --dry-runagainst this branch:packages/emulate→ 0.4.1 (Setting version for packages/emulate from release-as configuration). The other 15 paths are skipped withNo commits for path.npm publish.Follow-up after 0.4.1 is published
release-asfrompackages/emulate. While it is set, every later release of the package tries 0.4.1 again.mise.tomlto Bun 1.4.4 would also stop the stale pins. The new check stays useful either way.Related issue
Follow-up to #52 and #53 (the 0.3.2 / 0.4.0 release).
Checklist
eslinton changed files,actionlint,shellcheck)packages/emulate/README.md)Summary by cubic
Fixes
@pleaseai/emulate0.3.1 and 0.4.0 being uninstallable: both tarballs pin the@pleaseai/emulate-*service packages to versions that were never published. On Bun 1.4.3,bun pm packwritesworkspace:*deps from bun.lock instead of package.json, and release-please bumps only package.json, so every release packs stale pins.The publish job now syncs bun.lock with a non-frozen
bun install, then packs every released package and compares each in-repo dep in the tarball against the package's package.json version; any mismatch fails the step before anything is published. This PR also re-releases@pleaseai/emulateas 0.4.1 viarelease-asand adds the README the npm page was missing, including how--serviceand the config choose which services start. Not included: bumpingmise.tomlto Bun 1.4.4 (which reads package.json instead), so the new verification guard stays useful regardless.Follow-up after 0.4.1 ships
release-asfrompackages/emulate, or later releases will keep retrying 0.4.1.Written for commit 77aaab4. Summary will update on new commits.