npm publishing process for IntellyWeave CLI.
Before publishing:
- npm account with 2FA enabled
- Publish access to
intellyweave-clipackage - Authenticator app for OTP codes
- Clean working directory
We follow Semantic Versioning:
| Type | When to Use | Example |
|---|---|---|
| Patch | Bug fixes, no breaking changes | 2.5.1 → 2.5.2 |
| Minor | New features, backward compatible | 1.0.0 → 2.6.0 |
| Major | Breaking changes | 2.x.x → 3.0.0 |
git status # Should show no uncommitted changes# For bug fixes (2.5.1 → 2.5.2)
npm run publish:patch
# For new features (1.0.0 → 2.6.0)
npm run publish:minor
# For breaking changes (2.x.x → 3.0.0)
npm run publish:majorThe publish script automatically:
- Runs linter and type checks (
npm run check) - Builds the project (
npm run build) - Sets executable permissions on
dist/cli.js - Bumps version in
package.json - Creates a git tag
- Builds the package
- Prompts for OTP
npm error This operation requires a one-time password from your authenticator.
Get your 6-digit code and run:
npm publish --otp=123456Push commits and tags:
git push && git push --tagsAfter publishing, verify:
# Check npm registry
npm view intellyweave-cli
# Test installation
npx intellyweave-cli@latest --version
# Test in clean directory
cd /tmp
npx intellyweave-cli --helpThe prepublishOnly script in package.json runs automatically before publish:
{
"prepublishOnly": "npm run check && npm run build && chmod +x dist/cli.js"
}This ensures:
- Code passes linting and type checks
- Project is built
- CLI is executable
Enter OTP when prompted:
npm publish --otp=YOUR_6_DIGIT_CODECheck:
- You have publish access to the
intellyweave-clipackage - 2FA is properly set up
- You're logged in:
npm whoami
Fix the issue first:
npm run check # Fix linting/type errors
npm run build # Verify build works-
Unpublish within 72 hours (if possible):
npm unpublish intellyweave-cli@X.Y.Z
-
Or publish a new patch version with fix
- All tests pass:
npm run test - Linting passes:
npm run check - Build succeeds:
npm run build - Working directory is clean
- Version number is correct
- CHANGELOG updated (if applicable)
- Documentation updated for new features
- Git tag pushed
- npm package verified