This package uses an automated publishing process through GitHub Actions with the following workflows:
Add NPM_TOKEN to your GitHub repository secrets:
- Go to GitHub repository → Settings → Secrets and variables → Actions
- Add new repository secret named
NPM_TOKEN - Value should be your NPM access token with publish permissions for @thesis-co scope
- Go to Actions tab → "Version Bump" workflow → "Run workflow"
- Select version bump type (patch/minor/major)
- Review and merge the created PR
- Create a GitHub release with the new version tag
- Package publishes automatically when release is created
- Manually bump version in
package.json - Create PR and merge
- Create GitHub release with matching tag
- Package publishes automatically
- Trigger: Push to main, PRs to main
- Actions: Lint, test, build
- Purpose: Ensure code quality on all changes
- Trigger: GitHub release published
- Actions: Full CI pipeline + NPM publish
- Features:
- NPM provenance for security
- Public access for scoped package
- Trigger: Manual workflow dispatch
- Actions: Creates PR with version bump
- Options: patch, minor, major semver increments
Configure these branch protection rules for main:
-
Require pull request reviews before merging
- Required approving reviews: 1
- Dismiss stale reviews when new commits are pushed
-
Require status checks to pass before merging
- Require branches to be up to date before merging
- Required status checks:
lint-and-test
-
Restrict pushes that create files
- Restrict pushes to admins only
- CI passes (lint, test, build)
- Code follows project conventions
- Tests added/updated for new functionality
- Breaking changes documented
- Version bump is appropriate for changes
Follow Semantic Versioning:
- PATCH (0.0.X): Bug fixes, documentation updates
- MINOR (0.X.0): New features, backwards compatible
- MAJOR (X.0.0): Breaking changes
Key package.json fields for publishing:
"files": ["dist"]- Only publish built files"prepublishOnly"- Runs full CI before publishing"publishConfig": {"access": "public"}- Required for scoped packages
- Create feature branch from
main - Make changes, add tests
- Create PR to
main - Code review and CI checks
- Merge PR
- Use version bump workflow when ready to publish
- Create GitHub release to trigger publish
- Check NPM_TOKEN is valid and has correct permissions
- Ensure version in package.json doesn't already exist on NPM
- Verify CI passes completely
- Check GitHub Actions has write permissions to repository
- Ensure no conflicting branches exist
- Run
pnpm run lint,pnpm run test,pnpm run buildlocally - Fix any issues and push changes