create-cloudflare 2.66.4 → 2.67.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.66.4",
3
+ "version": "2.67.0",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -31,7 +31,7 @@
31
31
  "@babel/parser": "^7.21.3",
32
32
  "@babel/types": "^7.21.4",
33
33
  "@clack/prompts": "^0.6.3",
34
- "@cloudflare/workers-types": "^4.20260409.1",
34
+ "@cloudflare/workers-types": "^4.20260415.1",
35
35
  "@types/command-exists": "^1.2.0",
36
36
  "@types/cross-spawn": "^6.0.2",
37
37
  "@types/deepmerge": "^2.2.0",
@@ -58,13 +58,13 @@
58
58
  "indent-string": "^5.0.0",
59
59
  "jsonc-parser": "^3.2.0",
60
60
  "magic-string": "^0.30.5",
61
- "open": "^8.4.0",
61
+ "open": "^11.0.0",
62
62
  "recast": "^0.23.11",
63
63
  "semver": "^7.7.1",
64
64
  "smol-toml": "^1.5.2",
65
65
  "tree-kill": "^1.2.2",
66
66
  "typescript": "~5.8.3",
67
- "undici": "7.24.4",
67
+ "undici": "7.24.8",
68
68
  "vite": "^8.0.0",
69
69
  "vite-tsconfig-paths": "^4.0.8",
70
70
  "vitest": "4.1.0",
@@ -75,10 +75,10 @@
75
75
  "@cloudflare/cli": "1.4.0",
76
76
  "@cloudflare/codemod": "1.1.0",
77
77
  "@cloudflare/mock-npm-registry": "0.0.0",
78
- "@cloudflare/vite-plugin": "1.31.2",
79
- "@cloudflare/workers-utils": "0.15.0",
78
+ "@cloudflare/vite-plugin": "1.32.3",
80
79
  "@cloudflare/workers-tsconfig": "0.0.0",
81
- "wrangler": "4.81.1"
80
+ "@cloudflare/workers-utils": "0.16.1",
81
+ "wrangler": "4.83.0"
82
82
  },
83
83
  "engines": {
84
84
  "node": ">=20.0.0"
@@ -9,14 +9,13 @@
9
9
  "cf-typegen": "wrangler types"
10
10
  },
11
11
  "dependencies": {
12
- "chanfana": "^2.6.3",
13
- "hono": "^4.6.20",
14
- "zod": "^3.24.1"
12
+ "chanfana": "^3.3.0",
13
+ "hono": "^4.12.12",
14
+ "zod": "^4.3.6"
15
15
  },
16
16
  "devDependencies": {
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"
17
+ "@cloudflare/workers-types": "^4.20260413.1",
18
+ "@types/node": "^25.6.0",
19
+ "wrangler": "^4.81.1"
21
20
  }
22
21
  }
@@ -1,4 +1,4 @@
1
- import { Bool, OpenAPIRoute } from "chanfana";
1
+ import { OpenAPIRoute } from "chanfana";
2
2
  import { z } from "zod";
3
3
  import { type AppContext, Task } from "../types";
4
4
 
@@ -16,17 +16,13 @@ export class TaskCreate extends OpenAPIRoute {
16
16
  },
17
17
  },
18
18
  responses: {
19
- "200": {
19
+ "201": {
20
20
  description: "Returns the created task",
21
21
  content: {
22
22
  "application/json": {
23
23
  schema: z.object({
24
- series: z.object({
25
- success: Bool(),
26
- result: z.object({
27
- task: Task,
28
- }),
29
- }),
24
+ success: z.boolean(),
25
+ task: Task,
30
26
  }),
31
27
  },
32
28
  },
@@ -44,15 +40,18 @@ export class TaskCreate extends OpenAPIRoute {
44
40
  // Implement your own object insertion here
45
41
 
46
42
  // return the new task
47
- return {
48
- success: true,
49
- task: {
50
- name: taskToCreate.name,
51
- slug: taskToCreate.slug,
52
- description: taskToCreate.description,
53
- completed: taskToCreate.completed,
54
- due_date: taskToCreate.due_date,
43
+ return c.json(
44
+ {
45
+ success: true,
46
+ task: {
47
+ name: taskToCreate.name,
48
+ slug: taskToCreate.slug,
49
+ description: taskToCreate.description,
50
+ completed: taskToCreate.completed,
51
+ due_date: taskToCreate.due_date,
52
+ },
55
53
  },
56
- };
54
+ 201,
55
+ );
57
56
  }
58
57
  }
@@ -1,4 +1,4 @@
1
- import { Bool, OpenAPIRoute, Str } from "chanfana";
1
+ import { OpenAPIRoute } from "chanfana";
2
2
  import { z } from "zod";
3
3
  import { type AppContext, Task } from "../types";
4
4
 
@@ -8,7 +8,7 @@ export class TaskDelete extends OpenAPIRoute {
8
8
  summary: "Delete a Task",
9
9
  request: {
10
10
  params: z.object({
11
- taskSlug: Str({ description: "Task slug" }),
11
+ taskSlug: z.string().describe("Task slug"),
12
12
  }),
13
13
  },
14
14
  responses: {
@@ -17,11 +17,9 @@ export class TaskDelete extends OpenAPIRoute {
17
17
  content: {
18
18
  "application/json": {
19
19
  schema: z.object({
20
- series: z.object({
21
- success: Bool(),
22
- result: z.object({
23
- task: Task,
24
- }),
20
+ success: z.boolean(),
21
+ result: z.object({
22
+ task: Task,
25
23
  }),
26
24
  }),
27
25
  },
@@ -1,4 +1,4 @@
1
- import { Bool, OpenAPIRoute, Str } from "chanfana";
1
+ import { NotFoundException, OpenAPIRoute } from "chanfana";
2
2
  import { z } from "zod";
3
3
  import { type AppContext, Task } from "../types";
4
4
 
@@ -8,7 +8,7 @@ export class TaskFetch extends OpenAPIRoute {
8
8
  summary: "Get a single Task by slug",
9
9
  request: {
10
10
  params: z.object({
11
- taskSlug: Str({ description: "Task slug" }),
11
+ taskSlug: z.string().describe("Task slug"),
12
12
  }),
13
13
  },
14
14
  responses: {
@@ -17,25 +17,8 @@ export class TaskFetch extends OpenAPIRoute {
17
17
  content: {
18
18
  "application/json": {
19
19
  schema: z.object({
20
- series: z.object({
21
- success: Bool(),
22
- result: z.object({
23
- task: Task,
24
- }),
25
- }),
26
- }),
27
- },
28
- },
29
- },
30
- "404": {
31
- description: "Task not found",
32
- content: {
33
- "application/json": {
34
- schema: z.object({
35
- series: z.object({
36
- success: Bool(),
37
- error: Str(),
38
- }),
20
+ success: z.boolean(),
21
+ task: Task,
39
22
  }),
40
23
  },
41
24
  },
@@ -54,17 +37,8 @@ export class TaskFetch extends OpenAPIRoute {
54
37
 
55
38
  const exists = true;
56
39
 
57
- // @ts-ignore: check if the object exists
58
- if (exists === false) {
59
- return Response.json(
60
- {
61
- success: false,
62
- error: "Object not found",
63
- },
64
- {
65
- status: 404,
66
- },
67
- );
40
+ if (!exists) {
41
+ throw new NotFoundException();
68
42
  }
69
43
 
70
44
  return {
@@ -1,4 +1,4 @@
1
- import { Bool, Num, OpenAPIRoute } from "chanfana";
1
+ import { OpenAPIRoute } from "chanfana";
2
2
  import { z } from "zod";
3
3
  import { type AppContext, Task } from "../types";
4
4
 
@@ -8,14 +8,11 @@ export class TaskList extends OpenAPIRoute {
8
8
  summary: "List Tasks",
9
9
  request: {
10
10
  query: z.object({
11
- page: Num({
12
- description: "Page number",
13
- default: 0,
14
- }),
15
- isCompleted: Bool({
16
- description: "Filter by completed flag",
17
- required: false,
18
- }),
11
+ page: z.number().default(0).describe("Page number"),
12
+ isCompleted: z
13
+ .boolean()
14
+ .optional()
15
+ .describe("Filter by completed flag"),
19
16
  }),
20
17
  },
21
18
  responses: {
@@ -24,12 +21,8 @@ export class TaskList extends OpenAPIRoute {
24
21
  content: {
25
22
  "application/json": {
26
23
  schema: z.object({
27
- series: z.object({
28
- success: Bool(),
29
- result: z.object({
30
- tasks: Task.array(),
31
- }),
32
- }),
24
+ success: z.boolean(),
25
+ tasks: Task.array(),
33
26
  }),
34
27
  },
35
28
  },
@@ -52,7 +45,7 @@ export class TaskList extends OpenAPIRoute {
52
45
  {
53
46
  name: "Clean my room",
54
47
  slug: "clean-room",
55
- description: null,
48
+ description: undefined,
56
49
  completed: false,
57
50
  due_date: "2025-01-05",
58
51
  },
@@ -1,13 +1,12 @@
1
- import { DateTime, Str } from "chanfana";
2
1
  import type { Context } from "hono";
3
2
  import { z } from "zod";
4
3
 
5
4
  export type AppContext = Context<{ Bindings: Env }>;
6
5
 
7
6
  export const Task = z.object({
8
- name: Str({ example: "lorem" }),
9
- slug: Str(),
10
- description: Str({ required: false }),
7
+ name: z.string().openapi({ example: "lorem" }),
8
+ slug: z.string(),
9
+ description: z.string().optional(),
11
10
  completed: z.boolean().default(false),
12
- due_date: DateTime(),
11
+ due_date: z.iso.date(),
13
12
  });
@@ -9,9 +9,6 @@
9
9
  "resolveJsonModule": true,
10
10
  "moduleDetection": "force",
11
11
  /* Strictness */
12
- "noImplicitAny": false,
13
- "noImplicitThis": true,
14
- "strictNullChecks": false,
15
12
  "strict": true,
16
13
  "noUncheckedIndexedAccess": true,
17
14
  /* If NOT transpiling with TypeScript: */
@@ -20,8 +17,7 @@
20
17
  "noEmit": true,
21
18
  "lib": ["es2024"],
22
19
  "types": [
23
- "@types/node",
24
- "@types/service-worker-mock",
20
+ "@types/node"
25
21
  ]
26
22
  },
27
23
  "exclude": ["node_modules", "dist", "tests"],
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react'
2
2
  import reactLogo from './assets/react.svg'
3
- import viteLogo from '/vite.svg'
3
+ import viteLogo from './assets/vite.svg'
4
4
  import cloudflareLogo from './assets/Cloudflare_Logo.svg'
5
5
  import './App.css'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react'
2
2
  import reactLogo from './assets/react.svg'
3
- import viteLogo from '/vite.svg'
3
+ import viteLogo from './assets/vite.svg'
4
4
  import cloudflareLogo from './assets/Cloudflare_Logo.svg'
5
5
  import './App.css'
6
6
 
@@ -25,7 +25,7 @@ const generate = async (ctx: C3Context) => {
25
25
  await runFrameworkGenerator(ctx, [
26
26
  ctx.project.name,
27
27
  "--router",
28
- lang === "ts" ? "--ts" : "--no-ts",
28
+ ...(lang === "ts" ? ["--ts"] : []),
29
29
  ]);
30
30
  logRaw("");
31
31
  };