fix(release): clear errors instead of cryptic failures in the npm build/publish path#6
Merged
Merged
Conversation
…/publish path The local release tooling surfaced confusing failures when inputs were missing. A version mismatch (e.g. `npm-build VERSION=v0.1.2` against v0.1.1 tarballs) died with a `tar: Cannot open` error and left a half-built npm/dist, which then made `npm-publish` crash with `Cannot find module './package.json'`. - build-packages.mjs: preflight that every platform artifact for the version exists before touching npm/dist — clear "missing artifacts … build them first: make dist VERSION=…" message, and it no longer wipes or half-builds npm/dist on a mismatch. - Makefile: npm-publish / npm-dry-run now bail with guidance when npm/dist isn't assembled, and skip any directory that has no package.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Summary
The local release tooling surfaced confusing, hard-to-diagnose failures when inputs were missing. Two real cases hit during a release:
make npm-build VERSION=v0.1.2againstdist/holdingv0.1.1tarballs died with a cryptictar (child): … Cannot open: No such file or directory, and left a half-builtnpm/dist.make npm-publishover that half-builtnpm/distthen crashed withError: Cannot find module './package.json'(a dir existed without apackage.json).Changes
npm/scripts/build-packages.mjs— preflight that every platform artifact for the version exists before touchingnpm/dist. On a mismatch it prints the missing files +build them first: make dist VERSION=…and exits, so it never wipes a goodnpm/distor leaves a half-built one.Makefile—npm-publish/npm-dry-runbail with guidance whennpm/distisn't assembled (run: make dist … && make mcp-dist && make npm-build …), and skip any directory without apackage.json.Tested
make npm-publishon a half-builtnpm/dist→ clear "npm/dist not assembled" error (was:Cannot find module './package.json').make npm-build VERSION=v0.1.2(no v0.1.2 tarballs) → lists the missing artifacts +make dist VERSION=v0.1.2(was: cryptictarerror + half-built dir).make npm-build VERSION=v0.1.1(artifacts present) → assembles all 7 packages;make npm-dry-runvalidates them.🤖 Generated with Claude Code