npm Publishing Runbook
This guide summarizes Mission B4.3's publish process. Ownership of the npm org stays with @kneelinghorse.
Prerequisites
- Create the
@cpmsnpm org and invite maintainers. - Generate an automation npm access token and store it as
NPM_TOKENin GitHub secrets. - Optionally add
GH_PAT_RELEASEfor bot comments in release PRs.
Workspace Commands
pnpm install
pnpm build
pnpm test
pnpm changeset
Use pnpm test:workspace when you need per-package test runs.
Release Flow
pnpm changeset– select affected packages, choose version bumps, commit the generated markdown.- Push to
main– theRelease Packagesworkflow opens/updates a release PR viachangesets/action. - Merge the PR – CI runs
pnpm changeset publishto tag + publish packages. - Verify on npm:
npm view @cpms/core version, etc.
Manual fallback:
pnpm install
pnpm build
pnpm changeset publish
Smoke Tests
rm -rf /tmp/proto-test && mkdir -p /tmp/proto-test
cd /tmp/proto-test
npm init -y
npm install @cpms/core @cpms/data
node -e "const { createDataProtocol } = require('@cpms/data'); console.log('ok', !!createDataProtocol);"
Rollback Plan
npm unpublish @cpms/<pkg>@<version> --force(within 24 hours).- Fix the issue + bump via
pnpm changeset. - Run
pnpm version-packagesandpnpm releaseor let CI publish.
Document any emergency actions in cmos/context/MASTER_CONTEXT.json using the CMOS workflows.