Publishing Guide
This guide explains how to publish the ShellUI packages to npm.
Prerequisites
-
Ensure you're logged into npm:
npm login -
Make sure all packages have the correct version numbers in their
package.jsonfiles. -
Build all packages before publishing:
npm run build
Publishing Individual Packages
Publish CLI
npm run publish:cli
Or manually:
cd packages/cli
npm publish
Publish Core
npm run publish:core
Or manually:
cd packages/core
npm publish
Publish SDK
npm run publish:sdk
Or manually:
cd packages/sdk
npm publish
Publishing All Packages
To publish all packages in order:
npm run publish:all
Note: This will publish packages sequentially. Make sure dependencies are correct (e.g., @shellui/core should be published before @shellui/cli and @shellui/sdk if they depend on it).
Version Management
To update versions across all packages, you can use tools like:
npm version(manual)lerna(for more advanced versioning)changesets(for changelog management)
Example with npm:
cd packages/cli && npm version patch
cd ../core && npm version patch
cd ../sdk && npm version patch
Testing Before Publishing
-
Test locally by linking packages:
npm run build
cd packages/cli
npm link -
In another project:
npm link @shellui/cli -
Test the installation:
npm install -g @shellui/cli
shellui --version
Troubleshooting
- "Package already exists": The version number already exists on npm. Bump the version.
- "Access denied": Make sure you're logged in and have access to publish to the
@shelluiscope. - "Missing files": Check the
filesfield in eachpackage.jsonto ensure all necessary files are included.