Skip to content

ci(release): publish @tomic/* packages to npm on a v* tag - #1355

Open
joepio wants to merge 2 commits into
developfrom
cursor/ci-npm-publish-6193
Open

ci(release): publish @tomic/* packages to npm on a v* tag#1355
joepio wants to merge 2 commits into
developfrom
cursor/ci-npm-publish-6193

Conversation

@joepio

@joepio joepio commented Sep 3, 2026

Copy link
Copy Markdown
Member

Related Issues

Tag releases published crates.io and GitHub assets but never npm. @tomic/lib latest is still 0.40.0 and beta is stuck on 0.41.0-beta.0 (2025-06-23); v0.41.0-beta.1 through beta.4 never reached the registry.

What changed

  • New npm job in release.yml, independent of the crates job so a 401 from npmjs.org cannot re-attempt a crates.io publish that already succeeded.
  • pnpm publish -r --no-git-checks --ignore-scripts --access public --tag <dist-tag> — skips private packages and any version already on the registry, so a partial run can be retried.
  • Build @tomic/lib first, then the dependents. A single --filter list compiles them concurrently and tsc fails with TS2307 on a fresh checkout.
  • --ignore-scripts because @tomic/lib's prepublishOnlyattw currently crashes (Cannot read properties of undefined (reading 'filename')), which would fail every release. The workspace:* rewrite is done by pnpm publish itself.
  • Pre-releases use the first identifier as the dist-tag (v0.41.0-beta.4beta, v0.41.0latest) so a beta cannot replace the stable install. Logic is in scripts/npm-dist-tag.mjs (--check covered).
  • @tomic/plugin and @tomic/edit-mode get publishConfig.access: public (neither has ever been published).
  • CONTRIBUTING updated: npm is CI on tag push; the laptop pnpm publish -r path is the fallback.

Auth (needs a one-time setup)

The job reads secrets.NPM_TOKEN (granular automation token, write to @tomic) and also has id-token: write for npm Trusted Publishing. Configure one of:

  1. Repo secret NPM_TOKEN, or
  2. Trusted Publishing on each @tomic/* package at npmjs.com: repo ontola/atomic-server, workflow release.yml.

Without either, the job will 401 — which is louder than silently not publishing.

Verified locally

  • node scripts/npm-dist-tag.mjs --check — 8 cases
  • node scripts/bump-version.mjs --check 0.41.0-beta.4 — 15 sites agree
  • pnpm publish -r --dry-run --no-git-checks --ignore-scripts --access public --tag beta packs and would publish all seven @tomic/* packages; private workspace members are skipped; packed @tomic/react and @tomic/cli rewrite workspace:* to 0.41.0-beta.4

Checklist

  • Add changelog entry linking to issue, describe API changes
  • Add or update tests if needed
  • Update docs if needed
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 3, 2026 19:34
Tag releases published crates.io and GitHub assets but left npm as a
manual `pnpm publish -r`. That is why latest is still 0.40.0 and the
beta tag is stuck on 0.41.0-beta.0. Pre-releases use the beta/rc
dist-tag so they cannot replace latest.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
A single filter list compiles cli in parallel with lib, which fails
TS2307 on a fresh checkout. lib's prepublishOnly attw also crashes
(undefined filename), so publish uses --ignore-scripts after the
explicit build.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
@joepio
joepio marked this pull request as ready for review September 3, 2026 19:37
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