Skip to content

npm: ship weave-router as @workweave/router (org-scoped) + OIDC publish workflow#147

Merged
steventohme merged 7 commits into
mainfrom
steven/05-15-npm_publish_workflow
May 15, 2026
Merged

npm: ship weave-router as @workweave/router (org-scoped) + OIDC publish workflow#147
steventohme merged 7 commits into
mainfrom
steven/05-15-npm_publish_workflow

Conversation

@steventohme
Copy link
Copy Markdown
Collaborator

@steventohme steventohme commented May 15, 2026

Summary

Two coupled changes that should land together:

  1. Rename the npm package from weave-router to @workweave/router — gets the package owned by the workweave org from day one (npm has no CLI path to transfer unscoped packages to an org; it requires a support ticket), and reserves the @workweave/* scope for future packages.
  2. Add .github/workflows/publish_npm.yml — on tag push matching router-v*, asserts tag matches package.json version, then publishes via npm OIDC trusted publishing (no NPM_TOKEN secret in the repo).

The binary name stays weave-router (package.json bin field), so npm install -g @workweave/router still puts a weave-router command on PATH. Only the npx invocation changes: npx weave-routernpx @workweave/router.

Follow-ups (separate PRs)

  • WorkWeave monorepo: bump backend/internal/app/syncrouterinstall/config.go to render npx -y @workweave/router instead of npx -y weave-router, plus the matching test assertions.
  • Deprecate the old unscoped weave-router@0.1.0: npm deprecate weave-router@0.1.0 "moved to @workweave/router" (kills the squat risk without unpublishing).

Release flow after merge

  1. On npm, register the GitHub Actions trusted publisher for @workweave/router: org=workweave, repo=router, workflow=publish_npm.yml.
  2. Tag main: git tag router-v0.1.0 && git push origin router-v0.1.0.
  3. Workflow publishes @workweave/router@0.1.0 to npm with provenance.

Test plan

  • Configure npm trusted publisher
  • Merge + push router-v0.1.0 tag, confirm workflow run publishes
  • npx -y @workweave/router@0.1.0 --help works from a clean machine
  • Land the WorkWeave-side config.go bump so the UI install command points at the new name
  • npm deprecate weave-router@0.1.0 after the new package is live

- bump version to 0.1.1 (statusline self-refresh + uninstall delegation)
- add .github/workflows/publish_npm.yml: tag `weave-router-v*` triggers
  `npm publish --provenance --access public`, asserts tag matches
  package.json version first
Rename the unscoped weave-router package to @workweave/router (org-scoped) so
the package is owned by the workweave org from day one — no npm-support
ticket needed, no squat risk on the unscoped name.

- install/npm/package.json: name → @workweave/router, version reset to 0.1.0
  (fresh scoped package; the unscoped weave-router@0.1.0 will be deprecated
  with a pointer to the new name)
- Swap `npx weave-router` → `npx @workweave/router` in install.sh,
  uninstall.sh, install/README.md, install/npm/README.md, and bin.js comment
- Keep the binary name as `weave-router` (package.json bin field) so the CLI
  on PATH after `npm install -g` is unchanged
- publish_npm.yml: tag prefix `weave-router-v*` → `router-v*` (npm scope
  slashes break git refs; flat prefix is cleaner), drop NODE_AUTH_TOKEN env
  in favor of npm OIDC trusted publishing (no long-lived secret in repo)
@steventohme steventohme changed the title npm: bump weave-router to 0.1.1 + add tag-publish workflow npm: ship weave-router as @workweave/router (org-scoped) + OIDC publish workflow May 15, 2026
Comment thread .github/workflows/publish_npm.yml Outdated
Comment thread install/npm/package.json
Comment thread .github/workflows/publish_npm.yml
- homepage: weave.ai → workweave.ai (correct marketing domain)
- license: Apache-2.0 → "SEE LICENSE IN LICENSE" (the repo is ELv2, which
  is not on the SPDX list; the npm-recommended pattern for non-SPDX
  licenses is to point at the bundled LICENSE file)
- copy-installer.js: also copy ../../LICENSE into the npm package root so
  npm surfaces the license on the package page and consumers receive it
  with `npm install`
- .gitignore: add LICENSE alongside the other prepack-generated files
- bump to 0.1.1 (0.1.0 just shipped with the wrong metadata)
- pin actions/checkout + actions/setup-node to commit SHAs since this
  workflow has id-token: write and publishes to npm; floating tags here
  let an upstream-action compromise ship a malicious package
- bump node-version 20 → 24 because npm OIDC trusted publishing requires
  npm ≥ 11.5 (Node 20 ships with npm 10 and would 401)
Comment thread .github/workflows/publish_npm.yml
Without this, anyone with tag-push capability could publish from a side
branch and bypass branch-protection / PR-review on main. The new step
fetches origin/main and asserts the tagged commit is an ancestor before
the publish step runs.
Comment thread .github/workflows/publish_npm.yml
Default shallow clone (depth 1) only has the tagged commit, so
`git merge-base --is-ancestor $SHA origin/main` can't walk the graph
and the reachability check would reject even legitimate main-reachable
tags.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 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 f15615b. Configure here.

Comment thread .github/workflows/publish_npm.yml
actions/setup-node v6.0.2 is the first release with npm OIDC support
(actions/setup-node#1477). v4/v5 write an .npmrc that points
`_authToken` at $NODE_AUTH_TOKEN unconditionally, which short-circuits
npm CLI's OIDC code path and 401s at publish even when the trusted
publisher is configured correctly.
@steventohme steventohme merged commit 1c249b8 into main May 15, 2026
3 checks passed
@steventohme steventohme deleted the steven/05-15-npm_publish_workflow branch May 15, 2026 08:39
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