create-cloudflare 0.0.0-fa09f4a2 → 0.0.0-fa300e9a

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 (128) hide show
  1. package/dist/cli.js +37575 -22337
  2. package/dist/tsconfig.tsbuildinfo +1 -0
  3. package/package.json +20 -13
  4. package/templates/analog/c3.ts +134 -0
  5. package/templates/analog/snippets/devBindingsModule.ts +7 -0
  6. package/templates/analog/templates/env.d.ts +13 -0
  7. package/templates/analog/templates/src/dev-bindings.ts +18 -0
  8. package/templates/analog/templates/worker-configuration.d.ts +4 -0
  9. package/templates/analog/templates/wrangler.toml +85 -0
  10. package/templates/angular/c3.ts +100 -0
  11. package/{dist → templates}/angular/templates/tools/copy-files.mjs +1 -1
  12. package/templates/astro/c3.ts +112 -0
  13. package/templates/astro/snippets/runtimeDeclaration.ts +5 -0
  14. package/templates/astro/templates/wrangler.toml +85 -0
  15. package/templates/common/c3.ts +16 -0
  16. package/templates/common/js/.editorconfig +0 -1
  17. package/templates/common/js/wrangler.toml +78 -22
  18. package/templates/common/ts/.editorconfig +0 -1
  19. package/templates/common/ts/package.json +2 -1
  20. package/templates/common/ts/src/ab-test.ts +2 -2
  21. package/templates/common/ts/src/index.ts +5 -2
  22. package/templates/common/ts/src/proxy.ts +2 -2
  23. package/templates/common/ts/src/redirect.ts +2 -2
  24. package/templates/common/ts/worker-configuration.d.ts +2 -14
  25. package/templates/common/ts/wrangler.toml +78 -22
  26. package/templates/docusaurus/c3.ts +26 -0
  27. package/templates/gatsby/c3.ts +48 -0
  28. package/templates/hello-world/c3.ts +16 -0
  29. package/templates/hello-world/js/.editorconfig +0 -1
  30. package/templates/hello-world/js/package.json +5 -2
  31. package/templates/hello-world/js/test/index.spec.js +20 -0
  32. package/templates/hello-world/js/vitest.config.js +11 -0
  33. package/templates/hello-world/js/wrangler.toml +79 -22
  34. package/templates/hello-world/ts/.editorconfig +0 -1
  35. package/templates/hello-world/ts/package.json +6 -2
  36. package/templates/hello-world/ts/src/index.ts +5 -19
  37. package/templates/hello-world/ts/test/index.spec.ts +25 -0
  38. package/templates/hello-world/ts/test/tsconfig.json +8 -0
  39. package/templates/hello-world/ts/tsconfig.json +3 -2
  40. package/templates/hello-world/ts/vitest.config.ts +11 -0
  41. package/templates/hello-world/ts/worker-configuration.d.ts +4 -0
  42. package/templates/hello-world/ts/wrangler.toml +79 -22
  43. package/templates/hello-world-durable-object/c3.ts +16 -0
  44. package/templates/hello-world-durable-object/js/.editorconfig +0 -1
  45. package/templates/hello-world-durable-object/js/src/index.js +18 -14
  46. package/templates/hello-world-durable-object/js/wrangler.toml +78 -22
  47. package/templates/hello-world-durable-object/ts/.editorconfig +0 -1
  48. package/templates/hello-world-durable-object/ts/package.json +2 -2
  49. package/templates/hello-world-durable-object/ts/src/index.ts +26 -18
  50. package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +6 -0
  51. package/templates/hello-world-durable-object/ts/wrangler.toml +78 -22
  52. package/templates/hello-world-python/c3.ts +9 -0
  53. package/templates/hello-world-python/py/__dot__gitignore +68 -0
  54. package/templates/{chatgptPlugin/ts → hello-world-python/py}/package.json +2 -5
  55. package/templates/hello-world-python/py/src/entry.py +4 -0
  56. package/templates/hello-world-python/py/wrangler.toml +108 -0
  57. package/templates/hono/c3.ts +78 -0
  58. package/templates/hono/snippets/appDeclaration.ts +1 -0
  59. package/templates/hono/snippets/bindingsType.ts +3 -0
  60. package/templates/hono/templates/worker-configuration.d.ts +4 -0
  61. package/templates/hono/templates/wrangler.toml +107 -0
  62. package/templates/next/README.md +68 -0
  63. package/templates/next/app/js/app/api/hello/route.js +21 -0
  64. package/templates/next/app/js/app/not-found.js +58 -0
  65. package/templates/next/app/ts/app/api/hello/route.ts +22 -0
  66. package/templates/next/app/ts/app/not-found.tsx +58 -0
  67. package/templates/next/c3.ts +238 -0
  68. package/templates/next/env.d.ts +5 -0
  69. package/templates/next/pages/js/pages/api/hello.js +23 -0
  70. package/templates/next/pages/ts/pages/api/hello.ts +24 -0
  71. package/templates/next/wrangler.toml +86 -0
  72. package/templates/nuxt/c3.ts +133 -0
  73. package/templates/nuxt/templates/env.d.ts +14 -0
  74. package/templates/nuxt/templates/worker-configuration.d.ts +4 -0
  75. package/templates/nuxt/templates/wrangler.toml +85 -0
  76. package/templates/openapi/c3.ts +9 -0
  77. package/templates/openapi/ts/package.json +2 -1
  78. package/templates/openapi/ts/src/endpoints/taskList.ts +1 -1
  79. package/templates/openapi/ts/src/index.ts +3 -3
  80. package/templates/openapi/ts/worker-configuration.d.ts +4 -0
  81. package/templates/openapi/ts/wrangler.toml +104 -0
  82. package/templates/pre-existing/c3.ts +83 -0
  83. package/templates/pre-existing/js/.editorconfig +12 -0
  84. package/templates/pre-existing/js/.prettierrc +6 -0
  85. package/templates/{chatgptPlugin/ts → pre-existing/js}/__dot__gitignore +1 -0
  86. package/templates/pre-existing/js/package.json +13 -0
  87. package/templates/pre-existing/js/wrangler.toml +4 -0
  88. package/templates/queues/c3.ts +26 -0
  89. package/templates/queues/js/.editorconfig +0 -1
  90. package/templates/queues/js/wrangler.toml +95 -2
  91. package/templates/queues/ts/.editorconfig +0 -1
  92. package/templates/queues/ts/package.json +2 -1
  93. package/templates/queues/ts/src/index.ts +6 -8
  94. package/templates/queues/ts/worker-configuration.d.ts +5 -0
  95. package/templates/queues/ts/wrangler.toml +95 -2
  96. package/templates/qwik/c3.ts +146 -0
  97. package/templates/qwik/snippets/getPlatformProxy.ts +6 -0
  98. package/templates/qwik/templates/worker-configuration.d.ts +4 -0
  99. package/templates/qwik/templates/wrangler.toml +85 -0
  100. package/templates/react/c3.ts +31 -0
  101. package/templates/remix/c3.ts +66 -0
  102. package/templates/remix/templates/worker-configuration.d.ts +4 -0
  103. package/templates/remix/templates/wrangler.toml +85 -0
  104. package/templates/scheduled/c3.ts +16 -0
  105. package/templates/scheduled/js/.editorconfig +0 -1
  106. package/templates/scheduled/js/package.json +2 -2
  107. package/templates/scheduled/js/src/index.js +8 -1
  108. package/templates/scheduled/js/wrangler.toml +104 -0
  109. package/templates/scheduled/ts/.editorconfig +0 -1
  110. package/templates/scheduled/ts/package.json +3 -2
  111. package/templates/scheduled/ts/src/index.ts +6 -23
  112. package/templates/scheduled/ts/worker-configuration.d.ts +4 -0
  113. package/templates/scheduled/ts/wrangler.toml +104 -0
  114. package/templates/solid/c3.ts +86 -0
  115. package/templates/solid/templates/wrangler.toml +84 -0
  116. package/templates/svelte/c3.ts +130 -0
  117. package/templates/svelte/js/wrangler.toml +85 -0
  118. package/templates/svelte/ts/wrangler.toml +85 -0
  119. package/templates/vue/c3.ts +28 -0
  120. package/templates/chatgptPlugin/ts/.assets/example.png +0 -0
  121. package/templates/chatgptPlugin/ts/README.md +0 -25
  122. package/templates/chatgptPlugin/ts/src/index.ts +0 -33
  123. package/templates/chatgptPlugin/ts/src/search.ts +0 -59
  124. package/templates/chatgptPlugin/ts/wrangler.toml +0 -3
  125. package/{dist → templates}/angular/templates/server.ts +0 -0
  126. package/{dist → templates}/angular/templates/src/_routes.json +0 -0
  127. package/{dist → templates}/angular/templates/tools/alter-polyfills.mjs +1 -1
  128. /package/{dist → templates}/angular/templates/tools/paths.mjs +0 -0
@@ -1,59 +0,0 @@
1
- import { OpenAPIRoute, Query } from "@cloudflare/itty-router-openapi";
2
-
3
- export class GetSearch extends OpenAPIRoute {
4
- static schema = {
5
- tags: ["Search"],
6
- summary: "Search repositories by a query parameter",
7
- parameters: {
8
- q: Query(String, {
9
- description: "The query to search for",
10
- default: "cloudflare workers",
11
- }),
12
- },
13
- responses: {
14
- "200": {
15
- description: "Successfully response",
16
- schema: {
17
- repos: [
18
- {
19
- name: "itty-router-openapi",
20
- description:
21
- "OpenAPI 3 schema generator and validator for Cloudflare Workers",
22
- stars: "80",
23
- url: "https://github.com/cloudflare/itty-router-openapi",
24
- },
25
- ],
26
- },
27
- },
28
- },
29
- };
30
-
31
- async handle(request: Request, env, ctx, data: Record<string, any>) {
32
- const url = `https://api.github.com/search/repositories?q=${data.query.q}`;
33
-
34
- const resp = await fetch(url, {
35
- headers: {
36
- Accept: "application/vnd.github.v3+json",
37
- "User-Agent": "RepoAI - Cloudflare Workers ChatGPT Plugin Example",
38
- },
39
- });
40
-
41
- if (!resp.ok) {
42
- return new Response(await resp.text(), { status: 400 });
43
- }
44
-
45
- const json = await resp.json();
46
-
47
- // @ts-ignore
48
- const repos = json.items.map((item: any) => ({
49
- name: item.name,
50
- description: item.description,
51
- stars: item.stargazers_count,
52
- url: item.html_url,
53
- }));
54
-
55
- return {
56
- repos: repos,
57
- };
58
- }
59
- }
@@ -1,3 +0,0 @@
1
- name = "<TBD>"
2
- main = "src/index.ts"
3
- compatibility_date = "<TBD>"
File without changes
@@ -1,5 +1,5 @@
1
- import { EOL } from "node:os";
2
1
  import fs from "node:fs";
2
+ import { EOL } from "node:os";
3
3
  import { join } from "node:path";
4
4
  import { worker } from "./paths.mjs";
5
5