create-plasmic-app 0.0.147 → 0.0.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cpa-out/.gitignore +1 -0
- package/cpa-out/nextjs-app-codegen-js/next.config.mjs +7 -0
- package/cpa-out/nextjs-app-codegen-js/package.json +6 -6
- package/cpa-out/nextjs-app-codegen-ts/next.config.ts +8 -0
- package/cpa-out/nextjs-app-codegen-ts/package.json +8 -8
- package/cpa-out/nextjs-app-codegen-ts/tsconfig.json +10 -2
- package/cpa-out/nextjs-app-loader-js/app/layout.js +8 -11
- package/cpa-out/nextjs-app-loader-js/next.config.mjs +6 -0
- package/cpa-out/nextjs-app-loader-js/package.json +6 -6
- package/cpa-out/nextjs-app-loader-ts/app/layout.tsx +8 -11
- package/cpa-out/nextjs-app-loader-ts/next.config.ts +7 -0
- package/cpa-out/nextjs-app-loader-ts/package.json +8 -8
- package/cpa-out/nextjs-app-loader-ts/tsconfig.json +10 -2
- package/cpa-out/nextjs-pages-codegen-js/next.config.mjs +7 -0
- package/cpa-out/nextjs-pages-codegen-js/package.json +6 -6
- package/cpa-out/nextjs-pages-codegen-ts/next.config.ts +8 -0
- package/cpa-out/nextjs-pages-codegen-ts/package.json +8 -8
- package/cpa-out/nextjs-pages-codegen-ts/tsconfig.json +10 -2
- package/cpa-out/nextjs-pages-loader-js/next.config.mjs +7 -0
- package/cpa-out/nextjs-pages-loader-js/package.json +6 -6
- package/cpa-out/nextjs-pages-loader-ts/next.config.ts +8 -0
- package/cpa-out/nextjs-pages-loader-ts/package.json +8 -8
- package/cpa-out/nextjs-pages-loader-ts/tsconfig.json +10 -2
- package/dist/nextjs/nextjs.js +9 -10
- package/package.json +2 -2
- package/src/nextjs/nextjs.ts +11 -11
package/cpa-out/.gitignore
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
"dev": "next dev",
|
|
7
7
|
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "eslint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@plasmicapp/cli": "^0.1.361",
|
|
13
13
|
"@plasmicapp/react-web": "^1.0.8",
|
|
14
|
-
"next": "
|
|
15
|
-
"react": "
|
|
16
|
-
"react-dom": "
|
|
14
|
+
"next": "16.2.6",
|
|
15
|
+
"react": "19.2.4",
|
|
16
|
+
"react-dom": "19.2.4"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"eslint": "^
|
|
20
|
-
"eslint-config-next": "
|
|
19
|
+
"eslint": "^9",
|
|
20
|
+
"eslint-config-next": "16.2.6"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
"dev": "next dev",
|
|
7
7
|
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "eslint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@plasmicapp/cli": "^0.1.361",
|
|
13
13
|
"@plasmicapp/react-web": "^1.0.8",
|
|
14
|
-
"next": "
|
|
15
|
-
"react": "
|
|
16
|
-
"react-dom": "
|
|
14
|
+
"next": "16.2.6",
|
|
15
|
+
"react": "19.2.4",
|
|
16
|
+
"react-dom": "19.2.4"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "^20",
|
|
20
|
-
"@types/react": "^
|
|
21
|
-
"@types/react-dom": "^
|
|
22
|
-
"eslint": "^
|
|
23
|
-
"eslint-config-next": "
|
|
20
|
+
"@types/react": "^19",
|
|
21
|
+
"@types/react-dom": "^19",
|
|
22
|
+
"eslint": "^9",
|
|
23
|
+
"eslint-config-next": "16.2.6",
|
|
24
24
|
"typescript": "^5"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
3
4
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
5
|
"allowJs": true,
|
|
5
6
|
"skipLibCheck": true,
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
"moduleResolution": "bundler",
|
|
11
12
|
"resolveJsonModule": true,
|
|
12
13
|
"isolatedModules": true,
|
|
13
|
-
"jsx": "
|
|
14
|
+
"jsx": "react-jsx",
|
|
14
15
|
"incremental": true,
|
|
15
16
|
"plugins": [
|
|
16
17
|
{
|
|
@@ -21,6 +22,13 @@
|
|
|
21
22
|
"@/*": ["./*"]
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
|
-
"include": [
|
|
25
|
+
"include": [
|
|
26
|
+
"next-env.d.ts",
|
|
27
|
+
"**/*.ts",
|
|
28
|
+
"**/*.tsx",
|
|
29
|
+
".next/types/**/*.ts",
|
|
30
|
+
".next/dev/types/**/*.ts",
|
|
31
|
+
"**/*.mts"
|
|
32
|
+
],
|
|
25
33
|
"exclude": ["node_modules"]
|
|
26
34
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
2
2
|
import "./globals.css";
|
|
3
3
|
|
|
4
|
-
const geistSans =
|
|
5
|
-
src: "./fonts/GeistVF.woff",
|
|
4
|
+
const geistSans = Geist({
|
|
6
5
|
variable: "--font-geist-sans",
|
|
7
|
-
|
|
6
|
+
subsets: ["latin"],
|
|
8
7
|
});
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
|
|
9
|
+
const geistMono = Geist_Mono({
|
|
11
10
|
variable: "--font-geist-mono",
|
|
12
|
-
|
|
11
|
+
subsets: ["latin"],
|
|
13
12
|
});
|
|
14
13
|
|
|
15
14
|
export const metadata = {
|
|
@@ -19,10 +18,8 @@ export const metadata = {
|
|
|
19
18
|
|
|
20
19
|
export default function RootLayout({ children }) {
|
|
21
20
|
return (
|
|
22
|
-
<html lang="en">
|
|
23
|
-
<body
|
|
24
|
-
{children}
|
|
25
|
-
</body>
|
|
21
|
+
<html lang="en" className={`${geistSans.variable} ${geistMono.variable}`}>
|
|
22
|
+
<body>{children}</body>
|
|
26
23
|
</html>
|
|
27
24
|
);
|
|
28
25
|
}
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
"dev": "next dev",
|
|
7
7
|
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "eslint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@plasmicapp/loader-nextjs": "^2.0.4",
|
|
13
|
-
"next": "
|
|
14
|
-
"react": "
|
|
15
|
-
"react-dom": "
|
|
13
|
+
"next": "16.2.6",
|
|
14
|
+
"react": "19.2.4",
|
|
15
|
+
"react-dom": "19.2.4"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"eslint": "^
|
|
19
|
-
"eslint-config-next": "
|
|
18
|
+
"eslint": "^9",
|
|
19
|
+
"eslint-config-next": "16.2.6"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import type { Metadata } from "next";
|
|
2
|
-
import
|
|
2
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
3
3
|
import "./globals.css";
|
|
4
4
|
|
|
5
|
-
const geistSans =
|
|
6
|
-
src: "./fonts/GeistVF.woff",
|
|
5
|
+
const geistSans = Geist({
|
|
7
6
|
variable: "--font-geist-sans",
|
|
8
|
-
|
|
7
|
+
subsets: ["latin"],
|
|
9
8
|
});
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
const geistMono = Geist_Mono({
|
|
12
11
|
variable: "--font-geist-mono",
|
|
13
|
-
|
|
12
|
+
subsets: ["latin"],
|
|
14
13
|
});
|
|
15
14
|
|
|
16
15
|
export const metadata: Metadata = {
|
|
@@ -24,10 +23,8 @@ export default function RootLayout({
|
|
|
24
23
|
children: React.ReactNode;
|
|
25
24
|
}>) {
|
|
26
25
|
return (
|
|
27
|
-
<html lang="en">
|
|
28
|
-
<body
|
|
29
|
-
{children}
|
|
30
|
-
</body>
|
|
26
|
+
<html lang="en" className={`${geistSans.variable} ${geistMono.variable}`}>
|
|
27
|
+
<body>{children}</body>
|
|
31
28
|
</html>
|
|
32
29
|
);
|
|
33
30
|
}
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
"dev": "next dev",
|
|
7
7
|
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "eslint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@plasmicapp/loader-nextjs": "^2.0.4",
|
|
13
|
-
"next": "
|
|
14
|
-
"react": "
|
|
15
|
-
"react-dom": "
|
|
13
|
+
"next": "16.2.6",
|
|
14
|
+
"react": "19.2.4",
|
|
15
|
+
"react-dom": "19.2.4"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/node": "^20",
|
|
19
|
-
"@types/react": "^
|
|
20
|
-
"@types/react-dom": "^
|
|
21
|
-
"eslint": "^
|
|
22
|
-
"eslint-config-next": "
|
|
19
|
+
"@types/react": "^19",
|
|
20
|
+
"@types/react-dom": "^19",
|
|
21
|
+
"eslint": "^9",
|
|
22
|
+
"eslint-config-next": "16.2.6",
|
|
23
23
|
"typescript": "^5"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
3
4
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
5
|
"allowJs": true,
|
|
5
6
|
"skipLibCheck": true,
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
"moduleResolution": "bundler",
|
|
11
12
|
"resolveJsonModule": true,
|
|
12
13
|
"isolatedModules": true,
|
|
13
|
-
"jsx": "
|
|
14
|
+
"jsx": "react-jsx",
|
|
14
15
|
"incremental": true,
|
|
15
16
|
"plugins": [
|
|
16
17
|
{
|
|
@@ -21,6 +22,13 @@
|
|
|
21
22
|
"@/*": ["./*"]
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
|
-
"include": [
|
|
25
|
+
"include": [
|
|
26
|
+
"next-env.d.ts",
|
|
27
|
+
"**/*.ts",
|
|
28
|
+
"**/*.tsx",
|
|
29
|
+
".next/types/**/*.ts",
|
|
30
|
+
".next/dev/types/**/*.ts",
|
|
31
|
+
"**/*.mts"
|
|
32
|
+
],
|
|
25
33
|
"exclude": ["node_modules"]
|
|
26
34
|
}
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
"dev": "next dev",
|
|
7
7
|
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "eslint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@plasmicapp/cli": "^0.1.361",
|
|
13
13
|
"@plasmicapp/react-web": "^1.0.8",
|
|
14
|
-
"next": "
|
|
15
|
-
"react": "
|
|
16
|
-
"react-dom": "
|
|
14
|
+
"next": "16.2.6",
|
|
15
|
+
"react": "19.2.4",
|
|
16
|
+
"react-dom": "19.2.4"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"eslint": "^
|
|
20
|
-
"eslint-config-next": "
|
|
19
|
+
"eslint": "^9",
|
|
20
|
+
"eslint-config-next": "16.2.6"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
"dev": "next dev",
|
|
7
7
|
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "eslint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@plasmicapp/cli": "^0.1.361",
|
|
13
13
|
"@plasmicapp/react-web": "^1.0.8",
|
|
14
|
-
"next": "
|
|
15
|
-
"react": "
|
|
16
|
-
"react-dom": "
|
|
14
|
+
"next": "16.2.6",
|
|
15
|
+
"react": "19.2.4",
|
|
16
|
+
"react-dom": "19.2.4"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "^20",
|
|
20
|
-
"@types/react": "^
|
|
21
|
-
"@types/react-dom": "^
|
|
22
|
-
"eslint": "^
|
|
23
|
-
"eslint-config-next": "
|
|
20
|
+
"@types/react": "^19",
|
|
21
|
+
"@types/react-dom": "^19",
|
|
22
|
+
"eslint": "^9",
|
|
23
|
+
"eslint-config-next": "16.2.6",
|
|
24
24
|
"typescript": "^5"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
3
4
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
5
|
"allowJs": true,
|
|
5
6
|
"skipLibCheck": true,
|
|
@@ -10,12 +11,19 @@
|
|
|
10
11
|
"moduleResolution": "bundler",
|
|
11
12
|
"resolveJsonModule": true,
|
|
12
13
|
"isolatedModules": true,
|
|
13
|
-
"jsx": "
|
|
14
|
+
"jsx": "react-jsx",
|
|
14
15
|
"incremental": true,
|
|
15
16
|
"paths": {
|
|
16
17
|
"@/*": ["./*"]
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
|
-
"include": [
|
|
20
|
+
"include": [
|
|
21
|
+
"next-env.d.ts",
|
|
22
|
+
"**/*.ts",
|
|
23
|
+
"**/*.tsx",
|
|
24
|
+
".next/types/**/*.ts",
|
|
25
|
+
".next/dev/types/**/*.ts",
|
|
26
|
+
"**/*.mts"
|
|
27
|
+
],
|
|
20
28
|
"exclude": ["node_modules"]
|
|
21
29
|
}
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
"dev": "next dev",
|
|
7
7
|
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "eslint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@plasmicapp/loader-nextjs": "^2.0.4",
|
|
13
|
-
"next": "
|
|
14
|
-
"react": "
|
|
15
|
-
"react-dom": "
|
|
13
|
+
"next": "16.2.6",
|
|
14
|
+
"react": "19.2.4",
|
|
15
|
+
"react-dom": "19.2.4"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"eslint": "^
|
|
19
|
-
"eslint-config-next": "
|
|
18
|
+
"eslint": "^9",
|
|
19
|
+
"eslint-config-next": "16.2.6"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
"dev": "next dev",
|
|
7
7
|
"build": "next build",
|
|
8
8
|
"start": "next start",
|
|
9
|
-
"lint": "
|
|
9
|
+
"lint": "eslint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@plasmicapp/loader-nextjs": "^2.0.4",
|
|
13
|
-
"next": "
|
|
14
|
-
"react": "
|
|
15
|
-
"react-dom": "
|
|
13
|
+
"next": "16.2.6",
|
|
14
|
+
"react": "19.2.4",
|
|
15
|
+
"react-dom": "19.2.4"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/node": "^20",
|
|
19
|
-
"@types/react": "^
|
|
20
|
-
"@types/react-dom": "^
|
|
21
|
-
"eslint": "^
|
|
22
|
-
"eslint-config-next": "
|
|
19
|
+
"@types/react": "^19",
|
|
20
|
+
"@types/react-dom": "^19",
|
|
21
|
+
"eslint": "^9",
|
|
22
|
+
"eslint-config-next": "16.2.6",
|
|
23
23
|
"typescript": "^5"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
3
4
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
5
|
"allowJs": true,
|
|
5
6
|
"skipLibCheck": true,
|
|
@@ -10,12 +11,19 @@
|
|
|
10
11
|
"moduleResolution": "bundler",
|
|
11
12
|
"resolveJsonModule": true,
|
|
12
13
|
"isolatedModules": true,
|
|
13
|
-
"jsx": "
|
|
14
|
+
"jsx": "react-jsx",
|
|
14
15
|
"incremental": true,
|
|
15
16
|
"paths": {
|
|
16
17
|
"@/*": ["./*"]
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
|
-
"include": [
|
|
20
|
+
"include": [
|
|
21
|
+
"next-env.d.ts",
|
|
22
|
+
"**/*.ts",
|
|
23
|
+
"**/*.tsx",
|
|
24
|
+
".next/types/**/*.ts",
|
|
25
|
+
".next/dev/types/**/*.ts",
|
|
26
|
+
"**/*.mts"
|
|
27
|
+
],
|
|
20
28
|
"exclude": ["node_modules"]
|
|
21
29
|
}
|
package/dist/nextjs/nextjs.js
CHANGED
|
@@ -42,8 +42,8 @@ exports.nextjsStrategy = {
|
|
|
42
42
|
? "--app"
|
|
43
43
|
: "--no-app";
|
|
44
44
|
const templateArg = template ? ` --example ${template}` : "";
|
|
45
|
-
//
|
|
46
|
-
const createCommand = `npx create-next-app@
|
|
45
|
+
// NOTE: Not using create-next-app@latest to keep major version bumps deliberate
|
|
46
|
+
const createCommand = `npx create-next-app@16 ${projectPath} ${typescriptArg} ${experimentalAppArg} ${templateArg}` +
|
|
47
47
|
` --eslint --no-src-dir --import-alias "@/*" --no-tailwind`;
|
|
48
48
|
// Default Next.js starter already supports Typescript
|
|
49
49
|
// See where we `touch tsconfig.json` later on
|
|
@@ -60,15 +60,14 @@ exports.nextjsStrategy = {
|
|
|
60
60
|
}
|
|
61
61
|
}),
|
|
62
62
|
overwriteConfig: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
const { projectPath, scheme } = args;
|
|
64
|
-
const nextjsConfigFile = path_1.default.join(projectPath, "next.config.mjs");
|
|
63
|
+
const { projectPath, scheme, jsOrTs } = args;
|
|
65
64
|
if (scheme === "codegen") {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
const isTs = jsOrTs === "ts";
|
|
66
|
+
const typePragma = isTs
|
|
67
|
+
? `import type { NextConfig } from "next";\n\n`
|
|
68
|
+
: `/** @type {import('next').NextConfig} */\n`;
|
|
69
|
+
const typeAnnotation = isTs ? ": NextConfig" : "";
|
|
70
|
+
yield fs_1.promises.writeFile(path_1.default.join(projectPath, `next.config.${isTs ? "ts" : "mjs"}`), `${typePragma}const nextConfig${typeAnnotation} = {
|
|
72
71
|
trailingSlash: true,
|
|
73
72
|
reactStrictMode: true,
|
|
74
73
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-plasmic-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.148",
|
|
4
4
|
"description": "Create Plasmic-powered React apps",
|
|
5
5
|
"main": "./dist/lib.js",
|
|
6
6
|
"types": "./dist/lib.d.ts",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"validate-npm-package-name": "^3.0.0",
|
|
48
48
|
"yargs": "^16.2.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "e7fba8eb70bafe6176256ccbbef135a64f53ed35"
|
|
51
51
|
}
|
package/src/nextjs/nextjs.ts
CHANGED
|
@@ -32,9 +32,9 @@ export const nextjsStrategy: CPAStrategy = {
|
|
|
32
32
|
? "--app"
|
|
33
33
|
: "--no-app";
|
|
34
34
|
const templateArg = template ? ` --example ${template}` : "";
|
|
35
|
-
//
|
|
35
|
+
// NOTE: Not using create-next-app@latest to keep major version bumps deliberate
|
|
36
36
|
const createCommand =
|
|
37
|
-
`npx create-next-app@
|
|
37
|
+
`npx create-next-app@16 ${projectPath} ${typescriptArg} ${experimentalAppArg} ${templateArg}` +
|
|
38
38
|
` --eslint --no-src-dir --import-alias "@/*" --no-tailwind`;
|
|
39
39
|
|
|
40
40
|
// Default Next.js starter already supports Typescript
|
|
@@ -51,17 +51,17 @@ export const nextjsStrategy: CPAStrategy = {
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
overwriteConfig: async (args) => {
|
|
54
|
-
const { projectPath, scheme } = args;
|
|
55
|
-
const nextjsConfigFile = path.join(projectPath, "next.config.mjs");
|
|
54
|
+
const { projectPath, scheme, jsOrTs } = args;
|
|
56
55
|
if (scheme === "codegen") {
|
|
56
|
+
const isTs = jsOrTs === "ts";
|
|
57
|
+
const typePragma = isTs
|
|
58
|
+
? `import type { NextConfig } from "next";\n\n`
|
|
59
|
+
: `/** @type {import('next').NextConfig} */\n`;
|
|
60
|
+
const typeAnnotation = isTs ? ": NextConfig" : "";
|
|
61
|
+
|
|
57
62
|
await fs.writeFile(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/** @type {import('next').NextConfig} */
|
|
61
|
-
const nextConfig = {
|
|
62
|
-
eslint: {
|
|
63
|
-
ignoreDuringBuilds: true,
|
|
64
|
-
},
|
|
63
|
+
path.join(projectPath, `next.config.${isTs ? "ts" : "mjs"}`),
|
|
64
|
+
`${typePragma}const nextConfig${typeAnnotation} = {
|
|
65
65
|
trailingSlash: true,
|
|
66
66
|
reactStrictMode: true,
|
|
67
67
|
};
|