create-cloudflare 0.0.0-e55f489db → 0.0.0-e5ae13ade
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 +199 -165
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/templates/analog/c3.ts +0 -24
- package/templates/analog/templates/env.d.ts +1 -1
- package/templates/angular/pages/c3.ts +3 -3
- package/templates/angular/pages/templates/wrangler.jsonc +5 -0
- package/templates/angular/workers/c3.ts +1 -0
- package/templates/astro/workers/templates/js/wrangler.jsonc +2 -1
- package/templates/astro/workers/templates/ts/wrangler.jsonc +2 -1
- package/templates/common/ts/tsconfig.json +0 -3
- package/templates/docusaurus/pages/c3.ts +1 -0
- package/templates/docusaurus/workers/c3.ts +1 -0
- package/templates/gatsby/pages/c3.ts +1 -0
- package/templates/gatsby/workers/c3.ts +1 -0
- package/templates/hello-world/ts/test/index.spec.ts +0 -1
- package/templates/hello-world/ts/test/tsconfig.json +1 -1
- package/templates/hello-world/ts/tsconfig.json +0 -2
- package/templates/hello-world-assets-only/templates/public/index.html +1 -0
- package/templates/hello-world-assets-only/templates/wrangler.jsonc +1 -0
- package/templates/hello-world-durable-object/ts/tsconfig.json +0 -2
- package/templates/hello-world-durable-object-with-assets/js/public/index.html +1 -0
- package/templates/hello-world-durable-object-with-assets/js/wrangler.jsonc +1 -1
- package/templates/hello-world-durable-object-with-assets/py/public/index.html +1 -0
- package/templates/hello-world-durable-object-with-assets/py/wrangler.jsonc +1 -1
- package/templates/hello-world-durable-object-with-assets/ts/public/index.html +1 -0
- package/templates/hello-world-durable-object-with-assets/ts/tsconfig.json +0 -2
- package/templates/hello-world-durable-object-with-assets/ts/wrangler.jsonc +1 -1
- package/templates/hello-world-with-assets/js/public/index.html +1 -0
- package/templates/hello-world-with-assets/js/wrangler.jsonc +3 -2
- package/templates/hello-world-with-assets/py/public/index.html +1 -0
- package/templates/hello-world-with-assets/py/wrangler.jsonc +1 -1
- package/templates/hello-world-with-assets/ts/public/index.html +1 -0
- package/templates/hello-world-with-assets/ts/test/tsconfig.json +1 -1
- package/templates/hello-world-with-assets/ts/tsconfig.json +0 -2
- package/templates/hello-world-with-assets/ts/wrangler.jsonc +2 -2
- package/templates/hono/pages/c3.ts +4 -1
- package/templates/hono/workers/c3.ts +3 -1
- package/templates/next/pages/c3.ts +6 -10
- package/templates/next/workers/c3.ts +7 -5
- package/templates/nuxt/pages/c3.ts +2 -26
- package/templates/nuxt/pages/templates/env.d.ts +1 -1
- package/templates/nuxt/workers/c3.ts +2 -26
- package/templates/nuxt/workers/templates/env.d.ts +1 -1
- package/templates/openapi/ts/tsconfig.json +0 -1
- package/templates/queues/ts/tsconfig.json +0 -2
- package/templates/qwik/pages/c3.ts +1 -0
- package/templates/qwik/workers/c3.ts +1 -0
- package/templates/qwik/workers/templates/wrangler.jsonc +2 -1
- package/templates/react/pages/c3.ts +4 -2
- package/templates/react/pages/templates/wrangler.jsonc +5 -0
- package/templates/react/workers/ts/tsconfig.worker.json +1 -1
- package/templates/react-router/c3.ts +0 -12
- package/templates/remix/pages/c3.ts +1 -0
- package/templates/remix/pages/templates/worker-configuration.d.ts +1 -1
- package/templates/remix/workers/c3.ts +1 -0
- package/templates/scheduled/ts/tsconfig.json +0 -2
- package/templates/solid/c3.ts +1 -0
- package/templates/svelte/pages/c3.ts +3 -3
- package/templates/svelte/workers/c3.ts +3 -3
- package/templates/vue/pages/c3.ts +5 -3
- package/templates/vue/pages/templates/wrangler.jsonc +5 -0
- package/templates/vue/workers/ts/tsconfig.worker.json +1 -1
- package/templates-experimental/solid/c3.ts +1 -1
- package/templates/analog/templates/worker-configuration.d.ts +0 -4
- package/templates/astro/workers/templates/ts/worker-configuration.d.ts +0 -4
- package/templates/common/ts/worker-configuration.d.ts +0 -4
- package/templates/hello-world/ts/worker-configuration.d.ts +0 -8
- package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +0 -7
- package/templates/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +0 -8
- package/templates/hello-world-with-assets/ts/worker-configuration.d.ts +0 -7
- package/templates/hono/pages/templates/worker-configuration.d.ts +0 -4
- package/templates/hono/workers/templates/worker-configuration.d.ts +0 -4
- package/templates/next/pages/env.d.ts +0 -5
- package/templates/next/workers/templates/cloudflare-env.d.ts +0 -5
- package/templates/nuxt/pages/templates/worker-configuration.d.ts +0 -4
- package/templates/nuxt/workers/templates/worker-configuration.d.ts +0 -4
- package/templates/openapi/ts/worker-configuration.d.ts +0 -4
- package/templates/queues/ts/worker-configuration.d.ts +0 -5
- package/templates/react/workers/ts/worker-configuration.d.ts +0 -5
- package/templates/react-router/templates/worker-configuration.d.ts +0 -8
- package/templates/scheduled/ts/worker-configuration.d.ts +0 -4
- package/templates/vue/workers/ts/worker-configuration.d.ts +0 -6
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
"module": "es2022",
|
|
14
14
|
/* Specify how TypeScript looks up a file from a given module specifier. */
|
|
15
15
|
"moduleResolution": "node",
|
|
16
|
-
/* Specify type package names to be included without being referenced in a source file. */
|
|
17
|
-
"types": ["@cloudflare/workers-types"],
|
|
18
16
|
/* Enable importing .json files */
|
|
19
17
|
"resolveJsonModule": true,
|
|
20
18
|
|
|
@@ -49,11 +49,13 @@ const config: TemplateConfig = {
|
|
|
49
49
|
platform: "pages",
|
|
50
50
|
hidden: true,
|
|
51
51
|
path: "templates/react/pages",
|
|
52
|
+
copyFiles: { path: "./templates" },
|
|
52
53
|
generate,
|
|
53
54
|
transformPackageJson: async () => ({
|
|
54
55
|
scripts: {
|
|
55
|
-
deploy: `${npm} run build && wrangler pages deploy
|
|
56
|
-
preview: `${npm} run build && wrangler pages dev
|
|
56
|
+
deploy: `${npm} run build && wrangler pages deploy`,
|
|
57
|
+
preview: `${npm} run build && wrangler pages dev`,
|
|
58
|
+
"cf-typegen": `wrangler types`,
|
|
57
59
|
},
|
|
58
60
|
}),
|
|
59
61
|
devScript: "dev",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"extends": "./tsconfig.node.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.worker.tsbuildinfo",
|
|
5
|
-
"types": ["
|
|
5
|
+
"types": ["./worker-configuration.d.ts", "vite/client"],
|
|
6
6
|
},
|
|
7
7
|
"include": ["./worker-configuration.d.ts", "./worker"]
|
|
8
8
|
}
|
|
@@ -19,24 +19,12 @@ const generate = async (ctx: C3Context) => {
|
|
|
19
19
|
logRaw(""); // newline
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
// TODO: Uncomment this once @react-router/dev updates its peer dependency to Wrangler v4
|
|
23
|
-
// const configure = async () => {
|
|
24
|
-
// await installPackages(["wrangler@latest"], {
|
|
25
|
-
// dev: true,
|
|
26
|
-
// startText: "Updating the Wrangler version",
|
|
27
|
-
// doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`,
|
|
28
|
-
// });
|
|
29
|
-
// };
|
|
30
|
-
|
|
31
22
|
const config: TemplateConfig = {
|
|
32
23
|
configVersion: 1,
|
|
33
24
|
id: "react-router",
|
|
34
25
|
platform: "workers",
|
|
35
26
|
frameworkCli: "create-react-router",
|
|
36
27
|
displayName: "React Router (formerly Remix)",
|
|
37
|
-
copyFiles: {
|
|
38
|
-
path: "./templates",
|
|
39
|
-
},
|
|
40
28
|
generate,
|
|
41
29
|
// configure,
|
|
42
30
|
transformPackageJson: async () => ({
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
"module": "es2022",
|
|
14
14
|
/* Specify how TypeScript looks up a file from a given module specifier. */
|
|
15
15
|
"moduleResolution": "node",
|
|
16
|
-
/* Specify type package names to be included without being referenced in a source file. */
|
|
17
|
-
"types": ["@cloudflare/workers-types"],
|
|
18
16
|
/* Enable importing .json files */
|
|
19
17
|
"resolveJsonModule": true,
|
|
20
18
|
|
package/templates/solid/c3.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import { platform } from "node:os";
|
|
3
2
|
import { logRaw, updateStatus } from "@cloudflare/cli";
|
|
4
3
|
import { blue, brandColor, dim } from "@cloudflare/cli/colors";
|
|
5
4
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
@@ -124,6 +123,7 @@ const updateTypeDefinitions = (ctx: C3Context) => {
|
|
|
124
123
|
});
|
|
125
124
|
};
|
|
126
125
|
|
|
126
|
+
const typesPath = "src/worker-configuration.d.ts";
|
|
127
127
|
const config: TemplateConfig = {
|
|
128
128
|
configVersion: 1,
|
|
129
129
|
id: "svelte",
|
|
@@ -144,10 +144,9 @@ const config: TemplateConfig = {
|
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
if (usesTypescript(ctx)) {
|
|
147
|
-
const mv = platform() === "win32" ? "move" : "mv";
|
|
148
147
|
scripts = {
|
|
149
148
|
...scripts,
|
|
150
|
-
"cf-typegen": `wrangler types
|
|
149
|
+
"cf-typegen": `wrangler types ${typesPath}`,
|
|
151
150
|
};
|
|
152
151
|
}
|
|
153
152
|
|
|
@@ -156,5 +155,6 @@ const config: TemplateConfig = {
|
|
|
156
155
|
devScript: "dev",
|
|
157
156
|
deployScript: "deploy",
|
|
158
157
|
previewScript: "preview",
|
|
158
|
+
typesPath,
|
|
159
159
|
};
|
|
160
160
|
export default config;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { platform } from "node:os";
|
|
2
1
|
import { logRaw, updateStatus } from "@cloudflare/cli";
|
|
3
2
|
import { blue, brandColor, dim } from "@cloudflare/cli/colors";
|
|
4
3
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
@@ -94,6 +93,7 @@ const updateTypeDefinitions = (ctx: C3Context) => {
|
|
|
94
93
|
});
|
|
95
94
|
};
|
|
96
95
|
|
|
96
|
+
const typesPath = "./src/worker-configuration.d.ts";
|
|
97
97
|
const config: TemplateConfig = {
|
|
98
98
|
configVersion: 1,
|
|
99
99
|
id: "svelte",
|
|
@@ -113,10 +113,9 @@ const config: TemplateConfig = {
|
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
if (usesTypescript(ctx)) {
|
|
116
|
-
const mv = platform() === "win32" ? "move" : "mv";
|
|
117
116
|
scripts = {
|
|
118
117
|
...scripts,
|
|
119
|
-
"cf-typegen": `wrangler types
|
|
118
|
+
"cf-typegen": `wrangler types ${typesPath}`,
|
|
120
119
|
};
|
|
121
120
|
}
|
|
122
121
|
|
|
@@ -125,5 +124,6 @@ const config: TemplateConfig = {
|
|
|
125
124
|
devScript: "dev",
|
|
126
125
|
deployScript: "deploy",
|
|
127
126
|
previewScript: "preview",
|
|
127
|
+
typesPath,
|
|
128
128
|
};
|
|
129
129
|
export default config;
|
|
@@ -16,12 +16,14 @@ const config: TemplateConfig = {
|
|
|
16
16
|
displayName: "Vue",
|
|
17
17
|
platform: "pages",
|
|
18
18
|
hidden: true,
|
|
19
|
-
path: "templates/pages
|
|
19
|
+
path: "templates/vue/pages",
|
|
20
|
+
copyFiles: { path: "./templates" },
|
|
20
21
|
generate,
|
|
21
22
|
transformPackageJson: async () => ({
|
|
22
23
|
scripts: {
|
|
23
|
-
deploy: `${npm} run build && wrangler pages deploy
|
|
24
|
-
preview: `${npm} run build && wrangler pages dev
|
|
24
|
+
deploy: `${npm} run build && wrangler pages deploy`,
|
|
25
|
+
preview: `${npm} run build && wrangler pages dev`,
|
|
26
|
+
"cf-typegen": `wrangler types`,
|
|
25
27
|
},
|
|
26
28
|
}),
|
|
27
29
|
devScript: "dev",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"extends": "./tsconfig.node.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.worker.tsbuildinfo",
|
|
5
|
-
"types": [
|
|
5
|
+
"types": [ "./worker-configuration.d.ts","vite/client"],
|
|
6
6
|
},
|
|
7
7
|
"include": ["server"],
|
|
8
8
|
}
|
|
@@ -84,9 +84,9 @@ const config: TemplateConfig = {
|
|
|
84
84
|
scripts: {
|
|
85
85
|
preview: `${npm} run build && npx wrangler dev`,
|
|
86
86
|
deploy: `${npm} run build && wrangler deploy`,
|
|
87
|
+
"cf-typegen": `wrangler types`,
|
|
87
88
|
},
|
|
88
89
|
}),
|
|
89
|
-
compatibilityFlags: ["nodejs_compat"],
|
|
90
90
|
devScript: "dev",
|
|
91
91
|
deployScript: "deploy",
|
|
92
92
|
previewScript: "preview",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Generated by Wrangler by running `wrangler types --include-runtime=false` (hash: 2905fd8e181cd2f4083a615fa51f1913)
|
|
2
|
-
// After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
|
|
3
|
-
declare namespace Cloudflare {
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-empty-object-type
|
|
5
|
-
interface Env {
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
interface Env extends Cloudflare.Env {}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Generated by Wrangler by running `wrangler types --include-runtime=false` (hash: 4c81d17e8de07f650cddf73ce751ba8d)
|
|
2
|
-
declare namespace Cloudflare {
|
|
3
|
-
interface Env {
|
|
4
|
-
MY_DURABLE_OBJECT: DurableObjectNamespace<import("./src/index").MyDurableObject>;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
interface Env extends Cloudflare.Env {}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Generated by Wrangler by running `wrangler types --include-runtime=false` (hash: 24be54e90498ce3774054fcb8bb2bc1a)
|
|
2
|
-
declare namespace Cloudflare {
|
|
3
|
-
interface Env {
|
|
4
|
-
MY_DURABLE_OBJECT: DurableObjectNamespace<import("./src/index").MyDurableObject>;
|
|
5
|
-
ASSETS: Fetcher;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
interface Env extends Cloudflare.Env {}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Generated by Wrangler
|
|
2
|
-
// After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
|
|
3
|
-
declare namespace Cloudflare {
|
|
4
|
-
interface Env {
|
|
5
|
-
VALUE_FROM_CLOUDFLARE: "Hello from Cloudflare";
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
interface Env extends Cloudflare.Env {}
|