This directory contains automation scripts for releasing new versions of vintasend-ts and its implementation packages.
Creates a new implementation package from vintasend-implementation-template.
What it does:
- Copies the template to a new directory under
src/implementations - Updates the new package
nameinpackage.json - Keeps only selected components (backend, attachment-manager, adapter, template-renderer, logger)
- Deletes unused component source and test files
- Rewrites
src/index.tsexports to match selected components - Replaces
README.mdwith a concise package-specific version
Usage:
npm run implementation:generate -- --dir=vintasend-aws-ses --package=@acme/vintasend-aws-ses --components=backend,adapter,template-rendererOptional flags:
--forceto overwrite an existing target directory--helpto show all options
Interactive mode:
- If
--dir,--package, or--componentsare not passed, the script prompts for missing values. - If the target directory already exists and
--forceis not passed, it prompts for overwrite confirmation.
Main orchestration script that handles the entire release process.
- version-finder.js: Finds the highest version among implementation packages
- version-bumper.js: Handles version bumping logic
- package-updater.js: Updates package.json files
- publisher.js: Handles npm publishing and testing
- git-handler.js: Manages git operations (staging, committing)
npm run releaseThis will:
- Check git status (must be clean)
- Find the highest version among implementations
- Prompt for version bump type (patch or minor)
- Prompt for commit messages (separate for main and implementations)
- Show summary and ask for confirmation
- Update and publish main package (opens browser for 2FA)
- Wait for 2FA authorization (valid for 5 minutes)
- Update and publish all implementation packages
- Commit changes (implementations first, then main package)
npm run release:dry-runShows exactly what would happen without making any actual changes. Great for testing the process.
# Patch release (e.g., 0.4.14 → 0.4.15)
npm run release:patch
# Minor release (e.g., 0.4.14 → 0.5.0)
npm run release:minorThe script follows this sequence:
- Git Status Check: Ensures working directory is clean
- Version Detection: Finds highest version among implementations
- Version Calculation: Bumps version based on user selection
- User Confirmation: Shows summary and asks for confirmation
- Main Package:
- Updates version in package.json
- Runs tests
- Builds package
- Publishes to npm (opens browser for 2FA)
- Waits for user to confirm authorization
- Implementation Packages:
- Updates vintasend dependency version
- Updates package version to match main package
- Build & Publish Implementations:
- Tests each package
- Builds each package
- Publishes to npm (within 5-minute 2FA window)
- Git Commits:
- First: Commits all implementation package.json changes (custom message)
- Second: Commits main package.json changes (custom message)
- ✅ Dry run mode: Test without making changes
- ✅ Git status check: Prevents releases with uncommitted changes
- ✅ 2FA support: Pauses for browser authorization, then uses 5-minute window
- ✅ Separate commit messages: Different messages for main and implementations
- ✅ User confirmation: Shows summary before proceeding
- ✅ Test before publish: Runs tests for each package
- ✅ Error handling: Catches and reports errors
- ✅ Colored output: Clear visual feedback
After the automation completes:
- Update CHANGELOG.md (manual step)
- Review commits: Check the two commits created
- Push to remote:
git push
Commit or stash your changes before running the release script.
The script will skip publishing packages that fail tests. Fix the tests and run the release again.
- Check you're logged in to npm:
npm whoami - Check you have publish rights to the packages
- Verify the version doesn't already exist on npm
If the script fails mid-publish:
- Main package might be published but not implementations (or vice versa)
- Check npm to see which packages were published
- You may need to manually publish remaining packages
- The git commits are only made after all publishing succeeds
$ npm run release:patch
========================================
VintaSend Release Automation
========================================
[1] Checking git status...
✓ Working directory is clean
[2] Finding highest implementation version...
ℹ Highest version: 0.4.14 (vintasend-medplum)
[3] Determining version bump type...
ℹ New version will be: 0.4.15 (patch bump)
[4] Getting commit message...
Commit message (press Enter for "Bump versions"):
ℹ Commit message: "Bump versions"
==================================================
RELEASE SUMMARY
==================================================
New version: 0.4.15
Bump type: patch
Commit message: "Bump versions"
==================================================
Proceed with release? (yes/no): yes
[6] Updating main package version...
✓ Updated vintasend package.json to 0.4.15
...- The script excludes
vintasend-implementation-templatefrom releases - All implementations will be bumped to match the main package version
- Both
dependenciesandpeerDependenciesare updated for vintasend - Each implementation is published independently