-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
next-upgrade: prompt (un)install only when there's a change (#71308)
### Why? When running next-upgrade, `next-request-geo-ip` requires to install `@vercel/functions` and `built-in-next-font` makes `@next/font` no longer needed. We added a prompt to ask user whether to (un)install it at #71038 but it prompts even if there were no transform occurred. This is unnecessary layer so we only prompt when there's a change caused from the codemod. ### No Modification https://github.com/user-attachments/assets/3acfdb24-c8e7-4189-9c81-4765ce748822 ### With Modification https://github.com/user-attachments/assets/f44a8b1c-c75a-4446-afc8-f74111de939d ---------
- Loading branch information
1 parent
19e2edc
commit 26a2bab
Showing
10 changed files
with
138 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/next-codemod/bin/__testfixtures__/geo-ip-usage/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Installs `@vercel/functions` |
8 changes: 8 additions & 0 deletions
8
packages/next-codemod/bin/__testfixtures__/geo-ip-usage/app/route.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// @ts-nocheck | ||
import { type NextRequest, NextResponse } from 'next/server' | ||
|
||
export function GET(request: NextRequest) { | ||
const geo = request.geo | ||
const ip = request.ip | ||
return NextResponse.json({ geo, ip }) | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/next-codemod/bin/__testfixtures__/geo-ip-usage/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "geo-ip-usage", | ||
"scripts": { | ||
"dev": "next dev --turbo" | ||
}, | ||
"dependencies": { | ||
"next": "15.0.0-canary.152", | ||
"react": "19.0.0-rc-94e652d5-20240912", | ||
"react-dom": "19.0.0-rc-94e652d5-20240912" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/next-codemod/bin/__testfixtures__/no-geo-ip-usage/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Should not install `@vercel/functions` |
3 changes: 3 additions & 0 deletions
3
packages/next-codemod/bin/__testfixtures__/no-geo-ip-usage/app/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page() { | ||
return null | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/next-codemod/bin/__testfixtures__/no-geo-ip-usage/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "no-geo-ip-usage", | ||
"scripts": { | ||
"dev": "next dev --turbo" | ||
}, | ||
"dependencies": { | ||
"next": "15.0.0-canary.152", | ||
"react": "19.0.0-rc-94e652d5-20240912", | ||
"react-dom": "19.0.0-rc-94e652d5-20240912" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.