Skip to content

Fix prepareRelease JSON parse and bump to 0.1.1 - #5

Merged
FlyOverCoderKY merged 3 commits into
mainfrom
cursor/fix-prepare-pack-json-ebce
Aug 16, 2026
Merged

FlyOverCoderKY merged 3 commits into
mainfrom
cursor/fix-prepare-pack-json-ebce

Conversation

@FlyOverCoderKY

@FlyOverCoderKY FlyOverCoderKY commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

The v0.1.0 publish.yml prepare job failed (run 31915314737). prepareRelease ran JSON.parse on npm pack --json stdout after each package prepack of pnpm run build. pnpm prints a human banner:

> @pegma/...@0.1.0 build /home/runner/work/...

and parse threw SyntaxError: Unexpected token '>'.

The setup-node ${NODE_AUTH_TOKEN} .npmrc warning is unrelated. This PR does not add NODE_AUTH_TOKEN or any npm token. It does not tag, release, unpublish, or move v0.1.0.

What changed

  • Parse npm --json stdout after dropping > lifecycle banners, from the first JSON token — objects, arrays, and scalars ("sha512-…", numbers, true/false/null). Mail's packer JSON.parses full npm stdout, which already accepts integrity strings; this helper now does too, so queryRegistryIntegrity can skip-if-exists and confirm after publish.
  • Build the workspace with npm run build instead of pnpm run build.
  • Change public prepack scripts from pnpm run build to tsc -p tsconfig.json, matching @pegma/mail.
  • Bump @pegma/billing-core and @pegma/billing-stripe to 0.1.1 in lockstep, including the workspace pin and lockfile specifier.
  • Assert prepareRelease uses parseNpmJsonStdout (not JSON.parse(result.stdout)), that the helper accepts a pnpm banner prefix that raw JSON.parse rejects, and that npm view dist.integrity --json stdout ("sha512-abc") parses to a string.

Gate

pnpm run format:check, pnpm run check, and pnpm test all pass.

Out of scope

No Git tag, no GitHub release, no npm publish, no token fallback.

Open in Web Open in Cursor 

npm pack --json captured a prepack `pnpm run build` banner on stdout,
so JSON.parse threw Unexpected token '>'. Parse from the first JSON
token, build and pack through npm, and run tsc in prepack. Bump public
packages to 0.1.1 in lockstep after the failed v0.1.0 publish.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1cae589. Configure here.

Comment thread scripts/release-packages.mjs Resolved
parseNpmJsonStdout only sought [ or {, so npm view dist.integrity
--json stdout ("sha512-…") never parsed and registry skip/confirm
paths failed. Drop > banners, then parse any JSON value.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@FlyOverCoderKY
FlyOverCoderKY merged commit 407e375 into main Aug 16, 2026
5 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the cursor/fix-prepare-pack-json-ebce branch August 16, 2026 00:45
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.

2 participants