This monorepo uses Changesets for version management and release automation.
The release workflow runs automatically when:
- Changes are pushed to the
mainbranch - The changes affect packages, changesets, or configuration files
- There are pending changesets to release
Process:
- Developers create changesets during development
- PR merges to main trigger the release workflow
- Changesets creates a "Version Packages" PR
- Merging the version PR publishes packages to npm and GitHub Packages
Use the manual release workflow when you need to:
- Force a release without changesets
- Release specific packages
- Create prerelease versions
Trigger via GitHub Actions:
- Go to Actions → Manual Release
- Click "Run workflow"
- Select release type and packages
All PRs run:
- Linting and formatting checks
- Unit, integration, and e2e tests
- Build verification
- Changeset requirement check (skipped for chore/docs/ci/build PRs)
# Create a changeset
bun changeset
# Follow the prompts to:
# 1. Select packages to release
# 2. Choose version bump type (patch/minor/major)
# 3. Write a summary of changes- patch: Bug fixes and minor updates (0.0.x)
- minor: New features, backward compatible (0.x.0)
- major: Breaking changes (x.0.0)
# Bug fix in ecfr-sdk
bun changeset
# Select: @us-legal-tools/ecfr-sdk
# Type: patch
# Summary: Fix API endpoint URL generation
# New feature across multiple packages
bun changeset
# Select: @us-legal-tools/ecfr-sdk, @us-legal-tools/federal-register-sdk
# Type: minor
# Summary: Add pagination support to search endpoints
# Breaking change
bun changeset
# Select: @us-legal-tools/govinfo-sdk
# Type: major
# Summary: Refactor client API to use async/await pattern# Create feature branch
git checkout -b feature/add-new-endpoint
# Make changes
# ... edit files ...
# Create changeset
bun changeset
# Commit everything
git add .
git commit -m "feat: add new endpoint with changeset"
# Push and create PR
git push origin feature/add-new-endpointWhen changesets accumulate on main, the workflow creates a "Version Packages" PR that:
- Updates package versions
- Updates changelogs
- Updates dependencies
Review the PR to ensure:
- Version bumps are correct
- Changelog entries are clear
- No unexpected changes
Merging the "Version Packages" PR:
- Publishes packages to npm
- Creates git tags
- Publishes to GitHub Packages
- Creates GitHub releases
For testing releases:
# Create prerelease changeset
bun changeset pre enter beta
# Make changes and create changesets as normal
bun changeset
# Version as prerelease
bun changeset version
# When ready to exit prerelease
bun changeset pre exitCheck:
- Are there pending changesets? Run
bun changeset status - Did the push affect watched paths?
- Check workflow logs for errors
Common issues:
- NPM auth: Verify NPM_TOKEN secret
- Build errors: Check package builds locally
- Test failures: Run tests locally
If versions get out of sync:
# Reset versions to match npm
bun changeset version --snapshot-prerelease-template=""
# Or manually fix in package.json files{
"$schema": "https://changesets.com/config.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch"
}- Automatic: Push to main with changes in packages/
- Manual: Workflow dispatch with options
- PR Checks: All pull requests
Packages are published in dependency order:
- Packages with no dependencies
- Packages that depend on (1)
- And so on...
This ensures dependent packages always have their dependencies available.
- npm: https://www.npmjs.com/~beshkenadze
- GitHub Packages: https://github.com/beshkenadze/us-legal-tools/packages
- GitHub Releases: https://github.com/beshkenadze/us-legal-tools/releases
# Revert the merge commit
git revert -m 1 <merge-commit-sha>
# Create changeset for the fix
bun changeset
# Push to trigger new release
git push origin main# Within 72 hours
npm unpublish @us-legal-tools/package-name@version
# After 72 hours - deprecate instead
npm deprecate @us-legal-tools/package-name@version "Critical bug, use version x.x.x"