Publishing Guide
This guide explains how to publish the ShellUI packages to npm.
How publishing works
Publishing is done with a single script that:
- Reads the version from the root
package.json - Chooses the npm dist-tag from that version (so pre-releases don’t overwrite
latest):- Version contains
alpha(e.g.0.2.0-alpha.0) →--tag alpha - Version contains
beta(e.g.0.2.0-beta.1) →--tag beta - Otherwise →
--tag latest
- Version contains
- Publishes packages in dependency order: SDK → Core → CLI
You must use alpha or beta in the version string when publishing pre-releases so the correct tag is used automatically.
Prerequisites
-
Log in to npm:
npm login -
Set the version in the root
package.json. For pre-releases, includealphaorbetain the version (e.g.0.2.0-alpha.0,1.0.0-beta.1). -
Sync the version to all packages:
pnpm run version:sync -
Build before publishing:
pnpm run build
Publish all packages
From the repo root:
pnpm run publish
This runs scripts/publish-with-tag.js, which publishes @shellui/sdk, @shellui/core, and @shellui/cli in order with the tag derived from the root version. You don’t need to pass the tag manually.
Version management
-
Bump the root version in
package.json(e.g.0.2.0-alpha.0→0.2.0-alpha.1). -
Sync to all packages:
pnpm run version:sync -
Publish:
pnpm run publish
For stable releases, use a version without alpha or beta (e.g. 1.0.0); it will be published with tag latest.
Testing before publishing
-
Build and link locally:
pnpm run build
cd packages/cli
pnpm link --global -
In another project:
pnpm link --global @shellui/cli
shellui --version
Troubleshooting
- "Package already exists": This version is already on npm. Bump the version and run
pnpm run version:syncbefore publishing again. - "Access denied": Ensure you’re logged in (
npm login) and have publish access to the@shelluiscope. - Wrong tag on npm: Check that the root version contains
alphaorbetafor pre-releases; the script uses only the version string to pick the tag. - "Missing files": Check the
filesfield in each package’spackage.json.