feat: publish with npm provenance from CI and move Nx framework deps to peers#216
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit 466a1a8
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gonx-docs | 466a1a8 | Commit Preview URL Branch Preview URL |
Jul 21 2026, 02:07 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
nx-cloudflare | 466a1a8 | Commit Preview URL Branch Preview URL |
Jul 21 2026, 02:07 PM |
Stop shipping the Nx framework as nested runtime dependencies. `nx` and `@nx/devkit` are now peerDependencies at ^23.0.0 (same range as before). Every consumer is an Nx workspace that already provides these packages, and modern package managers auto-install peers, so this is a minor — not a major. `packageJsonUpdates` at 4.1.0 uses alwaysAddToPackageJson: true so `nx migrate @naxodev/gonx` still inserts the peers for consumers that relied on the previous transitive install.
Stop shipping the Nx framework as nested runtime dependencies. `@nx/devkit` and `@nx/js` are now peerDependencies at ^23.0.0 (same range as before); `wrangler` was already a peer. Every consumer is an Nx workspace that already provides these packages, and modern package managers auto-install peers, so this is a minor — not a major. `packageJsonUpdates` at 7.1.0 uses alwaysAddToPackageJson: true so `nx migrate @naxodev/nx-cloudflare` still inserts the peers for consumers that relied on the previous transitive install.
NachoVazquez
force-pushed
the
apnea/npm-provenance-ci-publish
branch
from
July 21, 2026 14:06
c336ecc to
466a1a8
Compare
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.
npmx flagged both published packages for supply-chain trust issues. This PR fixes the root causes and documents the one-time maintainer actions that code cannot perform.
Problems addressed
@naxodev/gonx(and 5.x–6.x of@naxodev/nx-cloudflare) had npm provenance attestations; every release since (gonx 4.x, nx-cloudflare 7.0.0) has none, because production publishing moved to a maintainer laptop with an OTP. Provenance can only be emitted from cloud CI.nx/@nx/devkit(gonx) and@nx/devkit/@nx/js(nx-cloudflare) were runtimedependencies, adding ~73MB per install and attributing the Nx framework's transitive advisories to these plugins. Both plugins only ever run inside an Nx workspace, which already provides these packages.gonx@nextpoints at2.0.0-beta.7(latest is 4.0.2);nx-cloudflare@nextpoints at5.0.0-rc.0(latest is 7.0.0).What changed
ci: publish production releases via OIDC with provenance
.github/workflows/publish.ymlreplacespublish-pr.yml(npm allows one trusted-publisher workflow filename per package, so preview and production must share a file):publish-preview— the existing label-gated PR-preview job, unchanged except job-level concurrency (publish-preview-<pr>) and an npm pin (npm@11).publish-production— fires on<project>@vX.Y.Ztag pushes (the tagsnx release --skip-publishalready creates) orworkflow_dispatchwith a tag input. Parses and validates the tag, checks out the tagged commit, asserts source and builtdist/manifest versions match the tag, skips idempotently if the version is already live, and publishesdist/packages/<project>tokenlessly via npm OIDC trusted publishing — provenance is automatic. Prereleases (version containing-) auto-tagnext; stable versions taglatest. Gated by theproductionGitHub environment.nx release publishdelegates to bun, whose OIDC exchange doesn't engage).CONTRIBUTING.mdReleasing section rewritten: version/changelog/tag locally withbunx nx release --projects=<project> --skip-publish, CI publishes on the pushed tag. Includes dry-run, re-run, prerelease handling, back-patchlatestwarning, trusted-publisher setup, dist-tag hygiene, provenance verification, and a no-provenance local fallback (last resort).CLAUDE.mdupdated to match.feat(gonx): move nx and @nx/devkit to peerDependencies
feat(nx-cloudflare): move @nx/devkit and @nx/js to peerDependencies
peerDependenciesat^23.0.0(same range that was already declared as runtime deps). Only true runtime deps remain independencies. Runtime imports are unchanged — peers resolve identically.packageJsonUpdatesmigrations still ship sonx migrateinserts the peers for anyone who relied on the previous transitive install: keyed at gonx 4.1.0 / nx-cloudflare 7.1.0 withalwaysAddToPackageJson: true.repository.urlnormalized togit+https://github.com/naxodev/oss.gitin both manifests (provenance hygiene).Not changed:
chalk@^4.1.2stays. OSVMAL-2025-46969affects onlychalk@5.6.1; scanners flagging gonx for it are ignoring affected-version ranges — false positive, no action.Test plan
bunx nx run gonx:lint/nx-cloudflare:lintgreen — includes@nx/nx-plugin-checks.bunx nx run-many -t build test --projects=gonx,nx-cloudflaregreen;bunx nx format:checkgreen.publish-pr.ymlreference is the intentional historical one in CONTRIBUTING.Post-merge checklist (human, in order)
@naxodev/gonxand@naxodev/nx-cloudflare: Package Settings → Trusted Publisher → change the GitHub Actions workflow filename frompublish-pr.ymltopublish.yml(repositorynaxodev/oss, environment field left blank). Until this is done, preview and production publishes fail loudly with an OIDC error.productionand add yourself as required reviewer.npm dist-tag rm @naxodev/gonx next(stale at2.0.0-beta.7) andnpm dist-tag rm @naxodev/nx-cloudflare next(stale at5.0.0-rc.0).bunx nx release --projects=gonx --skip-publish, then the same fornx-cloudflare— these produce the 4.1.0 / 7.1.0 minors carrying the peer-dependency move and its migrations. Approve the environment gate, then verifynpm view @naxodev/<pkg>@<version> --json | jq .dist.attestationsis non-null and the npmjs package page shows the provenance badge.chalkremains at^4.1.2and is unaffected by MAL-2025-46969 (scanner false positive on 5.6.1 only).Residual risk
nx migrate— rare in Nx 23 workspaces.latestbackwards (CI maps every non-prerelease tolatest); CONTRIBUTING documents the manualnpm dist-tag addretag.