This document describes how to publish the ZoriHQ framework libraries to npm.
You need to configure an NPM authentication token in GitHub Secrets:
- Create an npm account at https://www.npmjs.com/
- Generate an automation token: https://www.npmjs.com/settings/YOUR_USERNAME/tokens
- Add it to GitHub repository secrets as
NPM_TOKEN
All packages are published under the @zorihq scope:
@zorihq/react@zorihq/nextjs@zorihq/nextjs-server@zorihq/vue@zorihq/svelte
Ensure you have permission to publish to this scope on npm.
The workflow publish-packages.yml handles building, versioning, and publishing packages to npm.
- Go to Actions → Publish Framework Packages
- Click Run workflow
- Select options:
- Package: Choose which package to publish (react, nextjs, nextjs-server, vue, svelte)
- Version bump type: Choose
patch,minor, ormajor - Dry run: Check this to test without actually publishing
- Go to Actions → Publish Framework Packages
- Click Run workflow
- Select options:
- Package: Choose
all - Version bump type: Choose
patch,minor, ormajor - Dry run: Check this to test without actually publishing
- Package: Choose
- Checks out code from the repository
- Installs dependencies for the selected package(s)
- Verifies package files to ensure everything is ready
- Bumps version according to your selection (patch, minor, major)
- Publishes to npm with public access
- Commits version bump back to the repository
- Creates git tag in format
{package}/v{version}(e.g.,react/v1.0.1) - Creates GitHub Release with installation instructions
If you need to publish manually from your local machine:
npm logincd react # or nextjs, nextjs-server, vue, sveltenpm version patch # or minor, majornpm publish --access publicgit add package.json
git commit -m "chore(react): release v1.0.1"
git tag react/v1.0.1
git push origin main --tagsFollow semantic versioning:
- patch (1.0.0 → 1.0.1): Bug fixes, small improvements
- minor (1.0.0 → 1.1.0): New features, backward compatible
- major (1.0.0 → 2.0.0): Breaking changes
Each package is published with source files (TypeScript/TSX) to allow users' build systems to handle compilation:
@zorihq/react/
├── index.tsx # Main source file
├── README.md # Usage documentation
├── package.json # Package manifest
└── tsconfig.json # TypeScript config
After publishing, verify on npm:
npm view @zorihq/react
npm view @zorihq/nextjs
npm view @zorihq/nextjs-server
npm view @zorihq/vue
npm view @zorihq/svelteOr visit:
- https://www.npmjs.com/package/@zorihq/react
- https://www.npmjs.com/package/@zorihq/nextjs
- https://www.npmjs.com/package/@zorihq/nextjs-server
- https://www.npmjs.com/package/@zorihq/vue
- https://www.npmjs.com/package/@zorihq/svelte
Always test with dry-run enabled first:
- Run the workflow with dry-run: true
- Check the workflow logs to see what would be published
- If everything looks good, run again with dry-run: false
Test package locally before publishing:
cd react
npm pack
# This creates a .tgz file you can inspect or install locallyInstall the packed version in a test project:
npm install /path/to/zorihq-react-1.0.0.tgz- Ensure you're logged into the correct npm account
- Ensure you have access to the
@zorihqscope - Check that
NPM_TOKENsecret is correctly configured
- You're trying to publish a version that's already on npm
- Bump the version first with
npm version patch/minor/major
- Check the
filesfield inpackage.json - Run
npm pack --dry-runto see what would be included - Verify source files exist in the package directory
The workflow integrates with GitHub's CI/CD:
- On workflow_dispatch: Manual trigger from GitHub Actions UI
- Permissions: Requires
contents: writeandpackages: write - Matrix strategy: Can publish multiple packages in parallel when
allis selected
After publishing:
- Update documentation if needed
- Announce release in relevant channels
- Monitor npm for download stats
- Watch for issues reported by users
- ✅ Always use dry-run first for new packages
- ✅ Test locally before publishing
- ✅ Follow semantic versioning strictly
- ✅ Update README with breaking changes
- ✅ Tag releases with descriptive names
- ✅ Keep changelogs updated
- ✅ Coordinate releases when updating multiple packages
After publishing, packages are available at:
- npm:
https://www.npmjs.com/package/@zorihq/{package-name} - GitHub:
https://github.com/ZoriHQ/script/tree/main/{package-name} - Unpkg CDN:
https://unpkg.com/@zorihq/{package-name}(for bundled builds)
For issues with publishing:
- Check GitHub Actions logs for detailed error messages
- Verify npm credentials and permissions
- Review package.json configuration
- Test with
npm pack --dry-runlocally
All packages are published under the MIT License.