create-cloudflare 0.0.0-dfacbd46a → 0.0.0-dfea523ea

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 (34) hide show
  1. package/dist/cli.js +56 -34
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +6 -6
  4. package/templates/angular/pages/c3.ts +1 -0
  5. package/templates/astro/pages/c3.ts +1 -0
  6. package/templates/astro/workers/templates/ts/wrangler.jsonc +1 -1
  7. package/templates/docusaurus/pages/c3.ts +1 -0
  8. package/templates/gatsby/pages/c3.ts +1 -0
  9. package/templates/hello-world-assets-only/c3.ts +2 -2
  10. package/templates/hello-world-with-assets/c3.ts +3 -2
  11. package/templates/hono/pages/c3.ts +1 -0
  12. package/templates/next/pages/c3.ts +1 -0
  13. package/templates/next/workers/c3.ts +4 -4
  14. package/templates/next/workers/templates/open-next.config.ts +5 -2
  15. package/templates/next/workers/templates/wrangler.jsonc +1 -1
  16. package/templates/nuxt/pages/c3.ts +1 -0
  17. package/templates/pre-existing/c3.ts +1 -1
  18. package/templates/qwik/pages/c3.ts +1 -0
  19. package/templates/react/pages/c3.ts +1 -0
  20. package/templates/react/workers/js/src/App.jsx +1 -1
  21. package/templates/react/workers/js/{api → worker}/index.js +1 -1
  22. package/templates/react/workers/js/wrangler.jsonc +2 -2
  23. package/templates/react/workers/ts/src/App.tsx +1 -1
  24. package/templates/react/workers/ts/tsconfig.worker.json +1 -1
  25. package/templates/react/workers/ts/{api → worker}/index.ts +2 -3
  26. package/templates/react/workers/ts/wrangler.jsonc +2 -2
  27. package/templates/remix/pages/c3.ts +1 -0
  28. package/templates/scheduled/ts/src/index.ts +7 -0
  29. package/templates/svelte/pages/c3.ts +1 -0
  30. package/templates/vue/pages/c3.ts +1 -0
  31. package/templates/vue/workers/js/server/index.js +2 -2
  32. package/templates/vue/workers/js/wrangler.jsonc +0 -1
  33. package/templates/vue/workers/ts/server/index.ts +2 -3
  34. package/templates/vue/workers/ts/wrangler.jsonc +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "0.0.0-dfacbd46a",
3
+ "version": "0.0.0-dfea523ea",
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.20250321.0",
33
+ "@cloudflare/workers-types": "^4.20250410.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",
@@ -70,11 +70,11 @@
70
70
  "wrap-ansi": "^9.0.0",
71
71
  "xdg-app-paths": "^8.3.0",
72
72
  "yargs": "^17.7.2",
73
- "@cloudflare/cli": "1.1.1",
74
73
  "@cloudflare/eslint-config-worker": "1.1.0",
75
74
  "@cloudflare/mock-npm-registry": "0.0.0",
76
- "wrangler": "0.0.0-dfacbd46a",
77
- "@cloudflare/vite-plugin": "0.0.0-dfacbd46a",
75
+ "@cloudflare/vite-plugin": "0.0.0-dfea523ea",
76
+ "wrangler": "0.0.0-dfea523ea",
77
+ "@cloudflare/cli": "1.1.1",
78
78
  "@cloudflare/workers-tsconfig": "0.0.0"
79
79
  },
80
80
  "engines": {
@@ -95,6 +95,7 @@ const config: TemplateConfig = {
95
95
  frameworkCli: "@angular/create",
96
96
  displayName: "Angular",
97
97
  platform: "pages",
98
+ hidden: true,
98
99
  copyFiles: {
99
100
  path: "./templates",
100
101
  },
@@ -63,6 +63,7 @@ const config: TemplateConfig = {
63
63
  id: "astro",
64
64
  frameworkCli: "create-astro",
65
65
  platform: "pages",
66
+ hidden: true,
66
67
  displayName: "Astro",
67
68
  path: "templates/astro/pages",
68
69
  copyFiles: {
@@ -11,5 +11,5 @@
11
11
  },
12
12
  "observability": {
13
13
  "enabled": true
14
- }
14
+ },
15
15
  }
@@ -14,6 +14,7 @@ const config: TemplateConfig = {
14
14
  id: "docusaurus",
15
15
  frameworkCli: "create-docusaurus",
16
16
  platform: "pages",
17
+ hidden: true,
17
18
  displayName: "Docusaurus",
18
19
  path: "templates/docusaurus/pages",
19
20
  generate,
@@ -34,6 +34,7 @@ const config: TemplateConfig = {
34
34
  id: "gatsby",
35
35
  frameworkCli: "gatsby",
36
36
  platform: "pages",
37
+ hidden: true,
37
38
  displayName: "Gatsby",
38
39
  path: "templates/gatsby/pages",
39
40
  generate,
@@ -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: {
@@ -29,6 +29,7 @@ const config: TemplateConfig = {
29
29
  },
30
30
  path: "templates/hono/pages",
31
31
  platform: "pages",
32
+ hidden: true,
32
33
  generate,
33
34
  transformPackageJson: async () => ({
34
35
  scripts: {
@@ -161,6 +161,7 @@ export default {
161
161
  id: "next",
162
162
  frameworkCli: "create-next-app",
163
163
  platform: "pages",
164
+ hidden: true,
164
165
  displayName: "Next.js",
165
166
  path: "templates/next/pages",
166
167
  generate,
@@ -12,7 +12,7 @@ const generate = async (ctx: C3Context) => {
12
12
 
13
13
  const configure = async (ctx: C3Context) => {
14
14
  const packages = [
15
- "@opennextjs/cloudflare@0.5.x",
15
+ "@opennextjs/cloudflare@~1.0.0-beta.0 || ^1.0.0",
16
16
  "@cloudflare/workers-types",
17
17
  ];
18
18
  await installPackages(packages, {
@@ -51,7 +51,7 @@ export default {
51
51
  configVersion: 1,
52
52
  id: "next",
53
53
  frameworkCli: "create-next-app",
54
- frameworkCliPinnedVersion: "~15.2.2",
54
+ frameworkCliPinnedVersion: "~15.2.4",
55
55
  platform: "workers",
56
56
  displayName: "Next.js (using Node.js compat + Workers Assets)",
57
57
  path: "templates/next/workers",
@@ -62,8 +62,8 @@ export default {
62
62
  configure,
63
63
  transformPackageJson: async () => ({
64
64
  scripts: {
65
- deploy: `opennextjs-cloudflare && wrangler deploy`,
66
- preview: `opennextjs-cloudflare && wrangler dev`,
65
+ deploy: `opennextjs-cloudflare build && opennextjs-cloudflare deploy`,
66
+ preview: `opennextjs-cloudflare build && opennextjs-cloudflare preview`,
67
67
  "cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`,
68
68
  },
69
69
  }),
@@ -1,6 +1,9 @@
1
1
  import { defineCloudflareConfig } from "@opennextjs/cloudflare";
2
- import kvIncrementalCache from "@opennextjs/cloudflare/kv-cache";
3
2
 
4
3
  export default defineCloudflareConfig({
5
- incrementalCache: kvIncrementalCache,
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
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "<app-name>",
3
3
  "main": ".open-next/worker.js",
4
- "compatibility_date": "2024-09-26",
4
+ "compatibility_date": "2025-03-01",
5
5
  "compatibility_flags": [
6
6
  "nodejs_compat"
7
7
  ],
@@ -125,6 +125,7 @@ const config: TemplateConfig = {
125
125
  id: "nuxt",
126
126
  frameworkCli: "nuxi",
127
127
  platform: "pages",
128
+ hidden: true,
128
129
  displayName: "Nuxt",
129
130
  copyFiles: {
130
131
  path: "./templates",
@@ -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,
@@ -129,6 +129,7 @@ const config: TemplateConfig = {
129
129
  frameworkCli: "create-qwik",
130
130
  displayName: "Qwik",
131
131
  platform: "pages",
132
+ hidden: true,
132
133
  copyFiles: {
133
134
  path: "./templates",
134
135
  },
@@ -47,6 +47,7 @@ const config: TemplateConfig = {
47
47
  frameworkCli: "create-vite",
48
48
  displayName: "React",
49
49
  platform: "pages",
50
+ hidden: true,
50
51
  path: "templates/react/pages",
51
52
  generate,
52
53
  transformPackageJson: async () => ({
@@ -45,7 +45,7 @@ function App() {
45
45
  Name from API is: {name}
46
46
  </button>
47
47
  <p>
48
- Edit <code>api/index.js</code> to change the name
48
+ Edit <code>worker/index.js</code> to change the name
49
49
  </p>
50
50
  </div>
51
51
  <p className='read-the-docs'>
@@ -8,6 +8,6 @@ export default {
8
8
  });
9
9
  }
10
10
 
11
- return env.ASSETS.fetch(request);
11
+ return new Response(null, { status: 404 });
12
12
  },
13
13
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "<TBD>",
3
- "main": "api/index.js",
3
+ "main": "worker/index.js",
4
4
  "compatibility_date": "<TBD>",
5
- "assets": { "not_found_handling": "single-page-application", "binding": "ASSETS" },
5
+ "assets": { "not_found_handling": "single-page-application" },
6
6
  "observability": {
7
7
  "enabled": true
8
8
  }
@@ -45,7 +45,7 @@ function App() {
45
45
  Name from API is: {name}
46
46
  </button>
47
47
  <p>
48
- Edit <code>api/index.ts</code> to change the name
48
+ Edit <code>worker/index.ts</code> to change the name
49
49
  </p>
50
50
  </div>
51
51
  <p className='read-the-docs'>
@@ -4,5 +4,5 @@
4
4
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.worker.tsbuildinfo",
5
5
  "types": ["@cloudflare/workers-types/2023-07-01", "./worker-configuration.d.ts", "vite/client"],
6
6
  },
7
- "include": ["api"],
7
+ "include": ["worker"],
8
8
  }
@@ -1,5 +1,5 @@
1
1
  export default {
2
- fetch(request, env) {
2
+ fetch(request) {
3
3
  const url = new URL(request.url);
4
4
 
5
5
  if (url.pathname.startsWith("/api/")) {
@@ -7,7 +7,6 @@ export default {
7
7
  name: "Cloudflare",
8
8
  });
9
9
  }
10
-
11
- return env.ASSETS.fetch(request);
10
+ return new Response(null, { status: 404 });
12
11
  },
13
12
  } satisfies ExportedHandler<Env>;
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "<TBD>",
3
- "main": "api/index.ts",
3
+ "main": "worker/index.ts",
4
4
  "compatibility_date": "<TBD>",
5
- "assets": { "not_found_handling": "single-page-application", "binding": "ASSETS" },
5
+ "assets": { "not_found_handling": "single-page-application" },
6
6
  "observability": {
7
7
  "enabled": true
8
8
  }
@@ -47,6 +47,7 @@ const config: TemplateConfig = {
47
47
  id: "remix",
48
48
  frameworkCli: "create-remix",
49
49
  platform: "pages",
50
+ hidden: true,
50
51
  displayName: "Remix",
51
52
  copyFiles: {
52
53
  path: "./templates",
@@ -16,6 +16,13 @@
16
16
  */
17
17
 
18
18
  export default {
19
+ async fetch(req) {
20
+ const url = new URL(req.url);
21
+ url.pathname = '/__scheduled';
22
+ url.searchParams.append('cron', '* * * * *');
23
+ return new Response(`To test the scheduled handler, ensure you have used the "--test-scheduled" then try running "curl ${url.href}".`);
24
+ },
25
+
19
26
  // The scheduled handler is invoked at the interval set in our wrangler.jsonc's
20
27
  // [[triggers]] configuration.
21
28
  async scheduled(event, env, ctx): Promise<void> {
@@ -130,6 +130,7 @@ const config: TemplateConfig = {
130
130
  frameworkCli: "sv",
131
131
  displayName: "SvelteKit",
132
132
  platform: "pages",
133
+ hidden: true,
133
134
  copyFiles: {
134
135
  path: "./templates",
135
136
  },
@@ -15,6 +15,7 @@ const config: TemplateConfig = {
15
15
  frameworkCli: "create-vue",
16
16
  displayName: "Vue",
17
17
  platform: "pages",
18
+ hidden: true,
18
19
  path: "templates/pages/vue",
19
20
  generate,
20
21
  transformPackageJson: async () => ({
@@ -1,5 +1,5 @@
1
1
  export default {
2
- fetch(request, env) {
2
+ fetch(request) {
3
3
  const url = new URL(request.url);
4
4
 
5
5
  if (url.pathname.startsWith("/api/")) {
@@ -8,6 +8,6 @@ export default {
8
8
  });
9
9
  }
10
10
 
11
- return env.ASSETS.fetch(request);
11
+ return new Response(null, { status: 404 });
12
12
  },
13
13
  };
@@ -4,7 +4,6 @@
4
4
  "main": "server/index.ts",
5
5
  "assets": {
6
6
  "not_found_handling": "single-page-application",
7
- "binding": "ASSETS"
8
7
  },
9
8
  "observability": {
10
9
  "enabled": true
@@ -1,5 +1,5 @@
1
1
  export default {
2
- fetch(request, env) {
2
+ fetch(request) {
3
3
  const url = new URL(request.url);
4
4
 
5
5
  if (url.pathname.startsWith("/api/")) {
@@ -7,7 +7,6 @@ export default {
7
7
  name: "Cloudflare",
8
8
  });
9
9
  }
10
-
11
- return env.ASSETS.fetch(request);
10
+ return new Response(null, { status: 404 });
12
11
  },
13
12
  } satisfies ExportedHandler<Env>;
@@ -4,7 +4,6 @@
4
4
  "main": "server/index.ts",
5
5
  "assets": {
6
6
  "not_found_handling": "single-page-application",
7
- "binding": "ASSETS"
8
7
  },
9
8
  "observability": {
10
9
  "enabled": true