create-cloudflare 0.0.0-ecded1af1 → 0.0.0-ecef68635

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 (89) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +28433 -27402
  3. package/dist/tsconfig.tsbuildinfo +1 -1
  4. package/package.json +5 -4
  5. package/templates/common/js/wrangler.toml +6 -0
  6. package/templates/common/ts/wrangler.toml +6 -0
  7. package/templates/docusaurus/c3.ts +2 -1
  8. package/templates/hello-world/js/package.json +2 -2
  9. package/templates/hello-world/js/wrangler.toml +6 -0
  10. package/templates/hello-world/py/wrangler.toml +6 -0
  11. package/templates/hello-world/ts/package.json +2 -2
  12. package/templates/hello-world/ts/wrangler.toml +6 -0
  13. package/templates/hello-world-durable-object/js/wrangler.toml +6 -0
  14. package/templates/hello-world-durable-object/ts/src/index.ts +0 -21
  15. package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +3 -4
  16. package/templates/hello-world-durable-object/ts/wrangler.toml +6 -0
  17. package/templates/hono/templates/wrangler.toml +6 -0
  18. package/templates/next/c3.ts +6 -7
  19. package/templates/nuxt/templates/wrangler.toml +1 -0
  20. package/templates/openapi/ts/wrangler.toml +6 -0
  21. package/templates/pre-existing/c3.ts +2 -2
  22. package/templates/queues/js/wrangler.toml +6 -0
  23. package/templates/queues/ts/wrangler.toml +6 -0
  24. package/templates/qwik/c3.ts +3 -3
  25. package/templates/qwik/templates/wrangler.toml +1 -0
  26. package/templates/react/c3.ts +2 -2
  27. package/templates/scheduled/js/wrangler.toml +6 -0
  28. package/templates/scheduled/ts/wrangler.toml +6 -0
  29. package/templates-experimental/angular/c3.ts +6 -10
  30. package/templates-experimental/angular/templates/tools/alter-polyfills.mjs +12 -7
  31. package/templates-experimental/angular/templates/wrangler.toml +8 -2
  32. package/templates-experimental/astro/templates/wrangler.toml +7 -1
  33. package/templates-experimental/docusaurus/templates/wrangler.toml +7 -1
  34. package/templates-experimental/gatsby/templates/wrangler.toml +7 -1
  35. package/templates-experimental/hello-world-assets-only/c3.ts +15 -0
  36. package/templates-experimental/hello-world-assets-only/templates/package.json +13 -0
  37. package/templates-experimental/hello-world-assets-only/templates/public/index.html +11 -0
  38. package/templates-experimental/hello-world-assets-only/templates/wrangler.toml +10 -0
  39. package/templates-experimental/hello-world-durable-object-with-assets/c3.ts +23 -0
  40. package/templates-experimental/hello-world-durable-object-with-assets/js/.editorconfig +12 -0
  41. package/templates-experimental/hello-world-durable-object-with-assets/js/.prettierrc +6 -0
  42. package/templates-experimental/hello-world-durable-object-with-assets/js/__dot__gitignore +172 -0
  43. package/templates-experimental/hello-world-durable-object-with-assets/js/package.json +13 -0
  44. package/templates-experimental/hello-world-durable-object-with-assets/js/public/index.html +19 -0
  45. package/templates-experimental/hello-world-durable-object-with-assets/js/src/index.js +69 -0
  46. package/templates-experimental/hello-world-durable-object-with-assets/js/wrangler.toml +24 -0
  47. package/templates-experimental/hello-world-durable-object-with-assets/ts/.editorconfig +12 -0
  48. package/templates-experimental/hello-world-durable-object-with-assets/ts/.prettierrc +6 -0
  49. package/templates-experimental/hello-world-durable-object-with-assets/ts/__dot__gitignore +172 -0
  50. package/templates-experimental/hello-world-durable-object-with-assets/ts/package.json +15 -0
  51. package/templates-experimental/hello-world-durable-object-with-assets/ts/public/index.html +19 -0
  52. package/templates-experimental/hello-world-durable-object-with-assets/ts/src/index.ts +66 -0
  53. package/templates-experimental/hello-world-durable-object-with-assets/ts/tsconfig.json +101 -0
  54. package/templates-experimental/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +5 -0
  55. package/templates-experimental/hello-world-durable-object-with-assets/ts/wrangler.toml +24 -0
  56. package/templates-experimental/hello-world-with-assets/c3.ts +2 -2
  57. package/templates-experimental/hello-world-with-assets/js/package.json +2 -2
  58. package/templates-experimental/hello-world-with-assets/js/public/index.html +13 -1
  59. package/templates-experimental/hello-world-with-assets/js/src/index.js +9 -1
  60. package/templates-experimental/hello-world-with-assets/js/test/index.spec.js +33 -12
  61. package/templates-experimental/hello-world-with-assets/js/wrangler.toml +7 -1
  62. package/templates-experimental/hello-world-with-assets/py/public/index.html +14 -2
  63. package/templates-experimental/hello-world-with-assets/py/src/entry.py +7 -2
  64. package/templates-experimental/hello-world-with-assets/py/wrangler.toml +7 -1
  65. package/templates-experimental/hello-world-with-assets/ts/package.json +2 -2
  66. package/templates-experimental/hello-world-with-assets/ts/public/index.html +13 -1
  67. package/templates-experimental/hello-world-with-assets/ts/src/index.ts +10 -2
  68. package/templates-experimental/hello-world-with-assets/ts/test/index.spec.ts +33 -17
  69. package/templates-experimental/hello-world-with-assets/ts/wrangler.toml +7 -1
  70. package/templates-experimental/hono/c3.ts +43 -0
  71. package/templates-experimental/hono/templates/public/index.html +19 -0
  72. package/templates-experimental/hono/templates/src/index.ts +9 -0
  73. package/templates-experimental/hono/templates/worker-configuration.d.ts +4 -0
  74. package/templates-experimental/hono/templates/wrangler.toml +5 -0
  75. package/templates-experimental/next/c3.ts +52 -0
  76. package/templates-experimental/next/templates/__dot__gitignore +42 -0
  77. package/templates-experimental/next/templates/env.d.ts +5 -0
  78. package/templates-experimental/next/templates/wrangler.toml +12 -0
  79. package/templates-experimental/nuxt/templates/wrangler.toml +7 -1
  80. package/templates-experimental/qwik/c3.ts +1 -1
  81. package/templates-experimental/qwik/templates/wrangler.toml +7 -1
  82. package/templates-experimental/remix/c3.ts +1 -1
  83. package/templates-experimental/remix/templates/wrangler.toml +7 -1
  84. package/templates-experimental/solid/templates/wrangler.toml +7 -1
  85. package/templates-experimental/svelte/js/wrangler.toml +7 -1
  86. package/templates-experimental/svelte/ts/wrangler.toml +7 -1
  87. package/templates-experimental/angular/templates/src/.assetsignore +0 -4
  88. package/templates-experimental/angular/templates/tools/copy-files.mjs +0 -9
  89. package/templates-experimental/angular/templates/tools/paths.mjs +0 -9
@@ -0,0 +1,42 @@
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+ /.pnp
6
+ .pnp.js
7
+ .yarn/install-state.gz
8
+
9
+ # testing
10
+ /coverage
11
+
12
+ # next.js
13
+ /.next/
14
+ /out/
15
+
16
+ # production
17
+ /build
18
+
19
+ # misc
20
+ .DS_Store
21
+ *.pem
22
+
23
+ # debug
24
+ npm-debug.log*
25
+ yarn-debug.log*
26
+ yarn-error.log*
27
+
28
+ # local env files
29
+ .env*.local
30
+
31
+ # vercel
32
+ .vercel
33
+
34
+ # typescript
35
+ *.tsbuildinfo
36
+ next-env.d.ts
37
+
38
+
39
+ # Cloudflare related
40
+ /.save.next
41
+ /.worker-next
42
+ /.wrangler
@@ -0,0 +1,5 @@
1
+ // Generated by Wrangler
2
+ // by running `wrangler types --env-interface CloudflareEnv env.d.ts`
3
+
4
+ interface CloudflareEnv {
5
+ }
@@ -0,0 +1,12 @@
1
+ #:schema node_modules/wrangler/config-schema.json
2
+ name = "<app-name>"
3
+ main = ".worker-next/index.mjs"
4
+
5
+ compatibility_date = "2024-09-26"
6
+ compatibility_flags = ["nodejs_compat"]
7
+
8
+ # Minification helps to keep the Worker bundle size down and improve start up time.
9
+ minify = true
10
+
11
+ # Use the new Workers + Assets to host the static frontend files
12
+ assets = { directory = ".worker-next/assets", binding = "ASSETS" }
@@ -2,4 +2,10 @@
2
2
  name = "<TBD>"
3
3
  compatibility_date = "<TBD>"
4
4
  main = "./dist/worker/index.js"
5
- experimental_assets = { directory = "./dist/public", binding = "ASSETS" }
5
+ assets = { directory = "./dist/public", binding = "ASSETS" }
6
+
7
+ # Workers Logs
8
+ # Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
9
+ # Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
10
+ [observability]
11
+ enabled = true
@@ -13,7 +13,7 @@ import type { C3Context } from "types";
13
13
  const { npm, npx } = detectPackageManager();
14
14
 
15
15
  const generate = async (ctx: C3Context) => {
16
- await runFrameworkGenerator(ctx, ["basic", ctx.project.name]);
16
+ await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
17
17
  };
18
18
 
19
19
  const configure = async (ctx: C3Context) => {
@@ -3,4 +3,10 @@ name = "<TBD>"
3
3
  compatibility_date = "<TBD>"
4
4
  compatibility_flags = ["nodejs_compat"]
5
5
  main = "./dist/_worker.js"
6
- experimental_assets = { directory = "./dist", binding = "ASSET" }
6
+ assets = { directory = "./dist", binding = "ASSET" }
7
+
8
+ # Workers Logs
9
+ # Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
10
+ # Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
11
+ [observability]
12
+ enabled = true
@@ -24,7 +24,7 @@ const configure = async () => {
24
24
  await installPackages(["wrangler@latest"], {
25
25
  dev: true,
26
26
  startText: "Updating the Wrangler version",
27
- doneText: `${brandColor(`updateed`)} ${dim("wrangler@latest")}`,
27
+ doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`,
28
28
  });
29
29
 
30
30
  const typeDefsPath = "load-context.ts";
@@ -2,4 +2,10 @@
2
2
  name = "<TBD>"
3
3
  compatibility_date = "<TBD>"
4
4
  main = "./build/worker/index.js"
5
- experimental_assets = { directory = "./build/client" }
5
+ assets = { directory = "./build/client" }
6
+
7
+ # Workers Logs
8
+ # Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
9
+ # Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
10
+ [observability]
11
+ enabled = true
@@ -3,4 +3,10 @@ name = "<TBD>"
3
3
  compatibility_date = "<TBD>"
4
4
  compatibility_flags = ["nodejs_compat"]
5
5
  main = "./dist/worker/index.js"
6
- experimental_assets = { directory = "./dist/public", binding = "ASSETS" }
6
+ assets = { directory = "./dist/public", binding = "ASSETS" }
7
+
8
+ # Workers Logs
9
+ # Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
10
+ # Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
11
+ [observability]
12
+ enabled = true
@@ -2,4 +2,10 @@
2
2
  name = "<TBD>"
3
3
  compatibility_date = "<TBD>"
4
4
  main = ".svelte-kit/cloudflare/_worker.js"
5
- experimental_assets = { directory = ".svelte-kit/cloudflare", binding = "ASSETS" }
5
+ assets = { directory = ".svelte-kit/cloudflare", binding = "ASSETS" }
6
+
7
+ # Workers Logs
8
+ # Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
9
+ # Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
10
+ [observability]
11
+ enabled = true
@@ -2,4 +2,10 @@
2
2
  name = "<TBD>"
3
3
  compatibility_date = "<TBD>"
4
4
  main = ".svelte-kit/cloudflare/_worker.js"
5
- experimental_assets = { directory = ".svelte-kit/cloudflare", binding = "ASSETS" }
5
+ assets = { directory = ".svelte-kit/cloudflare", binding = "ASSETS" }
6
+
7
+ # Workers Logs
8
+ # Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
9
+ # Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
10
+ [observability]
11
+ enabled = true
@@ -1,4 +0,0 @@
1
- _worker.js
2
- _routes.json
3
- _headers
4
- _redirects
@@ -1,9 +0,0 @@
1
- // Copy the files over so that they can be uploaded by the pages publish command.
2
- import fs from "node:fs";
3
- import { join } from "node:path";
4
- import { client, cloudflare, ssr, worker } from "./paths.mjs";
5
-
6
- fs.cpSync(client, cloudflare, { recursive: true });
7
- fs.cpSync(ssr, worker, { recursive: true });
8
-
9
- fs.renameSync(join(worker, "server.mjs"), join(worker, "index.js"));
@@ -1,9 +0,0 @@
1
- import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
-
4
- const dirname = path.dirname(fileURLToPath(import.meta.url));
5
- export const root = path.resolve(dirname, "..");
6
- export const client = path.resolve(root, "dist/browser");
7
- export const ssr = path.resolve(root, "dist/server");
8
- export const cloudflare = path.resolve(root, "dist/cloudflare");
9
- export const worker = path.resolve(cloudflare, "_worker.js");