From 4375f7b301f662645dafc54e21df5e9e0c2de4d1 Mon Sep 17 00:00:00 2001 From: Prakhar Shukla Date: Tue, 22 Oct 2024 09:56:03 +0530 Subject: [PATCH 1/3] handle absence of dev script in upgrade codemod --- packages/next-codemod/bin/upgrade.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-codemod/bin/upgrade.ts b/packages/next-codemod/bin/upgrade.ts index c928eeed47055..feaae6f89466f 100644 --- a/packages/next-codemod/bin/upgrade.ts +++ b/packages/next-codemod/bin/upgrade.ts @@ -410,7 +410,7 @@ function isUsingAppDir(projectPath: string): boolean { */ async function suggestTurbopack(packageJson: any): Promise { const devScript: string = packageJson.scripts['dev'] - if (devScript.includes('--turbo')) return + if (devScript && devScript.includes('--turbo')) return const responseTurbopack = await prompts( { From d0ce9cc9977ff792ed90d4b8d15d629b07b68881 Mon Sep 17 00:00:00 2001 From: Jiwon Choi Date: Wed, 23 Oct 2024 15:50:01 +0900 Subject: [PATCH 2/3] is `--turbopack` --- packages/next-codemod/bin/upgrade.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-codemod/bin/upgrade.ts b/packages/next-codemod/bin/upgrade.ts index c233fcb6e73ac..1bec78707cb68 100644 --- a/packages/next-codemod/bin/upgrade.ts +++ b/packages/next-codemod/bin/upgrade.ts @@ -412,7 +412,7 @@ function isUsingAppDir(projectPath: string): boolean { */ async function suggestTurbopack(packageJson: any): Promise { const devScript: string = packageJson.scripts['dev'] - if (devScript && devScript.includes('--turbo')) return + if (devScript && devScript.includes('--turbopack')) return const responseTurbopack = await prompts( { From d8ae326bc9c087f5fe306c280611502b9e6d5857 Mon Sep 17 00:00:00 2001 From: Jiwon Choi Date: Wed, 23 Oct 2024 15:51:28 +0900 Subject: [PATCH 3/3] use optional catch --- packages/next-codemod/bin/upgrade.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-codemod/bin/upgrade.ts b/packages/next-codemod/bin/upgrade.ts index 1bec78707cb68..973a1ff7c941b 100644 --- a/packages/next-codemod/bin/upgrade.ts +++ b/packages/next-codemod/bin/upgrade.ts @@ -412,7 +412,7 @@ function isUsingAppDir(projectPath: string): boolean { */ async function suggestTurbopack(packageJson: any): Promise { const devScript: string = packageJson.scripts['dev'] - if (devScript && devScript.includes('--turbopack')) return + if (devScript?.includes('--turbopack')) return const responseTurbopack = await prompts( {