feat(npm): bootstrap from real tarballs instead of placeholders - #3
Merged
Conversation
npm Trusted Publishing can only be configured on a package that already exists, so the first publish of each of the seven names cannot come from CI. The previous instruction was to publish 373-byte placeholder packages, which has two defects: the placeholder claims the "latest" dist-tag, so `npm i @planmonster/olkcli` would install a launcher with no binary, and the junk version stays on the registry forever because versions are immutable. Bootstrap from the tarballs that a dry run already produces instead. A maintainer starts publish-npm.yml with dry_run: true, downloads the npm-tarballs artifact, and publishes it with scripts/bootstrap-npm.sh. No Mac is needed locally, the first published version is real and installable, and the token is used once and then revoked. scripts/bootstrap-npm.sh enforces the publish order (six binary packages first, launcher last) and refuses to run unless all seven tarballs are present. It supports --dry-run and --tag. build-npm.mjs gains --tag so the placeholder path, kept only for reserving names ahead of a first release, can stay off the "latest" tag.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesnpm publishing bootstrap
Sequence Diagram(s)sequenceDiagram
participant Maintainer
participant bootstrap_npm_sh
participant npm_registry
Maintainer->>bootstrap_npm_sh: Provide tarball directory and options
bootstrap_npm_sh->>bootstrap_npm_sh: Validate and classify seven tarballs
bootstrap_npm_sh->>npm_registry: Check package versions
bootstrap_npm_sh->>npm_registry: Publish six platform packages
bootstrap_npm_sh->>npm_registry: Publish launcher package
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ffd61203-c13e-45b3-b148-2683a954ebbb
📒 Files selected for processing (3)
docs/npm-publishing.mdscripts/bootstrap-npm.shscripts/build-npm.mjs
…trap resumable Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
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.
Follow-up to #2. The bootstrap step in
docs/npm-publishing.mdsaid "publish placeholders", which was underspecified and, on inspection, the wrong approach.The constraint
npm Trusted Publishing can only be configured on a package that already exists, and our CI publishes through Trusted Publishing. So the first publish of each of the 7 names must come from a maintainer's machine.
Why placeholders were wrong
A placeholder is a 373-byte package containing only
package.jsonand an emptybin/.gitkeep(verified withnpm pack --dry-run). Two defects:latestdist-tag —npm i @planmonster/olkcliwould install a launcher with no binary.What replaces it
Bootstrap from the tarballs a
dry_runalready builds:No Mac needed locally, no junk versions, and the first published version is real and installable.
scripts/bootstrap-npm.shenforces the ordering (6 binary packages, launcher last) and refuses to run unless all 7 tarballs are present.build-npm.mjsgains--tag, so the placeholder path — kept only for reserving names ahead of a first release — stays offlatest.Testing
bash scripts/bootstrap-npm.sh /tmp/bs --dry-runagainst 7 real packed tarballs: correct split (6 binary + 1 launcher), correct order, no publishnpm pack --dry-run:bin/.gitkeep+package.json, 373 Bbash scripts/test-npm-package.sh→ PASS (unscoped + scoped)bash -nclean on the new scriptNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.