chore: restore npm publishing via OIDC, update toolchain - #40
Merged
Conversation
npm revoked all classic tokens on 2025-12-09, which broke the Release workflow and left 0.7.2 unpublished (registry is still on 0.7.1). Switch to OIDC trusted publishing: pnpm 11 does the token exchange natively, so the workflow only needs `id-token: write` and no NPM_TOKEN at all. - fix: `postinstall` hardcoded `bin install latest`, so the CLOUDFLARED_VERSION env var documented in the README never applied. Installing an explicit version also printed `undefined`. - pnpm 10 -> 11; its settings move to pnpm-workspace.yaml, since the `pnpm` field in package.json is no longer read - pin @typescript-eslint to 8.66.0: pnpm 11's minimumReleaseAge check rejects 8.67.0, and project-service pulls it back in via a caret range - actions/checkout v4 -> v7, pnpm/action-setup v4 -> v6, both on Node 24 ahead of the Node 20 runner removal - refresh the cloudflared test matrix (upstream is on 2026.7.3) - drop the unused `changeset` package, an unrelated LevelDB utility that has nothing to do with the changesets CLI - move typedoc to a config file so `@platform` stops warning - keep prettier away from pnpm-lock.yaml
🦋 Changeset detectedLatest commit: 9844a3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merged
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.
Why
The Release workflow has been failing since the last merge to
main, so 0.7.2 was never published — the registry is still on 0.7.1. Root cause: theNPM_TOKENsecret was created 2022-07-24 and was a classic token, and npm permanently revoked all classic tokens on 2025-12-09.Publishing: OIDC trusted publishing
Rather than rotate to a granular token (capped at 90 days, so this recurs every quarter), publishing now uses OIDC. Verified by decompiling the pnpm bundles rather than trusting docs:
ACTIONS_ID_TOKEN_REQUEST_URLrunNpm(npmPath ?? "npm", ["publish", ...])pnpm 10 just shells out to whatever
npmis on PATH, andubuntu-latestships npm 10.9.8 — below the 11.5.1 that trusted publishing needs. Moving to pnpm 11 makes that irrelevant: the workflow only needsid-token: write, with noactions/setup-nodeand no npm upgrade step.NPM_TOKENis deliberately absent from the workflow env —changesets/actionwrites an.npmrcwhenever it sees one, and that credential would take precedence over OIDC. The secret has been deleted from the repo. Provenance signs automatically for a public repo + public package; it must not be set explicitly (changesets#1914).Setup done outside this PR: Trusted Publisher configured on npmjs.com pointing at
release.yml.Bug fix:
CLOUDFLARED_VERSIONwas ignoredpostinstallhardcodedbin install latest, so the env var the README documents had no effect. Reproduced: settingCLOUDFLARED_VERSION=2025.11.1installed 2026.7.3. Installing an explicit version also printedInstalling cloudflared undefined, because the message read the raw argument instead of the resolved version. CI never caught this because the tests reinstall the binary themselves, bypassing the postinstall path.Verified after the fix: env var honoured, unset still resolves to latest, explicit version still works.
pnpm 11 migration notes
Two breaking changes worth flagging for review:
pnpmfield inpackage.jsonis no longer read —onlyBuiltDependenciesmoves topnpm-workspace.yamlunder the newallowBuildssyntax.minimumReleaseAgesupply-chain check (24h default) that rejected@typescript-eslint@8.67.0, published the same day. pnpm's own suggestion was to add the packages tominimumReleaseAgeExclude— that was dropped, since it disables the check that just did its job. Pinned to 8.66.0 instead. Direct pinning alone isn't enough:@typescript-eslint/project-servicedepends on its siblings via a caret range, so anoverridesblock holds the whole set. That block is temporary and commented as such.Confirmed the policy is a pnpm built-in default, not local config (
pnpm config get minimumReleaseAge→undefined), so CI would hit it too. Validated with--frozen-lockfile.TypeScript stays on 6.0.3 — 7.0.2 breaks both build and lint (
typescript-eslint does not support TS 7.0, and typedoc hasn't caught up either).Other maintenance
actions/checkoutv4→v7 andpnpm/action-setupv4→v6, both Node 24, ahead of the Node 20 runner removal on 2026-09-16. Confirmedpeaceiris/actions-gh-pages@v4andchangesets/action@v1are already Node 24.test.yml's sudo call now uses the action'sbin_destoutput instead of$PNPM_HOME, which v6 changed the handling of.latest / 2026.7.3 / 2026.5.0 / 2026.2.0 / 2025.11.1. Keeping one explicit newest version is deliberate —install.tsuses a different download URL forlatestthan for a pinned version.changeset@0.2.6, an unrelated LevelDB JSON-diff utility from 2013 that was never the changesets CLI.@platformwarnings.pnpm-lock.yamladded to.prettierignore—pnpm formatwas rewriting the lockfile.no-unused-expressionsraised to error now that the source is clean.Verification
build/lint(0 warnings) /docs(0 warnings) /format/test(2 passed, 1 skipped) all pass under pnpm 11.21.0 with--frozen-lockfile.Note: 0.7.2 will be skipped; the next release goes straight to 0.7.3 with both CHANGELOG entries intact.