create-cloudflare 2.64.2 → 2.64.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.64.
|
|
3
|
+
"version": "2.64.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.20260302.0",
|
|
34
34
|
"@types/command-exists": "^1.2.0",
|
|
35
35
|
"@types/cross-spawn": "^6.0.2",
|
|
36
36
|
"@types/deepmerge": "^2.2.0",
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"wrap-ansi": "^9.0.0",
|
|
74
74
|
"xdg-app-paths": "^8.3.0",
|
|
75
75
|
"yargs": "^17.7.2",
|
|
76
|
-
"@cloudflare/workers-utils": "0.11.
|
|
77
|
-
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
78
|
-
"@cloudflare/vite-plugin": "1.25.1",
|
|
76
|
+
"@cloudflare/workers-utils": "0.11.2",
|
|
79
77
|
"@cloudflare/cli": "1.2.1",
|
|
80
78
|
"@cloudflare/eslint-config-shared": "1.2.1",
|
|
79
|
+
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
80
|
+
"@cloudflare/vite-plugin": "1.25.5",
|
|
81
81
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
82
|
-
"wrangler": "4.
|
|
82
|
+
"wrangler": "4.68.1"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": ">=18.14.1"
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { AngularAppEngine, createRequestHandler } from '@angular/ssr';
|
|
2
2
|
|
|
3
|
-
const angularApp = new AngularAppEngine(
|
|
3
|
+
const angularApp = new AngularAppEngine({
|
|
4
|
+
// It is safe to set allow `localhost`, so that SSR can run in local development,
|
|
5
|
+
// as, in production, Cloudflare will ensure that `localhost` is not the host.
|
|
6
|
+
allowedHosts: ['localhost'],
|
|
7
|
+
});
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
* This is a request handler used by the Angular CLI (dev-server and during build).
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { AngularAppEngine, createRequestHandler } from '@angular/ssr';
|
|
2
2
|
|
|
3
|
-
const angularApp = new AngularAppEngine(
|
|
3
|
+
const angularApp = new AngularAppEngine({
|
|
4
|
+
// It is safe to set allow `localhost`, so that SSR can run in local development,
|
|
5
|
+
// as, in production, Cloudflare will ensure that `localhost` is not the host.
|
|
6
|
+
allowedHosts: ['localhost'],
|
|
7
|
+
});
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
* This is a request handler used by the Angular CLI (dev-server and during build).
|
|
@@ -8,13 +8,7 @@ import type { C3Context } from "types";
|
|
|
8
8
|
const { npm } = detectPackageManager();
|
|
9
9
|
|
|
10
10
|
const generate = async (ctx: C3Context) => {
|
|
11
|
-
const variant = await
|
|
12
|
-
type: "select",
|
|
13
|
-
question: "Select a variant:",
|
|
14
|
-
label: "variant",
|
|
15
|
-
options: variantsOptions,
|
|
16
|
-
defaultValue: variantsOptions[0].value,
|
|
17
|
-
});
|
|
11
|
+
const variant = await getVariant(ctx);
|
|
18
12
|
|
|
19
13
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--template", variant]);
|
|
20
14
|
|
|
@@ -40,6 +34,26 @@ const variantsOptions = [
|
|
|
40
34
|
},
|
|
41
35
|
];
|
|
42
36
|
|
|
37
|
+
async function getVariant(ctx: C3Context) {
|
|
38
|
+
if (ctx.args.variant) {
|
|
39
|
+
const selected = variantsOptions.find((v) => v.value === ctx.args.variant);
|
|
40
|
+
if (!selected) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Unknown variant "${ctx.args.variant}". Valid variants are: ${variantsOptions.map((v) => v.value).join(", ")}`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return selected.value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return await inputPrompt({
|
|
49
|
+
type: "select",
|
|
50
|
+
question: "Select a variant:",
|
|
51
|
+
label: "variant",
|
|
52
|
+
options: variantsOptions,
|
|
53
|
+
defaultValue: variantsOptions[0].value,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
43
57
|
const config: TemplateConfig = {
|
|
44
58
|
configVersion: 1,
|
|
45
59
|
id: "react",
|