This guide explains how to publish @hrica/zcatalyst-cli-plugin-react to npm.
Note: This is a fork of the official
zcatalyst-cli-plugin-reactfrom the Zoho Catalyst Team. See FORK-NOTICE.md for details.
- npm Account: You need an npm account. Create one at npmjs.com
- npm CLI: Ensure you have npm installed (comes with Node.js)
- Authentication: Log in to npm from your terminal
Before publishing, ensure:
- All tests pass:
npm test - Version number is updated in
package.json - CHANGELOG.md is updated with release notes
- README.md is up to date
- All code is committed to git
- You're on the main/master branch
npm loginEnter your npm credentials when prompted.
Check what will be published:
npm pack --dry-runThis shows all files that will be included in the package.
Ensure all tests pass:
npm testUse npm's version command to bump the version:
# For patch release (1.0.0 -> 1.0.1)
npm version patch
# For minor release (1.0.0 -> 1.1.0)
npm version minor
# For major release (1.0.0 -> 2.0.0)
npm version majorThis will:
- Update version in package.json
- Create a git commit
- Create a git tag
For the first publish (scoped package):
npm publish --access publicFor subsequent publishes:
npm publishCheck that your package is published:
npm view @hrica/zcatalyst-cli-plugin-reactOr visit: https://www.npmjs.com/package/@hrica/zcatalyst-cli-plugin-react
Push your commits and tags:
git push origin main
git push origin --tagsThis project follows Semantic Versioning:
- MAJOR (1.x.x): Breaking changes
- MINOR (x.1.x): New features, backward compatible
- PATCH (x.x.1): Bug fixes, backward compatible
For pre-release versions:
# Set version to beta
npm version 1.1.0-beta.0
# Publish with beta tag
npm publish --tag betaUsers can install beta versions:
npm install @hrica/zcatalyst-cli-plugin-react@betaIf you need to unpublish (within 72 hours):
npm unpublish @hrica/zcatalyst-cli-plugin-react@1.0.0Warning: Unpublishing is discouraged. Use deprecation instead:
npm deprecate @hrica/zcatalyst-cli-plugin-react@1.0.0 "This version has critical bugs. Please upgrade to 1.0.1"For automated publishing via GitHub Actions, create .github/workflows/publish.yml:
name: Publish to npm
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm test
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}Add your npm token to GitHub Secrets as NPM_TOKEN.
After publishing:
- Announce: Update project documentation and notify users
- Monitor: Watch for issues on GitHub/npm
- Update Docs: Ensure installation instructions reference the new package name
- Test Installation: Try installing in a fresh project:
npm install @hrica/zcatalyst-cli-plugin-react
- Ensure you're logged in:
npm whoami - Check package name isn't taken:
npm view @hrica/zcatalyst-cli-plugin-react - Verify you have access to the
@hricascope
- Choose a more unique name or use a scope
- Bump the version number:
npm version patch
For issues with deployment:
- npm support: https://www.npmjs.com/support
- GitHub Issues: https://github.com/h-rica/zcatalyst-cli-plugin-react/issues
To report security vulnerabilities:
- Email: security@example.com
- Or use GitHub Security Advisories