Skip to content

fix(release): clear errors instead of cryptic failures in the npm build/publish path#6

Merged
protonspy merged 1 commit into
mainfrom
fix/release-tooling-guards
May 31, 2026
Merged

fix(release): clear errors instead of cryptic failures in the npm build/publish path#6
protonspy merged 1 commit into
mainfrom
fix/release-tooling-guards

Conversation

@protonspy
Copy link
Copy Markdown
Owner

Summary

The local release tooling surfaced confusing, hard-to-diagnose failures when inputs were missing. Two real cases hit during a release:

  1. Version mismatchmake npm-build VERSION=v0.1.2 against dist/ holding v0.1.1 tarballs died with a cryptic tar (child): … Cannot open: No such file or directory, and left a half-built npm/dist.
  2. Unassembled publishmake npm-publish over that half-built npm/dist then crashed with Error: Cannot find module './package.json' (a dir existed without a package.json).

Changes

  • npm/scripts/build-packages.mjs — preflight that every platform artifact for the version exists before touching npm/dist. On a mismatch it prints the missing files + build them first: make dist VERSION=… and exits, so it never wipes a good npm/dist or leaves a half-built one.
  • Makefilenpm-publish / npm-dry-run bail with guidance when npm/dist isn't assembled (run: make dist … && make mcp-dist && make npm-build …), and skip any directory without a package.json.

Tested

  • make npm-publish on a half-built npm/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: cryptic tar error + half-built dir).
  • make npm-build VERSION=v0.1.1 (artifacts present) → assembles all 7 packages; make npm-dry-run validates them.

🤖 Generated with Claude Code

…/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>
@protonspy protonspy merged commit b3e8e8b into main May 31, 2026
2 checks passed
@protonspy protonspy deleted the fix/release-tooling-guards branch May 31, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant