create-cloudflare 2.25.2 → 2.26.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/dist/cli.js +34 -8
- package/package.json +4 -4
- package/templates/react/c3.ts +31 -3
package/dist/cli.js
CHANGED
|
@@ -2881,7 +2881,7 @@ ${grayBar} ${msg}`);
|
|
|
2881
2881
|
var version;
|
|
2882
2882
|
var init_package = __esm({
|
|
2883
2883
|
"package.json"() {
|
|
2884
|
-
version = "2.
|
|
2884
|
+
version = "2.26.0";
|
|
2885
2885
|
}
|
|
2886
2886
|
});
|
|
2887
2887
|
|
|
@@ -25047,7 +25047,7 @@ var init_package2 = __esm({
|
|
|
25047
25047
|
"create-hono": "0.12.0",
|
|
25048
25048
|
"create-next-app": "14.2.5",
|
|
25049
25049
|
"create-qwik": "1.5.7",
|
|
25050
|
-
"create-
|
|
25050
|
+
"create-vite": "5.2.3",
|
|
25051
25051
|
"create-remix": "2.11.1",
|
|
25052
25052
|
"create-solid": "0.5.12",
|
|
25053
25053
|
"create-svelte": "6.3.8",
|
|
@@ -25065,7 +25065,7 @@ var init_package2 = __esm({
|
|
|
25065
25065
|
next: "create-next-app",
|
|
25066
25066
|
nuxt: "nuxi",
|
|
25067
25067
|
qwik: "create-qwik",
|
|
25068
|
-
react: "create-
|
|
25068
|
+
react: "create-vite",
|
|
25069
25069
|
remix: "create-remix",
|
|
25070
25070
|
solid: "create-solid",
|
|
25071
25071
|
svelte: "create-svelte",
|
|
@@ -25129,7 +25129,7 @@ var init_frameworks = __esm({
|
|
|
25129
25129
|
var version2;
|
|
25130
25130
|
var init_package3 = __esm({
|
|
25131
25131
|
"../wrangler/package.json"() {
|
|
25132
|
-
version2 = "3.
|
|
25132
|
+
version2 = "3.73.0";
|
|
25133
25133
|
}
|
|
25134
25134
|
});
|
|
25135
25135
|
|
|
@@ -70787,17 +70787,43 @@ var c3_exports10 = {};
|
|
|
70787
70787
|
__export(c3_exports10, {
|
|
70788
70788
|
default: () => c3_default10
|
|
70789
70789
|
});
|
|
70790
|
-
var npm8, generate10, config9, c3_default10;
|
|
70790
|
+
var npm8, generate10, variantsOptions, config9, c3_default10;
|
|
70791
70791
|
var init_c310 = __esm({
|
|
70792
70792
|
"templates/react/c3.ts"() {
|
|
70793
70793
|
init_cli();
|
|
70794
|
+
init_args();
|
|
70794
70795
|
init_frameworks();
|
|
70795
70796
|
init_packageManagers();
|
|
70796
70797
|
({ npm: npm8 } = detectPackageManager());
|
|
70797
70798
|
generate10 = async (ctx) => {
|
|
70798
|
-
await
|
|
70799
|
+
const variant = await processArgument(ctx.args, "variant", {
|
|
70800
|
+
type: "select",
|
|
70801
|
+
question: "Select a variant:",
|
|
70802
|
+
label: "variant",
|
|
70803
|
+
options: variantsOptions,
|
|
70804
|
+
defaultValue: variantsOptions[0].value
|
|
70805
|
+
});
|
|
70806
|
+
await runFrameworkGenerator(ctx, [ctx.project.name, "--template", variant]);
|
|
70799
70807
|
logRaw("");
|
|
70800
70808
|
};
|
|
70809
|
+
variantsOptions = [
|
|
70810
|
+
{
|
|
70811
|
+
value: "react-ts",
|
|
70812
|
+
label: "TypeScript"
|
|
70813
|
+
},
|
|
70814
|
+
{
|
|
70815
|
+
value: "react-swc-ts",
|
|
70816
|
+
label: "TypeScript + SWC"
|
|
70817
|
+
},
|
|
70818
|
+
{
|
|
70819
|
+
value: "react",
|
|
70820
|
+
label: "JavaScript"
|
|
70821
|
+
},
|
|
70822
|
+
{
|
|
70823
|
+
value: "react-swc",
|
|
70824
|
+
label: "JavaScript + SWC"
|
|
70825
|
+
}
|
|
70826
|
+
];
|
|
70801
70827
|
config9 = {
|
|
70802
70828
|
configVersion: 1,
|
|
70803
70829
|
id: "react",
|
|
@@ -70806,8 +70832,8 @@ var init_c310 = __esm({
|
|
|
70806
70832
|
generate: generate10,
|
|
70807
70833
|
transformPackageJson: async () => ({
|
|
70808
70834
|
scripts: {
|
|
70809
|
-
deploy: `${npm8} run build && wrangler pages deploy ./
|
|
70810
|
-
preview: `${npm8} run build && wrangler pages dev ./
|
|
70835
|
+
deploy: `${npm8} run build && wrangler pages deploy ./dist`,
|
|
70836
|
+
preview: `${npm8} run build && wrangler pages dev ./dist`
|
|
70811
70837
|
}
|
|
70812
70838
|
}),
|
|
70813
70839
|
devScript: "dev",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.0",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"which-pm-runs": "^1.1.0",
|
|
65
65
|
"wrap-ansi": "^9.0.0",
|
|
66
66
|
"yargs": "^17.7.2",
|
|
67
|
+
"@cloudflare/cli": "1.1.1",
|
|
68
|
+
"wrangler": "3.73.0",
|
|
67
69
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
68
|
-
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
69
|
-
"wrangler": "3.72.2",
|
|
70
|
-
"@cloudflare/cli": "1.1.1"
|
|
70
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=18.14.1"
|
package/templates/react/c3.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { logRaw } from "@cloudflare/cli";
|
|
2
|
+
import { processArgument } from "@cloudflare/cli/args";
|
|
2
3
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
3
4
|
import { detectPackageManager } from "helpers/packageManagers";
|
|
4
5
|
import type { TemplateConfig } from "../../src/templates";
|
|
@@ -7,11 +8,38 @@ import type { C3Context } from "types";
|
|
|
7
8
|
const { npm } = detectPackageManager();
|
|
8
9
|
|
|
9
10
|
const generate = async (ctx: C3Context) => {
|
|
10
|
-
await
|
|
11
|
+
const variant = await processArgument<string>(ctx.args, "variant", {
|
|
12
|
+
type: "select",
|
|
13
|
+
question: "Select a variant:",
|
|
14
|
+
label: "variant",
|
|
15
|
+
options: variantsOptions,
|
|
16
|
+
defaultValue: variantsOptions[0].value,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
await runFrameworkGenerator(ctx, [ctx.project.name, "--template", variant]);
|
|
11
20
|
|
|
12
21
|
logRaw("");
|
|
13
22
|
};
|
|
14
23
|
|
|
24
|
+
const variantsOptions = [
|
|
25
|
+
{
|
|
26
|
+
value: "react-ts",
|
|
27
|
+
label: "TypeScript",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "react-swc-ts",
|
|
31
|
+
label: "TypeScript + SWC",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: "react",
|
|
35
|
+
label: "JavaScript",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: "react-swc",
|
|
39
|
+
label: "JavaScript + SWC",
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
15
43
|
const config: TemplateConfig = {
|
|
16
44
|
configVersion: 1,
|
|
17
45
|
id: "react",
|
|
@@ -20,8 +48,8 @@ const config: TemplateConfig = {
|
|
|
20
48
|
generate,
|
|
21
49
|
transformPackageJson: async () => ({
|
|
22
50
|
scripts: {
|
|
23
|
-
deploy: `${npm} run build && wrangler pages deploy ./
|
|
24
|
-
preview: `${npm} run build && wrangler pages dev ./
|
|
51
|
+
deploy: `${npm} run build && wrangler pages deploy ./dist`,
|
|
52
|
+
preview: `${npm} run build && wrangler pages dev ./dist`,
|
|
25
53
|
},
|
|
26
54
|
}),
|
|
27
55
|
devScript: "dev",
|