create-cloudflare 0.0.0-e0850ad1 → 0.0.0-e11e1691

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 (119) hide show
  1. package/README.md +1 -52
  2. package/dist/cli.js +72644 -54169
  3. package/package.json +26 -13
  4. package/templates/angular/c3.ts +100 -0
  5. package/{dist/angular/templates/src/main.server.ts → templates/angular/templates/server.ts} +14 -15
  6. package/templates/angular/templates/tools/alter-polyfills.mjs +27 -0
  7. package/templates/angular/templates/tools/copy-files.mjs +9 -0
  8. package/templates/astro/c3.ts +112 -0
  9. package/templates/astro/snippets/runtimeDeclaration.ts +4 -0
  10. package/templates/astro/templates/wrangler.toml +52 -0
  11. package/templates/common/c3.ts +16 -0
  12. package/templates/common/js/.editorconfig +0 -1
  13. package/templates/common/js/__dot__gitignore +172 -0
  14. package/templates/common/js/package.json +1 -0
  15. package/templates/common/js/wrangler.toml +69 -23
  16. package/templates/common/ts/.editorconfig +0 -1
  17. package/templates/common/ts/__dot__gitignore +172 -0
  18. package/templates/common/ts/package.json +1 -1
  19. package/templates/common/ts/wrangler.toml +69 -23
  20. package/templates/docusaurus/c3.ts +26 -0
  21. package/templates/gatsby/c3.ts +48 -0
  22. package/templates/hello-world/c3.ts +16 -0
  23. package/templates/hello-world/js/.editorconfig +0 -1
  24. package/templates/hello-world/js/__dot__gitignore +172 -0
  25. package/templates/hello-world/js/package.json +4 -1
  26. package/templates/hello-world/js/test/index.spec.js +20 -0
  27. package/templates/hello-world/js/vitest.config.js +11 -0
  28. package/templates/hello-world/js/wrangler.toml +70 -23
  29. package/templates/hello-world/ts/.editorconfig +0 -1
  30. package/templates/hello-world/ts/__dot__gitignore +172 -0
  31. package/templates/hello-world/ts/package.json +6 -3
  32. package/templates/hello-world/ts/test/index.spec.ts +25 -0
  33. package/templates/hello-world/ts/test/tsconfig.json +11 -0
  34. package/templates/hello-world/ts/tsconfig.json +3 -2
  35. package/templates/hello-world/ts/vitest.config.ts +11 -0
  36. package/templates/hello-world/ts/wrangler.toml +70 -23
  37. package/templates/hello-world-durable-object/c3.ts +16 -0
  38. package/templates/hello-world-durable-object/js/.editorconfig +12 -0
  39. package/templates/hello-world-durable-object/js/.prettierrc +6 -0
  40. package/templates/hello-world-durable-object/js/__dot__gitignore +172 -0
  41. package/templates/hello-world-durable-object/js/package.json +13 -0
  42. package/templates/hello-world-durable-object/js/src/index.js +65 -0
  43. package/templates/hello-world-durable-object/js/wrangler.toml +97 -0
  44. package/templates/hello-world-durable-object/ts/.editorconfig +12 -0
  45. package/templates/hello-world-durable-object/ts/.prettierrc +6 -0
  46. package/templates/hello-world-durable-object/ts/__dot__gitignore +172 -0
  47. package/templates/hello-world-durable-object/ts/package.json +15 -0
  48. package/templates/hello-world-durable-object/ts/src/index.ts +78 -0
  49. package/templates/hello-world-durable-object/ts/tsconfig.json +101 -0
  50. package/templates/hello-world-durable-object/ts/wrangler.toml +98 -0
  51. package/templates/hono/c3.ts +25 -0
  52. package/templates/next/README.md +68 -0
  53. package/templates/next/app/js/app/api/hello/route.js +21 -0
  54. package/templates/next/app/js/app/not-found.js +58 -0
  55. package/templates/next/app/ts/app/api/hello/route.ts +22 -0
  56. package/templates/next/app/ts/app/not-found.tsx +58 -0
  57. package/templates/next/c3.ts +236 -0
  58. package/templates/next/env.d.ts +5 -0
  59. package/templates/next/pages/js/pages/api/hello.js +23 -0
  60. package/templates/next/pages/ts/pages/api/hello.ts +24 -0
  61. package/templates/next/wrangler.toml +54 -0
  62. package/templates/nuxt/c3.ts +134 -0
  63. package/templates/nuxt/templates/env.d.ts +14 -0
  64. package/templates/nuxt/templates/worker-configuration.d.ts +4 -0
  65. package/templates/nuxt/templates/wrangler.toml +52 -0
  66. package/templates/openapi/c3.ts +9 -0
  67. package/templates/openapi/ts/__dot__gitignore +171 -0
  68. package/templates/openapi/ts/package.json +1 -1
  69. package/templates/openapi/ts/src/endpoints/taskList.ts +1 -1
  70. package/templates/openapi/ts/src/index.ts +2 -2
  71. package/templates/pre-existing/c3.ts +83 -0
  72. package/templates/pre-existing/js/.editorconfig +12 -0
  73. package/templates/pre-existing/js/.prettierrc +6 -0
  74. package/templates/pre-existing/js/__dot__gitignore +172 -0
  75. package/templates/pre-existing/js/package.json +13 -0
  76. package/templates/pre-existing/js/wrangler.toml +3 -0
  77. package/templates/queues/c3.ts +26 -0
  78. package/templates/queues/js/.editorconfig +0 -1
  79. package/templates/queues/js/__dot__gitignore +172 -0
  80. package/templates/queues/js/package.json +1 -0
  81. package/templates/queues/js/wrangler.toml +85 -2
  82. package/templates/queues/ts/.editorconfig +0 -1
  83. package/templates/queues/ts/__dot__gitignore +172 -0
  84. package/templates/queues/ts/package.json +1 -1
  85. package/templates/queues/ts/wrangler.toml +85 -2
  86. package/templates/qwik/c3.ts +146 -0
  87. package/templates/qwik/snippets/getPlatformProxy.ts +6 -0
  88. package/templates/qwik/templates/worker-configuration.d.ts +4 -0
  89. package/templates/qwik/templates/wrangler.toml +52 -0
  90. package/templates/react/c3.ts +31 -0
  91. package/templates/remix/c3.ts +66 -0
  92. package/templates/remix/templates/worker-configuration.d.ts +4 -0
  93. package/templates/remix/templates/wrangler.toml +52 -0
  94. package/templates/scheduled/c3.ts +16 -0
  95. package/templates/scheduled/js/.editorconfig +0 -1
  96. package/templates/scheduled/js/__dot__gitignore +172 -0
  97. package/templates/scheduled/js/package.json +1 -0
  98. package/templates/scheduled/js/wrangler.toml +95 -1
  99. package/templates/scheduled/ts/.editorconfig +0 -1
  100. package/templates/scheduled/ts/__dot__gitignore +172 -0
  101. package/templates/scheduled/ts/package.json +1 -1
  102. package/templates/scheduled/ts/wrangler.toml +95 -1
  103. package/templates/solid/c3.ts +82 -0
  104. package/templates/svelte/c3.ts +130 -0
  105. package/templates/svelte/js/wrangler.toml +52 -0
  106. package/templates/svelte/ts/wrangler.toml +52 -0
  107. package/templates/vue/c3.ts +28 -0
  108. package/dist/angular/templates/tools/bundle.mjs +0 -77
  109. package/dist/angular/templates/tools/copy-client-files.mjs +0 -4
  110. package/dist/angular/templates/tools/copy-worker-files.mjs +0 -10
  111. package/dist/angular/templates/tsconfig.server.json +0 -5
  112. package/templates/chatgptPlugin/ts/.assets/example.png +0 -0
  113. package/templates/chatgptPlugin/ts/README.md +0 -25
  114. package/templates/chatgptPlugin/ts/package.json +0 -16
  115. package/templates/chatgptPlugin/ts/src/index.ts +0 -33
  116. package/templates/chatgptPlugin/ts/src/search.ts +0 -59
  117. package/templates/chatgptPlugin/ts/wrangler.toml +0 -3
  118. /package/{dist → templates}/angular/templates/src/_routes.json +0 -0
  119. /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>"