|
| 1 | +--- |
| 2 | +name: bump-conventions |
| 3 | +description: Bump the @sentry/conventions dependency to a new version across every package in the monorepo. Use when upgrading, bumping, or aligning @sentry/conventions, or when a new @sentry/conventions release needs to be pulled into all workspaces. |
| 4 | +argument-hint: "[version] # e.g. 0.16.0; defaults to latest on npm" |
| 5 | +--- |
| 6 | + |
| 7 | +# Bump `@sentry/conventions` |
| 8 | + |
| 9 | +Bump `@sentry/conventions` across every `package.json` at once, keeping the two pin styles consistent, then refresh `yarn.lock`. |
| 10 | + |
| 11 | +## 1. Determine the target version |
| 12 | + |
| 13 | +If the user gave a version, use it. Otherwise: |
| 14 | + |
| 15 | +```bash |
| 16 | +npm view @sentry/conventions version |
| 17 | +``` |
| 18 | + |
| 19 | +Find the current version to replace: |
| 20 | + |
| 21 | +```bash |
| 22 | +grep -rhoE '"@sentry/conventions": "[^"]+"' --include=package.json --exclude-dir=node_modules packages dev-packages | sort -u |
| 23 | +``` |
| 24 | + |
| 25 | +You should see exactly two entries for the current version: |
| 26 | + |
| 27 | +- `"@sentry/conventions": "^0.15.1"`, caret range in `packages/*` `dependencies` |
| 28 | +- `"@sentry/conventions": "0.15.1"`, exact pin in `dev-packages/*` `devDependencies` |
| 29 | + |
| 30 | +**Preserve each style.** Runtime packages keep the caret; dev-package test suites keep the exact pin. If you see more than two distinct entries, list them and confirm with the user before proceeding. |
| 31 | + |
| 32 | +## 2. Update every `package.json` |
| 33 | + |
| 34 | +Replace both forms in one pass. With `OLD` and `NEW` set to the bare versions (e.g. `0.15.1` and `0.16.0`): |
| 35 | + |
| 36 | +```bash |
| 37 | +grep -rl '"@sentry/conventions"' --include=package.json --exclude-dir=node_modules packages dev-packages \ |
| 38 | + | xargs sed -i '' \ |
| 39 | + -e "s/\"@sentry\/conventions\": \"\^${OLD}\"/\"@sentry\/conventions\": \"^${NEW}\"/" \ |
| 40 | + -e "s/\"@sentry\/conventions\": \"${OLD}\"/\"@sentry\/conventions\": \"${NEW}\"/" |
| 41 | +``` |
| 42 | + |
| 43 | +> `--exclude-dir=node_modules` is required: without it the recursive grep walks installed dependencies and `sed` would rewrite `package.json` files inside `node_modules`. |
| 44 | +> `sed -i ''` is the BSD/macOS form. On Linux use `sed -i` (no `''`). |
| 45 | +
|
| 46 | +Verify every reference is now `NEW`, still split across the two styles: |
| 47 | + |
| 48 | +```bash |
| 49 | +grep -rhoE '"@sentry/conventions": "[^"]+"' --include=package.json --exclude-dir=node_modules packages dev-packages | sort | uniq -c |
| 50 | +``` |
| 51 | + |
| 52 | +## 3. Refresh the lockfile and build |
| 53 | + |
| 54 | +```bash |
| 55 | +yarn install |
| 56 | +yarn dedupe-deps:fix |
| 57 | +yarn build:dev |
| 58 | +``` |
| 59 | + |
| 60 | +`yarn install` collapses the combined `yarn.lock` entry (`"@sentry/conventions@<OLD>", "@sentry/conventions@^<OLD>":`) onto the new version. Confirm no stale `<OLD>` resolution remains: |
| 61 | + |
| 62 | +```bash |
| 63 | +grep -n '@sentry/conventions@' yarn.lock |
| 64 | +``` |
| 65 | + |
| 66 | +## 4. Check for breaking API changes |
| 67 | + |
| 68 | +A `conventions` bump can rename or remove exported attribute constants. If `yarn build:dev` fails, inspect the type errors and update usages in `src/` **and** `test/`. Heaviest consumers: `packages/core`, `packages/opentelemetry`, `packages/aws-serverless`. |
| 69 | + |
| 70 | +Use LSP `findReferences` on the changed export to catch every call site. Do not paper over a rename with a cast. |
| 71 | + |
| 72 | +## 5. Final verification |
| 73 | + |
| 74 | +```bash |
| 75 | +yarn circularDepCheck |
| 76 | +yarn fix |
| 77 | +yarn test |
| 78 | +``` |
| 79 | + |
| 80 | +## Commit |
| 81 | + |
| 82 | +Use the `feat(deps):` prefix the repo uses for dependency bumps: |
| 83 | + |
| 84 | +``` |
| 85 | +feat(deps): Bump `@sentry/conventions` to <NEW> |
| 86 | +``` |
| 87 | + |
| 88 | +Follow the repo's commit and PR conventions (target `develop`, draft PR, `## What` / `## Why`). Do **not** create the commit yourself unless the user invokes `/commit-push-pr`. |
0 commit comments