fix(publish): preserve scope in publish attachment key and tarball URI#478
Merged
Merged
Conversation
The publish packument keyed `_attachments` and the `dist.tarball` URI by the on-disk pack filename, which flattens `@scope/pkg` to `scope-pkg`. GitHub Packages requires the scope-preserving `@scope/pkg-<version>.tgz` form for scoped packages and otherwise rejects the PUT with `no attachments present in packument`. Use a dedicated `publish_attachment_name` (`<name>-<version>.tgz`, matching npm's libnpmpublish) for the attachment key and tarball URI, leaving the flattened `nub pack` filename unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Shipped in v0.5.0: https://github.com/nubjs/nub/releases/tag/v0.5.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Publishing a scoped package to GitHub Packages fails with:
build_publish_bodykeyed both_attachmentsand thedist.tarballURI byarchive.filename, which is the on-disknub packname.pack::tarball_filenameflattens the scope (@scope/pkg→scope-pkg), so the publish body advertisedoisin-ee-momokaya-brand-0.1.2.tgzinstead of the scope-preserving@oisin-ee/momokaya-brand-0.1.2.tgzthat GitHub Packages requires. npm'slibnpmpublishuses${manifest.name}-${manifest.version}.tgz(scope intact) for both, so this is a divergence from the reference protocol.Fix
Add
publish_attachment_name(<name>-<version>.tgz, scope preserved) and use it for the_attachmentskey and the tarball URI. The flattenednub packfilename and the--jsonfilenamefield are unchanged, keeping npm-compatible pack output intact.The provenance attachment already used
archive.name(scoped), so only the tarball attachment was affected.Test
publish_body_uses_scoped_attachment_key_and_tarball_uriasserts the serialized body keys_attachmentsanddist.tarballby the scoped form for@oisin-ee/momokaya-brand, with no live registry needed. Verified locally: all 25commands::publishtests pass.Closes #477
Claude Opus| 𝕏