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/dist/cli.js +51 -31
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/templates/hello-world/js/package.json +1 -1
- package/templates/hello-world/py/pyproject.toml +1 -1
- package/templates/hello-world/ts/package.json +1 -1
- package/templates/hello-world-assets-only/c3.ts +2 -2
- package/templates/hello-world-with-assets/c3.ts +3 -2
- package/templates/hello-world-with-assets/js/package.json +1 -1
- package/templates/hello-world-with-assets/ts/package.json +1 -1
- package/templates/next/workers/c3.ts +1 -1
- package/templates/next/workers/templates/open-next.config.ts +5 -2
- package/templates/openapi/ts/__dot__gitignore +1 -0
- package/templates/openapi/ts/package.json +7 -6
- package/templates/openapi/ts/src/endpoints/taskCreate.ts +2 -2
- package/templates/openapi/ts/src/endpoints/taskDelete.ts +2 -2
- package/templates/openapi/ts/src/endpoints/taskFetch.ts +2 -2
- package/templates/openapi/ts/src/endpoints/taskList.ts +2 -2
- package/templates/openapi/ts/src/index.ts +4 -1
- package/templates/openapi/ts/src/types.ts +3 -0
- package/templates/openapi/ts/tsconfig.json +18 -20
- package/templates/pre-existing/c3.ts +1 -1
- package/templates/qwik/workers/c3.ts +2 -4
- package/templates/react/workers/c3.ts +1 -1
- package/templates/react/workers/ts/tsconfig.worker.json +2 -2
- package/templates/remix/workers/templates/wrangler.toml +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "0.0.0-
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
"
|
|
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"
|
|
@@ -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: "
|
|
7
|
+
displayName: "Static site",
|
|
8
8
|
description:
|
|
9
|
-
"For static sites
|
|
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: "
|
|
8
|
-
description:
|
|
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: {
|
|
@@ -51,7 +51,7 @@ export default {
|
|
|
51
51
|
configVersion: 1,
|
|
52
52
|
id: "next",
|
|
53
53
|
frameworkCli: "create-next-app",
|
|
54
|
-
frameworkCliPinnedVersion: "~15.
|
|
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
|
-
|
|
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
|
});
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
"cf-typegen": "wrangler types"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chanfana": "^2.
|
|
13
|
-
"
|
|
14
|
-
"
|
|
12
|
+
"chanfana": "^2.6.3",
|
|
13
|
+
"hono": "^4.6.20",
|
|
14
|
+
"zod": "^3.24.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types
|
|
18
|
-
"@types/
|
|
19
|
-
"
|
|
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,26 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
|
|
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
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
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", "
|
|
29
|
+
"include": ["src", "worker-configuration.d.ts"]
|
|
32
30
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
82
|
+
throw new Error("Failed to update `vite.config.ts`");
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
// Add the `platform` object to the object
|
|
@@ -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", "
|
|
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
|