foundations/net/common/scripts/README.md
A shell script to automatically bump the version of Node.js packages that have changed since a specified git revision in a Rush.js monorepo, and update their dependencies accordingly.
./common/scripts/bump-changes-from-tag.sh <git-revision> [major|minor|patch]
# Patch bump (default) for packages changed in the last 5 commits
./common/scripts/bump-changes-from-tag.sh HEAD~5
# Minor bump for packages changed since a specific tag
./common/scripts/bump-changes-from-tag.sh v0.7.0 minor
# Major bump for packages changed since a specific commit
./common/scripts/bump-changes-from-tag.sh abc1234 major
# Patch bump (explicit)
./common/scripts/bump-changes-from-tag.sh HEAD~3 patch
| Type | Example | Description |
|---|---|---|
patch | 1.2.3 → 1.2.4 | Bug fixes, small changes (default) |
minor | 1.2.3 → 1.3.0 | New features, backward compatible |
major | 1.2.3 → 2.0.0 | Breaking changes |
git diff --name-only to find files changed since the specified revisionrush.json to get all packages and their folders[INFO] Repository root: /path/to/repo
[INFO] Checking changes since: HEAD~3
[INFO] Bump type: minor
[INFO] Getting changed files since HEAD~3...
[INFO] Changed files:
packages/core/src/index.ts
packages/client/src/client.ts
[SUCCESS] Package @company/core changed: 0.7.0 -> 0.8.0 (minor)
[SUCCESS] Package @company/client changed: 0.7.0 -> 0.8.0 (minor)
[INFO] Found 2 package(s) to update
[INFO] Updating package versions...
[SUCCESS] Updated @company/core to version 0.8.0
[SUCCESS] Updated @company/client to version 0.8.0
[INFO] Updating dependencies across all packages...
[SUCCESS] Version bump complete!
[INFO] Summary of changes:
✓ @company/core -> 0.8.0 (will be published)
✓ @company/client -> 0.8.0 (will be published)
[INFO] Next steps:
1. Review the changes: git diff
2. Run tests: rush test
3. Build all packages: rush build
4. Commit changes: git add . && git commit -m 'Bump versions'
5. For publishable packages, run: rush publish
1.2.31.2.3-alpha.11.2.3 → 1.2.4 (increments patch)1.2.3 → 1.3.0 (increments minor, resets patch)1.2.3 → 2.0.0 (increments major, resets minor and patch)The script updates package references in:
dependenciesdevDependenciespeerDependenciesBoth regular dependencies (^1.0.0) and workspace dependencies (workspace:^1.0.0) are supported.