create-cloudflare 2.41.0 → 2.41.1
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/dist/cli.js +1160 -1552
- package/package.json +6 -6
- package/templates/react/workers/js/src/App.css +45 -0
- package/templates/react/workers/js/src/assets/Cloudflare_Logo.svg +51 -26
- package/templates/react/workers/ts/src/App.css +45 -0
- package/templates/react/workers/ts/src/assets/Cloudflare_Logo.svg +51 -26
- package/templates-experimental/next/c3.ts +9 -9
- package/templates-experimental/next/templates/open-next.config.ts +5 -27
- package/templates-experimental/next/templates/wrangler.jsonc +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.41.
|
|
3
|
+
"version": "2.41.1",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@babel/parser": "^7.21.3",
|
|
31
31
|
"@babel/types": "^7.21.4",
|
|
32
32
|
"@clack/prompts": "^0.6.3",
|
|
33
|
-
"@cloudflare/workers-types": "^4.
|
|
33
|
+
"@cloudflare/workers-types": "^4.20250317.0",
|
|
34
34
|
"@iarna/toml": "^3.0.0",
|
|
35
35
|
"@types/command-exists": "^1.2.0",
|
|
36
36
|
"@types/cross-spawn": "^6.0.2",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"degit": "^2.8.4",
|
|
53
53
|
"dns2": "^2.1.0",
|
|
54
54
|
"dotenv": "^16.0.0",
|
|
55
|
-
"esbuild": "0.
|
|
55
|
+
"esbuild": "0.24.2",
|
|
56
56
|
"execa": "^7.1.1",
|
|
57
57
|
"glob": "^10.3.3",
|
|
58
58
|
"haikunator": "^2.1.2",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"xdg-app-paths": "^8.3.0",
|
|
72
72
|
"yargs": "^17.7.2",
|
|
73
73
|
"@cloudflare/cli": "1.1.1",
|
|
74
|
+
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
74
75
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
75
|
-
"@cloudflare/vite-plugin": "0.1.10",
|
|
76
76
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
77
|
-
"@cloudflare/
|
|
78
|
-
"wrangler": "
|
|
77
|
+
"@cloudflare/vite-plugin": "0.1.12",
|
|
78
|
+
"wrangler": "4.1.0"
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
81
|
"node": ">=18.14.1"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#root {
|
|
2
|
+
max-width: 1280px;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
padding: 2rem;
|
|
5
|
+
text-align: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.logo {
|
|
9
|
+
height: 6em;
|
|
10
|
+
padding: 1.5em;
|
|
11
|
+
will-change: filter;
|
|
12
|
+
transition: filter 300ms;
|
|
13
|
+
}
|
|
14
|
+
.logo:hover {
|
|
15
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
16
|
+
}
|
|
17
|
+
.logo.react:hover {
|
|
18
|
+
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
19
|
+
}
|
|
20
|
+
.logo.cloudflare:hover {
|
|
21
|
+
filter: drop-shadow(0 0 2em #f6821faa);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes logo-spin {
|
|
25
|
+
from {
|
|
26
|
+
transform: rotate(0deg);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
transform: rotate(360deg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
34
|
+
a:nth-of-type(2) .logo {
|
|
35
|
+
animation: logo-spin infinite 20s linear;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card {
|
|
40
|
+
padding: 2em;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.read-the-docs {
|
|
44
|
+
color: #888;
|
|
45
|
+
}
|
|
@@ -1,26 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 822.8 355.5" style="enable-background:new 0 0 822.8 355.5;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#FFFFFF;}
|
|
7
|
+
.st1{fill:#FBAE40;}
|
|
8
|
+
.st2{fill:#F58220;}
|
|
9
|
+
</style>
|
|
10
|
+
<g id="Page-1">
|
|
11
|
+
<path id="CLOUDFLARE-_xAE_" class="st0" d="M772.2,252.6c-3.4,0-6.1-2.7-6.1-6.1c0-3.3,2.7-6.1,6.1-6.1c3.3,0,6.1,2.7,6.1,6.1
|
|
12
|
+
C778.3,249.8,775.5,252.6,772.2,252.6L772.2,252.6z M772.2,241.6c-2.7,0-4.9,2.2-4.9,4.9s2.2,4.9,4.9,4.9c2.7,0,4.9-2.2,4.9-4.9
|
|
13
|
+
S774.9,241.6,772.2,241.6L772.2,241.6z M775.3,249.7h-1.4l-1.2-2.3h-1.6v2.3h-1.3V243h3.2c1.4,0,2.3,0.9,2.3,2.2c0,1-0.6,1.7-1.4,2
|
|
14
|
+
L775.3,249.7z M772.9,246.2c0.5,0,1-0.3,1-1c0-0.8-0.4-1-1-1h-2v2H772.9z M136.7,239.8h15.6v42.5h27.1v13.6h-42.7V239.8z
|
|
15
|
+
M195.5,268v-0.2c0-16.1,13-29.2,30.3-29.2s30.1,12.9,30.1,29v0.2c0,16.1-13,29.2-30.3,29.2S195.5,284.1,195.5,268z M240.1,268
|
|
16
|
+
v-0.2c0-8.1-5.8-15.1-14.4-15.1c-8.5,0-14.2,6.9-14.2,15v0.2c0,8.1,5.8,15.1,14.3,15.1C234.4,283,240.1,276.1,240.1,268z
|
|
17
|
+
M275,271.3v-31.5h15.8V271c0,8.1,4.1,11.9,10.3,11.9c6.2,0,10.3-3.7,10.3-11.5v-31.6h15.8v31.1c0,18.1-10.3,26-26.3,26
|
|
18
|
+
C285,296.9,275,288.9,275,271.3z M351,239.8h21.6c20,0,31.7,11.5,31.7,27.7v0.2c0,16.2-11.8,28.2-32,28.2H351V239.8z M372.9,282.1
|
|
19
|
+
c9.3,0,15.5-5.1,15.5-14.2v-0.2c0-9-6.2-14.2-15.5-14.2h-6.3V282L372.9,282.1L372.9,282.1z M426.9,239.8h44.9v13.6h-29.4v9.6H469
|
|
20
|
+
v12.9h-26.6v20h-15.5V239.8z M493.4,239.8h15.5v42.5h27.2v13.6h-42.7V239.8z M576.7,239.4h15l23.9,56.5h-16.7l-4.1-10h-21.6l-4,10
|
|
21
|
+
h-16.3L576.7,239.4z M590.4,273.8l-6.2-15.9l-6.3,15.9H590.4z M635.6,239.8h26.5c8.6,0,14.5,2.2,18.3,6.1c3.3,3.2,5,7.5,5,13.1v0.2
|
|
22
|
+
c0,8.6-4.6,14.3-11.5,17.2l13.4,19.6h-18L658,279h-6.8v17h-15.6V239.8z M661.4,266.7c5.3,0,8.3-2.6,8.3-6.6v-0.2
|
|
23
|
+
c0-4.4-3.2-6.6-8.4-6.6h-10.2v13.4H661.4z M707.8,239.8h45.1V253h-29.7v8.5h26.9v12.3h-26.9v8.9h30.1v13.2h-45.5V239.8z
|
|
24
|
+
M102.7,274.6c-2.2,4.9-6.8,8.4-12.8,8.4c-8.5,0-14.3-7.1-14.3-15.1v-0.2c0-8.1,5.7-15,14.2-15c6.4,0,11.3,3.9,13.3,9.3h16.4
|
|
25
|
+
c-2.6-13.4-14.4-23.3-29.6-23.3c-17.3,0-30.3,13.1-30.3,29.2v0.2c0,16.1,12.8,29,30.1,29c14.8,0,26.4-9.6,29.4-22.4L102.7,274.6z"
|
|
26
|
+
/>
|
|
27
|
+
<path id="flare" class="st0" d="M734.5,150.4l-40.7-24.7c-0.6-0.1-4.4,0.3-6.4-0.7c-1.4-0.7-2.5-1.9-3.2-4c-3.2,0-175.5,0-175.5,0
|
|
28
|
+
v91.8h225.8V150.4z"/>
|
|
29
|
+
<path id="right-cloud" class="st1" d="M692.2,125.8c-0.8,0-1.5,0.6-1.8,1.4l-4.8,16.7c-2.1,7.2-1.3,13.8,2.2,18.7
|
|
30
|
+
c3.2,4.5,8.6,7.1,15.1,7.4l26.2,1.6c0.8,0,1.5,0.4,1.9,1c0.4,0.6,0.5,1.5,0.3,2.2c-0.4,1.2-1.6,2.1-2.9,2.2l-27.3,1.6
|
|
31
|
+
c-14.8,0.7-30.7,12.6-36.3,27.2l-2,5.1c-0.4,1,0.3,2,1.4,2H758c1.1,0,2.1-0.7,2.4-1.8c1.6-5.8,2.5-11.9,2.5-18.2
|
|
32
|
+
c0-37-30.2-67.2-67.3-67.2C694.5,125.7,693.3,125.7,692.2,125.8z"/>
|
|
33
|
+
<path id="left-cloud" class="st2" d="M656.4,204.6c2.1-7.2,1.3-13.8-2.2-18.7c-3.2-4.5-8.6-7.1-15.1-7.4L516,176.9
|
|
34
|
+
c-0.8,0-1.5-0.4-1.9-1c-0.4-0.6-0.5-1.4-0.3-2.2c0.4-1.2,1.6-2.1,2.9-2.2l124.2-1.6c14.7-0.7,30.7-12.6,36.3-27.2l7.1-18.5
|
|
35
|
+
c0.3-0.8,0.4-1.6,0.2-2.4c-8-36.2-40.3-63.2-78.9-63.2c-35.6,0-65.8,23-76.6,54.9c-7-5.2-15.9-8-25.5-7.1
|
|
36
|
+
c-17.1,1.7-30.8,15.4-32.5,32.5c-0.4,4.4-0.1,8.7,0.9,12.7c-27.9,0.8-50.2,23.6-50.2,51.7c0,2.5,0.2,5,0.5,7.5
|
|
37
|
+
c0.2,1.2,1.2,2.1,2.4,2.1h227.2c1.3,0,2.5-0.9,2.9-2.2L656.4,204.6z"/>
|
|
38
|
+
</g>
|
|
39
|
+
<g>
|
|
40
|
+
</g>
|
|
41
|
+
<g>
|
|
42
|
+
</g>
|
|
43
|
+
<g>
|
|
44
|
+
</g>
|
|
45
|
+
<g>
|
|
46
|
+
</g>
|
|
47
|
+
<g>
|
|
48
|
+
</g>
|
|
49
|
+
<g>
|
|
50
|
+
</g>
|
|
51
|
+
</svg>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#root {
|
|
2
|
+
max-width: 1280px;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
padding: 2rem;
|
|
5
|
+
text-align: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.logo {
|
|
9
|
+
height: 6em;
|
|
10
|
+
padding: 1.5em;
|
|
11
|
+
will-change: filter;
|
|
12
|
+
transition: filter 300ms;
|
|
13
|
+
}
|
|
14
|
+
.logo:hover {
|
|
15
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
16
|
+
}
|
|
17
|
+
.logo.react:hover {
|
|
18
|
+
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
19
|
+
}
|
|
20
|
+
.logo.cloudflare:hover {
|
|
21
|
+
filter: drop-shadow(0 0 2em #f6821faa);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes logo-spin {
|
|
25
|
+
from {
|
|
26
|
+
transform: rotate(0deg);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
transform: rotate(360deg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
34
|
+
a:nth-of-type(2) .logo {
|
|
35
|
+
animation: logo-spin infinite 20s linear;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card {
|
|
40
|
+
padding: 2em;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.read-the-docs {
|
|
44
|
+
color: #888;
|
|
45
|
+
}
|
|
@@ -1,26 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 822.8 355.5" style="enable-background:new 0 0 822.8 355.5;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#FFFFFF;}
|
|
7
|
+
.st1{fill:#FBAE40;}
|
|
8
|
+
.st2{fill:#F58220;}
|
|
9
|
+
</style>
|
|
10
|
+
<g id="Page-1">
|
|
11
|
+
<path id="CLOUDFLARE-_xAE_" class="st0" d="M772.2,252.6c-3.4,0-6.1-2.7-6.1-6.1c0-3.3,2.7-6.1,6.1-6.1c3.3,0,6.1,2.7,6.1,6.1
|
|
12
|
+
C778.3,249.8,775.5,252.6,772.2,252.6L772.2,252.6z M772.2,241.6c-2.7,0-4.9,2.2-4.9,4.9s2.2,4.9,4.9,4.9c2.7,0,4.9-2.2,4.9-4.9
|
|
13
|
+
S774.9,241.6,772.2,241.6L772.2,241.6z M775.3,249.7h-1.4l-1.2-2.3h-1.6v2.3h-1.3V243h3.2c1.4,0,2.3,0.9,2.3,2.2c0,1-0.6,1.7-1.4,2
|
|
14
|
+
L775.3,249.7z M772.9,246.2c0.5,0,1-0.3,1-1c0-0.8-0.4-1-1-1h-2v2H772.9z M136.7,239.8h15.6v42.5h27.1v13.6h-42.7V239.8z
|
|
15
|
+
M195.5,268v-0.2c0-16.1,13-29.2,30.3-29.2s30.1,12.9,30.1,29v0.2c0,16.1-13,29.2-30.3,29.2S195.5,284.1,195.5,268z M240.1,268
|
|
16
|
+
v-0.2c0-8.1-5.8-15.1-14.4-15.1c-8.5,0-14.2,6.9-14.2,15v0.2c0,8.1,5.8,15.1,14.3,15.1C234.4,283,240.1,276.1,240.1,268z
|
|
17
|
+
M275,271.3v-31.5h15.8V271c0,8.1,4.1,11.9,10.3,11.9c6.2,0,10.3-3.7,10.3-11.5v-31.6h15.8v31.1c0,18.1-10.3,26-26.3,26
|
|
18
|
+
C285,296.9,275,288.9,275,271.3z M351,239.8h21.6c20,0,31.7,11.5,31.7,27.7v0.2c0,16.2-11.8,28.2-32,28.2H351V239.8z M372.9,282.1
|
|
19
|
+
c9.3,0,15.5-5.1,15.5-14.2v-0.2c0-9-6.2-14.2-15.5-14.2h-6.3V282L372.9,282.1L372.9,282.1z M426.9,239.8h44.9v13.6h-29.4v9.6H469
|
|
20
|
+
v12.9h-26.6v20h-15.5V239.8z M493.4,239.8h15.5v42.5h27.2v13.6h-42.7V239.8z M576.7,239.4h15l23.9,56.5h-16.7l-4.1-10h-21.6l-4,10
|
|
21
|
+
h-16.3L576.7,239.4z M590.4,273.8l-6.2-15.9l-6.3,15.9H590.4z M635.6,239.8h26.5c8.6,0,14.5,2.2,18.3,6.1c3.3,3.2,5,7.5,5,13.1v0.2
|
|
22
|
+
c0,8.6-4.6,14.3-11.5,17.2l13.4,19.6h-18L658,279h-6.8v17h-15.6V239.8z M661.4,266.7c5.3,0,8.3-2.6,8.3-6.6v-0.2
|
|
23
|
+
c0-4.4-3.2-6.6-8.4-6.6h-10.2v13.4H661.4z M707.8,239.8h45.1V253h-29.7v8.5h26.9v12.3h-26.9v8.9h30.1v13.2h-45.5V239.8z
|
|
24
|
+
M102.7,274.6c-2.2,4.9-6.8,8.4-12.8,8.4c-8.5,0-14.3-7.1-14.3-15.1v-0.2c0-8.1,5.7-15,14.2-15c6.4,0,11.3,3.9,13.3,9.3h16.4
|
|
25
|
+
c-2.6-13.4-14.4-23.3-29.6-23.3c-17.3,0-30.3,13.1-30.3,29.2v0.2c0,16.1,12.8,29,30.1,29c14.8,0,26.4-9.6,29.4-22.4L102.7,274.6z"
|
|
26
|
+
/>
|
|
27
|
+
<path id="flare" class="st0" d="M734.5,150.4l-40.7-24.7c-0.6-0.1-4.4,0.3-6.4-0.7c-1.4-0.7-2.5-1.9-3.2-4c-3.2,0-175.5,0-175.5,0
|
|
28
|
+
v91.8h225.8V150.4z"/>
|
|
29
|
+
<path id="right-cloud" class="st1" d="M692.2,125.8c-0.8,0-1.5,0.6-1.8,1.4l-4.8,16.7c-2.1,7.2-1.3,13.8,2.2,18.7
|
|
30
|
+
c3.2,4.5,8.6,7.1,15.1,7.4l26.2,1.6c0.8,0,1.5,0.4,1.9,1c0.4,0.6,0.5,1.5,0.3,2.2c-0.4,1.2-1.6,2.1-2.9,2.2l-27.3,1.6
|
|
31
|
+
c-14.8,0.7-30.7,12.6-36.3,27.2l-2,5.1c-0.4,1,0.3,2,1.4,2H758c1.1,0,2.1-0.7,2.4-1.8c1.6-5.8,2.5-11.9,2.5-18.2
|
|
32
|
+
c0-37-30.2-67.2-67.3-67.2C694.5,125.7,693.3,125.7,692.2,125.8z"/>
|
|
33
|
+
<path id="left-cloud" class="st2" d="M656.4,204.6c2.1-7.2,1.3-13.8-2.2-18.7c-3.2-4.5-8.6-7.1-15.1-7.4L516,176.9
|
|
34
|
+
c-0.8,0-1.5-0.4-1.9-1c-0.4-0.6-0.5-1.4-0.3-2.2c0.4-1.2,1.6-2.1,2.9-2.2l124.2-1.6c14.7-0.7,30.7-12.6,36.3-27.2l7.1-18.5
|
|
35
|
+
c0.3-0.8,0.4-1.6,0.2-2.4c-8-36.2-40.3-63.2-78.9-63.2c-35.6,0-65.8,23-76.6,54.9c-7-5.2-15.9-8-25.5-7.1
|
|
36
|
+
c-17.1,1.7-30.8,15.4-32.5,32.5c-0.4,4.4-0.1,8.7,0.9,12.7c-27.9,0.8-50.2,23.6-50.2,51.7c0,2.5,0.2,5,0.5,7.5
|
|
37
|
+
c0.2,1.2,1.2,2.1,2.4,2.1h227.2c1.3,0,2.5-0.9,2.9-2.2L656.4,204.6z"/>
|
|
38
|
+
</g>
|
|
39
|
+
<g>
|
|
40
|
+
</g>
|
|
41
|
+
<g>
|
|
42
|
+
</g>
|
|
43
|
+
<g>
|
|
44
|
+
</g>
|
|
45
|
+
<g>
|
|
46
|
+
</g>
|
|
47
|
+
<g>
|
|
48
|
+
</g>
|
|
49
|
+
<g>
|
|
50
|
+
</g>
|
|
51
|
+
</svg>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { brandColor, dim } from "@cloudflare/cli/colors";
|
|
2
2
|
import { spinner } from "@cloudflare/cli/interactive";
|
|
3
3
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
4
|
-
import { readFile, writeFile } from "helpers/files";
|
|
4
|
+
import { readFile, usesTypescript, writeFile } from "helpers/files";
|
|
5
5
|
import { installPackages } from "helpers/packages";
|
|
6
6
|
import type { TemplateConfig } from "../../src/templates";
|
|
7
7
|
import type { C3Context } from "types";
|
|
@@ -10,7 +10,7 @@ const generate = async (ctx: C3Context) => {
|
|
|
10
10
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const configure = async () => {
|
|
13
|
+
const configure = async (ctx: C3Context) => {
|
|
14
14
|
const packages = [
|
|
15
15
|
"@opennextjs/cloudflare@0.5.x",
|
|
16
16
|
"@cloudflare/workers-types",
|
|
@@ -21,13 +21,15 @@ const configure = async () => {
|
|
|
21
21
|
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`,
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const usesTs = usesTypescript(ctx);
|
|
25
|
+
|
|
26
|
+
updateNextConfig(usesTs);
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
const updateNextConfig = () => {
|
|
29
|
+
const updateNextConfig = (usesTs: boolean) => {
|
|
28
30
|
const s = spinner();
|
|
29
31
|
|
|
30
|
-
const configFile =
|
|
32
|
+
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
31
33
|
s.start(`Updating \`${configFile}\``);
|
|
32
34
|
|
|
33
35
|
const configContent = readFile(configFile);
|
|
@@ -49,10 +51,8 @@ export default {
|
|
|
49
51
|
configVersion: 1,
|
|
50
52
|
id: "next",
|
|
51
53
|
frameworkCli: "create-next-app",
|
|
52
|
-
// TODO:
|
|
53
|
-
|
|
54
|
-
// is not yet fully ready for Next.js 15, once it is we should remove the following
|
|
55
|
-
frameworkCliPinnedVersion: "^14.2.23",
|
|
54
|
+
// TODO: Stop using a pinned version when the template graduates.
|
|
55
|
+
frameworkCliPinnedVersion: "~15.2.2",
|
|
56
56
|
platform: "workers",
|
|
57
57
|
displayName: "Next.js (using Node.js compat + Workers Assets)",
|
|
58
58
|
path: "templates-experimental/next",
|
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
|
|
2
|
+
import kvIncrementalCache from "@opennextjs/cloudflare/kv-cache";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
wrapper: "cloudflare-node",
|
|
7
|
-
converter: "edge",
|
|
8
|
-
incrementalCache: async () => cache,
|
|
9
|
-
tagCache: "dummy",
|
|
10
|
-
queue: "dummy",
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
middleware: {
|
|
15
|
-
external: true,
|
|
16
|
-
override: {
|
|
17
|
-
wrapper: "cloudflare-edge",
|
|
18
|
-
converter: "edge",
|
|
19
|
-
proxyExternalRequest: "fetch",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
dangerous: {
|
|
24
|
-
enableCacheInterception: false,
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default config;
|
|
4
|
+
export default defineCloudflareConfig({
|
|
5
|
+
incrementalCache: kvIncrementalCache,
|
|
6
|
+
});
|