From 38530a12f184139563a0628f336e9b3378fbceb8 Mon Sep 17 00:00:00 2001 From: Dominic Saadi Date: Wed, 26 Apr 2023 17:44:24 -0700 Subject: [PATCH] chore(v5): tidy up codemods (#8141) * rename codemods, fix help, etc * changes * add test for rest syntax --- .../__testfixtures__/restSyntax.input.ts | 33 +++++++++++++++++++ .../__testfixtures__/restSyntax.output.ts | 33 +++++++++++++++++++ .../v5.x.x/cellQueryResult/cellQueryResult.ts | 8 ++--- .../cellQueryResult/cellQueryResult.yargs.ts | 2 +- .../detectEmptyCells/detectEmptyCells.ts | 17 +++++++--- .../detectEmptyCells.yargs.ts | 27 +++++++++------ .../__testfixtures__/default.input.js | 6 ---- .../__testfixtures__/default.output.js | 6 ---- .../__tests__/renameValidateWith.test.ts | 2 +- .../renameValidateWith.yargs.ts | 32 ++++++++++-------- .../updateAuth0/__tests__/updateAuth0.ts | 5 --- .../__testfixtures__/default.input.js | 0 .../__testfixtures__/default.output.js | 0 .../__tests__/updateAuth0ToV2.test.ts | 5 +++ .../updateAuth0ToV2.ts} | 0 .../updateAuth0ToV2.yargs.ts} | 11 ++++--- .../v5.x.x/updateNodeEngineTo18/README.md | 3 ++ .../updateNodeEngineTo18.ts} | 6 ++-- .../updateNodeEngineTo18.yargs.ts | 21 ++++++++++++ .../v5.x.x/updateNodeEngines/README.md | 4 --- .../updateNodeEngines.yargs.ts | 18 ---------- .../upgradeToReact18/upgradeToReact18.ts | 2 +- .../upgradeToReact18.yargs.ts | 3 +- 23 files changed, 160 insertions(+), 84 deletions(-) create mode 100644 packages/codemods/src/codemods/v5.x.x/cellQueryResult/__testfixtures__/restSyntax.input.ts create mode 100644 packages/codemods/src/codemods/v5.x.x/cellQueryResult/__testfixtures__/restSyntax.output.ts delete mode 100644 packages/codemods/src/codemods/v5.x.x/updateAuth0/__tests__/updateAuth0.ts rename packages/codemods/src/codemods/v5.x.x/{updateAuth0 => updateAuth0ToV2}/__testfixtures__/default.input.js (100%) rename packages/codemods/src/codemods/v5.x.x/{updateAuth0 => updateAuth0ToV2}/__testfixtures__/default.output.js (100%) create mode 100644 packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/__tests__/updateAuth0ToV2.test.ts rename packages/codemods/src/codemods/v5.x.x/{updateAuth0/updateAuth0.ts => updateAuth0ToV2/updateAuth0ToV2.ts} (100%) rename packages/codemods/src/codemods/v5.x.x/{updateAuth0/updateAuth0.yargs.ts => updateAuth0ToV2/updateAuth0ToV2.yargs.ts} (73%) create mode 100644 packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/README.md rename packages/codemods/src/codemods/v5.x.x/{updateNodeEngines/updateNodeEngines.ts => updateNodeEngineTo18/updateNodeEngineTo18.ts} (80%) create mode 100644 packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.yargs.ts delete mode 100644 packages/codemods/src/codemods/v5.x.x/updateNodeEngines/README.md delete mode 100644 packages/codemods/src/codemods/v5.x.x/updateNodeEngines/updateNodeEngines.yargs.ts diff --git a/packages/codemods/src/codemods/v5.x.x/cellQueryResult/__testfixtures__/restSyntax.input.ts b/packages/codemods/src/codemods/v5.x.x/cellQueryResult/__testfixtures__/restSyntax.input.ts new file mode 100644 index 000000000000..9d072418fd4a --- /dev/null +++ b/packages/codemods/src/codemods/v5.x.x/cellQueryResult/__testfixtures__/restSyntax.input.ts @@ -0,0 +1,33 @@ +import type { FindAuthorQuery, FindAuthorQueryVariables } from 'types/graphql' + +import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web' + +import Author from 'src/components/Author' + +export const QUERY = gql` + query FindAuthorQuery($id: Int!) { + author: user(id: $id) { + email + fullName + } + } +` + +export const Loading = () => Loading... + +export const Empty = () => Empty + +export const Failure = ({ + error, +}: CellFailureProps) => ( + Error: {error?.message} +) + +export const Success = ({ + author, + ...props +}: CellSuccessProps) => ( + + + +) diff --git a/packages/codemods/src/codemods/v5.x.x/cellQueryResult/__testfixtures__/restSyntax.output.ts b/packages/codemods/src/codemods/v5.x.x/cellQueryResult/__testfixtures__/restSyntax.output.ts new file mode 100644 index 000000000000..9d072418fd4a --- /dev/null +++ b/packages/codemods/src/codemods/v5.x.x/cellQueryResult/__testfixtures__/restSyntax.output.ts @@ -0,0 +1,33 @@ +import type { FindAuthorQuery, FindAuthorQueryVariables } from 'types/graphql' + +import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web' + +import Author from 'src/components/Author' + +export const QUERY = gql` + query FindAuthorQuery($id: Int!) { + author: user(id: $id) { + email + fullName + } + } +` + +export const Loading = () => Loading... + +export const Empty = () => Empty + +export const Failure = ({ + error, +}: CellFailureProps) => ( + Error: {error?.message} +) + +export const Success = ({ + author, + ...props +}: CellSuccessProps) => ( + + + +) diff --git a/packages/codemods/src/codemods/v5.x.x/cellQueryResult/cellQueryResult.ts b/packages/codemods/src/codemods/v5.x.x/cellQueryResult/cellQueryResult.ts index 6617398e60ef..0eaa855c0715 100644 --- a/packages/codemods/src/codemods/v5.x.x/cellQueryResult/cellQueryResult.ts +++ b/packages/codemods/src/codemods/v5.x.x/cellQueryResult/cellQueryResult.ts @@ -43,11 +43,11 @@ export default function transform(file: FileInfo, api: API) { if (firstParameter.type === 'ObjectPattern') { const previouslySpreadPropertiesInUse = firstParameter.properties.filter((property: Property) => { - if (property.key.type !== 'Identifier') { - throw new Error( - 'Unable to process a parameter within the cell function' - ) + // skip rest params + if (property.type === 'RestElement') { + return false } + return nonSpreadVariables.includes(property.key.name) }) if (previouslySpreadPropertiesInUse.length > 0) { diff --git a/packages/codemods/src/codemods/v5.x.x/cellQueryResult/cellQueryResult.yargs.ts b/packages/codemods/src/codemods/v5.x.x/cellQueryResult/cellQueryResult.yargs.ts index afdcc5693ae9..6a1189654647 100644 --- a/packages/codemods/src/codemods/v5.x.x/cellQueryResult/cellQueryResult.yargs.ts +++ b/packages/codemods/src/codemods/v5.x.x/cellQueryResult/cellQueryResult.yargs.ts @@ -7,7 +7,7 @@ import runTransform from '../../../lib/runTransform' export const command = 'cell-query-result' export const description = - '(v4.x.x->v5.x.x) Updates cells to use the queryResult property' + '(v4.x.x->v5.x.x) Updates cells to use the `queryResult` property' export const handler = () => { task('cellQueryResult', async ({ setOutput }) => { diff --git a/packages/codemods/src/codemods/v5.x.x/detectEmptyCells/detectEmptyCells.ts b/packages/codemods/src/codemods/v5.x.x/detectEmptyCells/detectEmptyCells.ts index 4f2956b3c701..45212980b40e 100644 --- a/packages/codemods/src/codemods/v5.x.x/detectEmptyCells/detectEmptyCells.ts +++ b/packages/codemods/src/codemods/v5.x.x/detectEmptyCells/detectEmptyCells.ts @@ -1,3 +1,5 @@ +import type { TaskInnerAPI } from 'tasuku' + import { findCells, fileToAst, @@ -5,7 +7,7 @@ import { parseGqlQueryToAst, } from '../../../lib/cells' -async function detectEmptyCells() { +async function detectEmptyCells(taskContext: TaskInnerAPI) { const cellPaths = findCells() const susceptibleCells = cellPaths.filter((cellPath) => { @@ -22,17 +24,22 @@ async function detectEmptyCells() { }) if (susceptibleCells.length > 0) { - console.log( + taskContext.setOutput( [ - 'You have Cells that are susceptible to the new isDataEmpty behavior:', + 'You have Cells that are susceptible to the new `isDataEmpty` behavior:', '', susceptibleCells.map((c) => `• ${c}`).join('\n'), '', - "The new behavior is documented in detail here. It's most likely what you want, but consider whether it affects you.", + 'The new behavior is documented in detail on the forums: https://community.redwoodjs.com/t/redwood-v5-0-0-rc-is-now-available/4715.', + "It's most likely what you want, but consider whether it affects you.", "If you'd like to revert to the old behavior, you can override the `isDataEmpty` function.", ].join('\n') ) + } else { + taskContext.setOutput( + "None of your project's Cells are susceptible to the new `isDataEmpty` behavior." + ) } } -export default detectEmptyCells +export { detectEmptyCells } diff --git a/packages/codemods/src/codemods/v5.x.x/detectEmptyCells/detectEmptyCells.yargs.ts b/packages/codemods/src/codemods/v5.x.x/detectEmptyCells/detectEmptyCells.yargs.ts index 4c4fa271397e..b0c30b02d3d5 100644 --- a/packages/codemods/src/codemods/v5.x.x/detectEmptyCells/detectEmptyCells.yargs.ts +++ b/packages/codemods/src/codemods/v5.x.x/detectEmptyCells/detectEmptyCells.yargs.ts @@ -1,17 +1,24 @@ -import task, { TaskInnerAPI } from 'tasuku' +import task from 'tasuku' -import detectEmptyCells from './detectEmptyCells' +import { detectEmptyCells } from './detectEmptyCells' export const command = 'detect-empty-cells' -export const description = '(v4.x.x->v5.0.0) Detects empty cells and warns' + +export const description = + '(v4.x.x->v5.x.x) Detects Cells susceptible to the new Empty behavior' export const handler = () => { - task('detectEmptyCells', async ({ setError }: TaskInnerAPI) => { - try { - await detectEmptyCells() - console.log() - } catch (e: any) { - setError('Failed to detect empty cells in your project \n' + e?.message) + task( + 'Detecting Cells susceptible to the new Empty behavior', + async (taskContext) => { + try { + await detectEmptyCells(taskContext) + } catch (e: any) { + taskContext.setError( + 'Failed to detect cells susceptible to the new Empty behavior in your project \n' + + e?.message + ) + } } - }) + ) } diff --git a/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__testfixtures__/default.input.js b/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__testfixtures__/default.input.js index e520d9fd869d..d2a7583bba99 100644 --- a/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__testfixtures__/default.input.js +++ b/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__testfixtures__/default.input.js @@ -3,9 +3,3 @@ validateWith(() => { throw "You'll have to be more creative than that" } }) - -validateWith(() => { - if (input.name === 'Name') { - throw new Error("You'll have to be more creative than that") - } -}) diff --git a/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__testfixtures__/default.output.js b/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__testfixtures__/default.output.js index 7932f0929575..e01a9b456eb8 100644 --- a/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__testfixtures__/default.output.js +++ b/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__testfixtures__/default.output.js @@ -3,9 +3,3 @@ validateWithSync(() => { throw "You'll have to be more creative than that" } }) - -validateWithSync(() => { - if (input.name === 'Name') { - throw new Error("You'll have to be more creative than that") - } -}) diff --git a/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__tests__/renameValidateWith.test.ts b/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__tests__/renameValidateWith.test.ts index 5841531ab340..f43aeaadb213 100644 --- a/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__tests__/renameValidateWith.test.ts +++ b/packages/codemods/src/codemods/v5.x.x/renameValidateWith/__tests__/renameValidateWith.test.ts @@ -1,5 +1,5 @@ describe('renameValidateWith', () => { - it('Converts validateWith to validateWithSync', async () => { + it('Renames `validateWith` to `validateWithSync`', async () => { await matchTransformSnapshot('renameValidateWith', 'default') }) }) diff --git a/packages/codemods/src/codemods/v5.x.x/renameValidateWith/renameValidateWith.yargs.ts b/packages/codemods/src/codemods/v5.x.x/renameValidateWith/renameValidateWith.yargs.ts index 33daba57493f..3ddb3fe90df0 100644 --- a/packages/codemods/src/codemods/v5.x.x/renameValidateWith/renameValidateWith.yargs.ts +++ b/packages/codemods/src/codemods/v5.x.x/renameValidateWith/renameValidateWith.yargs.ts @@ -1,29 +1,33 @@ import path from 'path' -import task, { TaskInnerAPI } from 'tasuku' +import task from 'tasuku' import getFilesWithPattern from '../../../lib/getFilesWithPattern' import getRWPaths from '../../../lib/getRWPaths' import runTransform from '../../../lib/runTransform' export const command = 'rename-validate-with' + export const description = - '(v4.x.x->v5.x.x) Converts validateWith to validateWithSync' + '(v4.x.x->v5.x.x) Renames validateWith to validateWithSync' export const handler = () => { - task('Rename Validate With', async ({ setOutput }: TaskInnerAPI) => { - const rwPaths = getRWPaths() + task( + 'Renaming `validateWith` to `validateWithSync`', + async ({ setOutput }) => { + const redwoodProjectPaths = getRWPaths() - const files = getFilesWithPattern({ - pattern: 'validateWith', - filesToSearch: [rwPaths.api.src], - }) + const files = getFilesWithPattern({ + pattern: 'validateWith', + filesToSearch: [redwoodProjectPaths.api.src], + }) - await runTransform({ - transformPath: path.join(__dirname, 'renameValidateWith.js'), - targetPaths: files, - }) + await runTransform({ + transformPath: path.join(__dirname, 'renameValidateWith.js'), + targetPaths: files, + }) - setOutput('All done! Run `yarn rw lint --fix` to prettify your code') - }) + setOutput('All done! Run `yarn rw lint --fix` to prettify your code') + } + ) } diff --git a/packages/codemods/src/codemods/v5.x.x/updateAuth0/__tests__/updateAuth0.ts b/packages/codemods/src/codemods/v5.x.x/updateAuth0/__tests__/updateAuth0.ts deleted file mode 100644 index 0b69dae8f677..000000000000 --- a/packages/codemods/src/codemods/v5.x.x/updateAuth0/__tests__/updateAuth0.ts +++ /dev/null @@ -1,5 +0,0 @@ -describe('auth0', () => { - it('updates the auth0 file', async () => { - await matchTransformSnapshot('updateAuth0', 'default') - }) -}) diff --git a/packages/codemods/src/codemods/v5.x.x/updateAuth0/__testfixtures__/default.input.js b/packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/__testfixtures__/default.input.js similarity index 100% rename from packages/codemods/src/codemods/v5.x.x/updateAuth0/__testfixtures__/default.input.js rename to packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/__testfixtures__/default.input.js diff --git a/packages/codemods/src/codemods/v5.x.x/updateAuth0/__testfixtures__/default.output.js b/packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/__testfixtures__/default.output.js similarity index 100% rename from packages/codemods/src/codemods/v5.x.x/updateAuth0/__testfixtures__/default.output.js rename to packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/__testfixtures__/default.output.js diff --git a/packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/__tests__/updateAuth0ToV2.test.ts b/packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/__tests__/updateAuth0ToV2.test.ts new file mode 100644 index 000000000000..4fb382a28ed1 --- /dev/null +++ b/packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/__tests__/updateAuth0ToV2.test.ts @@ -0,0 +1,5 @@ +describe('updateAuth0ToV2', () => { + it('updates the web-side auth file to the v2 SDK', async () => { + await matchTransformSnapshot('updateAuth0ToV2', 'default') + }) +}) diff --git a/packages/codemods/src/codemods/v5.x.x/updateAuth0/updateAuth0.ts b/packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.ts similarity index 100% rename from packages/codemods/src/codemods/v5.x.x/updateAuth0/updateAuth0.ts rename to packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.ts diff --git a/packages/codemods/src/codemods/v5.x.x/updateAuth0/updateAuth0.yargs.ts b/packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.yargs.ts similarity index 73% rename from packages/codemods/src/codemods/v5.x.x/updateAuth0/updateAuth0.yargs.ts rename to packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.yargs.ts index a4da0c73c0f3..0fc710584a65 100644 --- a/packages/codemods/src/codemods/v5.x.x/updateAuth0/updateAuth0.yargs.ts +++ b/packages/codemods/src/codemods/v5.x.x/updateAuth0ToV2/updateAuth0ToV2.yargs.ts @@ -1,18 +1,19 @@ import path from 'path' import execa from 'execa' -import task, { TaskInnerAPI } from 'tasuku' +import task from 'tasuku' import getRWPaths from '../../../lib/getRWPaths' import isTSProject from '../../../lib/isTSProject' import runTransform from '../../../lib/runTransform' -export const command = 'update-auth0' +export const command = 'update-auth0-to-v2' + export const description = - '(v4.x.x->v5.x.x) For Auth0 users; updates the web-side auth.ts,js file' + '(v4.x.x->v5.x.x) Updates the web-side auth.{ts,js} file to the v2 SDK' export const handler = () => { - task('Update Auth0', async ({ setOutput }: TaskInnerAPI) => { + task('Updating Auth0 to v2', async ({ setOutput }) => { const authFile = isTSProject ? 'auth.ts' : 'auth.js' try { @@ -26,7 +27,7 @@ export const handler = () => { } await runTransform({ - transformPath: path.join(__dirname, 'updateAuth0.js'), + transformPath: path.join(__dirname, 'updateAuth0ToV2.js'), targetPaths: [path.join(getRWPaths().web.src, authFile)], }) diff --git a/packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/README.md b/packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/README.md new file mode 100644 index 000000000000..b3709f9b289e --- /dev/null +++ b/packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/README.md @@ -0,0 +1,3 @@ +# Update Node Engine to 18 + +This codemod updates the `engines.node` key in a project's root `package.json` to `"=18.x"`. diff --git a/packages/codemods/src/codemods/v5.x.x/updateNodeEngines/updateNodeEngines.ts b/packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.ts similarity index 80% rename from packages/codemods/src/codemods/v5.x.x/updateNodeEngines/updateNodeEngines.ts rename to packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.ts index cd9f31e47bad..51eadc279789 100644 --- a/packages/codemods/src/codemods/v5.x.x/updateNodeEngines/updateNodeEngines.ts +++ b/packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.ts @@ -3,13 +3,13 @@ import path from 'path' import getRWPaths from '../../../lib/getRWPaths' -async function updateNodeEngines() { +async function updateNodeEngineTo18() { const packageJSONPath = path.join(getRWPaths().base, 'package.json') - const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf8')) + const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8')) packageJSON.engines.node = '=18.x' fs.writeFileSync(packageJSONPath, JSON.stringify(packageJSON, null, 2)) } -export { updateNodeEngines } +export { updateNodeEngineTo18 } diff --git a/packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.yargs.ts b/packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.yargs.ts new file mode 100644 index 000000000000..bfde2d9e918e --- /dev/null +++ b/packages/codemods/src/codemods/v5.x.x/updateNodeEngineTo18/updateNodeEngineTo18.yargs.ts @@ -0,0 +1,21 @@ +import task from 'tasuku' + +import { updateNodeEngineTo18 } from './updateNodeEngineTo18' + +export const command = 'update-node-engine-to-18' + +export const description = + '(v4.x.x->v5.x.x) Updates `engines.node` to `"=18.x"` in your project\'s root package.json' + +export const handler = () => { + task( + 'Updating `engines.node` to `"=18.x"` in root package.json', + async ({ setError }) => { + try { + await updateNodeEngineTo18() + } catch (e: any) { + setError('Failed to codemod your project \n' + e?.message) + } + } + ) +} diff --git a/packages/codemods/src/codemods/v5.x.x/updateNodeEngines/README.md b/packages/codemods/src/codemods/v5.x.x/updateNodeEngines/README.md deleted file mode 100644 index d2e7f21a22ae..000000000000 --- a/packages/codemods/src/codemods/v5.x.x/updateNodeEngines/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Update Node Engines - - diff --git a/packages/codemods/src/codemods/v5.x.x/updateNodeEngines/updateNodeEngines.yargs.ts b/packages/codemods/src/codemods/v5.x.x/updateNodeEngines/updateNodeEngines.yargs.ts deleted file mode 100644 index ffef3a20208e..000000000000 --- a/packages/codemods/src/codemods/v5.x.x/updateNodeEngines/updateNodeEngines.yargs.ts +++ /dev/null @@ -1,18 +0,0 @@ -import task from 'tasuku' - -import { updateNodeEngines } from './updateNodeEngines' - -export const command = 'update-node-engines' - -export const description = - '(v5.x.x->v5.x.x) Changes the structure of your Redwood Project' - -export const handler = () => { - task('Update Node Engines', async ({ setError }: TaskInnerApi) => { - try { - await updateNodeEngines() - } catch (e: any) { - setError('Failed to codemod your project \n' + e?.message) - } - }) -} diff --git a/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.ts b/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.ts index a50b3a6efd6c..08cf9ef26c5a 100644 --- a/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.ts +++ b/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.ts @@ -37,7 +37,7 @@ function checkAndTransformReactRoot(taskContext: TaskInnerAPI) { '', reactRootHTML, '', - 'React expects to control this DOM node completely. This codemod has moved the children outside the react root', + 'React expects to control this DOM node completely. This codemod has moved the children outside the react root,', 'but consider moving them into a layout.', ].join('\n') ) diff --git a/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.ts b/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.ts index a536545a1b88..b3ea3197280f 100644 --- a/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.ts +++ b/packages/codemods/src/codemods/v5.x.x/upgradeToReact18/upgradeToReact18.yargs.ts @@ -7,7 +7,8 @@ import { export const command = 'upgrade-to-react-18' -export const description = '(v4.x.x->v5.0.0) Upgrade to React 18' +export const description = + '(v4.x.x->v5.0.0) Upgrades a project to React 18 and checks the react root' export const handler = () => { task('Check and transform react root', async (taskContext) => {