create-cloudflare 0.0.0-d329da16c → 0.0.0-d34ef3d5b

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": "0.0.0-d329da16c",
3
+ "version": "0.0.0-d34ef3d5b",
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.20250405.0",
33
+ "@cloudflare/workers-types": "^4.20250424.0",
34
34
  "@iarna/toml": "^3.0.0",
35
35
  "@types/command-exists": "^1.2.0",
36
36
  "@types/cross-spawn": "^6.0.2",
@@ -52,7 +52,7 @@
52
52
  "degit": "^2.8.4",
53
53
  "dns2": "^2.1.0",
54
54
  "dotenv": "^16.0.0",
55
- "esbuild": "0.24.2",
55
+ "esbuild": "0.25.2",
56
56
  "execa": "^7.1.1",
57
57
  "glob": "^10.3.3",
58
58
  "haikunator": "^2.1.2",
@@ -65,17 +65,17 @@
65
65
  "undici": "^5.28.5",
66
66
  "vite": "^5.4.14",
67
67
  "vite-tsconfig-paths": "^4.0.8",
68
- "vitest": "~3.0.8",
68
+ "vitest": "~3.1.1",
69
69
  "which-pm-runs": "^1.1.0",
70
70
  "wrap-ansi": "^9.0.0",
71
71
  "xdg-app-paths": "^8.3.0",
72
72
  "yargs": "^17.7.2",
73
73
  "@cloudflare/cli": "1.1.1",
74
- "@cloudflare/mock-npm-registry": "0.0.0",
75
- "@cloudflare/vite-plugin": "0.0.0-d329da16c",
76
- "@cloudflare/workers-tsconfig": "0.0.0",
77
74
  "@cloudflare/eslint-config-worker": "1.1.0",
78
- "wrangler": "0.0.0-d329da16c"
75
+ "@cloudflare/mock-npm-registry": "0.0.0",
76
+ "@cloudflare/vite-plugin": "0.0.0-d34ef3d5b",
77
+ "wrangler": "0.0.0-d34ef3d5b",
78
+ "@cloudflare/workers-tsconfig": "0.0.0"
79
79
  },
80
80
  "engines": {
81
81
  "node": ">=18.14.1"
@@ -9,7 +9,7 @@
9
9
  "test": "vitest"
10
10
  },
11
11
  "devDependencies": {
12
- "@cloudflare/vitest-pool-workers": "^0.7.5",
12
+ "@cloudflare/vitest-pool-workers": "^0.8.19",
13
13
  "wrangler": "^3.101.0",
14
14
  "vitest": "~3.0.7"
15
15
  }
@@ -6,4 +6,4 @@ readme = "README.md"
6
6
  requires-python = ">=3.12"
7
7
  dependencies = [
8
8
  "webtypy>=0.1.7",
9
- ]
9
+ ]
@@ -10,7 +10,7 @@
10
10
  "cf-typegen": "wrangler types"
11
11
  },
12
12
  "devDependencies": {
13
- "@cloudflare/vitest-pool-workers": "^0.7.5",
13
+ "@cloudflare/vitest-pool-workers": "^0.8.19",
14
14
  "typescript": "^5.5.2",
15
15
  "vitest": "~3.0.7",
16
16
  "wrangler": "^3.101.0"
@@ -4,9 +4,9 @@ const config: TemplateConfig = {
4
4
  configVersion: 1,
5
5
  id: "hello-world-assets-only",
6
6
  path: "templates/hello-world-assets-only",
7
- displayName: "Assets only",
7
+ displayName: "Static site",
8
8
  description:
9
- "For static sites (including SPAs) or when using your own backend",
9
+ "For static sites or when using your own backend. Uses Workers Static Assets.",
10
10
  platform: "workers",
11
11
  copyFiles: {
12
12
  path: "./templates",
@@ -4,8 +4,9 @@ const config: TemplateConfig = {
4
4
  configVersion: 1,
5
5
  id: "hello-world-with-assets",
6
6
  path: "templates/hello-world-with-assets",
7
- displayName: "Worker + Assets",
8
- description: "For static sites with an API or server-side rendering (SSR)",
7
+ displayName: "SSR / full-stack app",
8
+ description:
9
+ "For sites with a backend API, or server-side rendering (SSR). Uses Static Assets with a Worker.",
9
10
  platform: "workers",
10
11
  copyFiles: {
11
12
  variants: {
@@ -9,7 +9,7 @@
9
9
  "test": "vitest"
10
10
  },
11
11
  "devDependencies": {
12
- "@cloudflare/vitest-pool-workers": "^0.7.5",
12
+ "@cloudflare/vitest-pool-workers": "^0.8.19",
13
13
  "wrangler": "^3.101.0",
14
14
  "vitest": "~3.0.7"
15
15
  }
@@ -10,7 +10,7 @@
10
10
  "cf-typegen": "wrangler types"
11
11
  },
12
12
  "devDependencies": {
13
- "@cloudflare/vitest-pool-workers": "^0.7.5",
13
+ "@cloudflare/vitest-pool-workers": "^0.8.19",
14
14
  "typescript": "^5.5.2",
15
15
  "vitest": "~3.0.7",
16
16
  "wrangler": "^3.101.0"
@@ -51,7 +51,7 @@ export default {
51
51
  configVersion: 1,
52
52
  id: "next",
53
53
  frameworkCli: "create-next-app",
54
- frameworkCliPinnedVersion: "~15.2.4",
54
+ frameworkCliPinnedVersion: "~15.3.0",
55
55
  platform: "workers",
56
56
  displayName: "Next.js (using Node.js compat + Workers Assets)",
57
57
  path: "templates/next/workers",
@@ -1,6 +1,9 @@
1
1
  import { defineCloudflareConfig } from "@opennextjs/cloudflare";
2
- import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";
3
2
 
4
3
  export default defineCloudflareConfig({
5
- incrementalCache: r2IncrementalCache,
4
+ // Uncomment to enable R2 cache,
5
+ // It should be imported as:
6
+ // `import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";`
7
+ // See https://opennext.js.org/cloudflare/caching for more details
8
+ // incrementalCache: r2IncrementalCache,
6
9
  });
@@ -169,3 +169,4 @@ dist
169
169
  # wrangler project
170
170
 
171
171
  .dev.vars
172
+ .wrangler/
@@ -9,13 +9,14 @@
9
9
  "cf-typegen": "wrangler types"
10
10
  },
11
11
  "dependencies": {
12
- "chanfana": "^2.0.2",
13
- "zod": "^3.23.8",
14
- "hono": "^4.4.7"
12
+ "chanfana": "^2.6.3",
13
+ "hono": "^4.6.20",
14
+ "zod": "^3.24.1"
15
15
  },
16
16
  "devDependencies": {
17
- "@types/node": "20.8.3",
18
- "@types/service-worker-mock": "^2.0.1",
19
- "wrangler": "^3.101.0"
17
+ "@cloudflare/workers-types": "^4.20250129.0",
18
+ "@types/node": "22.13.0",
19
+ "@types/service-worker-mock": "^2.0.4",
20
+ "wrangler": "^3.107.2"
20
21
  }
21
22
  }
@@ -1,6 +1,6 @@
1
1
  import { Bool, OpenAPIRoute } from "chanfana";
2
2
  import { z } from "zod";
3
- import { Task } from "../types";
3
+ import { type AppContext, Task } from "../types";
4
4
 
5
5
  export class TaskCreate extends OpenAPIRoute {
6
6
  schema = {
@@ -34,7 +34,7 @@ export class TaskCreate extends OpenAPIRoute {
34
34
  },
35
35
  };
36
36
 
37
- async handle(c) {
37
+ async handle(c: AppContext) {
38
38
  // Get validated data
39
39
  const data = await this.getValidatedData<typeof this.schema>();
40
40
 
@@ -1,6 +1,6 @@
1
1
  import { Bool, OpenAPIRoute, Str } from "chanfana";
2
2
  import { z } from "zod";
3
- import { Task } from "../types";
3
+ import { type AppContext, Task } from "../types";
4
4
 
5
5
  export class TaskDelete extends OpenAPIRoute {
6
6
  schema = {
@@ -30,7 +30,7 @@ export class TaskDelete extends OpenAPIRoute {
30
30
  },
31
31
  };
32
32
 
33
- async handle(c) {
33
+ async handle(c: AppContext) {
34
34
  // Get validated data
35
35
  const data = await this.getValidatedData<typeof this.schema>();
36
36
 
@@ -1,6 +1,6 @@
1
1
  import { Bool, OpenAPIRoute, Str } from "chanfana";
2
2
  import { z } from "zod";
3
- import { Task } from "../types";
3
+ import { type AppContext, Task } from "../types";
4
4
 
5
5
  export class TaskFetch extends OpenAPIRoute {
6
6
  schema = {
@@ -43,7 +43,7 @@ export class TaskFetch extends OpenAPIRoute {
43
43
  },
44
44
  };
45
45
 
46
- async handle(c) {
46
+ async handle(c: AppContext) {
47
47
  // Get validated data
48
48
  const data = await this.getValidatedData<typeof this.schema>();
49
49
 
@@ -1,6 +1,6 @@
1
1
  import { Bool, Num, OpenAPIRoute } from "chanfana";
2
2
  import { z } from "zod";
3
- import { Task } from "../types";
3
+ import { type AppContext, Task } from "../types";
4
4
 
5
5
  export class TaskList extends OpenAPIRoute {
6
6
  schema = {
@@ -37,7 +37,7 @@ export class TaskList extends OpenAPIRoute {
37
37
  },
38
38
  };
39
39
 
40
- async handle(c) {
40
+ async handle(c: AppContext) {
41
41
  // Get validated data
42
42
  const data = await this.getValidatedData<typeof this.schema>();
43
43
 
@@ -6,7 +6,7 @@ import { TaskFetch } from "./endpoints/taskFetch";
6
6
  import { TaskList } from "./endpoints/taskList";
7
7
 
8
8
  // Start a Hono app
9
- const app = new Hono();
9
+ const app = new Hono<{ Bindings: Env }>();
10
10
 
11
11
  // Setup OpenAPI registry
12
12
  const openapi = fromHono(app, {
@@ -19,5 +19,8 @@ openapi.post("/api/tasks", TaskCreate);
19
19
  openapi.get("/api/tasks/:taskSlug", TaskFetch);
20
20
  openapi.delete("/api/tasks/:taskSlug", TaskDelete);
21
21
 
22
+ // You may also register routes for non OpenAPI directly on Hono
23
+ // app.get('/test', (c) => c.text('Hono!'))
24
+
22
25
  // Export the Hono app
23
26
  export default app;
@@ -1,6 +1,9 @@
1
1
  import { DateTime, Str } from "chanfana";
2
+ import type { Context } from "hono";
2
3
  import { z } from "zod";
3
4
 
5
+ export type AppContext = Context<{ Bindings: Env }>;
6
+
4
7
  export const Task = z.object({
5
8
  name: Str({ example: "lorem" }),
6
9
  slug: Str(),
@@ -1,26 +1,24 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "allowJs": true,
4
- "allowSyntheticDefaultImports": true,
5
- "baseUrl": "src",
6
- "declaration": true,
7
- "sourceMap": true,
3
+ /* Base Options: */
8
4
  "esModuleInterop": true,
9
- "inlineSourceMap": false,
10
- "lib": ["esnext"],
11
- "listEmittedFiles": false,
12
- "listFiles": false,
13
- "moduleResolution": "node",
14
- "noFallthroughCasesInSwitch": true,
15
- "pretty": true,
16
- "resolveJsonModule": true,
17
- "rootDir": ".",
18
5
  "skipLibCheck": true,
19
- "strict": false,
20
- "traceResolution": false,
21
- "outDir": "",
22
- "target": "esnext",
23
- "module": "esnext",
6
+ "target": "es2022",
7
+ "verbatimModuleSyntax": false,
8
+ "allowJs": true,
9
+ "resolveJsonModule": true,
10
+ "moduleDetection": "force",
11
+ /* Strictness */
12
+ "noImplicitAny": false,
13
+ "noImplicitThis": true,
14
+ "strictNullChecks": false,
15
+ "strict": true,
16
+ "noUncheckedIndexedAccess": true,
17
+ /* If NOT transpiling with TypeScript: */
18
+ "moduleResolution": "Bundler",
19
+ "module": "es2022",
20
+ "noEmit": true,
21
+ "lib": ["es2022"],
24
22
  "types": [
25
23
  "@types/node",
26
24
  "@types/service-worker-mock",
@@ -28,5 +26,5 @@
28
26
  ]
29
27
  },
30
28
  "exclude": ["node_modules", "dist", "tests"],
31
- "include": ["src", "scripts"]
29
+ "include": ["src", "worker-configuration.d.ts"]
32
30
  }
@@ -32,7 +32,7 @@ export async function copyExistingWorkerFiles(ctx: C3Context) {
32
32
  await runCommand(
33
33
  [
34
34
  ...dlx,
35
- "wrangler@3",
35
+ "wrangler@latest",
36
36
  "init",
37
37
  "--from-dash",
38
38
  ctx.args.existingScript,
@@ -1,4 +1,4 @@
1
- import { crash, endSection } from "@cloudflare/cli";
1
+ import { endSection } from "@cloudflare/cli";
2
2
  import { brandColor } from "@cloudflare/cli/colors";
3
3
  import { spinner } from "@cloudflare/cli/interactive";
4
4
  import { runFrameworkGenerator } from "frameworks/index";
@@ -24,8 +24,6 @@ const configure = async (ctx: C3Context) => {
24
24
  await runCommand(cmd);
25
25
 
26
26
  // Remove the extraneous Pages files
27
- removeFile("./public/_headers");
28
- removeFile("./public/_redirects");
29
27
  removeFile("./public/_routes.json");
30
28
 
31
29
  addBindingsProxy(ctx);
@@ -81,7 +79,7 @@ const addBindingsProxy = (ctx: C3Context) => {
81
79
  }
82
80
 
83
81
  if (configArgument.type !== "ObjectExpression") {
84
- crash("Failed to update `vite.config.ts`");
82
+ throw new Error("Failed to update `vite.config.ts`");
85
83
  }
86
84
 
87
85
  // Add the `platform` object to the object
@@ -36,7 +36,7 @@ const configure = async (ctx: C3Context) => {
36
36
  doneText: `${brandColor(`installed`)} ${dim("@cloudflare/vite-plugin")}`,
37
37
  });
38
38
 
39
- await transformViteConfig(ctx);
39
+ transformViteConfig(ctx);
40
40
 
41
41
  if (usesTypescript(ctx)) {
42
42
  updateTsconfigJson();
@@ -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": ["@cloudflare/workers-types/2023-07-01", "vite/client"]
6
6
  },
7
- "include": ["worker"],
7
+ "include": ["./worker-configuration.d.ts", "./worker"]
8
8
  }
@@ -8,4 +8,4 @@ assets = { directory = "./build/client" }
8
8
  # Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
9
9
  # Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
10
10
  [observability]
11
- enabled = true
11
+ enabled = true