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.
Files changed (83) hide show
  1. package/dist/cli.js +199 -165
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +4 -4
  4. package/templates/analog/c3.ts +0 -24
  5. package/templates/analog/templates/env.d.ts +1 -1
  6. package/templates/angular/pages/c3.ts +3 -3
  7. package/templates/angular/pages/templates/wrangler.jsonc +5 -0
  8. package/templates/angular/workers/c3.ts +1 -0
  9. package/templates/astro/workers/templates/js/wrangler.jsonc +2 -1
  10. package/templates/astro/workers/templates/ts/wrangler.jsonc +2 -1
  11. package/templates/common/ts/tsconfig.json +0 -3
  12. package/templates/docusaurus/pages/c3.ts +1 -0
  13. package/templates/docusaurus/workers/c3.ts +1 -0
  14. package/templates/gatsby/pages/c3.ts +1 -0
  15. package/templates/gatsby/workers/c3.ts +1 -0
  16. package/templates/hello-world/ts/test/index.spec.ts +0 -1
  17. package/templates/hello-world/ts/test/tsconfig.json +1 -1
  18. package/templates/hello-world/ts/tsconfig.json +0 -2
  19. package/templates/hello-world-assets-only/templates/public/index.html +1 -0
  20. package/templates/hello-world-assets-only/templates/wrangler.jsonc +1 -0
  21. package/templates/hello-world-durable-object/ts/tsconfig.json +0 -2
  22. package/templates/hello-world-durable-object-with-assets/js/public/index.html +1 -0
  23. package/templates/hello-world-durable-object-with-assets/js/wrangler.jsonc +1 -1
  24. package/templates/hello-world-durable-object-with-assets/py/public/index.html +1 -0
  25. package/templates/hello-world-durable-object-with-assets/py/wrangler.jsonc +1 -1
  26. package/templates/hello-world-durable-object-with-assets/ts/public/index.html +1 -0
  27. package/templates/hello-world-durable-object-with-assets/ts/tsconfig.json +0 -2
  28. package/templates/hello-world-durable-object-with-assets/ts/wrangler.jsonc +1 -1
  29. package/templates/hello-world-with-assets/js/public/index.html +1 -0
  30. package/templates/hello-world-with-assets/js/wrangler.jsonc +3 -2
  31. package/templates/hello-world-with-assets/py/public/index.html +1 -0
  32. package/templates/hello-world-with-assets/py/wrangler.jsonc +1 -1
  33. package/templates/hello-world-with-assets/ts/public/index.html +1 -0
  34. package/templates/hello-world-with-assets/ts/test/tsconfig.json +1 -1
  35. package/templates/hello-world-with-assets/ts/tsconfig.json +0 -2
  36. package/templates/hello-world-with-assets/ts/wrangler.jsonc +2 -2
  37. package/templates/hono/pages/c3.ts +4 -1
  38. package/templates/hono/workers/c3.ts +3 -1
  39. package/templates/next/pages/c3.ts +6 -10
  40. package/templates/next/workers/c3.ts +7 -5
  41. package/templates/nuxt/pages/c3.ts +2 -26
  42. package/templates/nuxt/pages/templates/env.d.ts +1 -1
  43. package/templates/nuxt/workers/c3.ts +2 -26
  44. package/templates/nuxt/workers/templates/env.d.ts +1 -1
  45. package/templates/openapi/ts/tsconfig.json +0 -1
  46. package/templates/queues/ts/tsconfig.json +0 -2
  47. package/templates/qwik/pages/c3.ts +1 -0
  48. package/templates/qwik/workers/c3.ts +1 -0
  49. package/templates/qwik/workers/templates/wrangler.jsonc +2 -1
  50. package/templates/react/pages/c3.ts +4 -2
  51. package/templates/react/pages/templates/wrangler.jsonc +5 -0
  52. package/templates/react/workers/ts/tsconfig.worker.json +1 -1
  53. package/templates/react-router/c3.ts +0 -12
  54. package/templates/remix/pages/c3.ts +1 -0
  55. package/templates/remix/pages/templates/worker-configuration.d.ts +1 -1
  56. package/templates/remix/workers/c3.ts +1 -0
  57. package/templates/scheduled/ts/tsconfig.json +0 -2
  58. package/templates/solid/c3.ts +1 -0
  59. package/templates/svelte/pages/c3.ts +3 -3
  60. package/templates/svelte/workers/c3.ts +3 -3
  61. package/templates/vue/pages/c3.ts +5 -3
  62. package/templates/vue/pages/templates/wrangler.jsonc +5 -0
  63. package/templates/vue/workers/ts/tsconfig.worker.json +1 -1
  64. package/templates-experimental/solid/c3.ts +1 -1
  65. package/templates/analog/templates/worker-configuration.d.ts +0 -4
  66. package/templates/astro/workers/templates/ts/worker-configuration.d.ts +0 -4
  67. package/templates/common/ts/worker-configuration.d.ts +0 -4
  68. package/templates/hello-world/ts/worker-configuration.d.ts +0 -8
  69. package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +0 -7
  70. package/templates/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +0 -8
  71. package/templates/hello-world-with-assets/ts/worker-configuration.d.ts +0 -7
  72. package/templates/hono/pages/templates/worker-configuration.d.ts +0 -4
  73. package/templates/hono/workers/templates/worker-configuration.d.ts +0 -4
  74. package/templates/next/pages/env.d.ts +0 -5
  75. package/templates/next/workers/templates/cloudflare-env.d.ts +0 -5
  76. package/templates/nuxt/pages/templates/worker-configuration.d.ts +0 -4
  77. package/templates/nuxt/workers/templates/worker-configuration.d.ts +0 -4
  78. package/templates/openapi/ts/worker-configuration.d.ts +0 -4
  79. package/templates/queues/ts/worker-configuration.d.ts +0 -5
  80. package/templates/react/workers/ts/worker-configuration.d.ts +0 -5
  81. package/templates/react-router/templates/worker-configuration.d.ts +0 -8
  82. package/templates/scheduled/ts/worker-configuration.d.ts +0 -4
  83. 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
 
@@ -146,5 +146,6 @@ const config: TemplateConfig = {
146
146
  devScript: "dev",
147
147
  deployScript: "deploy",
148
148
  previewScript: "preview",
149
+ workersTypes: "installed",
149
150
  };
150
151
  export default config;
@@ -148,5 +148,6 @@ const config: TemplateConfig = {
148
148
  devScript: "dev",
149
149
  deployScript: "deploy",
150
150
  previewScript: "preview",
151
+ workersTypes: "installed",
151
152
  };
152
153
  export default config;
@@ -3,7 +3,8 @@
3
3
  "main": "./dist/_worker.js",
4
4
  "compatibility_date": "<TBD>",
5
5
  "compatibility_flags": [
6
- "nodejs_compat"
6
+ "nodejs_compat",
7
+ "global_fetch_strictly_public"
7
8
  ],
8
9
  "assets": {
9
10
  "binding": "ASSET",
@@ -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 ./dist`,
56
- preview: `${npm} run build && wrangler pages dev ./dist`,
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",
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "<TBD>",
3
+ "compatibility_date": "<TBD>",
4
+ "pages_build_output_dir": "./dist"
5
+ }
@@ -2,7 +2,7 @@
2
2
  "extends": "./tsconfig.node.json",
3
3
  "compilerOptions": {
4
4
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.worker.tsbuildinfo",
5
- "types": ["@cloudflare/workers-types/2023-07-01", "vite/client"]
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 () => ({
@@ -65,5 +65,6 @@ const config: TemplateConfig = {
65
65
  devScript: "dev",
66
66
  deployScript: "deploy",
67
67
  previewScript: "preview",
68
+ workersTypes: "installed",
68
69
  };
69
70
  export default config;
@@ -1,4 +1,4 @@
1
1
  // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
2
+ // After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen`
3
3
  interface Env {
4
4
  }
@@ -48,5 +48,6 @@ const config: TemplateConfig = {
48
48
  devScript: "dev",
49
49
  deployScript: "deploy",
50
50
  previewScript: "preview",
51
+ workersTypes: "installed",
51
52
  };
52
53
  export default config;
@@ -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
 
@@ -77,6 +77,7 @@ const config: TemplateConfig = {
77
77
  scripts: {
78
78
  preview: `${npm} run build && npx wrangler pages dev`,
79
79
  deploy: `${npm} run build && wrangler pages deploy`,
80
+ "cf-typegen": `wrangler types`,
80
81
  },
81
82
  }),
82
83
  compatibilityFlags: ["nodejs_compat"],
@@ -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 && ${mv} worker-configuration.d.ts src/`,
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 && ${mv} worker-configuration.d.ts src/`,
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/vue",
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 ./dist`,
24
- preview: `${npm} run build && wrangler pages dev ./dist`,
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",
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "<TBD>",
3
+ "compatibility_date": "<TBD>",
4
+ "pages_build_output_dir": "./dist"
5
+ }
@@ -2,7 +2,7 @@
2
2
  "extends": "./tsconfig.node.json",
3
3
  "compilerOptions": {
4
4
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.worker.tsbuildinfo",
5
- "types": ["@cloudflare/workers-types/2023-07-01", "./worker-configuration.d.ts","vite/client"],
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,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- }
@@ -1,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- }
@@ -1,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- }
@@ -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,7 +0,0 @@
1
- // Generated by Wrangler by running `wrangler types --include-runtime=false` (hash: 187132f48ddf0f604882ba8213fe386f)
2
- declare namespace Cloudflare {
3
- interface Env {
4
- ASSETS: Fetcher;
5
- }
6
- }
7
- interface Env extends Cloudflare.Env {}
@@ -1,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface CloudflareBindings {
4
- }
@@ -1,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface CloudflareBindings {
4
- }
@@ -1,5 +0,0 @@
1
- // Generated by Wrangler
2
- // by running `wrangler types --env-interface CloudflareEnv env.d.ts`
3
-
4
- interface CloudflareEnv {
5
- }
@@ -1,5 +0,0 @@
1
- // Generated by Wrangler
2
- // by running `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
3
-
4
- interface CloudflareEnv {
5
- }
@@ -1,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- }
@@ -1,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- }
@@ -1,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- }
@@ -1,5 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- MY_QUEUE: Queue;
5
- }
@@ -1,5 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- ASSETS: Fetcher;
5
- }
@@ -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 {}
@@ -1,4 +0,0 @@
1
- // Generated by Wrangler
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
- interface Env {
4
- }
@@ -1,6 +0,0 @@
1
- // Generated by Wrangler by running `wrangler types`
2
- // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
-
4
- interface Env {
5
- ASSETS: Fetcher;
6
- }