Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
365f1d1d
Unverified
Commit
365f1d1d
authored
Oct 14, 2024
by
Jiachi Liu
Committed by
GitHub
Oct 14, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codemod: prettier the version logging at the beginning (#71264)
parent
f847daef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
upgrade.ts
packages/next-codemod/bin/upgrade.ts
+5
-5
No files found.
packages/next-codemod/bin/upgrade.ts
View file @
365f1d1d
...
@@ -81,9 +81,6 @@ export async function runUpgrade(
...
@@ -81,9 +81,6 @@ export async function runUpgrade(
const
installedNextVersion
=
getInstalledNextVersion
()
const
installedNextVersion
=
getInstalledNextVersion
()
// Align the prefix spaces
console
.
log
(
` Current Next.js version: v
${
installedNextVersion
}
`
)
const
targetNextVersion
=
targetNextPackageJson
.
version
const
targetNextVersion
=
targetNextPackageJson
.
version
if
(
compareVersions
(
installedNextVersion
,
targetNextVersion
)
===
0
)
{
if
(
compareVersions
(
installedNextVersion
,
targetNextVersion
)
===
0
)
{
...
@@ -102,7 +99,10 @@ export async function runUpgrade(
...
@@ -102,7 +99,10 @@ export async function runUpgrade(
}
}
const
installedReactVersion
=
getInstalledReactVersion
()
const
installedReactVersion
=
getInstalledReactVersion
()
console
.
log
(
`Current React version: v
${
installedReactVersion
}
`
)
// Align the prefix spaces
console
.
log
(
` Detected installed versions:`
)
console
.
log
(
` - React: v
${
installedReactVersion
}
`
)
console
.
log
(
` - Next.js: v
${
installedNextVersion
}
`
)
let
shouldStayOnReact18
=
false
let
shouldStayOnReact18
=
false
if
(
if
(
// From release v14.3.0-canary.45, Next.js expects the React version to be 19.0.0-beta.0
// From release v14.3.0-canary.45, Next.js expects the React version to be 19.0.0-beta.0
...
@@ -230,6 +230,7 @@ export async function runUpgrade(
...
@@ -230,6 +230,7 @@ export async function runUpgrade(
{
stdio
:
'inherit'
}
{
stdio
:
'inherit'
}
)
)
}
}
if
(
shouldRunReactTypesCodemods
)
{
if
(
shouldRunReactTypesCodemods
)
{
// https://react.dev/blog/2024/04/25/react-19-upgrade-guide#typescript-changes
// https://react.dev/blog/2024/04/25/react-19-upgrade-guide#typescript-changes
// `--yes` skips prompts and applies all codemods automatically
// `--yes` skips prompts and applies all codemods automatically
...
@@ -238,7 +239,6 @@ export async function runUpgrade(
...
@@ -238,7 +239,6 @@ export async function runUpgrade(
stdio
:
'inherit'
,
stdio
:
'inherit'
,
})
})
}
}
console
.
log
()
// new line
console
.
log
()
// new line
if
(
codemods
.
length
>
0
)
{
if
(
codemods
.
length
>
0
)
{
console
.
log
(
`
${
pc
.
green
(
'✔'
)}
Codemods have been applied successfully.`
)
console
.
log
(
`
${
pc
.
green
(
'✔'
)}
Codemods have been applied successfully.`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment