fix: Guard against unresolved catalog:/workspace: protocols - #1053
Conversation
…anifests Fixes solidjs-community#1052. @solid-primitives/event-listener@3.0.0-next.4 and @solid-primitives/pagination@1.0.0-next.7 were published to npm with a literal, unresolved "catalog:peer" string left in peerDependencies instead of a resolved semver range, breaking plain npm/yarn installs with EUNSUPPORTEDPROTOCOL. Root cause in that specific CI run isn't conclusively provable after the fact (local repro with matching pnpm 11.9.0 resolves correctly today, and the OIDC npm-upgrade step some would suspect postdates the broken commit), so the fix is root-cause agnostic: verify the actual packed manifest before publishing, not the source files. - scripts/verify-published-manifests.ts: packs the whole workspace via `pnpm pack -r --json`, reads each packed package/package.json, and fails loudly if any dependency field still contains an unresolved catalog:/workspace: protocol string. - Wire `pnpm run verify:manifests` into both release/release-tagged scripts, gating changeset publish. - Add the same check to tests.yml for earlier feedback on every PR. - Changeset republishes event-listener and pagination with correctly resolved peerDependencies once this guard is in place.
🦋 Changeset detectedLatest commit: a47cf15 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
✅ Deploy Preview for solid-primitives-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe changes add a script that checks packed package manifests for unresolved ChangesPublished manifest verification
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This adds packed-manifest validation before release publishing and in CI, while republishing the affected packages with resolved dependency ranges. No merge-blocking risk is identified. Sequence Diagram(s)sequenceDiagram
participant CI_or_release
participant verify_manifests
participant pnpm_pack
participant tar
CI_or_release->>verify_manifests: Run verification after build
verify_manifests->>pnpm_pack: Pack all packages
pnpm_pack-->>verify_manifests: Return packed archives
verify_manifests->>tar: Extract package/package.json
tar-->>verify_manifests: Return packed manifest
verify_manifests->>verify_manifests: Scan dependency fields
verify_manifests-->>CI_or_release: Pass or exit with failure
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Before writing a fix I checked the actual scope and cause directly against the npm registry, rather than assuming this affects every package that uses the
catalog:peerpattern (it doesn't — ~97 packages use that pattern in source, but most haven't been re-published since the catalog migration and were never at risk):event-listener@3.0.0-next.4andpagination@1.0.0-next.7, both bumped in the same "Version Packages" commit — the most recent one onnext. Nothing else has published since.11.9.0, pinned viapackageManager, unchanged since that commit) — bothpnpm packandpnpm publish --dry-runcorrectly resolvecatalog:peer→^2.0.0-rc.0today, from the exact same source files. This isn't a currently-reproducible bug in the repo's config.npm install -g npm@lateststep (for npm OIDC trusted publishing) sitting right before the publish step. Confirmed via git history that this step didn't exist yet at the commit that produced the broken publish — it postdates the incident, so it can't be the cause.Fix
scripts/verify-published-manifests.ts(new) — packs the entire workspace in one call (pnpm pack -r --json), reads every packedpackage/package.json(the manifest exactly as it would land on npm, not the source file), and fails with a precisepackage@version field.dep = "value"message if any dependency field still contains an unresolvedcatalog:/workspace:string.pnpm run release/release-tagged(right afterpnpm build, beforechangeset publish) — fails closed, so a bad manifest never reachesnpm publish.tests.ymlso this is checked on every PR, not just at release time (this PR itself exercises it in CI).event-listener(next.4→next.5) andpagination(next.7→next.8) withpeerDependenciescorrectly resolved. No functional changes in either package.Testing
Notes
release-tagged.ymlwith the new guard in place. If resolution behaves as it does locally, it publishes cleanly; if not, the job fails beforechangeset publishever runs, with an exact error instead of silently shipping broken again.Closes #1052
Summary by CodeRabbit
Bug Fixes
@solid-primitives/event-listenerand@solid-primitives/paginationwith corrected dependency metadata.Chores