Repository Update System
Automated system for updating multiple repositories with Nx migrations.
Usage
Update Individual Repository (setup handled automatically):
nx run update-repos:update-nx-repo
nx run update-repos:update-ocean-repo
nx run update-repos:update-nx-examples-repo
nx run update-repos:update-nx-console-repo
Update All Repositories:
nx run update-repos:update-all-repos
Or using the convenient npm script:
pnpm update-all-repos
Note
: No separate setup step is required. Each update task automatically handles repository setup if needed.
How It Works
Automatic Setup (if repository doesn't exist):
- Uses GitHub CLI to clone repositories to OS temp directory
- Configures repositories from
config/repos.json - Skips setup if repository already exists (noop)
Update Process:
- Create update branch (
upnx) from remote main branch - Detect package manager (pnpm/yarn/bun/npm) from lockfiles
- Run
nx migrate nextto update to latest Nx version - Install updated dependencies
- Run
nx migrate --run-migrations --create-commits(auto-generates commits) - Clean up
migrations.jsonfile after successful migration - Run
post-nx-updatescript if it exists in package.json (optional) - Commit any changes from post-nx-update script separately
- Run
nx resetto clear cache (prevents prepush hook issues) - Push branch to remote (with
--no-verifyto skip git hooks) - Create new PR or update existing PR with current version info
- Open PR in browser
Post-Update Hook:
- Repositories can define a
post-nx-updatescript in their root package.json - This script runs after Nx migrations complete but before pushing changes
- Any changes made by the script are committed separately
- If the script doesn't exist, the process continues normally (no failure)
PR Management:
- Creates new PRs when none exist for the update branch
- Updates existing PRs with latest version information
- Always opens PRs in browser regardless of create vs update