You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/next-codemod/bin/next-codemod.ts
+1-10Lines changed: 1 addition & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -58,18 +58,9 @@ program
58
58
.description(
59
59
'Upgrade Next.js apps to desired versions with a single command.'
60
60
)
61
-
// The CLI interface must be backwards compatible at all times so that older
62
-
// versions of Next.js can still run the codemod successfully.
63
61
.argument(
64
62
'[revision]',
65
-
'Specify the target Next.js version using an NPM dist tag (e.g. "latest", "canary", "rc", "beta") or an exact version number (e.g. "15.0.0").',
66
-
packageJson.version.includes('-canary.')
67
-
? 'canary'
68
-
: packageJson.version.includes('-rc.')
69
-
? 'rc'
70
-
: packageJson.version.includes('-beta.')
71
-
? 'beta'
72
-
: 'latest'
63
+
'Specify the upgrade type ("patch", "minor", "major"), an NPM dist tag (e.g. "latest", "canary", "rc"), or an exact version (e.g. "15.0.0"). Defaults to "minor".'
@@ -109,12 +172,10 @@ export async function runUpgrade(
109
172
'peerDependencies'intargetNextPackageJson
110
173
if(!validRevision){
111
174
thrownewBadInput(
112
-
`Invalid revision provided: "${revision}". Please provide a valid Next.js version or dist-tag (e.g. "latest", "canary", "beta", "rc", or "15.0.0").\nCheck available versions at https://www.npmjs.com/package/next?activeTab=versions.`
175
+
`Invalid revision provided: "${revision??'minor'}" (resolved to "${resolvedRevision}"). Please provide a valid Next.js version, dist-tag (e.g. "latest", "canary", "rc"), or upgrade type ("patch", "minor", "major").\nCheck available versions at https://www.npmjs.com/package/next?activeTab=versions.`
0 commit comments