Skip to content

Commit 029e504

Browse files
teetanghclaude
andauthored
chore: upgrade dependencies and fix compatibility issues (#184)
## Major Changes - Upgrade Zod 3.24.2 → 4.1.13 (breaking changes handled) - Upgrade Vitest 3.0.8 → 4.0.14 - Upgrade Vite 6.2.1 → 7.2.6 - Downgrade Tailwind CSS to v3.4.18 (v4 requires significant migration) - Add missing server-only dependency ## Next.js 15 Compatibility Fixes - Update route handlers to use async params (Next.js 15 breaking change) - Update next.config.mjs: experimental.serverComponentsExternalPackages → serverExternalPackages - Remove obsolete build script polyfill reference ## Zod 4 Migration - Replace error.errors with error.issues throughout codebase - Update type imports in route handlers ## Other Upgrades - @ianvs/prettier-plugin-sort-imports 4.4.1 → 4.7.0 - @radix-ui/react-slot 1.1.2 → 1.2.4 - @typescript-eslint/parser 8.26.1 → 8.48.1 - autoprefixer 10.4.21 → 10.4.22 - chalk 5.4.1 → 5.6.2 - couchbase 4.4.5 → 4.6.0 - dotenv 16.4.7 → 17.2.3 - eslint 9.22.0 → 9.39.1 - eslint-config-prettier 10.1.1 → 10.1.8 - eslint-plugin-react 7.37.4 → 7.37.5 - lucide-react 0.482.0 → 0.555.0 - postcss 8.5.3 → 8.5.6 - prettier 3.5.3 → 3.7.3 - sharp 0.33.5 → 0.34.5 - swagger-ui-react 5.20.1 → 5.30.3 - tailwind-merge 3.0.2 → 3.4.0 - typescript 5.8.2 → 5.9.3 ## Kept at Current Versions - React 18.3.1 (avoided React 19 for stability) - Next.js 15.2.2 (stayed on 15.x for stability) - @types/node 22.13.10 (matches Node 22 LTS) ## Verification - ✅ All 44 integration tests passing - ✅ Build successful - ✅ No security vulnerabilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent cfb8f9d commit 029e504

File tree

9 files changed

+81
-67
lines changed

9 files changed

+81
-67
lines changed

app/api/v1/airline/[airlineId]/route.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ import { AirlineSchema, TAirline } from "@/app/models/Airline"
4444
*/
4545
export async function GET(
4646
req: NextRequest,
47-
{ params }: { params: { airlineId: string } }
47+
{ params }: { params: Promise<{ airlineId: string }> }
4848
) {
4949
try {
50-
const { airlineId } = params
50+
const { airlineId } = await params
5151
const { airlineCollection } = await getDatabase()
5252

5353
const airline = await airlineCollection.get(airlineId)
@@ -117,10 +117,10 @@ export async function GET(
117117
*/
118118
export async function POST(
119119
req: NextRequest,
120-
{ params }: { params: { airlineId: string } }
120+
{ params }: { params: Promise<{ airlineId: string }> }
121121
) {
122122
try {
123-
const { airlineId } = params
123+
const { airlineId } = await params
124124
const airlineData: TAirline = await req.json()
125125
const parsedAirlineData = AirlineSchema.parse(airlineData)
126126
const { airlineCollection } = await getDatabase()
@@ -142,7 +142,7 @@ export async function POST(
142142
return NextResponse.json(
143143
{
144144
message: "Invalid request body",
145-
error: error.errors,
145+
error: error.issues,
146146
},
147147
{ status: 400 }
148148
)
@@ -203,10 +203,10 @@ export async function POST(
203203
*/
204204
export async function PUT(
205205
req: NextRequest,
206-
{ params }: { params: { airlineId: string } }
206+
{ params }: { params: Promise<{ airlineId: string }> }
207207
) {
208208
try {
209-
const { airlineId } = params
209+
const { airlineId } = await params
210210
const airlineData: TAirline = await req.json()
211211
const parsedAirlineData = AirlineSchema.parse(airlineData)
212212
const { airlineCollection } = await getDatabase()
@@ -217,7 +217,7 @@ export async function PUT(
217217

218218
if (error instanceof ZodError) {
219219
return NextResponse.json(
220-
{ message: "Invalid request body", error: error.errors },
220+
{ message: "Invalid request body", error: error.issues },
221221
{ status: 400 }
222222
)
223223
} else {
@@ -267,10 +267,10 @@ export async function PUT(
267267
*/
268268
export async function DELETE(
269269
req: NextRequest,
270-
{ params }: { params: { airlineId: string } }
270+
{ params }: { params: Promise<{ airlineId: string }> }
271271
) {
272272
try {
273-
const { airlineId } = params
273+
const { airlineId } = await params
274274
const { airlineCollection } = await getDatabase()
275275

276276
await airlineCollection.remove(airlineId)

app/api/v1/airport/[airportId]/route.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ import { AirportSchema, TAirport } from "@/app/models/Airport"
4444
*/
4545
export async function GET(
4646
req: NextRequest,
47-
{ params }: { params: { airportId: string } }
47+
{ params }: { params: Promise<{ airportId: string }> }
4848
) {
4949
try {
50-
const { airportId } = params
50+
const { airportId } = await params
5151
const { airportCollection } = await getDatabase()
5252

5353
const airport = await airportCollection.get(airportId)
@@ -118,10 +118,10 @@ export async function GET(
118118
*/
119119
export async function POST(
120120
req: NextRequest,
121-
{ params }: { params: { airportId: string } }
121+
{ params }: { params: Promise<{ airportId: string }> }
122122
) {
123123
try {
124-
const { airportId } = params
124+
const { airportId } = await params
125125
const airportData: TAirport = await req.json()
126126
const parsedAirportData = AirportSchema.parse(airportData)
127127
const { airportCollection } = await getDatabase()
@@ -142,7 +142,7 @@ export async function POST(
142142
return NextResponse.json(
143143
{
144144
message: "Invalid request body",
145-
error: error.errors,
145+
error: error.issues,
146146
},
147147
{ status: 400 }
148148
)
@@ -202,10 +202,10 @@ export async function POST(
202202
*/
203203
export async function PUT(
204204
req: NextRequest,
205-
{ params }: { params: { airportId: string } }
205+
{ params }: { params: Promise<{ airportId: string }> }
206206
) {
207207
try {
208-
const { airportId } = params
208+
const { airportId } = await params
209209
const airportData: TAirport = await req.json()
210210
const parsedAirportData = AirportSchema.parse(airportData)
211211
const { airportCollection } = await getDatabase()
@@ -216,7 +216,7 @@ export async function PUT(
216216

217217
if (error instanceof ZodError) {
218218
return NextResponse.json(
219-
{ message: "Invalid request body", error: error.errors },
219+
{ message: "Invalid request body", error: error.issues },
220220
{ status: 400 }
221221
)
222222
} else {
@@ -265,10 +265,10 @@ export async function PUT(
265265
*/
266266
export async function DELETE(
267267
req: NextRequest,
268-
{ params }: { params: { airportId: string } }
268+
{ params }: { params: Promise<{ airportId: string }> }
269269
) {
270270
try {
271-
const { airportId } = params
271+
const { airportId } = await params
272272
const { airportCollection } = await getDatabase()
273273

274274
await airportCollection.remove(airportId)

app/api/v1/hotel/filter/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export async function GET(req: NextRequest) {
185185
// } catch (error) {
186186
// if (error instanceof z.ZodError) {
187187
// return NextResponse.json(
188-
// { error: 'Invalid request parameters', message: error.errors },
188+
// { error: 'Invalid request parameters', message: error.issues },
189189
// { status: 400 }
190190
// );
191191
// }

app/api/v1/route/[routeId]/route.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ import { RouteSchema, TRoute } from "@/app/models/Route"
4444
*/
4545
export async function GET(
4646
req: NextRequest,
47-
{ params }: { params: { routeId: string } }
47+
{ params }: { params: Promise<{ routeId: string }> }
4848
) {
4949
try {
50-
const { routeId } = params
50+
const { routeId } = await params
5151
const { routeCollection } = await getDatabase()
5252

5353
const route = await routeCollection.get(routeId)
@@ -117,10 +117,10 @@ export async function GET(
117117
*/
118118
export async function POST(
119119
req: NextRequest,
120-
{ params }: { params: { routeId: string } }
120+
{ params }: { params: Promise<{ routeId: string }> }
121121
) {
122122
try {
123-
const { routeId } = params
123+
const { routeId } = await params
124124
const routeData: TRoute = await req.json()
125125
const parsedRouteData = RouteSchema.parse(routeData)
126126

@@ -142,7 +142,7 @@ export async function POST(
142142
return NextResponse.json(
143143
{
144144
message: "Invalid request body",
145-
error: error.errors,
145+
error: error.issues,
146146
},
147147
{ status: 400 }
148148
)
@@ -202,10 +202,10 @@ export async function POST(
202202
*/
203203
export async function PUT(
204204
req: NextRequest,
205-
{ params }: { params: { routeId: string } }
205+
{ params }: { params: Promise<{ routeId: string }> }
206206
) {
207207
try {
208-
const { routeId } = params
208+
const { routeId } = await params
209209
const routeData: TRoute = await req.json()
210210
const parsedRouteData = RouteSchema.parse(routeData)
211211
const { routeCollection } = await getDatabase()
@@ -216,7 +216,7 @@ export async function PUT(
216216

217217
if (error instanceof ZodError) {
218218
return NextResponse.json(
219-
{ message: "Invalid request body", error: error.errors },
219+
{ message: "Invalid request body", error: error.issues },
220220
{ status: 400 }
221221
)
222222
} else {
@@ -265,10 +265,10 @@ export async function PUT(
265265
*/
266266
export async function DELETE(
267267
req: NextRequest,
268-
{ params }: { params: { routeId: string } }
268+
{ params }: { params: Promise<{ routeId: string }> }
269269
) {
270270
try {
271-
const { routeId } = params
271+
const { routeId } = await params
272272
const { routeCollection } = await getDatabase()
273273

274274
await routeCollection.remove(routeId)

components/theme-provider.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use client"
22

33
import * as React from "react"
4-
import { ThemeProvider as NextThemesProvider } from "next-themes"
5-
import { ThemeProviderProps } from "next-themes/dist/types"
4+
import { ThemeProvider as NextThemesProvider, type ThemeProviderProps } from "next-themes"
65

76
export function ThemeProvider({ children, ...props }: Readonly<ThemeProviderProps>) {
87
return <NextThemesProvider {...props}>{children}</NextThemesProvider>

next-env.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
34

45
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
6+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

next.config.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const nextConfig = {
1313
"swagger-client",
1414
"swagger-ui-react",
1515
],
16-
experimental: {
17-
serverComponentsExternalPackages: ["couchbase"],
18-
},
16+
serverExternalPackages: ["couchbase"],
1917
}
2018

2119
export default nextConfig

package.json

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.2",
44
"private": true,
55
"scripts": {
6-
"build": "node --require ./pollyfills/pollyfill.ts ./node_modules/.bin/next build",
6+
"build": "next build",
77
"dev": "next dev",
88
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache",
99
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
@@ -16,45 +16,46 @@
1616
"test:coverage": "vitest --coverage"
1717
},
1818
"dependencies": {
19-
"@radix-ui/react-slot": "^1.1.2",
20-
"chalk": "^5.4.1",
19+
"@radix-ui/react-slot": "^1.2.4",
20+
"chalk": "^5.6.2",
2121
"class-variance-authority": "^0.7.1",
2222
"clsx": "^2.1.1",
23-
"couchbase": "^4.4.5",
24-
"dotenv": "^16.4.7",
25-
"lucide-react": "^0.482.0",
23+
"couchbase": "^4.6.0",
24+
"dotenv": "^17.2.3",
25+
"lucide-react": "^0.555.0",
2626
"next": "^15.2.2",
2727
"next-swagger-doc": "^0.4.1",
2828
"next-themes": "^0.4.6",
2929
"openapi-types": "^12.1.3",
3030
"react": "^18.3.1",
3131
"react-dom": "^18.3.1",
32-
"sharp": "^0.33.5",
33-
"swagger-ui-react": "^5.20.1",
34-
"tailwind-merge": "^3.0.2",
32+
"server-only": "^0.0.1",
33+
"sharp": "^0.34.5",
34+
"swagger-ui-react": "^5.30.3",
35+
"tailwind-merge": "^3.4.0",
3536
"tailwindcss-animate": "^1.0.7",
36-
"zod": "^3.24.2"
37+
"zod": "^4.1.13"
3738
},
3839
"devDependencies": {
39-
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
40+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
4041
"@types/node": "^22.13.10",
41-
"@types/react": "^18.2.64",
42-
"@types/react-dom": "^18.2.21",
42+
"@types/react": "^18.3.18",
43+
"@types/react-dom": "^18.3.5",
4344
"@types/swagger-ui-react": "^5.18.0",
44-
"@typescript-eslint/parser": "^8.26.1",
45-
"@vitest/coverage-v8": "^3.0.8",
46-
"autoprefixer": "^10.4.21",
47-
"eslint": "^9.22.0",
45+
"@typescript-eslint/parser": "^8.48.1",
46+
"@vitest/coverage-v8": "^4.0.14",
47+
"autoprefixer": "^10.4.22",
48+
"eslint": "^9.39.1",
4849
"eslint-config-next": "15.2.2",
49-
"eslint-config-prettier": "^10.1.1",
50-
"eslint-plugin-react": "^7.37.4",
50+
"eslint-config-prettier": "^10.1.8",
51+
"eslint-plugin-react": "^7.37.5",
5152
"eslint-plugin-tailwindcss": "^4.0.0-alpha.0",
52-
"postcss": "^8.5.3",
53-
"prettier": "^3.5.3",
54-
"tailwindcss": "^4.0.13",
55-
"typescript": "^5.8.2",
56-
"vite": "^6.2.1",
53+
"postcss": "^8.5.6",
54+
"prettier": "^3.7.3",
55+
"tailwindcss": "^3.4.18",
56+
"typescript": "^5.9.3",
57+
"vite": "^7.2.6",
5758
"vite-tsconfig-paths": "^5.1.4",
58-
"vitest": "^3.0.8"
59+
"vitest": "^4.0.14"
5960
}
6061
}

tsconfig.json

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"compilerOptions": {
3-
"lib": ["dom", "dom.iterable", "esnext"],
3+
"lib": [
4+
"dom",
5+
"dom.iterable",
6+
"esnext"
7+
],
48
"allowJs": true,
59
"skipLibCheck": true,
610
"strict": true,
@@ -15,15 +19,26 @@
1519
"jsx": "preserve",
1620
"baseUrl": ".",
1721
"paths": {
18-
"@/*": ["./*"]
22+
"@/*": [
23+
"./*"
24+
]
1925
},
2026
"plugins": [
2127
{
2228
"name": "next"
2329
}
2430
],
25-
"strictNullChecks": true
31+
"strictNullChecks": true,
32+
"target": "ES2017"
2633
},
27-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "vite.config.mts"],
28-
"exclude": ["node_modules"]
34+
"include": [
35+
"next-env.d.ts",
36+
"**/*.ts",
37+
"**/*.tsx",
38+
".next/types/**/*.ts",
39+
"vite.config.mts"
40+
],
41+
"exclude": [
42+
"node_modules"
43+
]
2944
}

0 commit comments

Comments
 (0)