-
Notifications
You must be signed in to change notification settings - Fork 412
feat(upgrade): Update upgrade CLI structure to support multiple releases #7385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 3c2e9bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughReplace the Ink/React interactive upgrade UI with an imperative CLI flow; add SDK detection, package-manager utilities, codemod runner and scan tooling; add Core 3 upgrade metadata, codemods, fixtures, helpers, and integration tests; remove prior UI components and legacy utilities. Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as CLI Main
participant Detect as SDK Detector
participant Config as Config Loader
participant Codemods as Codemod Runner
participant Scanner as Scan Runner
participant PkgMgr as Package Manager
User->>CLI: run upgrade command
CLI->>Detect: detectSdk(dir)
Detect-->>CLI: sdk type & version
CLI->>Config: loadConfig(sdk, version | release)
Config-->>CLI: config (codemods, changes, versions)
CLI->>CLI: promptConfirm(...)
alt user confirms
CLI->>Codemods: runCodemods(config, sdk, options)
Codemods-->>CLI: codemod results
CLI->>Scanner: runScans(config, sdk, options)
Scanner-->>CLI: scan results
CLI->>PkgMgr: detectPackageManager(dir)
PkgMgr-->>CLI: manager
CLI->>PkgMgr: perform upgrade (remove/upgrade packages)
PkgMgr-->>CLI: success/error
end
CLI-->>User: renderComplete / summary
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
!allow-major |
| export default { | ||
| id: 'core-3', | ||
| name: 'Core 3', | ||
| docsUrl: 'https://clerk.com/docs/upgrade-guides/core-3', | ||
| sdkVersions: { | ||
| nextjs: { from: 6, to: 7 }, | ||
| react: { from: 5, to: 7 }, | ||
| expo: { from: 2, to: 3 }, | ||
| 'react-router': { from: 2, to: 3 }, | ||
| 'tanstack-react-start': { from: 0, to: 1 }, | ||
| astro: { from: 2, to: 3 }, | ||
| nuxt: { from: 2, to: 3 }, | ||
| vue: { from: 2, to: 3 }, | ||
| }, | ||
| codemods: [ | ||
| 'transform-clerk-react-v6', | ||
| 'transform-remove-deprecated-props', | ||
| 'transform-remove-deprecated-appearance-props', | ||
| 'transform-appearance-layout-to-options', | ||
| 'transform-themes-to-ui-themes', | ||
| 'transform-align-experimental-unstable-prefixes', | ||
| ], | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New version/release manifest that outlines a version's impacted SDKs and changes. We can use this for only specific SDKs if necessary as well.
|
!snapshot |
|
Hey @jacekradko - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/agent-toolkit@0.2.7-snapshot.v20251208202852 --save-exact
npm i @clerk/astro@3.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/backend@3.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/chrome-extension@3.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/clerk-js@6.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/dev-cli@1.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/expo@3.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/expo-passkeys@1.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/express@2.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/fastify@2.6.7-snapshot.v20251208202852 --save-exact
npm i @clerk/localizations@4.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/nextjs@7.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/nuxt@2.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/react@6.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/react-router@3.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/shared@4.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/testing@2.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/ui@1.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/upgrade@2.0.0-snapshot.v20251208202852 --save-exact
npm i @clerk/vue@2.0.0-snapshot.v20251208202852 --save-exact |
|
Does this support upgrading to canary or snapshot versions? |
|
@jacekradko not currently, open to suggestions on how to accomplish that! Maybe a |
|
@brkalow |
|
Another DX improvement, when we fail to upgrade for whatever reason, we should not just bail out like this, but allow the user to continue to codemods |
jacekradko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be good for us to merge this and then iterate. I have some outstanding codemod/upgrade work that is kind of blocked by this refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
🧹 Nitpick comments (22)
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsx (1)
1-19: Fixture implementation looks correct and aligned with other examplesThe ClerkProvider +
useUserusage and conditional rendering are straightforward and appropriate for a fixture. No functional issues spotted. If these fixtures are type-checked with the same strict rules as source, you could optionally add explicit return types toAppandUserInfo, but that’s not critical here.packages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.js (1)
7-13: Consider adding explicit test cases for no-change scenarios.The test suite currently covers positive transformations well, but would benefit from explicit negative test cases to ensure the codemod doesn't incorrectly transform unrelated code. For example:
- Imports from other packages (e.g.,
import x from '@other/themes')- String literals that contain the package name but aren't imports
- Comments or documentation mentioning the old package name
This would improve test coverage and catch false-positive transformations.
You can add these cases to the fixtures array:
{ name: 'Does not transform unrelated imports', source: `import theme from '@other/themes';`, output: undefined, // or the same as source to indicate no change }, { name: 'Does not transform string literals', source: `const pkg = '@clerk/themes';`, output: undefined, }packages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.js (2)
1-47: Consider normalizing whitespace in fixtures for consistency.The
sourcefields have inconsistent leading/trailing whitespace across fixtures, while the test relies onoutput.trim()to match. This works but could be clearer if both source and output followed consistent whitespace patterns.For maintainability, consider either:
- Trimming both source and output in the fixtures themselves
- Removing the
.trim()call in the test and ensuring exact whitespace matchesExample normalized fixture:
{ name: 'Renames root import', source: `import { dark, light } from '@clerk/themes';`, output: `import { dark, light } from "@clerk/ui/themes";`, },
1-47: Add test case for named export with source.The codemod implementation handles
ExportNamedDeclarationwith a source (lines 33-37 in transform-themes-to-ui-themes.cjs), but there's no corresponding test fixture for this case.Add a fixture for named exports:
{ name: 'Renames named export source', source: `export { dark, light } from '@clerk/themes';`, output: `export { dark, light } from "@clerk/ui/themes";`, },packages/upgrade/src/codemods/transform-themes-to-ui-themes.cjs (1)
14-14: Consider adding JSDoc documentation.Per coding guidelines, public APIs should have JSDoc comments. Adding documentation would help other developers understand the codemod's purpose and usage.
Example JSDoc:
/** * Transforms imports from the legacy @clerk/themes package to @clerk/ui/themes. * Handles various import forms including ES modules, CommonJS, and dynamic imports. * * @param {Object} file - The file object containing source code * @param {string} file.source - The source code to transform * @param {Object} api - The jscodeshift API object * @param {Function} api.jscodeshift - The jscodeshift function (j) * @returns {string|undefined} The transformed source code, or undefined if no changes */ module.exports = function transformThemesToUiThemes({ source }, { jscodeshift: j }) {packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs (1)
105-120: Consider simplifying the key generation logic.The key generation on line 108 handles multiple cases but is complex. For
ImportSpecifiernodes,spec.importedshould always exist and be anIdentifier, so the additional checks for?.valueand the empty string fallback add complexity without clear benefit.Consider this simpler approach:
const mergeImportSpecifiers = (targetImport, specifiers) => { const existingKeys = new Set( (targetImport.node.specifiers || []).map( - spec => `${spec.local ? spec.local.name : (spec.imported?.name ?? spec.imported?.value ?? '')}`, + spec => spec.local?.name ?? spec.imported?.name ?? '', ), ); specifiers.forEach(spec => { - const key = spec.local ? spec.local.name : spec.imported?.name; + const key = spec.local?.name ?? spec.imported?.name; if (!existingKeys.has(key)) {packages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.js (1)
1-74: Consider adding test cases for additional edge cases.The current fixtures provide good coverage of the main scenarios, but consider adding test cases for:
- Removed props in object destructuring patterns (relates to the ObjectPattern handling issue):
const { __unstable_manageBillingUrl, validProp } = props;
- Aliased imports that need to be moved:
import { __experimental_createTheme as myTheme } from '@clerk/ui';
- Object expressions with removed props (non-JSX):
const config = { __unstable_manageBillingUrl: 'url', other: true };
- Merging imports when target already exists:
import { Button } from '@clerk/ui/themes/experimental'; import { __experimental_createTheme } from '@clerk/ui';These would help catch edge cases and ensure consistent behavior across all AST node types.
packages/upgrade/src/codemods/transform-remove-deprecated-appearance-props.cjs (1)
1-116: Codemod logic is solid; identifier resolution limitations are acceptable but worth notingThe transform correctly:
- Targets only
appearanceJSX attributes.- Handles both inline object literals and identifiers bound to object literals.
- Safely renames
baseTheme→themeand the listedvariableskeys, including string-literal keys and non-computed props.- Avoids touching spread elements and non-object
appearancevalues.Two minor, behavior-defining limitations to be aware of:
findObjectForIdentifieronly follows identifiers that are directly initialized with an object literal in aVariableDeclarator, so imported configs or indirection likeconst a = appearance; <X appearance={a} />won’t be transformed.- If the same identifier name is declared multiple times in the file, the first object-literal declarator wins, which could be surprising in unusual code.
If that scope is intentional for core‑3 migrations, this is good to ship as-is; otherwise, a follow‑up could tighten identifier resolution (e.g., by preferring nearest scope/const declarations around the JSX site).
packages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.js (1)
7-12: Make tests resilient to no-op transforms and formatting differencesSince the transformer returns
undefinedwhen it makes no changes, this test will fail if you add a fixture where no migration is expected. Also, strict equality againstoutput.trim()can be fragile if the printer adds a trailing newline or minor whitespace.You can harden the test like this:
- it.each(fixtures)('$name', ({ source, output }) => { - const result = applyTransform(transformer, {}, { source }); - - expect(result).toEqual(output.trim()); - }); + it.each(fixtures)('$name', ({ source, output }) => { + const result = applyTransform(transformer, {}, { source }) ?? source; + + expect(result.trim()).toEqual(output.trim()); + });packages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.js (1)
1-67: Good fixture coverage; consider adding a no-op caseFixtures nicely cover:
- Inline JSX
appearance={{ baseTheme: ... }}.- Referenced
appearanceobject with nestedvariables.- String-literal keys.
For extra confidence, you might add a fixture where
appearancecontains no deprecated keys, to lock in the codemod’s no-op behavior and formatting stability.packages/upgrade/src/codemods/transform-appearance-layout-to-options.cjs (1)
1-67: Codemod logic forappearance→optionslooks solid; literal-only scope is acceptableThe transform correctly and safely renames
layouttooptionsfor object-literalappearanceprops, handling identifiers, string literals, and computed string-literal keys while safely ignoring other property shapes. For now, restricting to inline object literals (and not chasing variables or nested structures) is a reasonable trade-off between safety and coverage.If you later want broader coverage, you could extend this to handle identifiers pointing at object literals or nested
layoutkeys, but that’d be an incremental enhancement, not a blocker.packages/upgrade/src/util/detect-sdk.js (1)
9-124: SDK detection and version helpers are cohesive and resilientThe detection helpers handle both new and legacy package names, gracefully deal with missing or non‑semver versions, and centralize normalization (
normalizeSdkNameandgetOldPackageName) in a way that matches how the CLI uses them. Returningnull/{}on unreadable package.jsons is a sensible fallback for a CLI utility.If you ever need to support setups that only use
peerDependenciesoroptionalDependenciesfor Clerk SDKs, you could extenddetectSdk/getInstalledClerkPackagesto scan those sections as well.packages/upgrade/src/config.js (1)
10-93: Version selection and package name helpers are straightforward and match the new upgrade model
loadConfig’s search strategy (explicit release first, otherwise first matchingneeds-upgradethenalready-upgraded) is reasonable for the current single core-3 release and keeps the data-drivensdkVersionslogic central. ThegetTargetPackageName/getOldPackageNamehelpers align with the SDK normalization logic indetect-sdk.js, which should keep package resolution and docs change entries in sync.If you later add multiple releases, you may want to sort
versionDirs(e.g. semver-aware) to make the upgrade path deterministic across filesystems.Also applies to: 121-139
packages/upgrade/src/render.js (1)
11-99: Rendering and prompt utilities are solid; a couple of small UX nitsThe rendering layer looks cohesive and appropriate for the new imperative CLI—headers, config summary, prompts, spinner, codemod/scan results, and completion messaging all fit together well.
Two minor polish ideas:
- In
promptConfirm/promptSelect/promptText, consider trimming input (answer.trim().toLowerCase()) so trailing spaces don’t cause “no” onyand similar.- In
renderCodemodResults, rendering0 errorsin red is slightly misleading; you could color only whenresult.error > 0and leave the zero case uncolored or green.These are minor DX tweaks; the current implementation is otherwise good to ship.
Also applies to: 101-143, 145-182
packages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.js (1)
1-13: Codemod test wiring is correct and follows existing patternsThe test correctly wires
applyTransformto the CJS transformer, iterates over fixtures withit.each, and asserts the transformed source matches the expected output. This provides good coverage for the primary behavior of the codemod.You could add a no-op fixture (where
appearancelacks alayoutkey) to assert that unchanged inputs are passed through untouched, but that’s an optional extra guard.packages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.js (1)
1-11: Consider adding edge case fixtures for more robust codemod testing.The current fixture covers the basic JSX transformation. Consider adding additional test cases such as:
- Multiple components with
appearanceprops in the same file- Nested
layoutobjects with multiple properties- Components where
layoutshould not be renamed (non-Clerk components)- Mixed
layoutand otherappearancepropertiespackages/upgrade/src/__tests__/integration/detect-sdk.test.js (1)
45-48: Test name may be misleading - fixture name vs. actual version.The test name says "clerk-react fixture" but the fixture is named
react-v6while the expected version is 5. Consider clarifying whetherreact-v6refers to the target upgrade version or the fixture's current Clerk version.- it('returns major version 5 for clerk-react fixture', () => { + it('returns major version 5 for react-v6 fixture with @clerk/clerk-react ^5.0.0', () => { const version = getSdkVersion('clerk-react', getFixturePath('react-v6')); expect(version).toBe(5); });packages/upgrade/src/cli.js (2)
205-212: Consider allowing codemods to run even after upgrade failure.Per PR discussion, when the package upgrade fails (e.g., version not found), the CLI currently exits immediately. Users might still benefit from running codemods on their existing code. Consider prompting to continue with codemods despite the installation failure.
try { await upgradePackage(packageManager, targetPackage, targetVersion, options.dir); spinner.success(`Upgraded ${targetPackage} to version ${targetVersion}`); } catch (error) { spinner.error(`Failed to upgrade ${targetPackage}`); renderError(error.message); - process.exit(1); + if (isInteractive) { + const continueAnyway = await promptConfirm('Would you like to continue with codemods anyway?'); + if (!continueAnyway) { + process.exit(1); + } + } else { + process.exit(1); + } }
81-84: Minor: Extra leading space in warning message.if (options.dryRun) { - renderWarning(' Upgrade running in dry run mode - no changes will be made'); + renderWarning('Upgrade running in dry run mode - no changes will be made'); renderNewline(); }packages/upgrade/src/__tests__/integration/cli.test.js (2)
15-61: ImproverunCliportability and env flexibilityTwo small tweaks would make this helper more robust:
- Use
process.execPathinstead of hardcoded'node'so tests work in environments wherenodeisn’t on PATH or has a different binary name.- Merge an optional
options.envinto the child env (on top of the color flags) so tests can explicitly control things likeCI, feature flags, etc.For example:
- return new Promise((resolve, reject) => { - const child = spawn('node', [CLI_PATH, ...args], { - cwd: options.cwd || process.cwd(), - env: { ...process.env, FORCE_COLOR: '0', NO_COLOR: '1' }, + return new Promise((resolve, reject) => { + const child = spawn(process.execPath, [CLI_PATH, ...args], { + cwd: options.cwd || process.cwd(), + env: { + ...process.env, + FORCE_COLOR: '0', + NO_COLOR: '1', + ...(options.env || {}), + }, stdio: ['pipe', 'pipe', 'pipe'], });
223-239: Align codemods dry‑run test with its intentThis test is named/described as listing codemods that would run in dry‑run mode, but it also passes
--skip-codemods. That can be a bit confusing when reading the spec.Consider either:
- Dropping
--skip-codemodshere so the test truly reflects “dry‑run with codemods”, or- Updating the description to clarify that codemods are skipped but still listed.
Functionally it’s fine either way; this is mostly a readability/DX tweak for future maintainers.
packages/upgrade/src/util/package-manager.js (1)
52-81: Include the invoked command in error messages from package manager runs
runPackageManagerCommandalready aggregatesstdout/stderrand rejects on non‑zero exit, which is good. For debugging failed upgrades, it would help to surface the exact command that was run:- child.on('close', code => { - if (code === 0) { - resolve({ stdout, stderr }); - } else { - reject(new Error(`Command failed with code ${code}: ${stderr || stdout}`)); - } - }); + child.on('close', code => { + if (code === 0) { + resolve({ stdout, stderr }); + } else { + const cmdLine = [command, ...args].join(' '); + reject( + new Error( + `Command "${cmdLine}" failed with code ${code}: ${stderr || stdout}`, + ), + ); + } + });This makes it much easier to reproduce and diagnose issues when the underlying package manager rejects.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (5)
packages/upgrade/src/__tests__/fixtures/expo-old-package/package-lock.jsonis excluded by!**/package-lock.jsonpackages/upgrade/src/__tests__/fixtures/nextjs-v6/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlpackages/upgrade/src/__tests__/fixtures/nextjs-v7/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlpackages/upgrade/src/__tests__/fixtures/react-v6/yarn.lockis excluded by!**/yarn.lock,!**/*.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (49)
.changeset/busy-tires-admire.md(1 hunks)eslint.config.mjs(2 hunks)packages/upgrade/package.json(1 hunks)packages/upgrade/src/__tests__/fixtures/expo-old-package/package.json(1 hunks)packages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsx(1 hunks)packages/upgrade/src/__tests__/fixtures/nextjs-v6/package.json(1 hunks)packages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsx(1 hunks)packages/upgrade/src/__tests__/fixtures/nextjs-v7/package.json(1 hunks)packages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx(1 hunks)packages/upgrade/src/__tests__/fixtures/no-clerk/package.json(1 hunks)packages/upgrade/src/__tests__/fixtures/react-v6/package.json(1 hunks)packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsx(1 hunks)packages/upgrade/src/__tests__/helpers/create-fixture.js(1 hunks)packages/upgrade/src/__tests__/integration/cli.test.js(1 hunks)packages/upgrade/src/__tests__/integration/config.test.js(1 hunks)packages/upgrade/src/__tests__/integration/detect-sdk.test.js(1 hunks)packages/upgrade/src/__tests__/integration/runner.test.js(1 hunks)packages/upgrade/src/app.js(0 hunks)packages/upgrade/src/cli.js(1 hunks)packages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.js(1 hunks)packages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.js(1 hunks)packages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.js(1 hunks)packages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.js(1 hunks)packages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.js(1 hunks)packages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.js(1 hunks)packages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.js(1 hunks)packages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.js(1 hunks)packages/upgrade/src/codemods/index.js(2 hunks)packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs(1 hunks)packages/upgrade/src/codemods/transform-appearance-layout-to-options.cjs(1 hunks)packages/upgrade/src/codemods/transform-remove-deprecated-appearance-props.cjs(1 hunks)packages/upgrade/src/codemods/transform-themes-to-ui-themes.cjs(1 hunks)packages/upgrade/src/components/Codemod.js(0 hunks)packages/upgrade/src/components/Command.js(0 hunks)packages/upgrade/src/components/Header.js(0 hunks)packages/upgrade/src/components/SDKWorkflow.js(0 hunks)packages/upgrade/src/components/Scan.js(0 hunks)packages/upgrade/src/components/UpgradeSDK.js(0 hunks)packages/upgrade/src/config.js(1 hunks)packages/upgrade/src/render.js(1 hunks)packages/upgrade/src/runner.js(1 hunks)packages/upgrade/src/util/detect-sdk.js(1 hunks)packages/upgrade/src/util/expandable-list.js(0 hunks)packages/upgrade/src/util/get-clerk-version.js(0 hunks)packages/upgrade/src/util/guess-framework.js(0 hunks)packages/upgrade/src/util/package-manager.js(1 hunks)packages/upgrade/src/versions/core-3/changes/clerk-expo-package-rename.md(1 hunks)packages/upgrade/src/versions/core-3/changes/clerk-react-package-rename.md(1 hunks)packages/upgrade/src/versions/core-3/index.js(1 hunks)
💤 Files with no reviewable changes (10)
- packages/upgrade/src/util/get-clerk-version.js
- packages/upgrade/src/components/Codemod.js
- packages/upgrade/src/components/UpgradeSDK.js
- packages/upgrade/src/util/guess-framework.js
- packages/upgrade/src/components/Scan.js
- packages/upgrade/src/app.js
- packages/upgrade/src/components/Header.js
- packages/upgrade/src/components/SDKWorkflow.js
- packages/upgrade/src/components/Command.js
- packages/upgrade/src/util/expandable-list.js
🧰 Additional context used
📓 Path-based instructions (16)
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/upgrade/src/__tests__/fixtures/nextjs-v6/package.jsonpackages/upgrade/src/__tests__/fixtures/react-v6/package.jsonpackages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/versions/core-3/changes/clerk-expo-package-rename.mdpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/fixtures/no-clerk/package.jsonpackages/upgrade/src/__tests__/integration/cli.test.jspackages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.jspackages/upgrade/src/versions/core-3/index.jspackages/upgrade/src/__tests__/integration/runner.test.jspackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/__tests__/fixtures/expo-old-package/package.jsonpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.jspackages/upgrade/src/__tests__/integration/config.test.jspackages/upgrade/src/runner.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.jspackages/upgrade/src/config.jspackages/upgrade/src/util/package-manager.jspackages/upgrade/src/__tests__/integration/detect-sdk.test.jspackages/upgrade/src/__tests__/helpers/create-fixture.jspackages/upgrade/src/versions/core-3/changes/clerk-react-package-rename.mdpackages/upgrade/package.jsonpackages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.jspackages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.jspackages/upgrade/src/cli.jspackages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.jspackages/upgrade/src/util/detect-sdk.jspackages/upgrade/src/__tests__/fixtures/nextjs-v7/package.jsonpackages/upgrade/src/render.jspackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.jspackages/upgrade/src/codemods/index.js
**/package.json
📄 CodeRabbit inference engine (.cursor/rules/global.mdc)
Use pnpm as the package manager for this monorepo
Files:
packages/upgrade/src/__tests__/fixtures/nextjs-v6/package.jsonpackages/upgrade/src/__tests__/fixtures/react-v6/package.jsonpackages/upgrade/src/__tests__/fixtures/no-clerk/package.jsonpackages/upgrade/src/__tests__/fixtures/expo-old-package/package.jsonpackages/upgrade/package.jsonpackages/upgrade/src/__tests__/fixtures/nextjs-v7/package.json
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Use Prettier for code formatting across all packages
Files:
packages/upgrade/src/__tests__/fixtures/nextjs-v6/package.jsonpackages/upgrade/src/__tests__/fixtures/react-v6/package.jsonpackages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/versions/core-3/changes/clerk-expo-package-rename.mdpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/fixtures/no-clerk/package.jsonpackages/upgrade/src/__tests__/integration/cli.test.jspackages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.jspackages/upgrade/src/versions/core-3/index.jspackages/upgrade/src/__tests__/integration/runner.test.jspackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/__tests__/fixtures/expo-old-package/package.jsonpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.jspackages/upgrade/src/__tests__/integration/config.test.jspackages/upgrade/src/runner.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.jspackages/upgrade/src/config.jspackages/upgrade/src/util/package-manager.jspackages/upgrade/src/__tests__/integration/detect-sdk.test.jspackages/upgrade/src/__tests__/helpers/create-fixture.jspackages/upgrade/src/versions/core-3/changes/clerk-react-package-rename.mdpackages/upgrade/package.jsonpackages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.jspackages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.jspackages/upgrade/src/cli.jspackages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.jspackages/upgrade/src/util/detect-sdk.jspackages/upgrade/src/__tests__/fixtures/nextjs-v7/package.jsonpackages/upgrade/src/render.jspackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.jspackages/upgrade/src/codemods/index.js
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
All code must pass ESLint checks with the project's configuration
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/integration/cli.test.jspackages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.jspackages/upgrade/src/versions/core-3/index.jspackages/upgrade/src/__tests__/integration/runner.test.jspackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.jspackages/upgrade/src/__tests__/integration/config.test.jspackages/upgrade/src/runner.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.jspackages/upgrade/src/config.jspackages/upgrade/src/util/package-manager.jspackages/upgrade/src/__tests__/integration/detect-sdk.test.jspackages/upgrade/src/__tests__/helpers/create-fixture.jspackages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.jspackages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.jspackages/upgrade/src/cli.jspackages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.jspackages/upgrade/src/util/detect-sdk.jspackages/upgrade/src/render.jspackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.jspackages/upgrade/src/codemods/index.js
packages/**/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Follow established naming conventions (PascalCase for components, camelCase for variables)
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/integration/cli.test.jspackages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.jspackages/upgrade/src/versions/core-3/index.jspackages/upgrade/src/__tests__/integration/runner.test.jspackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.jspackages/upgrade/src/__tests__/integration/config.test.jspackages/upgrade/src/runner.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.jspackages/upgrade/src/config.jspackages/upgrade/src/util/package-manager.jspackages/upgrade/src/__tests__/integration/detect-sdk.test.jspackages/upgrade/src/__tests__/helpers/create-fixture.jspackages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.jspackages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.jspackages/upgrade/src/cli.jspackages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.jspackages/upgrade/src/util/detect-sdk.jspackages/upgrade/src/render.jspackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.jspackages/upgrade/src/codemods/index.js
packages/**/src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/integration/cli.test.jspackages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.jspackages/upgrade/src/versions/core-3/index.jspackages/upgrade/src/__tests__/integration/runner.test.jspackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.jspackages/upgrade/src/__tests__/integration/config.test.jspackages/upgrade/src/runner.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.jspackages/upgrade/src/config.jspackages/upgrade/src/util/package-manager.jspackages/upgrade/src/__tests__/integration/detect-sdk.test.jspackages/upgrade/src/__tests__/helpers/create-fixture.jspackages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.jspackages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.jspackages/upgrade/src/cli.jspackages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.jspackages/upgrade/src/util/detect-sdk.jspackages/upgrade/src/render.jspackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.jspackages/upgrade/src/codemods/index.js
**/*.ts?(x)
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components
**/*.tsx: Use proper type definitions for props and state in React components
Leverage TypeScript's type inference where possible in React components
Use proper event types for handlers in React components
Implement proper generic types for reusable React components
Use proper type guards for conditional rendering in React components
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx
**/*.{md,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Update documentation for API changes
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/versions/core-3/changes/clerk-expo-package-rename.mdpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/versions/core-3/changes/clerk-react-package-rename.mdpackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/react.mdc)
**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g.,UserProfile,NavigationMenu)
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)
**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Implement type guards forunknowntypes using the patternfunction isType(value: unknown): value is Type
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details in classes
Useprotectedfor inheritance hierarchies
Usepublicexplicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like<T extends { id: string }>
Use utility types likeOmit,Partial, andPickfor data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Useconst assertionswithas constfor literal types
Usesatisfiesoperator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Use ESLint with custom configurations tailored for different package types
Files:
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsxpackages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsxpackages/upgrade/src/__tests__/integration/cli.test.jspackages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.jspackages/upgrade/src/versions/core-3/index.jspackages/upgrade/src/__tests__/integration/runner.test.jspackages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.jspackages/upgrade/src/__tests__/integration/config.test.jspackages/upgrade/src/runner.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-align-experimental-unstable-prefixes.fixtures.jspackages/upgrade/src/config.jspackages/upgrade/src/util/package-manager.jspackages/upgrade/src/__tests__/integration/detect-sdk.test.jspackages/upgrade/src/__tests__/helpers/create-fixture.jspackages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.jspackages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.jspackages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.jspackages/upgrade/src/cli.jspackages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.jspackages/upgrade/src/util/detect-sdk.jspackages/upgrade/src/render.jspackages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsxpackages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.jspackages/upgrade/src/codemods/index.js
**/*.{test,spec}.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{test,spec}.{ts,tsx,js,jsx}: Unit tests are required for all new functionality
Verify proper error handling and edge cases
Include tests for all new features
Files:
packages/upgrade/src/__tests__/integration/cli.test.jspackages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.jspackages/upgrade/src/__tests__/integration/runner.test.jspackages/upgrade/src/__tests__/integration/config.test.jspackages/upgrade/src/__tests__/integration/detect-sdk.test.jspackages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.jspackages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.jspackages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.js
**/*.{test,spec,e2e}.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use real Clerk instances for integration tests
Files:
packages/upgrade/src/__tests__/integration/cli.test.jspackages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.jspackages/upgrade/src/__tests__/integration/runner.test.jspackages/upgrade/src/__tests__/integration/config.test.jspackages/upgrade/src/__tests__/integration/detect-sdk.test.jspackages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.jspackages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.jspackages/upgrade/src/codemods/__tests__/transform-align-experimental-unstable-prefixes.test.js
packages/*/package.json
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
packages/*/package.json: Packages should export TypeScript types alongside runtime code
Follow semantic versioning for all packagesAll packages must be published under @clerk namespace
packages/*/package.json: Framework packages should depend on@clerk/clerk-jsfor core functionality
@clerk/sharedshould be a common dependency for most packages in the monorepo
Files:
packages/upgrade/package.json
🧬 Code graph analysis (16)
packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsx (3)
packages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsx (1)
App(3-9)packages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsx (1)
App(4-6)packages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx (1)
App(3-5)
packages/upgrade/src/__tests__/integration/cli.test.js (3)
packages/upgrade/src/__tests__/helpers/create-fixture.js (2)
getFixturePath(9-11)createTempFixture(13-25)packages/upgrade/src/cli.js (1)
options(71-79)packages/upgrade/src/__tests__/integration/runner.test.js (2)
fixture(21-21)fixture(71-71)
packages/upgrade/src/codemods/__tests__/transform-appearance-layout-to-options.test.js (1)
packages/upgrade/src/codemods/__tests__/__fixtures__/transform-appearance-layout-to-options.fixtures.js (2)
fixtures(1-11)fixtures(1-11)
packages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsx (3)
packages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsx (1)
App(4-6)packages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx (1)
App(3-5)packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsx (1)
App(3-9)
packages/upgrade/src/codemods/transform-themes-to-ui-themes.cjs (1)
packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs (1)
source(238-238)
packages/upgrade/src/runner.js (2)
packages/upgrade/src/codemods/index.js (4)
GLOBBY_IGNORE(16-34)result(61-61)runCodemod(36-80)getCodemodConfig(82-84)packages/upgrade/src/render.js (2)
createSpinner(103-143)renderCodemodResults(145-148)
packages/upgrade/src/config.js (3)
packages/upgrade/src/__tests__/integration/cli.test.js (1)
__dirname(12-12)packages/upgrade/src/__tests__/helpers/create-fixture.js (1)
__dirname(6-6)packages/upgrade/src/cli.js (2)
sdk(87-87)currentVersion(119-119)
packages/upgrade/src/util/package-manager.js (1)
packages/upgrade/src/cli.js (1)
packageManager(120-120)
packages/upgrade/src/__tests__/integration/detect-sdk.test.js (4)
packages/upgrade/src/cli.js (1)
sdk(87-87)packages/upgrade/src/util/detect-sdk.js (5)
detectSdk(30-50)version(63-67)getSdkVersion(52-74)getMajorVersion(76-86)normalizeSdkName(107-124)packages/upgrade/src/__tests__/helpers/create-fixture.js (1)
getFixturePath(9-11)packages/upgrade/src/util/package-manager.js (1)
detectPackageManager(5-20)
packages/upgrade/src/__tests__/helpers/create-fixture.js (3)
packages/upgrade/src/__tests__/integration/cli.test.js (1)
__dirname(12-12)packages/upgrade/src/config.js (3)
__dirname(7-7)filePath(152-152)content(153-153)packages/upgrade/src/runner.js (1)
content(82-82)
packages/upgrade/src/codemods/__tests__/transform-remove-deprecated-appearance-props.test.js (1)
packages/upgrade/src/codemods/__tests__/__fixtures__/transform-remove-deprecated-appearance-props.fixtures.js (2)
fixtures(1-67)fixtures(1-67)
packages/upgrade/src/codemods/__tests__/transform-themes-to-ui-themes.test.js (1)
packages/upgrade/src/codemods/__tests__/__fixtures__/transform-themes-to-ui-themes.fixtures.js (2)
fixtures(1-47)fixtures(1-47)
packages/upgrade/src/cli.js (5)
packages/upgrade/src/render.js (12)
renderHeader(5-9)renderWarning(24-26)renderNewline(28-30)renderError(20-22)renderText(11-14)promptSelect(61-83)renderConfig(32-45)promptConfirm(47-59)renderSuccess(16-18)renderScanResults(150-175)renderComplete(177-182)createSpinner(103-143)packages/upgrade/src/util/detect-sdk.js (3)
normalizeSdkName(107-124)detectSdk(30-50)getSupportedSdks(26-28)packages/upgrade/src/util/package-manager.js (4)
detectPackageManager(5-20)getPackageManagerDisplayName(93-105)removePackage(88-91)upgradePackage(83-86)packages/upgrade/src/config.js (5)
config(29-29)config(53-53)loadConfig(10-93)getTargetPackageName(121-129)getOldPackageName(131-139)packages/upgrade/src/runner.js (5)
runCodemods(33-59)results(76-76)runScans(61-120)spinner(43-43)spinner(68-68)
packages/upgrade/src/util/detect-sdk.js (3)
packages/upgrade/src/util/package-manager.js (1)
pkg(23-23)packages/upgrade/src/cli.js (1)
sdk(87-87)packages/upgrade/src/config.js (1)
getOldPackageName(131-139)
packages/upgrade/src/__tests__/fixtures/nextjs-v7/src/app.tsx (3)
packages/upgrade/src/__tests__/fixtures/expo-old-package/src/App.tsx (1)
App(3-9)packages/upgrade/src/__tests__/fixtures/nextjs-v6/src/app.tsx (2)
App(4-6)UserProfile(8-17)packages/upgrade/src/__tests__/fixtures/react-v6/src/App.tsx (1)
App(3-9)
packages/upgrade/src/codemods/index.js (4)
packages/upgrade/src/__tests__/integration/cli.test.js (1)
__dirname(12-12)packages/upgrade/src/cli.js (1)
options(71-79)packages/upgrade/src/runner.js (1)
result(46-46)packages/upgrade/src/codemods/transform-clerk-react-v6.cjs (1)
result(148-148)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
- GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
- GitHub Check: Integration Tests (nextjs, chrome, 15)
- GitHub Check: Integration Tests (quickstart, chrome, 16)
- GitHub Check: Integration Tests (astro, chrome)
- GitHub Check: Integration Tests (machine, chrome)
- GitHub Check: Integration Tests (quickstart, chrome, 15)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (nextjs, chrome, 16)
- GitHub Check: Integration Tests (vue, chrome)
- GitHub Check: Integration Tests (billing, chrome, RQ)
- GitHub Check: Integration Tests (machine, chrome, RQ)
- GitHub Check: Integration Tests (custom, chrome)
- GitHub Check: Integration Tests (react-router, chrome)
- GitHub Check: Integration Tests (tanstack-react-start, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (ap-flows, chrome)
- GitHub Check: Integration Tests (handshake, chrome)
- GitHub Check: Integration Tests (handshake:staging, chrome)
- GitHub Check: Integration Tests (sessions:staging, chrome)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
| it('respects ignore patterns', async () => { | ||
| const config = await loadConfig('nextjs', 6); | ||
| const options = { | ||
| dir: fixture.path, | ||
| ignore: ['**/src/**'], | ||
| }; | ||
|
|
||
| const results = await runScans(config, 'nextjs', options); | ||
|
|
||
| expect(Array.isArray(results)).toBe(true); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test doesn't verify that ignore patterns actually reduce results.
This test should compare results with and without ignore patterns to confirm the ignore functionality works, or at minimum verify that no results come from ignored paths.
const results = await runScans(config, 'nextjs', options);
- expect(Array.isArray(results)).toBe(true);
+ expect(Array.isArray(results)).toBe(true);
+ // Verify no results from ignored src directory
+ const srcResults = results.flatMap(r => r.instances).filter(i => i.file.includes('src/'));
+ expect(srcResults).toHaveLength(0);🤖 Prompt for AI Agents
In packages/upgrade/src/__tests__/integration/runner.test.js around lines 57-67,
the test only asserts results is an array and doesn't verify that the ignore
pattern actually reduces or removes results; update the test to run runScans
twice (once without the ignore option and once with ignore: ['**/src/**']) and
assert that the ignored run returns fewer results (or at minimum that none of
the returned items originate from paths containing '/src/' or match the ignore
glob), e.g., capture both result sets and compare lengths or filter results for
entries with paths including '/src/' and assert zero for the ignored run.
packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs
Show resolved
Hide resolved
| root.find(j.ObjectPattern).forEach(path => { | ||
| path.node.properties.forEach(prop => { | ||
| if (!prop) { | ||
| return; | ||
| } | ||
| const keyName = getPropertyName(prop.key); | ||
| if (keyName && REMOVED_PROPS.has(keyName) && !prop.computed) { | ||
| return; | ||
| } | ||
| if (prop.key) { | ||
| renamePropertyKey(prop.key, prop.computed); | ||
| } | ||
| if (prop.value && j.Identifier.check(prop.value)) { | ||
| renameIdentifier(prop.value); | ||
| } | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObjectPattern handling doesn't remove deprecated props.
Unlike JSXAttributes (lines 204-219), Properties (lines 169-172), and ObjectExpression (lines 460-473), this code doesn't filter out properties that are in REMOVED_PROPS from object destructuring patterns. The early return on line 187 only skips renaming but leaves the deprecated property in place.
This inconsistency means destructuring like const { __unstable_manageBillingUrl, other } = props; won't have the deprecated property removed, while JSX attributes and object literals will. If this is intentional (e.g., to avoid breaking function signatures), it should be documented. Otherwise, consider filtering the properties array similar to other node types.
If removal is intended, apply this diff:
root.find(j.ObjectPattern).forEach(path => {
- path.node.properties.forEach(prop => {
+ const filtered = [];
+ path.node.properties.forEach(prop => {
if (!prop) {
return;
}
const keyName = getPropertyName(prop.key);
if (keyName && REMOVED_PROPS.has(keyName) && !prop.computed) {
+ dirty = true;
return;
}
if (prop.key) {
renamePropertyKey(prop.key, prop.computed);
}
if (prop.value && j.Identifier.check(prop.value)) {
renameIdentifier(prop.value);
}
+ filtered.push(prop);
});
+ path.node.properties = filtered;
});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| root.find(j.ObjectPattern).forEach(path => { | |
| path.node.properties.forEach(prop => { | |
| if (!prop) { | |
| return; | |
| } | |
| const keyName = getPropertyName(prop.key); | |
| if (keyName && REMOVED_PROPS.has(keyName) && !prop.computed) { | |
| return; | |
| } | |
| if (prop.key) { | |
| renamePropertyKey(prop.key, prop.computed); | |
| } | |
| if (prop.value && j.Identifier.check(prop.value)) { | |
| renameIdentifier(prop.value); | |
| } | |
| }); | |
| }); | |
| root.find(j.ObjectPattern).forEach(path => { | |
| const filtered = []; | |
| path.node.properties.forEach(prop => { | |
| if (!prop) { | |
| return; | |
| } | |
| const keyName = getPropertyName(prop.key); | |
| if (keyName && REMOVED_PROPS.has(keyName) && !prop.computed) { | |
| dirty = true; | |
| return; | |
| } | |
| if (prop.key) { | |
| renamePropertyKey(prop.key, prop.computed); | |
| } | |
| if (prop.value && j.Identifier.check(prop.value)) { | |
| renameIdentifier(prop.value); | |
| } | |
| filtered.push(prop); | |
| }); | |
| path.node.properties = filtered; | |
| }); |
| function loadChanges(versionDir, sdk) { | ||
| const changesDir = path.join(VERSIONS_DIR, versionDir, 'changes'); | ||
|
|
||
| if (!fs.existsSync(changesDir)) { | ||
| return []; | ||
| } | ||
|
|
||
| const files = fs.readdirSync(changesDir).filter(f => f.endsWith('.md')); | ||
| const changes = []; | ||
|
|
||
| for (const file of files) { | ||
| const filePath = path.join(changesDir, file); | ||
| const content = fs.readFileSync(filePath, 'utf8'); | ||
| const parsed = matter(content); | ||
| const fm = parsed.data; | ||
|
|
||
| const packages = fm.packages || ['*']; | ||
| const appliesToSdk = packages.includes('*') || packages.includes(sdk); | ||
|
|
||
| if (!appliesToSdk) { | ||
| continue; | ||
| } | ||
|
|
||
| const matcher = fm.matcher | ||
| ? Array.isArray(fm.matcher) | ||
| ? fm.matcher.map(m => new RegExp(m, `g${fm.matcherFlags || ''}`)) | ||
| : new RegExp(fm.matcher, `g${fm.matcherFlags || ''}`) | ||
| : null; | ||
|
|
||
| changes.push({ | ||
| title: fm.title, | ||
| matcher, | ||
| packages, | ||
| category: fm.category || 'breaking', | ||
| warning: fm.warning || fm.category === 'warning', | ||
| docsAnchor: fm.docsAnchor || file.replace('.md', ''), | ||
| content: parsed.content, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against invalid RegExp flags when combining matcher and matcherFlags
loadChanges always prefixes 'g' to fm.matcherFlags:
new RegExp(fm.matcher, `g${fm.matcherFlags || ''}`)If a change file ever sets matcherFlags including 'g' (e.g. 'gi'), this becomes 'ggi' and will throw a SyntaxError at runtime, breaking the CLI when loading changes.
You can make this more robust by deduplicating flags and ensuring g is present only once, e.g.:
- const matcher = fm.matcher
- ? Array.isArray(fm.matcher)
- ? fm.matcher.map(m => new RegExp(m, `g${fm.matcherFlags || ''}`))
- : new RegExp(fm.matcher, `g${fm.matcherFlags || ''}`)
- : null;
+ const matcher = fm.matcher
+ ? (() => {
+ const baseFlags = fm.matcherFlags || '';
+ const flags = baseFlags.includes('g') ? baseFlags : `g${baseFlags}`;
+ if (Array.isArray(fm.matcher)) {
+ return fm.matcher.map(m => new RegExp(m, flags));
+ }
+ return new RegExp(fm.matcher, flags);
+ })()
+ : null;This keeps the “always global” behavior while avoiding brittle config expectations.
🤖 Prompt for AI Agents
In packages/upgrade/src/config.js around lines 141 to 178, the code blindly
prefixes 'g' to fm.matcherFlags which can produce invalid duplicate flags (e.g.
'ggi') and throw a SyntaxError; fix by normalizing the flags: treat
fm.matcherFlags as a string, split into individual characters, filter to the
allowed RegExp flag set (e.g. 'g', 'i', 'm', 's', 'u', 'y'), remove duplicates,
ensure 'g' is present exactly once, then rejoin the characters to build the
flags argument passed to new RegExp; apply this normalization for both array and
string matcher branches and handle empty/undefined fm.matcherFlags by falling
back to just 'g'.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…table-prefixes.cjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs (1)
191-207: ObjectPattern doesn't remove deprecated props (inconsistent with other node types).The early return on line 198 skips processing deprecated props but doesn't remove them from
path.node.properties. This leaves deprecated properties in destructuring patterns, which is inconsistent with how deprecated props are removed from Property nodes (line 181 prunes), JSXOpeningElement (lines 215-230 filters), and ObjectExpression (lines 473-483 filters).For example,
const { __unstable_manageBillingUrl, other } = props;would retain the deprecated prop in the pattern.Apply this diff to filter out deprecated props from ObjectPattern:
root.find(j.ObjectPattern).forEach(path => { - path.node.properties.forEach(prop => { + const filtered = []; + path.node.properties.forEach(prop => { if (!prop) { return; } const keyName = getPropertyName(prop.key); if (keyName && REMOVED_PROPS.has(keyName) && !prop.computed) { + dirty = true; return; } if (prop.key) { renamePropertyKey(prop.key, prop.computed); } if (prop.value && j.Identifier.check(prop.value)) { renameIdentifier(prop.value); } + filtered.push(prop); }); + path.node.properties = filtered; });
🧹 Nitpick comments (1)
packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs (1)
339-469: Consider extracting shared logic for require() handling.The blocks handling UI theme requires (lines 339-405) and Chrome extension requires (lines 407-469) are nearly identical, differing only in the source constants, name sets, and target destinations. Extracting a shared helper function would improve maintainability and reduce duplication.
For example:
const relocateRequireImports = (sourceMatcher, nameSet, targetSource) => { root .find(j.VariableDeclarator, { init: { callee: { name: 'require' } }, }) .filter(path => { const arg = path.node.init.arguments?.[0]; return ( arg && (j.Literal.check(arg) || (j.StringLiteral && j.StringLiteral.check(arg))) && sourceMatcher(arg.value) ); }) .forEach(path => { // ... shared relocation logic ... }); }; // Then call: relocateRequireImports( source => UI_LEGACY_SOURCES.has(source), UI_THEME_NAMES, UI_THEME_SOURCE ); relocateRequireImports( source => source === CHROME_LEGACY_SOURCE, CHROME_CLIENT_NAMES, CHROME_BACKGROUND_SOURCE );
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/upgrade/src/__tests__/integration/runner.test.js(1 hunks)packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/upgrade/src/tests/integration/runner.test.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
- GitHub Check: Publish with pkg-pr-new
- GitHub Check: Unit Tests (shared, clerk-js, RQ)
- GitHub Check: Static analysis
- GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
- GitHub Check: Integration Tests (quickstart, chrome, 16)
- GitHub Check: Integration Tests (quickstart, chrome, 15)
- GitHub Check: Integration Tests (nextjs, chrome, 15)
- GitHub Check: Integration Tests (machine, chrome, RQ)
- GitHub Check: Integration Tests (machine, chrome)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (nextjs, chrome, 16)
- GitHub Check: Integration Tests (billing, chrome, RQ)
- GitHub Check: Integration Tests (react-router, chrome)
- GitHub Check: Integration Tests (custom, chrome)
- GitHub Check: Integration Tests (vue, chrome)
- GitHub Check: Integration Tests (astro, chrome)
- GitHub Check: Integration Tests (handshake:staging, chrome)
- GitHub Check: Integration Tests (tanstack-react-start, chrome)
- GitHub Check: Integration Tests (handshake, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Integration Tests (sessions:staging, chrome)
- GitHub Check: Integration Tests (ap-flows, chrome)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs (1)
248-337: Import reorganization logic looks sound.The complex logic for relocating UI theme imports (lines 254-294) and Chrome extension imports (lines 296-336) appears correct:
- Properly identifies and normalizes specifiers to move
- Handles the case where source is already the target (lines 268-275)
- Creates new imports or merges into existing ones using
mergeImportSpecifiers- Correctly removes or updates original imports based on remaining specifiers
The
mergeImportSpecifiersutility prevents duplicate imports, and the use ofinsertAfterpreserves import ordering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
packages/upgrade/src/codemods/index.js (1)
44-52:dryvsdryRunstill allow real writes whendryis true butdryRunis falseAs currently structured:
- A caller passing
{ dry: true }but leavingdryRunfalsy will:
- Run the first jscodeshift pass in dry mode (no writes).
- Still run the second pass with
dry: false(real file writes), because onlydryRungates the second pass.- Then hit
if (options.dry) { return dryResult; }, returning the dry stats while the second pass has already mutated files.That’s surprising behavior for programmatic callers who might reasonably equate
dry: truewith “do not write changes,” and it can lead to unintended code modifications that the returned result doesn’t reflect.You can preserve current CLI semantics while making
drysafe by treating it as an alias for “dry run” at this level and skipping the second pass whenever eitherdryordryRunis truthy, and by short‑circuiting before the second run. For example:const resolvedPath = resolve(__dirname, `${transform}.cjs`); - - const paths = await globby(glob, { ignore: GLOBBY_IGNORE }); - - if (options.skipCodemods) { + if (options.skipCodemods) { return { stats: { total: 0, modified: 0, deleted: 0, }, }; } + + const paths = await globby(glob, { ignore: GLOBBY_IGNORE }); + + const isDryRun = Boolean(options.dryRun ?? options.dry); // First pass: dry run to collect stats (jscodeshift only reports stats in dry mode) const dryResult = await run(resolvedPath, paths ?? [], { ...options, dry: true, silent: true, }); - let result = {}; - if (!options.dryRun) { - // Second pass: apply the changes - result = await run(resolvedPath, paths ?? [], { - ...options, - dry: false, - silent: true, - }); - } - - if (options.dry) { - return dryResult; - } + if (isDryRun) { + // Only collect stats; don't apply changes. + return dryResult; + } + + // Second pass: apply the changes + const result = await run(resolvedPath, paths ?? [], { + ...options, + dry: false, + silent: true, + }); // Merge stats from dry run into final result return { ...result, stats: dryResult.stats, };This:
- Keeps existing CLI behavior for
dryRun.- Ensures that any caller setting
dry: true(with or withoutdryRun) never triggers the write pass.- Avoids doing the expensive second
runjust to throw its result away.To double‑check how risky this is and who might be using
dry, you can scan forrunCodemodcall sites:#!/bin/bash # Inspect call sites and options passed into runCodemod rg -n "runCodemod\(" -C3Also applies to: 61-79
🧹 Nitpick comments (1)
packages/upgrade/src/codemods/index.js (1)
4-4: Nice codemod config + human‑friendly summary; consider doc/testability tweaksThe CODEMOD_CONFIG mapping plus the summary renderer give a good hook for per‑transform guidance and clear follow‑up instructions for developers, and the messages themselves are concrete and actionable.
Two small polish ideas you might consider (non‑blocking):
- If
getCodemodConfigand this config object are part of the package’s public surface (used outside this package), adding a brief JSDoc ongetCodemodConfigand documenting the expectedstatsshape would help future callers and align with the “public APIs documented with JSDoc” guideline.- For easier unit testing and potential reuse, you could factor the message assembly into a pure helper that returns an array of lines, and have
renderDeprecatedPropsSummaryjust join/console.logthem. That would let tests assert on output without needing to stub the console.Also applies to: 10-14, 82-120
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/upgrade/src/codemods/index.js(3 hunks)packages/upgrade/src/runner.js(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/upgrade/src/runner.js
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
All code must pass ESLint checks with the project's configuration
Files:
packages/upgrade/src/codemods/index.js
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/upgrade/src/codemods/index.js
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Follow established naming conventions (PascalCase for components, camelCase for variables)
Files:
packages/upgrade/src/codemods/index.js
packages/**/src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels
Files:
packages/upgrade/src/codemods/index.js
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Use ESLint with custom configurations tailored for different package types
Files:
packages/upgrade/src/codemods/index.js
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Use Prettier for code formatting across all packages
Files:
packages/upgrade/src/codemods/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
- GitHub Check: Integration Tests (machine, chrome, RQ)
- GitHub Check: Integration Tests (quickstart, chrome, 16)
- GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
- GitHub Check: Integration Tests (billing, chrome, RQ)
- GitHub Check: Integration Tests (nextjs, chrome, 16)
- GitHub Check: Integration Tests (machine, chrome)
- GitHub Check: Integration Tests (quickstart, chrome, 15)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (nextjs, chrome, 15)
- GitHub Check: Integration Tests (astro, chrome)
- GitHub Check: Integration Tests (handshake, chrome)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (tanstack-react-start, chrome)
- GitHub Check: Integration Tests (custom, chrome)
- GitHub Check: Integration Tests (react-router, chrome)
- GitHub Check: Integration Tests (vue, chrome)
- GitHub Check: Integration Tests (handshake:staging, chrome)
- GitHub Check: Integration Tests (sessions:staging, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (ap-flows, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/upgrade/src/codemods/index.js (1)
31-33: Expanded ignore patterns look appropriate for JS/TS codemodsExcluding common binary assets and stylesheet extensions from the codemod glob should reduce unnecessary file system work and avoid accidentally feeding non‑source files into jscodeshift. This looks aligned with how these codemods are meant to be used.
Description
The Upgrade CLI has been restructured to better handle current and upcoming releases. The internals have been simplified and release-specific logic has been consolidated out of the core logic.
inkusagecore-2upgrade support. If folks need to upgrade, they can use a previous major of@clerk/upgradeChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.