create-cloudflare 2.34.0 → 2.35.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.35.0",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -67,15 +67,16 @@
|
|
|
67
67
|
"xdg-app-paths": "^8.3.0",
|
|
68
68
|
"yargs": "^17.7.2",
|
|
69
69
|
"@cloudflare/cli": "1.1.1",
|
|
70
|
-
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
71
70
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
72
|
-
"
|
|
71
|
+
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
72
|
+
"wrangler": "3.96.0"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=18.14.1"
|
|
76
76
|
},
|
|
77
77
|
"workers-sdk": {
|
|
78
|
-
"prerelease": true
|
|
78
|
+
"prerelease": true,
|
|
79
|
+
"type": "cli"
|
|
79
80
|
},
|
|
80
81
|
"volta": {
|
|
81
82
|
"extends": "../../package.json"
|
package/templates/next/README.md
CHANGED
|
@@ -46,7 +46,7 @@ In order to enable the example:
|
|
|
46
46
|
```ts
|
|
47
47
|
// KV Example:
|
|
48
48
|
```
|
|
49
|
-
and uncomment the commented lines below it.
|
|
49
|
+
and uncomment the commented lines below it (also uncomment the relevant imports).
|
|
50
50
|
- Do the same in the `wrangler.toml` file, where
|
|
51
51
|
the comment is:
|
|
52
52
|
```
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getRequestContext } from '@cloudflare/next-on-pages'
|
|
1
|
+
// import { getRequestContext } from '@cloudflare/next-on-pages'
|
|
2
2
|
|
|
3
3
|
export const runtime = 'edge'
|
|
4
4
|
|
|
5
|
-
export async function GET(
|
|
6
|
-
|
|
5
|
+
export async function GET() {
|
|
6
|
+
const responseText = 'Hello World'
|
|
7
7
|
|
|
8
8
|
// In the edge runtime you can use Bindings that are available in your application
|
|
9
9
|
// (for more details see:
|
|
@@ -15,7 +15,7 @@ export async function GET(request) {
|
|
|
15
15
|
// const myKv = getRequestContext().env.MY_KV_NAMESPACE
|
|
16
16
|
// await myKv.put('suffix', ' from a KV store!')
|
|
17
17
|
// const suffix = await myKv.get('suffix')
|
|
18
|
-
// responseText
|
|
18
|
+
// return new Response(responseText + suffix)
|
|
19
19
|
|
|
20
20
|
return new Response(responseText)
|
|
21
21
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getRequestContext } from '@cloudflare/next-on-pages'
|
|
1
|
+
// import { getRequestContext } from '@cloudflare/next-on-pages'
|
|
3
2
|
|
|
4
3
|
export const runtime = 'edge'
|
|
5
4
|
|
|
6
|
-
export async function GET(
|
|
7
|
-
|
|
5
|
+
export async function GET() {
|
|
6
|
+
const responseText = 'Hello World'
|
|
8
7
|
|
|
9
8
|
// In the edge runtime you can use Bindings that are available in your application
|
|
10
9
|
// (for more details see:
|
|
@@ -16,7 +15,7 @@ export async function GET(request: NextRequest) {
|
|
|
16
15
|
// const myKv = getRequestContext().env.MY_KV_NAMESPACE
|
|
17
16
|
// await myKv.put('suffix', ' from a KV store!')
|
|
18
17
|
// const suffix = await myKv.get('suffix')
|
|
19
|
-
// responseText
|
|
18
|
+
// return new Response(responseText + suffix)
|
|
20
19
|
|
|
21
20
|
return new Response(responseText)
|
|
22
21
|
}
|
package/templates/next/c3.ts
CHANGED
|
@@ -49,10 +49,10 @@ const generate = async (ctx: C3Context) => {
|
|
|
49
49
|
updateStatus("Created wrangler.toml file");
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
const updateNextConfig = () => {
|
|
52
|
+
const updateNextConfig = (usesTs: boolean) => {
|
|
53
53
|
const s = spinner();
|
|
54
54
|
|
|
55
|
-
const configFile =
|
|
55
|
+
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
56
56
|
s.start(`Updating \`${configFile}\``);
|
|
57
57
|
|
|
58
58
|
const configContent = readFile(configFile);
|
|
@@ -107,7 +107,7 @@ const configure = async (ctx: C3Context) => {
|
|
|
107
107
|
await writeEslintrc(ctx);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
updateNextConfig();
|
|
110
|
+
updateNextConfig(usesTs);
|
|
111
111
|
|
|
112
112
|
copyFile(
|
|
113
113
|
join(getTemplatePath(ctx), "README.md"),
|
|
@@ -30,6 +30,10 @@ export default {
|
|
|
30
30
|
configVersion: 1,
|
|
31
31
|
id: "next",
|
|
32
32
|
frameworkCli: "create-next-app",
|
|
33
|
+
// TODO: here we need to specify a version of create-next-app which is different from the
|
|
34
|
+
// standard one used in the stable Next.js template, that's because our open-next adapter
|
|
35
|
+
// is not yet fully ready for Next.js 15, once it is we should remove the following
|
|
36
|
+
frameworkCliPinnedVersion: "14.2.5",
|
|
33
37
|
platform: "workers",
|
|
34
38
|
displayName: "Next (using Node.js compat + Workers Assets)",
|
|
35
39
|
path: "templates-experimental/next",
|