Skip to content

Fix prepareRelease JSON.parse of pnpm banners and bump 0.1.1 - #8

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
cursor/fix-packer-json-parse-0-1-1-5969
Aug 16, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
cursor/fix-packer-json-parse-0-1-1-5969

Conversation

@FlyOverCoderKY

@FlyOverCoderKY FlyOverCoderKY commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

publish.yml prepare for v0.1.0 (run 31915311913) failed because prepareRelease did JSON.parse on npm pack --json stdout after prepack ran pnpm run build. pnpm prints a human banner:

> @pegma/flags-contracts@0.1.0 build /home/runner/work/...

and parse threw SyntaxError: Unexpected token '>'.

The setup-node ${NODE_AUTH_TOKEN} .npmrc warning is unrelated. This change does not add NODE_AUTH_TOKEN or any npm token.

v0.1.0 is left untouched: no tag, release, unpublish, or move.

What changed

  • Match pegma-dev/mail scripts/release-packages.mjs: isolated public-registry npm (real npm CLI, empty user/global npmrc, no token env), build and pack through that npm, not pnpm.
  • parseNpmJson skips non-JSON prefixes so a pnpm script banner cannot be parsed as pack metadata, and accepts scalar JSON ("sha512-...", numbers, true/false/null) so npm view dist.integrity --json works after publish and on retries.
  • Public package prepack is now tsc -p tsconfig.json (mail's pattern), so pack no longer shells out to pnpm.
  • Lockstep bump to 0.1.1 for @pegma/flags-contracts, flags-core, flags-static, flags-azure-appconfig, flags-aws-appconfig, flags-cloudflare-flagship, flags-flagd, and flags-launchdarkly, plus lockfile pins.
  • Tests cover the banner+JSON mix and npm view dist.integrity --json stdout ("sha512-abc").

Gate

pnpm run format:check, pnpm run check, and pnpm test passed (201 tests).

Open in Web Open in Cursor 

prepareRelease parsed npm pack --json stdout after prepack ran
`pnpm run build`, so pnpm's `> package build` banner made JSON.parse
throw. Isolate npm like pegma-dev/mail, skip non-JSON prefixes, run
prepack through tsc, and bump public packages to 0.1.1 in lockstep.

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 high 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 dc15a35. Configure here.

Comment thread scripts/release-packages.mjs Resolved

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc15a35478

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/release-packages.mjs Resolved
queryRegistryIntegrity feeds parseNpmJson the npm 11 output of
`npm view dist.integrity --json`, a quoted string. Recognize strings,
numbers, and true/false/null as well as objects and arrays so publish
confirmation and idempotent retries do not throw.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@FlyOverCoderKY
FlyOverCoderKY merged commit 10a3c43 into main Aug 16, 2026
5 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the cursor/fix-packer-json-parse-0-1-1-5969 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