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.
- package/README.md +1 -52
- package/dist/cli.js +72644 -54169
- package/package.json +26 -13
- package/templates/angular/c3.ts +100 -0
- package/{dist/angular/templates/src/main.server.ts → templates/angular/templates/server.ts} +14 -15
- package/templates/angular/templates/tools/alter-polyfills.mjs +27 -0
- package/templates/angular/templates/tools/copy-files.mjs +9 -0
- package/templates/astro/c3.ts +112 -0
- package/templates/astro/snippets/runtimeDeclaration.ts +4 -0
- package/templates/astro/templates/wrangler.toml +52 -0
- package/templates/common/c3.ts +16 -0
- package/templates/common/js/.editorconfig +0 -1
- package/templates/common/js/__dot__gitignore +172 -0
- package/templates/common/js/package.json +1 -0
- package/templates/common/js/wrangler.toml +69 -23
- package/templates/common/ts/.editorconfig +0 -1
- package/templates/common/ts/__dot__gitignore +172 -0
- package/templates/common/ts/package.json +1 -1
- package/templates/common/ts/wrangler.toml +69 -23
- package/templates/docusaurus/c3.ts +26 -0
- package/templates/gatsby/c3.ts +48 -0
- package/templates/hello-world/c3.ts +16 -0
- package/templates/hello-world/js/.editorconfig +0 -1
- package/templates/hello-world/js/__dot__gitignore +172 -0
- package/templates/hello-world/js/package.json +4 -1
- package/templates/hello-world/js/test/index.spec.js +20 -0
- package/templates/hello-world/js/vitest.config.js +11 -0
- package/templates/hello-world/js/wrangler.toml +70 -23
- package/templates/hello-world/ts/.editorconfig +0 -1
- package/templates/hello-world/ts/__dot__gitignore +172 -0
- package/templates/hello-world/ts/package.json +6 -3
- package/templates/hello-world/ts/test/index.spec.ts +25 -0
- package/templates/hello-world/ts/test/tsconfig.json +11 -0
- package/templates/hello-world/ts/tsconfig.json +3 -2
- package/templates/hello-world/ts/vitest.config.ts +11 -0
- package/templates/hello-world/ts/wrangler.toml +70 -23
- package/templates/hello-world-durable-object/c3.ts +16 -0
- package/templates/hello-world-durable-object/js/.editorconfig +12 -0
- package/templates/hello-world-durable-object/js/.prettierrc +6 -0
- package/templates/hello-world-durable-object/js/__dot__gitignore +172 -0
- package/templates/hello-world-durable-object/js/package.json +13 -0
- package/templates/hello-world-durable-object/js/src/index.js +65 -0
- package/templates/hello-world-durable-object/js/wrangler.toml +97 -0
- package/templates/hello-world-durable-object/ts/.editorconfig +12 -0
- package/templates/hello-world-durable-object/ts/.prettierrc +6 -0
- package/templates/hello-world-durable-object/ts/__dot__gitignore +172 -0
- package/templates/hello-world-durable-object/ts/package.json +15 -0
- package/templates/hello-world-durable-object/ts/src/index.ts +78 -0
- package/templates/hello-world-durable-object/ts/tsconfig.json +101 -0
- package/templates/hello-world-durable-object/ts/wrangler.toml +98 -0
- package/templates/hono/c3.ts +25 -0
- package/templates/next/README.md +68 -0
- package/templates/next/app/js/app/api/hello/route.js +21 -0
- package/templates/next/app/js/app/not-found.js +58 -0
- package/templates/next/app/ts/app/api/hello/route.ts +22 -0
- package/templates/next/app/ts/app/not-found.tsx +58 -0
- package/templates/next/c3.ts +236 -0
- package/templates/next/env.d.ts +5 -0
- package/templates/next/pages/js/pages/api/hello.js +23 -0
- package/templates/next/pages/ts/pages/api/hello.ts +24 -0
- package/templates/next/wrangler.toml +54 -0
- package/templates/nuxt/c3.ts +134 -0
- package/templates/nuxt/templates/env.d.ts +14 -0
- package/templates/nuxt/templates/worker-configuration.d.ts +4 -0
- package/templates/nuxt/templates/wrangler.toml +52 -0
- package/templates/openapi/c3.ts +9 -0
- package/templates/openapi/ts/__dot__gitignore +171 -0
- package/templates/openapi/ts/package.json +1 -1
- package/templates/openapi/ts/src/endpoints/taskList.ts +1 -1
- package/templates/openapi/ts/src/index.ts +2 -2
- package/templates/pre-existing/c3.ts +83 -0
- package/templates/pre-existing/js/.editorconfig +12 -0
- package/templates/pre-existing/js/.prettierrc +6 -0
- package/templates/pre-existing/js/__dot__gitignore +172 -0
- package/templates/pre-existing/js/package.json +13 -0
- package/templates/pre-existing/js/wrangler.toml +3 -0
- package/templates/queues/c3.ts +26 -0
- package/templates/queues/js/.editorconfig +0 -1
- package/templates/queues/js/__dot__gitignore +172 -0
- package/templates/queues/js/package.json +1 -0
- package/templates/queues/js/wrangler.toml +85 -2
- package/templates/queues/ts/.editorconfig +0 -1
- package/templates/queues/ts/__dot__gitignore +172 -0
- package/templates/queues/ts/package.json +1 -1
- package/templates/queues/ts/wrangler.toml +85 -2
- package/templates/qwik/c3.ts +146 -0
- package/templates/qwik/snippets/getPlatformProxy.ts +6 -0
- package/templates/qwik/templates/worker-configuration.d.ts +4 -0
- package/templates/qwik/templates/wrangler.toml +52 -0
- package/templates/react/c3.ts +31 -0
- package/templates/remix/c3.ts +66 -0
- package/templates/remix/templates/worker-configuration.d.ts +4 -0
- package/templates/remix/templates/wrangler.toml +52 -0
- package/templates/scheduled/c3.ts +16 -0
- package/templates/scheduled/js/.editorconfig +0 -1
- package/templates/scheduled/js/__dot__gitignore +172 -0
- package/templates/scheduled/js/package.json +1 -0
- package/templates/scheduled/js/wrangler.toml +95 -1
- package/templates/scheduled/ts/.editorconfig +0 -1
- package/templates/scheduled/ts/__dot__gitignore +172 -0
- package/templates/scheduled/ts/package.json +1 -1
- package/templates/scheduled/ts/wrangler.toml +95 -1
- package/templates/solid/c3.ts +82 -0
- package/templates/svelte/c3.ts +130 -0
- package/templates/svelte/js/wrangler.toml +52 -0
- package/templates/svelte/ts/wrangler.toml +52 -0
- package/templates/vue/c3.ts +28 -0
- package/dist/angular/templates/tools/bundle.mjs +0 -77
- package/dist/angular/templates/tools/copy-client-files.mjs +0 -4
- package/dist/angular/templates/tools/copy-worker-files.mjs +0 -10
- package/dist/angular/templates/tsconfig.server.json +0 -5
- package/templates/chatgptPlugin/ts/.assets/example.png +0 -0
- package/templates/chatgptPlugin/ts/README.md +0 -25
- package/templates/chatgptPlugin/ts/package.json +0 -16
- package/templates/chatgptPlugin/ts/src/index.ts +0 -33
- package/templates/chatgptPlugin/ts/src/search.ts +0 -59
- package/templates/chatgptPlugin/ts/wrangler.toml +0 -3
- /package/{dist → templates}/angular/templates/src/_routes.json +0 -0
- /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
|
-
}
|
|
File without changes
|
|
File without changes
|