create-cloudflare 2.50.2 → 2.50.4
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 +16066 -12232
- package/package.json +12 -14
- package/templates/solid/c3.ts +20 -14
- package/templates/solid/templates/wrangler.jsonc +8 -1
- package/templates-experimental/solid/c3.ts +0 -94
- package/templates-experimental/solid/templates/wrangler.jsonc +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.50.
|
|
3
|
+
"version": "2.50.4",
|
|
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.20250712.0",
|
|
34
34
|
"@iarna/toml": "^3.0.0",
|
|
35
35
|
"@types/command-exists": "^1.2.0",
|
|
36
36
|
"@types/cross-spawn": "^6.0.2",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@types/semver": "^7.5.1",
|
|
43
43
|
"@types/which-pm-runs": "^1.0.0",
|
|
44
44
|
"@types/yargs": "^17.0.22",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
46
|
-
"@typescript-eslint/parser": "^
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
|
46
|
+
"@typescript-eslint/parser": "^8.35.1",
|
|
47
47
|
"chalk": "^5.2.0",
|
|
48
48
|
"command-exists": "^1.2.9",
|
|
49
49
|
"comment-json": "^4.2.5",
|
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"dotenv": "^16.0.0",
|
|
55
55
|
"esbuild": "0.25.4",
|
|
56
56
|
"execa": "^7.1.1",
|
|
57
|
+
"exit-hook": "2.2.1",
|
|
58
|
+
"get-port": "^7.1.0",
|
|
57
59
|
"glob": "^10.3.3",
|
|
58
60
|
"haikunator": "^2.1.2",
|
|
59
61
|
"indent-string": "^5.0.0",
|
|
@@ -61,8 +63,8 @@
|
|
|
61
63
|
"open": "^8.4.0",
|
|
62
64
|
"recast": "^0.22.0",
|
|
63
65
|
"semver": "^7.7.1",
|
|
64
|
-
"typescript": "^5.
|
|
65
|
-
"undici": "^
|
|
66
|
+
"typescript": "^5.8.3",
|
|
67
|
+
"undici": "^7.10.0",
|
|
66
68
|
"vite": "^5.4.14",
|
|
67
69
|
"vite-tsconfig-paths": "^4.0.8",
|
|
68
70
|
"vitest": "~3.2.0",
|
|
@@ -70,12 +72,12 @@
|
|
|
70
72
|
"wrap-ansi": "^9.0.0",
|
|
71
73
|
"xdg-app-paths": "^8.3.0",
|
|
72
74
|
"yargs": "^17.7.2",
|
|
75
|
+
"@cloudflare/cli": "1.1.1",
|
|
73
76
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
74
77
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
75
|
-
"@cloudflare/
|
|
76
|
-
"@cloudflare/vite-plugin": "1.
|
|
77
|
-
"wrangler": "4.
|
|
78
|
-
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
78
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
79
|
+
"@cloudflare/vite-plugin": "1.9.5",
|
|
80
|
+
"wrangler": "4.24.4"
|
|
79
81
|
},
|
|
80
82
|
"engines": {
|
|
81
83
|
"node": ">=18.14.1"
|
|
@@ -93,10 +95,6 @@
|
|
|
93
95
|
"check:lint": "eslint . --max-warnings=0",
|
|
94
96
|
"check:type": "tsc",
|
|
95
97
|
"test:e2e": "vitest run --config ./vitest-e2e.config.mts",
|
|
96
|
-
"test:e2e:npm": "pnpm run build && cross-env TEST_PM=npm vitest run --config ./vitest-e2e.config.mts",
|
|
97
|
-
"test:e2e:pnpm": "pnpm run build && cross-env TEST_PM=pnpm vitest run --config ./vitest-e2e.config.mts",
|
|
98
|
-
"test:e2e:bun": "pnpm run build && cross-env TEST_PM=bun vitest run --config ./vitest-e2e.config.mts",
|
|
99
|
-
"test:e2e:yarn": "pnpm run build && cross-env TEST_PM=yarn vitest run --config ./vitest-e2e.config.mts",
|
|
100
98
|
"test:unit": "vitest run --config ./vitest.config.mts",
|
|
101
99
|
"test:unit:watch": "vitest --config ./vitest.config.mts",
|
|
102
100
|
"dev": "node -r esbuild-register scripts/build.ts --watch",
|
package/templates/solid/c3.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { logRaw, updateStatus } from "@cloudflare/cli";
|
|
2
|
-
import { blue } from "@cloudflare/cli/colors";
|
|
2
|
+
import { blue, brandColor, dim } from "@cloudflare/cli/colors";
|
|
3
3
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
4
4
|
import { mergeObjectProperties, transformFile } from "helpers/codemod";
|
|
5
|
+
import { getWorkerdCompatibilityDate } from "helpers/compatDate";
|
|
5
6
|
import { usesTypescript } from "helpers/files";
|
|
6
7
|
import { detectPackageManager } from "helpers/packageManagers";
|
|
8
|
+
import { installPackages } from "helpers/packages";
|
|
7
9
|
import * as recast from "recast";
|
|
8
10
|
import type { TemplateConfig } from "../../src/templates";
|
|
9
11
|
import type { C3Context } from "types";
|
|
@@ -19,9 +21,18 @@ const generate = async (ctx: C3Context) => {
|
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
const configure = async (ctx: C3Context) => {
|
|
24
|
+
const packages = ["nitropack"];
|
|
25
|
+
await installPackages(packages, {
|
|
26
|
+
dev: true,
|
|
27
|
+
startText: "Installing nitro module `nitropack`",
|
|
28
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`,
|
|
29
|
+
});
|
|
30
|
+
|
|
22
31
|
usesTypescript(ctx);
|
|
23
32
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
24
33
|
|
|
34
|
+
const compatDate = await getWorkerdCompatibilityDate();
|
|
35
|
+
|
|
25
36
|
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
26
37
|
|
|
27
38
|
transformFile(filePath, {
|
|
@@ -32,25 +43,20 @@ const configure = async (ctx: C3Context) => {
|
|
|
32
43
|
}
|
|
33
44
|
|
|
34
45
|
const b = recast.types.builders;
|
|
35
|
-
|
|
36
46
|
mergeObjectProperties(
|
|
37
47
|
n.node.arguments[0] as recast.types.namedTypes.ObjectExpression,
|
|
38
48
|
[
|
|
39
49
|
b.objectProperty(
|
|
40
50
|
b.identifier("server"),
|
|
41
51
|
b.objectExpression([
|
|
52
|
+
// preset: "cloudflare_module"
|
|
42
53
|
b.objectProperty(
|
|
43
54
|
b.identifier("preset"),
|
|
44
|
-
b.stringLiteral("
|
|
55
|
+
b.stringLiteral("cloudflare_module"),
|
|
45
56
|
),
|
|
46
57
|
b.objectProperty(
|
|
47
|
-
b.identifier("
|
|
48
|
-
b.
|
|
49
|
-
b.objectProperty(
|
|
50
|
-
b.identifier("external"),
|
|
51
|
-
b.arrayExpression([b.stringLiteral("node:async_hooks")]),
|
|
52
|
-
),
|
|
53
|
-
]),
|
|
58
|
+
b.identifier("compatibilityDate"),
|
|
59
|
+
b.stringLiteral(compatDate),
|
|
54
60
|
),
|
|
55
61
|
]),
|
|
56
62
|
),
|
|
@@ -67,20 +73,20 @@ const config: TemplateConfig = {
|
|
|
67
73
|
id: "solid",
|
|
68
74
|
frameworkCli: "create-solid",
|
|
69
75
|
displayName: "SolidStart",
|
|
70
|
-
platform: "
|
|
76
|
+
platform: "workers",
|
|
71
77
|
copyFiles: {
|
|
72
78
|
path: "./templates",
|
|
73
79
|
},
|
|
80
|
+
path: "templates/solid",
|
|
74
81
|
generate,
|
|
75
82
|
configure,
|
|
76
83
|
transformPackageJson: async () => ({
|
|
77
84
|
scripts: {
|
|
78
|
-
preview: `${npm} run build && npx wrangler
|
|
79
|
-
deploy: `${npm} run build && wrangler
|
|
85
|
+
preview: `${npm} run build && npx wrangler dev`,
|
|
86
|
+
deploy: `${npm} run build && wrangler deploy`,
|
|
80
87
|
"cf-typegen": `wrangler types`,
|
|
81
88
|
},
|
|
82
89
|
}),
|
|
83
|
-
compatibilityFlags: ["nodejs_compat"],
|
|
84
90
|
devScript: "dev",
|
|
85
91
|
deployScript: "deploy",
|
|
86
92
|
previewScript: "preview",
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<TBD>",
|
|
3
|
+
"main": "./.output/server/index.mjs",
|
|
3
4
|
"compatibility_date": "<TBD>",
|
|
4
5
|
"compatibility_flags": [
|
|
5
6
|
"nodejs_compat"
|
|
6
7
|
],
|
|
7
|
-
"
|
|
8
|
+
"assets": {
|
|
9
|
+
"binding": "ASSETS",
|
|
10
|
+
"directory": "./.output/public"
|
|
11
|
+
},
|
|
12
|
+
"observability": {
|
|
13
|
+
"enabled": true
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { logRaw, updateStatus } from "@cloudflare/cli";
|
|
2
|
-
import { blue, brandColor, dim } from "@cloudflare/cli/colors";
|
|
3
|
-
import { runFrameworkGenerator } from "frameworks/index";
|
|
4
|
-
import { mergeObjectProperties, transformFile } from "helpers/codemod";
|
|
5
|
-
import { getWorkerdCompatibilityDate } from "helpers/compatDate";
|
|
6
|
-
import { usesTypescript } from "helpers/files";
|
|
7
|
-
import { detectPackageManager } from "helpers/packageManagers";
|
|
8
|
-
import { installPackages } from "helpers/packages";
|
|
9
|
-
import * as recast from "recast";
|
|
10
|
-
import type { TemplateConfig } from "../../src/templates";
|
|
11
|
-
import type { C3Context } from "types";
|
|
12
|
-
|
|
13
|
-
const { npm } = detectPackageManager();
|
|
14
|
-
|
|
15
|
-
const generate = async (ctx: C3Context) => {
|
|
16
|
-
// Run the create-solid command
|
|
17
|
-
// -s flag forces solid-start
|
|
18
|
-
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
19
|
-
|
|
20
|
-
logRaw("");
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const configure = async (ctx: C3Context) => {
|
|
24
|
-
const packages = ["nitropack"];
|
|
25
|
-
await installPackages(packages, {
|
|
26
|
-
dev: true,
|
|
27
|
-
startText: "Installing nitro module `nitropack`",
|
|
28
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
usesTypescript(ctx);
|
|
32
|
-
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
33
|
-
|
|
34
|
-
const compatDate = await getWorkerdCompatibilityDate();
|
|
35
|
-
|
|
36
|
-
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
37
|
-
|
|
38
|
-
transformFile(filePath, {
|
|
39
|
-
visitCallExpression: function (n) {
|
|
40
|
-
const callee = n.node.callee as recast.types.namedTypes.Identifier;
|
|
41
|
-
if (callee.name !== "defineConfig") {
|
|
42
|
-
return this.traverse(n);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const b = recast.types.builders;
|
|
46
|
-
mergeObjectProperties(
|
|
47
|
-
n.node.arguments[0] as recast.types.namedTypes.ObjectExpression,
|
|
48
|
-
[
|
|
49
|
-
b.objectProperty(
|
|
50
|
-
b.identifier("server"),
|
|
51
|
-
b.objectExpression([
|
|
52
|
-
// preset: "cloudflare_module"
|
|
53
|
-
b.objectProperty(
|
|
54
|
-
b.identifier("preset"),
|
|
55
|
-
b.stringLiteral("cloudflare_module"),
|
|
56
|
-
),
|
|
57
|
-
b.objectProperty(
|
|
58
|
-
b.identifier("compatibilityDate"),
|
|
59
|
-
b.stringLiteral(compatDate),
|
|
60
|
-
),
|
|
61
|
-
]),
|
|
62
|
-
),
|
|
63
|
-
],
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
return false;
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const config: TemplateConfig = {
|
|
72
|
-
configVersion: 1,
|
|
73
|
-
id: "solid",
|
|
74
|
-
frameworkCli: "create-solid",
|
|
75
|
-
displayName: "SolidStart",
|
|
76
|
-
platform: "workers",
|
|
77
|
-
copyFiles: {
|
|
78
|
-
path: "./templates",
|
|
79
|
-
},
|
|
80
|
-
path: "templates-experimental/solid",
|
|
81
|
-
generate,
|
|
82
|
-
configure,
|
|
83
|
-
transformPackageJson: async () => ({
|
|
84
|
-
scripts: {
|
|
85
|
-
preview: `${npm} run build && npx wrangler dev`,
|
|
86
|
-
deploy: `${npm} run build && wrangler deploy`,
|
|
87
|
-
"cf-typegen": `wrangler types`,
|
|
88
|
-
},
|
|
89
|
-
}),
|
|
90
|
-
devScript: "dev",
|
|
91
|
-
deployScript: "deploy",
|
|
92
|
-
previewScript: "preview",
|
|
93
|
-
};
|
|
94
|
-
export default config;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<TBD>",
|
|
3
|
-
"main": "./.output/server/index.mjs",
|
|
4
|
-
"compatibility_date": "<TBD>",
|
|
5
|
-
"compatibility_flags": [
|
|
6
|
-
"nodejs_compat"
|
|
7
|
-
],
|
|
8
|
-
"assets": {
|
|
9
|
-
"binding": "ASSETS",
|
|
10
|
-
"directory": "./.output/public"
|
|
11
|
-
},
|
|
12
|
-
"observability": {
|
|
13
|
-
"enabled": true
|
|
14
|
-
}
|
|
15
|
-
}
|