create-cloudflare 2.55.1 → 2.57.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 +708 -682
- package/package.json +7 -7
- package/templates/angular/workers/c3.ts +2 -2
- package/templates/hello-world-durable-object/js/src/index.js +1 -1
- package/templates/hello-world-durable-object/py/src/entry.py +1 -1
- package/templates/hello-world-durable-object/ts/src/index.ts +1 -1
- package/templates/hello-world-durable-object-with-assets/js/src/index.js +1 -1
- package/templates/hello-world-durable-object-with-assets/py/src/entry.py +1 -1
- package/templates/hello-world-durable-object-with-assets/ts/src/index.ts +1 -1
- package/templates/pre-existing/c3.ts +4 -4
- package/templates/react/workers/c3.ts +1 -1
- package/templates/redwood/c3.ts +33 -0
- package/templates/solid/c3.ts +1 -9
- package/templates/tanstack-start/c3.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.57.0",
|
|
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.20251128.0",
|
|
34
34
|
"@types/command-exists": "^1.2.0",
|
|
35
35
|
"@types/cross-spawn": "^6.0.2",
|
|
36
36
|
"@types/deepmerge": "^2.2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"degit": "^2.8.4",
|
|
52
52
|
"dns2": "^2.1.0",
|
|
53
53
|
"dotenv": "^16.0.0",
|
|
54
|
-
"esbuild": "0.
|
|
54
|
+
"esbuild": "0.27.0",
|
|
55
55
|
"eslint": "^9.39.1",
|
|
56
56
|
"execa": "^7.1.1",
|
|
57
57
|
"exit-hook": "2.2.1",
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"wrap-ansi": "^9.0.0",
|
|
75
75
|
"xdg-app-paths": "^8.3.0",
|
|
76
76
|
"yargs": "^17.7.2",
|
|
77
|
-
"@cloudflare/cli": "1.1.
|
|
77
|
+
"@cloudflare/cli": "1.1.4",
|
|
78
78
|
"@cloudflare/eslint-config-shared": "1.1.0",
|
|
79
|
-
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
80
79
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
81
|
-
"@cloudflare/vite-plugin": "1.
|
|
82
|
-
"
|
|
80
|
+
"@cloudflare/vite-plugin": "1.16.0",
|
|
81
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
82
|
+
"wrangler": "4.52.0"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": ">=18.14.1"
|
|
@@ -94,12 +94,12 @@ const config: TemplateConfig = {
|
|
|
94
94
|
path: "templates/angular/workers",
|
|
95
95
|
devScript: "start",
|
|
96
96
|
deployScript: "deploy",
|
|
97
|
-
previewScript: "
|
|
97
|
+
previewScript: "preview",
|
|
98
98
|
generate,
|
|
99
99
|
configure,
|
|
100
100
|
transformPackageJson: async () => ({
|
|
101
101
|
scripts: {
|
|
102
|
-
|
|
102
|
+
preview: `${npm} run build && wrangler dev`,
|
|
103
103
|
build: `ng build`,
|
|
104
104
|
deploy: `${npm} run build && wrangler deploy`,
|
|
105
105
|
"cf-typegen": `wrangler types`,
|
|
@@ -31,7 +31,7 @@ export class MyDurableObject extends DurableObject {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* The Durable Object exposes an RPC method sayHello which will be invoked when
|
|
34
|
+
* The Durable Object exposes an RPC method sayHello which will be invoked when a Durable
|
|
35
35
|
* Object instance receives a request from a Worker via the same method invocation on the stub
|
|
36
36
|
*
|
|
37
37
|
* @param {string} name - The name provided to a Durable Object instance from a Worker
|
|
@@ -30,7 +30,7 @@ class MyDurableObject(DurableObject):
|
|
|
30
30
|
super().__init__(ctx, env)
|
|
31
31
|
|
|
32
32
|
"""
|
|
33
|
-
* The Durable Object exposes an RPC method `say_hello` which will be invoked when
|
|
33
|
+
* The Durable Object exposes an RPC method `say_hello` which will be invoked when a Durable
|
|
34
34
|
* Object instance receives a request from a Worker via the same method invocation on the stub
|
|
35
35
|
*
|
|
36
36
|
* @param {string} name - The name provided to a Durable Object instance from a Worker
|
|
@@ -27,7 +27,7 @@ export class MyDurableObject extends DurableObject<Env> {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* The Durable Object exposes an RPC method sayHello which will be invoked when
|
|
30
|
+
* The Durable Object exposes an RPC method sayHello which will be invoked when a Durable
|
|
31
31
|
* Object instance receives a request from a Worker via the same method invocation on the stub
|
|
32
32
|
*
|
|
33
33
|
* @param name - The name provided to a Durable Object instance from a Worker
|
|
@@ -31,7 +31,7 @@ export class MyDurableObject extends DurableObject {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* The Durable Object exposes an RPC method sayHello which will be invoked when
|
|
34
|
+
* The Durable Object exposes an RPC method sayHello which will be invoked when a Durable
|
|
35
35
|
* Object instance receives a request from a Worker via the same method invocation on the stub
|
|
36
36
|
*
|
|
37
37
|
* @param {string} name - The name provided to a Durable Object instance from a Worker
|
|
@@ -30,7 +30,7 @@ class MyDurableObject(DurableObject):
|
|
|
30
30
|
super().__init__(ctx, env)
|
|
31
31
|
|
|
32
32
|
"""
|
|
33
|
-
* The Durable Object exposes an RPC method `say_hello` which will be invoked when
|
|
33
|
+
* The Durable Object exposes an RPC method `say_hello` which will be invoked when a Durable
|
|
34
34
|
* Object instance receives a request from a Worker via the same method invocation on the stub
|
|
35
35
|
*
|
|
36
36
|
* @param {string} name - The name provided to a Durable Object instance from a Worker
|
|
@@ -28,7 +28,7 @@ export class MyDurableObject extends DurableObject {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* The Durable Object exposes an RPC method sayHello which will be invoked when
|
|
31
|
+
* The Durable Object exposes an RPC method sayHello which will be invoked when a Durable
|
|
32
32
|
* Object instance receives a request from a Worker via the same method invocation on the stub
|
|
33
33
|
*
|
|
34
34
|
* @param name - The name provided to a Durable Object instance from a Worker
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { existsSync } from "fs";
|
|
2
|
-
import { cp, mkdtemp } from "fs/promises";
|
|
3
|
-
import { tmpdir } from "os";
|
|
4
|
-
import { join } from "path";
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { cp, mkdtemp } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
5
|
import { brandColor, dim } from "@cloudflare/cli/colors";
|
|
6
6
|
import { processArgument } from "helpers/args";
|
|
7
7
|
import { runCommand } from "helpers/command";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { logRaw } from "@cloudflare/cli";
|
|
2
|
+
import { runFrameworkGenerator } from "frameworks/index";
|
|
3
|
+
import { detectPackageManager } from "helpers/packageManagers";
|
|
4
|
+
import type { TemplateConfig } from "../../src/templates";
|
|
5
|
+
import type { C3Context } from "types";
|
|
6
|
+
|
|
7
|
+
const { npm } = detectPackageManager();
|
|
8
|
+
|
|
9
|
+
const generate = async (ctx: C3Context) => {
|
|
10
|
+
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
11
|
+
|
|
12
|
+
logRaw("");
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const config: TemplateConfig = {
|
|
16
|
+
configVersion: 1,
|
|
17
|
+
id: "redwood",
|
|
18
|
+
platform: "workers",
|
|
19
|
+
frameworkCli: "create-rwsdk",
|
|
20
|
+
displayName: "RedwoodSDK",
|
|
21
|
+
generate,
|
|
22
|
+
transformPackageJson: async () => ({
|
|
23
|
+
scripts: {
|
|
24
|
+
deploy: `${npm} run release`,
|
|
25
|
+
preview: `${npm} run build && wrangler dev`,
|
|
26
|
+
"cf-typegen": `wrangler types`,
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
devScript: "dev",
|
|
30
|
+
deployScript: "release",
|
|
31
|
+
previewScript: "preview",
|
|
32
|
+
};
|
|
33
|
+
export default config;
|
package/templates/solid/c3.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { logRaw, updateStatus } from "@cloudflare/cli";
|
|
2
|
-
import { blue
|
|
2
|
+
import { blue } from "@cloudflare/cli/colors";
|
|
3
3
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
4
4
|
import { mergeObjectProperties, transformFile } from "helpers/codemod";
|
|
5
5
|
import { getWorkerdCompatibilityDate } from "helpers/compatDate";
|
|
6
6
|
import { usesTypescript } from "helpers/files";
|
|
7
7
|
import { detectPackageManager } from "helpers/packageManagers";
|
|
8
|
-
import { installPackages } from "helpers/packages";
|
|
9
8
|
import * as recast from "recast";
|
|
10
9
|
import type { TemplateConfig } from "../../src/templates";
|
|
11
10
|
import type { C3Context } from "types";
|
|
@@ -21,13 +20,6 @@ const generate = async (ctx: C3Context) => {
|
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
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
23
|
usesTypescript(ctx);
|
|
32
24
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
33
25
|
|