Skip to content

Commit 7b7c90f

Browse files
authored
fix(upgrade): Update README.md (#7413)
1 parent 1b37f2a commit 7b7c90f

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

.changeset/metal-badgers-refuse.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/upgrade': patch
3+
---
4+
5+
Update README.md

packages/upgrade/README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,55 @@
2727

2828
## Getting Started
2929

30-
A tool that helps with upgrading major versions of Clerk's SDKs.
30+
A CLI that detects your installed Clerk SDK, upgrades packages to the next major release, runs codemods, and scans your codebase for breaking changes.
3131

3232
### Prerequisites
3333

34-
- Node.js `>=18.17.0` or later
34+
- Node.js `>=20.9.0`
35+
- pnpm, npm, or yarn installed in the target project
3536

3637
## Usage
3738

38-
Navigate to the application you want to upgrade and run the following in your terminal:
39+
Run the CLI from the root of the project you want to upgrade:
3940

4041
```sh
42+
# with pnpm
43+
pnpm dlx @clerk/upgrade
44+
45+
# with npm
4146
npx @clerk/upgrade
47+
48+
# if installed locally
49+
pnpm clerk-upgrade
4250
```
4351

44-
Fill out the questionnaire and the CLI will show you the required changes.
52+
Fill out the prompts and the CLI will:
53+
54+
- Detect your Clerk SDK and version (or prompt for `--sdk`)
55+
- Upgrade packages (including renames such as `@clerk/clerk-react``@clerk/react`)
56+
- Run codemods for the selected release
57+
- Scan your files for breaking changes and print a report
58+
59+
### CLI options
60+
61+
- `--sdk` — SDK to upgrade (e.g., `nextjs`, `react`, `expo`); required in non-interactive runs if detection fails
62+
- `--dir` — directory to scan (default: current working directory)
63+
- `--glob` — glob of files for codemods (default: `**/*.(js|jsx|ts|tsx|mjs|cjs)`)
64+
- `--ignore` — extra globs to ignore during scans (repeatable)
65+
- `--release` — target release (e.g., `core-3`); otherwise auto-selected from installed versions
66+
- `--skip-upgrade` — skip installing/updating packages
67+
- `--skip-codemods` — skip codemod execution
68+
- `--dry-run` — show what would change without writing or installing
69+
70+
### Releases
71+
72+
- `core-3`: upgrades Next.js 6 → 7, React 5 → 7, Expo 2 → 3, React Router 2 → 3, TanStack React Start 0 → 1, Astro 2 → 3, Nuxt 2 → 3, Vue 2 → 3; includes package renames for React/Expo
73+
74+
The CLI selects the appropriate release automatically based on the installed major version, or you can pin a release with `--release` (currently `core-3`).
4575

4676
### Caveats
4777

48-
This tool uses regular expressions to scan for patterns that match breaking changes. This makes it run substantially faster and makes it more accessible for us at Clerk to author matchers for each breaking change, however it means that _we cannot gurarantee 100% accuracy of the results_. As such, it's important to treat this as a tool that can help you to complete your major version upgrades, rather than an automatic fix to all issues.
78+
Scans rely on regular expressions, so some patterns (unusual imports, bound methods, indirect calls) can be missed. Codemods cover common upgrades, but you should still review the report, run your test suite, and verify the app before deploying.
4979

5080
The main thing that this tool will miss is cases where _unusual import patterns_ are used in your codebase. As an example, if Clerk made a breaking change to the `getAuth` function exported from `@clerk/nextjs`, `@clerk/upgrade` would likely look for something like `import { getAuth } from "@clerk/nextjs"` in order to detect whether you need to make some changes. If you were using your imports like `import * as ClerkNext from "@clerk/nextjs"`, you could use `getAuth` without it detecting it with its matcher.
5181

0 commit comments

Comments
 (0)