Before publishing this package to npm, ensure you have:
- Tested the package locally
- Updated version number in package.json
- Updated CHANGELOG.md with release notes
- Run all tests and they pass
- Built the package successfully
- Committed all changes to git
npm loginYou can test the package locally before publishing:
npm packThis creates a .tgz file that you can install in another project to test:
npm install /path/to/adjanour-react-components-1.0.0.tgzFor the first release:
npm publish --access publicFor subsequent releases, just use:
npm publishAfter publishing, tag the release in git:
git tag v1.0.0
git push origin v1.0.0Go to the GitHub repository and create a new release with the tag you just created.
For future releases, use npm's built-in version commands:
# Patch release (1.0.0 -> 1.0.1)
npm version patch
# Minor release (1.0.0 -> 1.1.0)
npm version minor
# Major release (1.0.0 -> 2.0.0)
npm version majorThese commands will automatically:
- Update package.json
- Create a git commit
- Create a git tag
Then publish:
npm publish
git push && git push --tagsAfter publishing, verify the package:
- Visit https://www.npmjs.com/package/@adjanour/react-components
- Check that all files are included correctly
- Test installing it in a new project:
npm install @adjanour/react-componentsIf the package name is taken, you'll need to:
- Update the
namefield in package.json - Update references in README.md
Check .npmignore and ensure you're not excluding necessary files.
Ensure tsup is generating .d.ts files and they're included in the files array in package.json.