|
| 1 | +--- |
| 2 | +name: update-packages |
| 3 | +description: > |
| 4 | + Update all npm packages to their latest versions using the update-packages |
| 5 | + script. Use this when asked to update, upgrade, or consolidate dependencies, |
| 6 | + or to close dependabot PRs. |
| 7 | +--- |
| 8 | + |
| 9 | +## Update Packages Workflow |
| 10 | + |
| 11 | +Follow these steps in order. |
| 12 | + |
| 13 | +### 1. Create a GitHub issue (as `chrisjwalk`) |
| 14 | + |
| 15 | +```bash |
| 16 | +gh issue create --title "chore: update all packages to latest" --body "..." |
| 17 | +``` |
| 18 | + |
| 19 | +Note the issue number (e.g. #42). |
| 20 | + |
| 21 | +### 2. Create a branch off main |
| 22 | + |
| 23 | +```bash |
| 24 | +git checkout main && git pull |
| 25 | +git checkout -b feat/consolidate-deps-<issue-number> |
| 26 | +``` |
| 27 | + |
| 28 | +### 3. Run the update-packages script |
| 29 | + |
| 30 | +Always omit `typescript` — upgrading TypeScript is a breaking change that |
| 31 | +requires a dedicated branch and tsconfig work (see issue #101 for context). |
| 32 | + |
| 33 | +```bash |
| 34 | +npx ts-node ./tools/update-packages/src/main.ts --omit typescript --interactive false |
| 35 | +``` |
| 36 | + |
| 37 | +The script will: |
| 38 | + |
| 39 | +- Detect all outdated packages via `pnpm outdated` |
| 40 | +- Run `nx migrate <pkg>@latest` for each one |
| 41 | +- Merge any generated migrations into `migrations.json` |
| 42 | +- Print next steps (install + run migrations if needed) |
| 43 | + |
| 44 | +### 4. Install updated packages |
| 45 | + |
| 46 | +```bash |
| 47 | +pnpm install --no-frozen-lockfile |
| 48 | +``` |
| 49 | + |
| 50 | +If the install fails, check for postinstall build errors (e.g. tsconfig |
| 51 | +issues in `tools/builders/dotnet-builder`). |
| 52 | + |
| 53 | +### 5. Run migrations (only if migrations.json was updated) |
| 54 | + |
| 55 | +```bash |
| 56 | +npx nx migrate --run-migrations |
| 57 | +``` |
| 58 | + |
| 59 | +### 6. Run all tests |
| 60 | + |
| 61 | +```bash |
| 62 | +nx reset |
| 63 | +nx run-many -t build,test |
| 64 | +``` |
| 65 | + |
| 66 | +All 9 projects must pass before committing. |
| 67 | + |
| 68 | +### 7. Commit |
| 69 | + |
| 70 | +```bash |
| 71 | +git add -A |
| 72 | +git commit -m "chore: update all packages to latest (closes #<issue-number>) |
| 73 | +
|
| 74 | +Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>" |
| 75 | +``` |
| 76 | + |
| 77 | +### 8. Push and open PR as `chrisjwalk-bot`, then switch back |
| 78 | + |
| 79 | +```bash |
| 80 | +gh auth switch --user chrisjwalk-bot |
| 81 | +git push origin feat/consolidate-deps-<issue-number> |
| 82 | +gh pr create --title "chore: update all packages to latest" --body "Closes #<issue-number> ..." |
| 83 | +gh auth switch --user chrisjwalk |
| 84 | +``` |
| 85 | + |
| 86 | +### 9. Close stale dependabot PRs |
| 87 | + |
| 88 | +Close any open dependabot PRs that are now covered by this update: |
| 89 | + |
| 90 | +```bash |
| 91 | +gh pr list --author "app/dependabot" --json number,title |
| 92 | +gh pr close <number> --comment "Covered by consolidated update PR" --delete-branch |
| 93 | +``` |
| 94 | + |
| 95 | +Leave open any dependabot PRs for packages that were intentionally omitted |
| 96 | +(e.g. TypeScript major version bumps). |
| 97 | + |
| 98 | +## Notes |
| 99 | + |
| 100 | +- `typescript` is always omitted — track TS upgrades separately in issue #101 |
| 101 | +- If a package is a transitive dep not shown by `pnpm outdated`, use |
| 102 | + `pnpm.overrides` in `package.json` to force the version |
| 103 | +- After merging, watch for new dependabot PRs — dependabot may recreate stale |
| 104 | + ones; close them if the package was already updated |
0 commit comments