Skip to content

chore: add scripts/npm_init_packages to create new npm packages for trusted publishing - #25912

Merged
charlielye merged 1 commit into
nextfrom
cl/npm-init-packages
Dec 3, 2026
Merged

charlielye merged 1 commit into
nextfrom
cl/npm-init-packages

Conversation

@charlielye

Copy link
Copy Markdown
Contributor

Releases publish to npm with trusted publishing from the publish job in ci3.yml. Trusted publishing can only publish to a package that already exists and trusts the workflow, so the first release of a new package fails with ENEEDAUTH. That happened on v7.0.0-nightly.20261126.1 for the new @aztec-foundation/wsdb-ref packages.

scripts/npm_init_packages <package>... is the one-off step an npm owner runs by hand for new packages:

  • publishes a 0.0.0-init placeholder for each package that doesn't exist;
  • waits for npm to process them, which can take several minutes, checking the registry directly rather than npm's cache;
  • adds the ci3.yml / master trusted publisher to each package that doesn't already have it.

It can be re-run safely. A placeholder still being processed is treated as published instead of failing the run. Trust calls are batched after the wait, so they need one 2FA prompt with "skip for 5 minutes". It was used to set up the five wsdb-ref packages.

scripts/tests/npm_init_packages_test runs it against fake npm and curl, and is added to the scripts tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L

…rusted publishing

A release publishes with npm trusted publishing, which can only publish to a package that already
exists and trusts the workflow. This creates each missing package with a 0.0.0-init placeholder,
waits for npm to process it, and adds the ci3.yml (master) trusted publisher, batched so the trust
step needs a single 2FA prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
@charlielye
charlielye merged commit d26475b into next Dec 3, 2026
16 checks passed
@charlielye
charlielye deleted the cl/npm-init-packages branch December 3, 2026 15:50
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