create-cloudflare 2.0.2 → 2.0.3

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 (44) hide show
  1. package/package.json +1 -1
  2. package/dist/angular/templates/src/_routes.json +0 -5
  3. package/dist/angular/templates/src/main.server.ts +0 -35
  4. package/dist/angular/templates/tools/bundle.mjs +0 -74
  5. package/dist/angular/templates/tools/copy-client-files.mjs +0 -4
  6. package/dist/angular/templates/tools/copy-worker-files.mjs +0 -10
  7. package/dist/angular/templates/tools/paths.mjs +0 -9
  8. package/dist/angular/templates/tsconfig.server.json +0 -5
  9. package/dist/cli.js +0 -56580
  10. package/dist/tsconfig.tsbuildinfo +0 -1
  11. package/templates/chatgptPlugin/ts/.assets/example.png +0 -0
  12. package/templates/chatgptPlugin/ts/README.md +0 -25
  13. package/templates/chatgptPlugin/ts/package-lock.json +0 -1971
  14. package/templates/chatgptPlugin/ts/package.json +0 -16
  15. package/templates/chatgptPlugin/ts/src/index.ts +0 -33
  16. package/templates/chatgptPlugin/ts/src/search.ts +0 -63
  17. package/templates/chatgptPlugin/ts/wrangler.toml +0 -3
  18. package/templates/common/js/.prettierrc +0 -5
  19. package/templates/common/js/package.json +0 -14
  20. package/templates/common/js/src/ab-test.js +0 -41
  21. package/templates/common/js/src/proxy.js +0 -23
  22. package/templates/common/js/src/redirect.js +0 -13
  23. package/templates/common/js/src/router.js +0 -22
  24. package/templates/common/js/src/worker.js +0 -46
  25. package/templates/common/js/wrangler.toml +0 -40
  26. package/templates/common/ts/.prettierrc +0 -5
  27. package/templates/common/ts/package.json +0 -15
  28. package/templates/common/ts/src/ab-test.ts +0 -41
  29. package/templates/common/ts/src/proxy.ts +0 -23
  30. package/templates/common/ts/src/redirect.ts +0 -13
  31. package/templates/common/ts/src/router.ts +0 -22
  32. package/templates/common/ts/src/worker.ts +0 -46
  33. package/templates/common/ts/tsconfig.json +0 -101
  34. package/templates/common/ts/worker-configuration.d.ts +0 -16
  35. package/templates/common/ts/wrangler.toml +0 -40
  36. package/templates/simple/js/.prettierrc +0 -5
  37. package/templates/simple/js/package.json +0 -14
  38. package/templates/simple/js/src/worker.js +0 -15
  39. package/templates/simple/js/wrangler.toml +0 -40
  40. package/templates/simple/ts/.prettierrc +0 -5
  41. package/templates/simple/ts/package.json +0 -14
  42. package/templates/simple/ts/src/worker.ts +0 -32
  43. package/templates/simple/ts/tsconfig.json +0 -101
  44. package/templates/simple/ts/wrangler.toml +0 -40
@@ -1,16 +0,0 @@
1
- {
2
- "name": "cloudflare-workers-chatgpt-plugin-example",
3
- "version": "0.0.1",
4
- "private": true,
5
- "scripts": {
6
- "deploy": "wrangler publish",
7
- "start": "wrangler dev"
8
- },
9
- "dependencies": {
10
- "@cloudflare/itty-router-openapi": "^0.1.2"
11
- },
12
- "devDependencies": {
13
- "@cloudflare/workers-types": "^4.20230404.0",
14
- "wrangler": "^2.15.1"
15
- }
16
- }
@@ -1,33 +0,0 @@
1
- import { OpenAPIRouter } from "@cloudflare/itty-router-openapi";
2
- import { GetSearch } from "./search";
3
-
4
- export const router = OpenAPIRouter({
5
- schema: {
6
- info: {
7
- title: "GitHub Repositories Search API",
8
- description:
9
- "A plugin that allows the user to search for GitHub repositories using ChatGPT",
10
- version: "v0.0.1",
11
- },
12
- },
13
- docs_url: "/",
14
- aiPlugin: {
15
- name_for_human: "GitHub Repositories Search",
16
- name_for_model: "github_repositories_search",
17
- description_for_human: "GitHub Repositories Search plugin for ChatGPT.",
18
- description_for_model:
19
- "GitHub Repositories Search plugin for ChatGPT. You can search for GitHub repositories using this plugin.",
20
- contact_email: "support@example.com",
21
- legal_info_url: "http://www.example.com/legal",
22
- logo_url: "https://workers.cloudflare.com/resources/logo/logo.svg",
23
- },
24
- });
25
-
26
- router.get("/search", GetSearch);
27
-
28
- // 404 for everything else
29
- router.all("*", () => new Response("Not Found.", { status: 404 }));
30
-
31
- export default {
32
- fetch: router.handle,
33
- };
@@ -1,63 +0,0 @@
1
- import {
2
- ApiException,
3
- OpenAPIRoute,
4
- Query,
5
- ValidationError,
6
- } from "@cloudflare/itty-router-openapi";
7
-
8
- export class GetSearch extends OpenAPIRoute {
9
- static schema = {
10
- tags: ["Search"],
11
- summary: "Search repositories by a query parameter",
12
- parameters: {
13
- q: Query(String, {
14
- description: "The query to search for",
15
- default: "cloudflare workers",
16
- }),
17
- },
18
- responses: {
19
- "200": {
20
- schema: {
21
- repos: [
22
- {
23
- name: "itty-router-openapi",
24
- description:
25
- "OpenAPI 3 schema generator and validator for Cloudflare Workers",
26
- stars: "80",
27
- url: "https://github.com/cloudflare/itty-router-openapi",
28
- },
29
- ],
30
- },
31
- },
32
- },
33
- };
34
-
35
- async handle(request: Request, env, ctx, data: Record<string, any>) {
36
- const url = `https://api.github.com/search/repositories?q=${data.q}`;
37
-
38
- const resp = await fetch(url, {
39
- headers: {
40
- Accept: "application/vnd.github.v3+json",
41
- "User-Agent": "RepoAI - Cloudflare Workers ChatGPT Plugin Example",
42
- },
43
- });
44
-
45
- if (!resp.ok) {
46
- return new Response(await resp.text(), { status: 400 });
47
- }
48
-
49
- const json = await resp.json();
50
-
51
- // @ts-ignore
52
- const repos = json.items.map((item: any) => ({
53
- name: item.name,
54
- description: item.description,
55
- stars: item.stargazers_count,
56
- url: item.html_url,
57
- }));
58
-
59
- return {
60
- repos: repos,
61
- };
62
- }
63
- }
@@ -1,3 +0,0 @@
1
- name = "cloudflare-workers-chatgpt-plugin-example"
2
- main = "src/index.ts"
3
- compatibility_date = "2023-04-07"
@@ -1,5 +0,0 @@
1
- {
2
- "printWidth": 140,
3
- "singleQuote": true,
4
- "semi": true
5
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "<TBD>",
3
- "version": "0.0.0",
4
- "private": true,
5
- "scripts": {
6
- "deploy": "wrangler publish",
7
- "start": "wrangler dev"
8
- },
9
- "devDependencies": {
10
- "@cloudflare/workers-types": "^4.20230419.0",
11
- "itty-router": "^3.0.12",
12
- "wrangler": "^2.19.0"
13
- }
14
- }
@@ -1,41 +0,0 @@
1
- const ORIGIN_URL = 'https://example.com';
2
- const EXPERIMENTS = [
3
- { name: 'big-button', threshold: 0.5 }, // enable the Big Button experiment for 50% of users
4
- { name: 'new-brand', threshold: 0.1 }, // enable the New Brand experiment for 10% of users
5
- { name: 'new-layout', threshold: 0.02 }, // enable the New Layout experiment for 2% of users
6
- ];
7
-
8
- export default {
9
- async fetch(request, env, ctx) {
10
- const fingerprint = [request.headers.get('cf-connecting-ip'), request.cf?.postalCode]; // add any values you want considered as a fingerprint
11
- const activeExperiments = await getActiveExperiments(fingerprint, EXPERIMENTS);
12
-
13
- // add a data-experiments attribute to the <body> tag
14
- // which can be styled in CSS with a wildcard selector like [data-experiments*="big-button"]
15
- const rewriter = new HTMLRewriter().on('body', {
16
- element(element) {
17
- element.setAttribute('data-experiments', activeExperiments.join(' '));
18
- },
19
- });
20
-
21
- const res = await fetch(ORIGIN_URL, request);
22
-
23
- return rewriter.transform(res);
24
- },
25
- };
26
-
27
- // Get active experiments by hashing a fingerprint
28
- async function getActiveExperiments(fingerprint, experiments) {
29
- const fingerprintHash = await hash('SHA-1', JSON.stringify(fingerprint));
30
- const MAX_UINT8 = 255;
31
- const activeExperiments = experiments.filter((exp, i) => fingerprintHash[i] <= exp.threshold * MAX_UINT8);
32
- return activeExperiments.map((exp) => exp.name);
33
- }
34
-
35
- // Hash a string using the Web Crypto API
36
- async function hash(algorithm, message) {
37
- const msgUint8 = new TextEncoder().encode(message); // encode as (utf-8) Uint8Array
38
- const hashBuffer = await crypto.subtle.digest(algorithm, msgUint8); // hash the message
39
- const hashArray = new Uint8Array(hashBuffer); // convert buffer to byte array
40
- return hashArray;
41
- }
@@ -1,23 +0,0 @@
1
- export default {
2
- async fetch(request, env, ctx) {
3
- const url = new URL(request.url);
4
-
5
- const proxyUrl = url.searchParams.get('proxyUrl'); // get a query param value (?proxyUrl=...)
6
- const modify = url.searchParams.has('modify'); // check if a query param is set (?proxyUrl=...&modify)
7
-
8
- if (!proxyUrl) {
9
- return new Response('Bad request: Missing `proxyUrl` query param', { status: 400 });
10
- }
11
-
12
- // make subrequests with the global `fetch()` function
13
- let res = await fetch(proxyUrl, request);
14
-
15
- // optionally, modify the respone
16
- if (modify) {
17
- res = new Response(res.body, res);
18
- res.headers.set('X-My-Header', 'My Header Value');
19
- }
20
-
21
- return res;
22
- },
23
- };
@@ -1,13 +0,0 @@
1
- export default {
2
- async fetch(request, env, ctx) {
3
- const url = new URL(request.url);
4
- const redirectUrl = url.searchParams.get('redirectUrl'); // get a query param value (?redirectUrl=...)
5
-
6
- if (!redirectUrl) {
7
- return new Response('Bad request: Missing `redirectUrl` query param', { status: 400 });
8
- }
9
-
10
- // The Response class has static methods to create common Response objects as a convenience
11
- return Response.redirect(redirectUrl);
12
- },
13
- };
@@ -1,22 +0,0 @@
1
- import { Router } from 'itty-router';
2
-
3
- // now let's create a router (note the lack of "new")
4
- const router = Router();
5
-
6
- // GET collection index
7
- router.get('/api/todos', () => new Response('Todos Index!'));
8
-
9
- // GET item
10
- router.get('/api/todos/:id', ({ params }) => new Response(`Todo #${params.id}`));
11
-
12
- // POST to the collection (we'll use async here)
13
- router.post('/api/todos', async (request) => {
14
- const content = await request.json();
15
-
16
- return new Response('Creating Todo: ' + JSON.stringify(content));
17
- });
18
-
19
- // 404 for everything else
20
- router.all('*', () => new Response('Not Found.', { status: 404 }));
21
-
22
- export default router;
@@ -1,46 +0,0 @@
1
- /**
2
- * Welcome to Cloudflare Workers! This is your first worker.
3
- *
4
- * - Run `npm run dev` in your terminal to start a development server
5
- * - Open a browser tab at http://localhost:8787/ to see your worker in action
6
- * - Run `npm run deploy` to publish your worker
7
- *
8
- * Learn more at https://developers.cloudflare.com/workers/
9
- */
10
-
11
- import handleProxy from './proxy';
12
- import handleRedirect from './redirect';
13
- import apiRouter from './router';
14
-
15
- // Export a default object containing event handlers
16
- export default {
17
- // The fetch handler is invoked when this worker receives a HTTP(S) request
18
- // and should return a Response (optionally wrapped in a Promise)
19
- async fetch(request, env, ctx) {
20
- // You'll find it helpful to parse the request.url string into a URL object. Learn more at https://developer.mozilla.org/en-US/docs/Web/API/URL
21
- const url = new URL(request.url);
22
-
23
- // You can get pretty far with simple logic like if/switch-statements
24
- switch (url.pathname) {
25
- case '/redirect':
26
- return handleRedirect.fetch(request, env, ctx);
27
-
28
- case '/proxy':
29
- return handleProxy.fetch(request, env, ctx);
30
- }
31
-
32
- if (url.pathname.startsWith('/api/')) {
33
- // You can also use more robust routing
34
- return apiRouter.handle(request);
35
- }
36
-
37
- return new Response(
38
- `Try making requests to:
39
- <ul>
40
- <li><code><a href="/redirect?redirectUrl=https://example.com/">/redirect?redirectUrl=https://example.com/</a></code>,</li>
41
- <li><code><a href="/proxy?modify&proxyUrl=https://example.com/">/proxy?modify&proxyUrl=https://example.com/</a></code>, or</li>
42
- <li><code><a href="/api/todos">/api/todos</a></code></li>`,
43
- { headers: { 'Content-Type': 'text/html' } }
44
- );
45
- },
46
- };
@@ -1,40 +0,0 @@
1
- name = "<TBD>"
2
- main = "src/worker.ts"
3
- compatibility_date = "2023-04-21"
4
-
5
- # # KV Namespace binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv
6
- # [[kv_namespaces]]
7
- # binding = "MY_KV_NAMESPACE"
8
- # id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
9
-
10
- # # Durable Object binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/durable-objects
11
- # [[durable_objects]]
12
- # binding = "MY_DURABLE_OBJECT"
13
- # class_name = "MyDurableObject"
14
-
15
- # # Bucket binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv#bucket
16
- # [[buckets]]
17
- # binding = "MY_BUCKET"
18
- # name = "my-bucket"
19
- # bucket_id = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
20
-
21
- # # Service binding - For more information: https://developers.cloudflare.com/workers/platform/services
22
- # [[routes]]
23
- # binding = "MY_SERVICE"
24
- # pattern = "/api/*"
25
- # script = "api.js"
26
-
27
- # # Queue binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/queues
28
- # [[queues]]
29
- # binding = "MY_QUEUE"
30
- # name = "my-queue"
31
- # zone_id = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
32
-
33
- # [env.production]
34
- # MY_VARIABLE = "production_value"
35
-
36
- # [env.staging]
37
- # MY_VARIABLE = "staging_value"
38
-
39
- # [env.shared]
40
- # SHARED_VARIABLE = "shared_value"
@@ -1,5 +0,0 @@
1
- {
2
- "printWidth": 140,
3
- "singleQuote": true,
4
- "semi": true
5
- }
@@ -1,15 +0,0 @@
1
- {
2
- "name": "<TBD>",
3
- "version": "0.0.0",
4
- "private": true,
5
- "scripts": {
6
- "deploy": "wrangler publish",
7
- "start": "wrangler dev"
8
- },
9
- "devDependencies": {
10
- "@cloudflare/workers-types": "^4.20230419.0",
11
- "itty-router": "^3.0.12",
12
- "typescript": "^5.0.4",
13
- "wrangler": "^2.19.0"
14
- }
15
- }
@@ -1,41 +0,0 @@
1
- const ORIGIN_URL = 'https://example.com';
2
- const EXPERIMENTS = [
3
- { name: 'big-button', threshold: 0.5 }, // enable the Big Button experiment for 50% of users
4
- { name: 'new-brand', threshold: 0.1 }, // enable the New Brand experiment for 10% of users
5
- { name: 'new-layout', threshold: 0.02 }, // enable the New Layout experiment for 2% of users
6
- ];
7
-
8
- export default {
9
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
10
- const fingerprint = [request.headers.get('cf-connecting-ip'), request.cf?.postalCode]; // add any values you want considered as a fingerprint
11
- const activeExperiments = await getActiveExperiments(fingerprint, EXPERIMENTS);
12
-
13
- // add a data-experiments attribute to the <body> tag
14
- // which can be styled in CSS with a wildcard selector like [data-experiments*="big-button"]
15
- const rewriter = new HTMLRewriter().on('body', {
16
- element(element: Element) {
17
- element.setAttribute('data-experiments', activeExperiments.join(' '));
18
- },
19
- });
20
-
21
- const res = await fetch(ORIGIN_URL, request);
22
-
23
- return rewriter.transform(res);
24
- },
25
- };
26
-
27
- // Get active experiments by hashing a fingerprint
28
- async function getActiveExperiments(fingerprint: unknown, experiments: Array<{ name: string; threshold: number }>) {
29
- const fingerprintHash: Uint8Array = await hash('SHA-1', JSON.stringify(fingerprint));
30
- const MAX_UINT8 = 255;
31
- const activeExperiments = experiments.filter((exp, i) => fingerprintHash[i] <= exp.threshold * MAX_UINT8);
32
- return activeExperiments.map((exp) => exp.name);
33
- }
34
-
35
- // Hash a string using the Web Crypto API
36
- async function hash(algorithm: 'SHA-1' | 'SHA-256' | 'SHA-512', message: string): Promise<Uint8Array> {
37
- const msgUint8 = new TextEncoder().encode(message); // encode as (utf-8) Uint8Array
38
- const hashBuffer = await crypto.subtle.digest(algorithm, msgUint8); // hash the message
39
- const hashArray = new Uint8Array(hashBuffer); // convert buffer to byte array
40
- return hashArray;
41
- }
@@ -1,23 +0,0 @@
1
- export default {
2
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
3
- const url = new URL(request.url);
4
-
5
- const proxyUrl = url.searchParams.get('proxyUrl'); // get a query param value (?proxyUrl=...)
6
- const modify = url.searchParams.has('modify'); // check if a query param is set (?proxyUrl=...&modify)
7
-
8
- if (!proxyUrl) {
9
- return new Response('Bad request: Missing `proxyUrl` query param', { status: 400 });
10
- }
11
-
12
- // make subrequests with the global `fetch()` function
13
- let res = await fetch(proxyUrl, request);
14
-
15
- // optionally, modify the respone
16
- if (modify) {
17
- res = new Response(res.body, res);
18
- res.headers.set('X-My-Header', 'My Header Value');
19
- }
20
-
21
- return res;
22
- },
23
- };
@@ -1,13 +0,0 @@
1
- export default {
2
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
3
- const url = new URL(request.url);
4
- const redirectUrl = url.searchParams.get('redirectUrl'); // get a query param value (?redirectUrl=...)
5
-
6
- if (!redirectUrl) {
7
- return new Response('Bad request: Missing `redirectUrl` query param', { status: 400 });
8
- }
9
-
10
- // The Response class has static methods to create common Response objects as a convenience
11
- return Response.redirect(redirectUrl);
12
- },
13
- };
@@ -1,22 +0,0 @@
1
- import { Router } from 'itty-router';
2
-
3
- // now let's create a router (note the lack of "new")
4
- const router = Router();
5
-
6
- // GET collection index
7
- router.get('/api/todos', () => new Response('Todos Index!'));
8
-
9
- // GET item
10
- router.get('/api/todos/:id', ({ params }) => new Response(`Todo #${params.id}`));
11
-
12
- // POST to the collection (we'll use async here)
13
- router.post('/api/todos', async (request) => {
14
- const content = await request.json();
15
-
16
- return new Response('Creating Todo: ' + JSON.stringify(content));
17
- });
18
-
19
- // 404 for everything else
20
- router.all('*', () => new Response('Not Found.', { status: 404 }));
21
-
22
- export default router;
@@ -1,46 +0,0 @@
1
- /**
2
- * Welcome to Cloudflare Workers! This is your first worker.
3
- *
4
- * - Run `npm run dev` in your terminal to start a development server
5
- * - Open a browser tab at http://localhost:8787/ to see your worker in action
6
- * - Run `npm run deploy` to publish your worker
7
- *
8
- * Learn more at https://developers.cloudflare.com/workers/
9
- */
10
-
11
- import handleProxy from './proxy';
12
- import handleRedirect from './redirect';
13
- import apiRouter from './router';
14
-
15
- // Export a default object containing event handlers
16
- export default {
17
- // The fetch handler is invoked when this worker receives a HTTP(S) request
18
- // and should return a Response (optionally wrapped in a Promise)
19
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
20
- // You'll find it helpful to parse the request.url string into a URL object. Learn more at https://developer.mozilla.org/en-US/docs/Web/API/URL
21
- const url = new URL(request.url);
22
-
23
- // You can get pretty far with simple logic like if/switch-statements
24
- switch (url.pathname) {
25
- case '/redirect':
26
- return handleRedirect.fetch(request, env, ctx);
27
-
28
- case '/proxy':
29
- return handleProxy.fetch(request, env, ctx);
30
- }
31
-
32
- if (url.pathname.startsWith('/api/')) {
33
- // You can also use more robust routing
34
- return apiRouter.handle(request);
35
- }
36
-
37
- return new Response(
38
- `Try making requests to:
39
- <ul>
40
- <li><code><a href="/redirect?redirectUrl=https://example.com/">/redirect?redirectUrl=https://example.com/</a></code>,</li>
41
- <li><code><a href="/proxy?modify&proxyUrl=https://example.com/">/proxy?modify&proxyUrl=https://example.com/</a></code>, or</li>
42
- <li><code><a href="/api/todos">/api/todos</a></code></li>`,
43
- { headers: { 'Content-Type': 'text/html' } }
44
- );
45
- },
46
- };
@@ -1,101 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Enable incremental compilation */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
- "target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
- "lib": ["es2021"] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
16
- "jsx": "react" /* Specify what JSX code is generated. */,
17
- // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
20
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
22
- // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
23
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
-
26
- /* Modules */
27
- "module": "es2022" /* Specify what module code is generated. */,
28
- // "rootDir": "./", /* Specify the root folder within your source files. */
29
- "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
30
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
31
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
32
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
33
- // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
34
- "types": ["@cloudflare/workers-types"] /* Specify type package names to be included without being referenced in a source file. */,
35
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
36
- "resolveJsonModule": true /* Enable importing .json files */,
37
- // "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
38
-
39
- /* JavaScript Support */
40
- "allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */,
41
- "checkJs": false /* Enable error reporting in type-checked JavaScript files. */,
42
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
43
-
44
- /* Emit */
45
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
46
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
47
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
48
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
49
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
50
- // "outDir": "./", /* Specify an output folder for all emitted files. */
51
- // "removeComments": true, /* Disable emitting comments. */
52
- "noEmit": true /* Disable emitting files from a compilation. */,
53
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
54
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
55
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
56
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
57
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
58
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
59
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
60
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
61
- // "newLine": "crlf", /* Set the newline character for emitting files. */
62
- // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
63
- // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
64
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
65
- // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
66
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
67
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
68
-
69
- /* Interop Constraints */
70
- "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
71
- "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
72
- // "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
73
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
74
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
75
-
76
- /* Type Checking */
77
- "strict": true /* Enable all strict type-checking options. */,
78
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
79
- // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
80
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
81
- // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
82
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
83
- // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
84
- // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
85
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
86
- // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
87
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
88
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
89
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
90
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
91
- // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
92
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
93
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
94
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
95
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
96
-
97
- /* Completeness */
98
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
99
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
100
- }
101
- }
@@ -1,16 +0,0 @@
1
- interface Env {
2
- // Example binding to KV. Learn more at https://developers.cloudflare.com/workers/runtime-apis/kv/
3
- // MY_KV_NAMESPACE: KVNamespace;
4
- //
5
- // Example binding to Durable Object. Learn more at https://developers.cloudflare.com/workers/runtime-apis/durable-objects/
6
- // MY_DURABLE_OBJECT: DurableObjectNamespace;
7
- //
8
- // Example binding to R2. Learn more at https://developers.cloudflare.com/workers/runtime-apis/r2/
9
- // MY_BUCKET: R2Bucket;
10
- //
11
- // Example binding to a Service. Learn more at https://developers.cloudflare.com/workers/runtime-apis/service-bindings/
12
- // MY_SERVICE: Fetcher;
13
- //
14
- // Example binding to a Queue. Learn more at https://developers.cloudflare.com/queues/javascript-apis/
15
- // MY_QUEUE: Queue;
16
- }