Releasing loopbase
Package: @superdesign/loopbase (scoped — the bare loopbase name is blocked
by npm as "too similar to loopback"). Installed bins stay loopbase/lb. Source
is published (no build step); npm publish packs the files whitelist from the
working tree, so always publish from a clean checkout.
Preconditions
- All fixes for this release are merged into
main(publish frommain, not a dirty tree or a feature branch). - Pick the new version: patch for fixes, minor for features. Versions are
immutable — you can't republish or cleanly unpublish, so bump every time.
Current published:
npm view @superdesign/loopbase version.
Steps
Publish from a clean checkout of
main(isolated worktree → never ships a dirty tree or another session's WIP):git fetch origin git worktree add -b release/x.y.z /tmp/lb-pub origin/main cd /tmp/lb-pub npm version x.y.z --no-git-tag-version # bumps package.json only (no git tag) npm publish --dry-run # sanity: name, version, file countAuth + OTP. The npm account has 2FA, and the token expires between releases.
npm whoami # 401? → tell the user to run `npm login` (browser flow), confirm "Logged in"The write needs a fresh OTP (~30s lifetime) which only the user's authenticator can produce. So: stage everything first, then ask the user for a 6-digit code, then publish immediately:
npm publish --access public --otp=<code>--access publicis required for a scoped package.- A misleading
404 … not in this registryalmost always means the token expired → re-npm login, then retry with a new OTP.
Record the version bump via PR — never push to
maindirectly.git commit -aqm "release: vx.y.z" git push origin release/x.y.z gh pr create --base main --head release/x.y.z --title "release: vx.y.z" --body "…"Merge the PR so the repo's
package.jsonmatches the registry.Clean up + update the local global install:
cd <repo> && git worktree remove /tmp/lb-pub --force && git branch -D release/x.y.z bun add -g @superdesign/loopbase # updates global loopbase/lb to latest bun pm ls -g | grep loopbase # verify the new version
Gotchas (learned the hard way)
- OTP timing: do the bump + worktree + dry-run BEFORE asking for the code. The OTP expires in ~30s — don't set up after you have it.
- Token expiry between releases is normal (
npm whoami→ 401) — re-login. - Publish from clean
main:npm publishpacks the working tree, so a dirty tree ships uncommitted edits. Theorigin/mainworktree avoids that. - Branch-first: the version-bump commit goes through a PR, like every other
change — don't push it straight to
main. - The CLI has no
--versionflag; check the installed version withbun pm ls -g | grep loopbase.