create-cloudflare 2.64.6 → 2.64.8
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 +231 -256
- package/package.json +7 -7
- package/templates/astro/workers/c3.ts +3 -41
- package/templates/nuxt/pages/templates/{env.d.ts → _cloudflare/env.d.ts} +1 -1
- package/templates/nuxt/pages/templates/app/env.d.ts +1 -0
- package/templates/nuxt/pages/templates/server/env.d.ts +1 -0
- package/templates/nuxt/workers/templates/{env.d.ts → _cloudflare/env.d.ts} +1 -1
- package/templates/nuxt/workers/templates/app/env.d.ts +1 -0
- package/templates/nuxt/workers/templates/server/env.d.ts +1 -0
- package/templates/react/pages/c3.ts +6 -1
- package/templates/react/workers/c3.ts +1 -0
- package/templates/astro/workers/templates/js/wrangler.jsonc +0 -16
- package/templates/astro/workers/templates/ts/wrangler.jsonc +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.64.
|
|
3
|
+
"version": "2.64.8",
|
|
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.20260312.1",
|
|
34
34
|
"@types/command-exists": "^1.2.0",
|
|
35
35
|
"@types/cross-spawn": "^6.0.2",
|
|
36
36
|
"@types/deepmerge": "^2.2.0",
|
|
@@ -65,20 +65,20 @@
|
|
|
65
65
|
"tree-kill": "^1.2.2",
|
|
66
66
|
"typescript": "~5.8.3",
|
|
67
67
|
"undici": "7.18.2",
|
|
68
|
-
"vite": "^5.4.
|
|
68
|
+
"vite": "^5.4.14",
|
|
69
69
|
"vite-tsconfig-paths": "^4.0.8",
|
|
70
|
-
"vitest": "
|
|
70
|
+
"vitest": "3.2.4",
|
|
71
71
|
"which-pm-runs": "^1.1.0",
|
|
72
72
|
"wrap-ansi": "^9.0.0",
|
|
73
73
|
"xdg-app-paths": "^8.3.0",
|
|
74
74
|
"yargs": "^17.7.2",
|
|
75
75
|
"@cloudflare/workers-utils": "0.12.0",
|
|
76
76
|
"@cloudflare/cli": "1.2.1",
|
|
77
|
-
"@cloudflare/eslint-config-shared": "1.2.1",
|
|
78
77
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
79
|
-
"@cloudflare/
|
|
78
|
+
"@cloudflare/eslint-config-shared": "1.2.1",
|
|
79
|
+
"@cloudflare/vite-plugin": "1.29.0",
|
|
80
80
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
81
|
-
"wrangler": "4.
|
|
81
|
+
"wrangler": "4.74.0"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">=18.14.1"
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { logRaw
|
|
2
|
-
import {
|
|
1
|
+
import { logRaw } from "@cloudflare/cli";
|
|
2
|
+
import { brandColor, dim } from "@cloudflare/cli/colors";
|
|
3
3
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
4
|
-
import { transformFile } from "helpers/codemod";
|
|
5
4
|
import { runCommand } from "helpers/command";
|
|
6
5
|
import { usesTypescript } from "helpers/files";
|
|
7
6
|
import { detectPackageManager } from "helpers/packageManagers";
|
|
8
|
-
import * as recast from "recast";
|
|
9
7
|
import type { TemplateConfig } from "../../../src/templates";
|
|
10
8
|
import type { C3Context, PackageJson } from "types";
|
|
11
9
|
|
|
@@ -33,42 +31,6 @@ const configure = async () => {
|
|
|
33
31
|
`via \`${npx} astro add cloudflare\``,
|
|
34
32
|
)}`,
|
|
35
33
|
});
|
|
36
|
-
|
|
37
|
-
// Update Astro config to enable platformProxy and imageService
|
|
38
|
-
const filePath = "astro.config.mjs";
|
|
39
|
-
|
|
40
|
-
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
41
|
-
|
|
42
|
-
transformFile(filePath, {
|
|
43
|
-
visitCallExpression: function (n) {
|
|
44
|
-
const callee = n.node.callee as recast.types.namedTypes.Identifier;
|
|
45
|
-
if (callee.name !== "cloudflare") {
|
|
46
|
-
return this.traverse(n);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const b = recast.types.builders;
|
|
50
|
-
n.node.arguments = [
|
|
51
|
-
b.objectExpression([
|
|
52
|
-
// platformProxy: {
|
|
53
|
-
// enabled: true,
|
|
54
|
-
// },
|
|
55
|
-
b.objectProperty(
|
|
56
|
-
b.identifier("platformProxy"),
|
|
57
|
-
b.objectExpression([
|
|
58
|
-
b.objectProperty(b.identifier("enabled"), b.booleanLiteral(true)),
|
|
59
|
-
]),
|
|
60
|
-
),
|
|
61
|
-
// imageService: "cloudflare",
|
|
62
|
-
b.objectProperty(
|
|
63
|
-
b.identifier("imageService"),
|
|
64
|
-
b.stringLiteral("cloudflare"),
|
|
65
|
-
),
|
|
66
|
-
]),
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
return false;
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
34
|
};
|
|
73
35
|
|
|
74
36
|
const config: TemplateConfig = {
|
|
@@ -103,7 +65,7 @@ const config: TemplateConfig = {
|
|
|
103
65
|
transformPackageJson: async (pkgJson: PackageJson, ctx: C3Context) => ({
|
|
104
66
|
scripts: {
|
|
105
67
|
deploy: `astro build && wrangler deploy`,
|
|
106
|
-
preview: `astro build &&
|
|
68
|
+
preview: `astro build && astro preview`,
|
|
107
69
|
...(usesTypescript(ctx) && { "cf-typegen": `wrangler types` }),
|
|
108
70
|
},
|
|
109
71
|
}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="../_cloudflare/env.d.ts" />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="../_cloudflare/env.d.ts" />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="../_cloudflare/env.d.ts" />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="../_cloudflare/env.d.ts" />
|
|
@@ -10,7 +10,12 @@ const { npm } = detectPackageManager();
|
|
|
10
10
|
const generate = async (ctx: C3Context) => {
|
|
11
11
|
const variant = await getVariant(ctx);
|
|
12
12
|
|
|
13
|
-
await runFrameworkGenerator(ctx, [
|
|
13
|
+
await runFrameworkGenerator(ctx, [
|
|
14
|
+
ctx.project.name,
|
|
15
|
+
"--template",
|
|
16
|
+
variant,
|
|
17
|
+
"--no-immediate",
|
|
18
|
+
]);
|
|
14
19
|
|
|
15
20
|
logRaw("");
|
|
16
21
|
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<WORKER_NAME>",
|
|
3
|
-
"main": "./dist/_worker.js/index.js",
|
|
4
|
-
"compatibility_date": "<COMPATIBILITY_DATE>",
|
|
5
|
-
"compatibility_flags": [
|
|
6
|
-
"nodejs_compat",
|
|
7
|
-
"global_fetch_strictly_public"
|
|
8
|
-
],
|
|
9
|
-
"assets": {
|
|
10
|
-
"binding": "ASSETS",
|
|
11
|
-
"directory": "./dist"
|
|
12
|
-
},
|
|
13
|
-
"observability": {
|
|
14
|
-
"enabled": true
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<WORKER_NAME>",
|
|
3
|
-
"main": "./dist/_worker.js/index.js",
|
|
4
|
-
"compatibility_date": "<COMPATIBILITY_DATE>",
|
|
5
|
-
"compatibility_flags": [
|
|
6
|
-
"nodejs_compat",
|
|
7
|
-
"global_fetch_strictly_public"
|
|
8
|
-
],
|
|
9
|
-
"assets": {
|
|
10
|
-
"binding": "ASSETS",
|
|
11
|
-
"directory": "./dist"
|
|
12
|
-
},
|
|
13
|
-
"observability": {
|
|
14
|
-
"enabled": true
|
|
15
|
-
},
|
|
16
|
-
}
|