How pgflow automatically releases packages to npm and JSR via CI.
- 📝 Developer creates changeset + merges feature PR
- 🤖 CI creates "Version Packages" PR (updates versions & changelogs)
- ✅ Maintainer merges the Version Packages PR
- 🚀 CI publishes to npm + JSR automatically
All releases happen through GitHub Actions - no manual publishing.
When making changes to any package:
pnpm changeset # Create changeset fileThis will:
- Ask which packages changed
- Ask for version bump type (major/minor/patch)
- Ask for changelog description
Then commit the .changeset/*.md file with the code changes.
After feature PRs with changesets are merged to main:
🤖 CI automatically creates "Version Packages" PR containing:
- Updated version numbers in all package.json files
- Updated CHANGELOG.md files
- Synced jsr.json versions (via
update-jsr-json-version.sh)
Note
All pgflow packages use "fixed" versioning - they share the same version number.
When the Version Packages PR is merged:
🚀 CI runs the release workflow (.github/workflows/release.yml):
# 1. Build all packages
pnpm nx run-many -t build
# 2. Publish to npm (all packages except edge-worker)
pnpm publish --recursive --filter=!./pkgs/edge-worker
# 3. Publish edge-worker to JSR
cd ./pkgs/edge-worker && jsr publish --allow-slow-types
# 4. Create and push git tags
pnpm changeset tag && git push --follow-tags📦 Why npm first, then JSR?
edge-worker imports npm packages via npm:@pgflow/core@0.5.0. If JSR published first, it would reference non-existent npm versions.
⚙️ Fixed Versioning Setup
.changeset/config.json:
{
"fixed": [["@pgflow/*", "pgflow"]]
}All pgflow packages share the same version and release together.
🔄 Version Syncing (npm → JSR)
update-jsr-json-version.sh automatically:
- Copies version from package.json → jsr.json
- Updates import versions:
"@pgflow/core": "npm:@pgflow/core@0.5.0"
This keeps JSR packages in sync with npm versions.
| Type | Version Example | When to Use | See |
|---|---|---|---|
| Regular | 0.5.0 |
Stable releases | This doc |
| Snapshot | 0.0.0-fix-auth-... |
PR testing | SNAPSHOT_RELEASES.md |
Important
Release workflow needs these GitHub secrets:
NPM_TOKEN- npm publishingGITHUB_TOKEN- PR creation (auto-provided)- OIDC permissions - JSR publishing
📝 Adding a Feature
# 1. Make changes
# 2. Create changeset
pnpm changeset
# 3. Commit & push
# 4. Merge PR
# 5. Wait for Version PR → merge it🐛 Fixing a Bug
# 1. Fix bug
# 2. Create changeset (usually patch)
pnpm changeset
# 3. Commit & push
# 4. Merge PR
# 5. Wait for Version PR → merge it🧪 Testing Before Release
Use snapshot releases - see SNAPSHOT_RELEASES.md
🛑 "No changesets found"
Run pnpm changeset before pushing. CI requires changesets for package changes.
🛑 Version mismatch npm/JSR
- Check
update-jsr-json-version.shran in Version PR - package.json and jsr.json versions must match
🛑 JSR publish fails
- Already uses
--allow-slow-types - Check JSR dashboard for specific errors
- Ensure OIDC permissions are configured