wrangler 0.0.0-e9f8a2fa → 0.0.0-ea3e16a89

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "0.0.0-e9f8a2fa",
3
+ "version": "0.0.0-ea3e16a89",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -47,158 +47,120 @@
47
47
  "wrangler-dist",
48
48
  "templates",
49
49
  "kv-asset-handler.js",
50
- "Cloudflare_CA.pem",
51
50
  "config-schema.json"
52
51
  ],
53
- "jest": {
54
- "moduleNameMapper": {
55
- "clipboardy": "<rootDir>/src/__tests__/helpers/clipboardy-mock.js",
56
- "miniflare/cli": "<rootDir>/../../node_modules/miniflare/dist/src/cli.js"
57
- },
58
- "restoreMocks": true,
59
- "setupFilesAfterEnv": [
60
- "<rootDir>/src/__tests__/jest.setup.ts"
61
- ],
62
- "testRegex": "src/__tests__/.*\\.(test|spec)\\.[jt]sx?$",
63
- "testTimeout": 50000,
64
- "transform": {
65
- "^.+\\.c?(t|j)sx?$": [
66
- "esbuild-jest",
67
- {
68
- "sourcemap": true
69
- }
70
- ]
71
- },
72
- "transformIgnorePatterns": [
73
- "node_modules/.pnpm/(?!find-up|locate-path|p-locate|p-limit|p-timeout|p-queue|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream|get-port|supports-color|pretty-bytes|strip-ansi|ansi-regex)"
74
- ],
75
- "snapshotFormat": {
76
- "escapeString": true,
77
- "printBasicPrototype": true
78
- },
79
- "prettierPath": null
80
- },
81
52
  "dependencies": {
82
- "@esbuild-plugins/node-globals-polyfill": "^0.2.3",
83
- "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
84
- "blake3-wasm": "^2.1.5",
85
- "chokidar": "^3.5.3",
53
+ "@esbuild-plugins/node-globals-polyfill": "0.2.3",
54
+ "@esbuild-plugins/node-modules-polyfill": "0.2.2",
55
+ "blake3-wasm": "2.1.5",
86
56
  "esbuild": "0.17.19",
87
- "nanoid": "^3.3.3",
88
- "path-to-regexp": "^6.2.0",
89
- "resolve": "^1.22.8",
90
- "resolve.exports": "^2.0.2",
91
- "selfsigned": "^2.0.1",
92
- "source-map": "0.6.1",
93
- "xxhash-wasm": "^1.0.1",
94
- "@cloudflare/kv-asset-handler": "0.3.2",
95
- "miniflare": "3.20240512.0"
57
+ "path-to-regexp": "6.3.0",
58
+ "sharp": "^0.33.5",
59
+ "unenv": "2.0.0-rc.1",
60
+ "workerd": "1.20250124.0",
61
+ "@cloudflare/kv-asset-handler": "0.3.4",
62
+ "miniflare": "0.0.0-ea3e16a89"
96
63
  },
97
64
  "devDependencies": {
98
- "@cloudflare/types": "^6.18.4",
99
- "@cloudflare/workers-types": "^4.20240512.0",
65
+ "@aws-sdk/client-s3": "^3.721.0",
66
+ "@cloudflare/types": "6.18.4",
67
+ "@cloudflare/workers-types": "^4.20250121.0",
100
68
  "@cspotcode/source-map-support": "0.8.1",
101
69
  "@iarna/toml": "^3.0.0",
102
- "@microsoft/api-extractor": "^7.28.3",
70
+ "@microsoft/api-extractor": "^7.47.0",
103
71
  "@sentry/node": "^7.86.0",
104
72
  "@sentry/types": "^7.86.0",
105
73
  "@sentry/utils": "^7.86.0",
106
- "@types/body-parser": "^1.19.2",
107
74
  "@types/command-exists": "^1.2.0",
108
- "@types/express": "^4.17.13",
109
- "@types/glob-to-regexp": "0.4.1",
75
+ "@types/glob-to-regexp": "^0.4.1",
110
76
  "@types/is-ci": "^3.0.0",
111
77
  "@types/javascript-time-ago": "^2.0.3",
112
- "@types/jest": "^29.5.5",
113
- "@types/mime": "^2.0.3",
78
+ "@types/mime": "^3.0.4",
114
79
  "@types/minimatch": "^5.1.2",
80
+ "@types/node": "^18.19.71",
81
+ "@types/node-forge": "^1.3.11",
115
82
  "@types/prompts": "^2.0.14",
116
- "@types/react": "^17.0.37",
117
83
  "@types/resolve": "^1.20.6",
118
- "@types/serve-static": "^1.13.10",
119
84
  "@types/shell-quote": "^1.7.2",
120
85
  "@types/signal-exit": "^3.0.1",
121
86
  "@types/supports-color": "^8.1.1",
122
- "@types/ws": "^8.5.3",
123
- "@types/yargs": "^17.0.10",
124
- "@vitest/ui": "^1.6.0",
87
+ "@types/ws": "^8.5.7",
88
+ "@types/yargs": "^17.0.22",
89
+ "@vitest/ui": "~2.1.8",
125
90
  "@webcontainer/env": "^1.1.0",
126
- "body-parser": "^1.20.0",
127
- "chalk": "^2.4.2",
91
+ "chalk": "^5.2.0",
92
+ "chokidar": "^4.0.1",
128
93
  "cli-table3": "^0.6.3",
129
- "clipboardy": "^3.0.0",
130
94
  "cmd-shim": "^4.1.0",
131
95
  "command-exists": "^1.2.9",
132
- "concurrently": "^7.2.2",
133
- "devtools-protocol": "^0.0.955664",
134
- "dotenv": "^16.0.0",
135
- "es-module-lexer": "^1.3.0",
136
- "esbuild-jest": "0.5.0",
96
+ "concurrently": "^8.2.2",
97
+ "date-fns": "^4.1.0",
98
+ "devtools-protocol": "^0.0.1182435",
99
+ "dotenv": "^16.3.1",
137
100
  "execa": "^6.1.0",
138
- "express": "^4.18.1",
139
101
  "find-up": "^6.3.0",
140
- "get-port": "^6.1.2",
141
- "glob-to-regexp": "0.4.1",
142
- "http-terminator": "^3.2.0",
102
+ "get-port": "^7.0.0",
103
+ "glob-to-regexp": "^0.4.1",
143
104
  "https-proxy-agent": "7.0.2",
144
105
  "ignore": "^5.2.0",
145
- "ink": "^3.2.0",
146
- "ink-select-input": "^4.2.1",
147
- "ink-spinner": "^4.0.3",
148
- "ink-table": "^3.0.0",
149
106
  "is-ci": "^3.0.1",
107
+ "itty-time": "^1.0.6",
150
108
  "javascript-time-ago": "^2.5.4",
151
- "jest": "^29.7.0",
152
- "jest-fetch-mock": "^3.0.3",
153
- "jest-websocket-mock": "^2.5.0",
154
109
  "md5-file": "5.0.0",
155
110
  "mime": "^3.0.0",
156
111
  "minimatch": "^5.1.0",
157
- "msw": "^0.49.1",
112
+ "mock-socket": "^9.3.1",
113
+ "msw": "2.4.3",
114
+ "node-forge": "^1.3.1",
158
115
  "open": "^8.4.0",
159
116
  "p-queue": "^7.2.0",
160
117
  "patch-console": "^1.0.0",
161
118
  "pretty-bytes": "^6.0.0",
162
119
  "prompts": "^2.4.2",
163
- "ps-list": "^8.1.1",
164
- "react": "^17.0.2",
165
- "react-error-boundary": "^3.1.4",
120
+ "resolve": "^1.22.8",
121
+ "rimraf": "^5.0.10",
122
+ "selfsigned": "^2.0.1",
166
123
  "semiver": "^1.1.0",
167
- "serve-static": "^1.15.0",
168
124
  "shell-quote": "^1.8.1",
169
- "shellac": "^0.8.0",
170
125
  "signal-exit": "^3.0.7",
171
- "strip-ansi": "^7.0.1",
126
+ "source-map": "^0.6.1",
127
+ "strip-ansi": "^7.1.0",
172
128
  "supports-color": "^9.2.2",
173
129
  "timeago.js": "^4.0.2",
174
130
  "ts-dedent": "^2.2.0",
175
131
  "ts-json-schema-generator": "^1.5.0",
176
- "undici": "5.28.4",
132
+ "typescript": "^5.7.2",
133
+ "undici": "^5.28.4",
177
134
  "update-check": "^1.5.4",
178
- "vitest": "^1.6.0",
179
- "ws": "^8.5.0",
135
+ "vitest": "~2.1.8",
136
+ "vitest-websocket-mock": "^0.4.0",
137
+ "ws": "^8.18.0",
180
138
  "xdg-app-paths": "^8.3.0",
139
+ "xxhash-wasm": "^1.0.1",
181
140
  "yargs": "^17.7.2",
182
- "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
183
- "@cloudflare/cli": "1.1.1",
184
141
  "@cloudflare/eslint-config-worker": "1.1.0",
185
- "@cloudflare/workers-tsconfig": "0.0.0",
186
- "@cloudflare/pages-shared": "^0.11.36"
187
- },
188
- "optionalDependencies": {
189
- "fsevents": "~2.3.2"
142
+ "@cloudflare/cli": "1.1.1",
143
+ "@cloudflare/workers-shared": "0.0.0-ea3e16a89",
144
+ "@cloudflare/pages-shared": "^0.13.4",
145
+ "@cloudflare/workers-tsconfig": "0.0.0"
190
146
  },
191
147
  "peerDependencies": {
192
- "@cloudflare/workers-types": "^4.20240512.0"
148
+ "@cloudflare/workers-types": "^4.20250121.0"
193
149
  },
194
150
  "peerDependenciesMeta": {
195
151
  "@cloudflare/workers-types": {
196
152
  "optional": true
197
153
  }
198
154
  },
155
+ "optionalDependencies": {
156
+ "fsevents": "~2.3.2"
157
+ },
199
158
  "engines": {
200
159
  "node": ">=16.17.0"
201
160
  },
161
+ "volta": {
162
+ "extends": "../../package.json"
163
+ },
202
164
  "workers-sdk": {
203
165
  "prerelease": true
204
166
  },
@@ -206,17 +168,17 @@
206
168
  "assert-git-version": "node -r esbuild-register scripts/assert-git-version.ts",
207
169
  "build": "pnpm run clean && pnpm run bundle && pnpm run emit-types && pnpm run generate-json-schema",
208
170
  "bundle": "node -r esbuild-register scripts/bundle.ts",
209
- "check:lint": "eslint .",
171
+ "check:lint": "eslint . --max-warnings=0",
210
172
  "check:type": "tsc",
211
173
  "clean": "rimraf wrangler-dist miniflare-dist emitted-types",
212
174
  "dev": "pnpm run clean && concurrently -c black,blue --kill-others-on-fail false \"pnpm run bundle --watch\" \"pnpm run check:type --watch --preserveWatchOutput\"",
213
175
  "emit-types": "tsc -p tsconfig.emit.json && node -r esbuild-register scripts/emit-types.ts",
214
176
  "generate-json-schema": "pnpm exec ts-json-schema-generator --no-type-check --path src/config/config.ts --type RawConfig --out config-schema.json",
215
177
  "start": "pnpm run bundle && cross-env NODE_OPTIONS=--enable-source-maps ./bin/wrangler.js",
216
- "test": "pnpm run assert-git-version && jest",
217
- "test:ci": "pnpm run test",
178
+ "test": "dotenv -- pnpm run assert-git-version && dotenv -- vitest",
179
+ "test:ci": "pnpm run test run",
218
180
  "test:debug": "pnpm run test --silent=false --verbose=true",
219
- "test:e2e": "vitest -c ./e2e/vitest.config.ts",
181
+ "test:e2e": "dotenv -- vitest -c ./e2e/vitest.config.mts",
220
182
  "test:watch": "pnpm run test --testTimeout=50000 --watch",
221
183
  "type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json"
222
184
  }
@@ -3,10 +3,10 @@ declare module "__ENTRY_POINT__" {
3
3
  import { WorkerEntrypoint } from "cloudflare:workers";
4
4
 
5
5
  export type WorkerEntrypointConstructor = typeof WorkerEntrypoint;
6
- export type WithMiddleware<T> = T & { middleware?: Middleware[] };
7
6
 
8
- const worker: WithMiddleware<ExportedHandler | WorkerEntrypointConstructor>;
7
+ const worker: ExportedHandler | WorkerEntrypointConstructor;
9
8
  export default worker;
9
+ export const __INTERNAL_WRANGLER_MIDDLEWARE__: Middleware[];
10
10
  }
11
11
 
12
12
  declare module "__KV_ASSET_HANDLER__" {
@@ -165,3 +165,6 @@ dist
165
165
  .yarn/build-state.yml
166
166
  .yarn/install-state.gz
167
167
  .pnp.\*
168
+
169
+ .wrangler
170
+ .DS_Store
@@ -1,9 +1,9 @@
1
1
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
2
2
  import { unstable_dev } from "wrangler";
3
- import type { UnstableDevWorker } from "wrangler";
3
+ import type { Unstable_DevWorker } from "wrangler";
4
4
 
5
5
  describe("Worker", () => {
6
- let worker: UnstableDevWorker;
6
+ let worker: Unstable_DevWorker;
7
7
 
8
8
  beforeAll(async () => {
9
9
  worker = await unstable_dev("src/index.ts", {
@@ -3,12 +3,9 @@
3
3
  // export dynamically through wrangler, or we can potentially let users directly
4
4
  // add them as a sort of "plugin" system.
5
5
 
6
- import ENTRY from "__ENTRY_POINT__";
6
+ import ENTRY, { __INTERNAL_WRANGLER_MIDDLEWARE__ } from "__ENTRY_POINT__";
7
7
  import { __facade_invoke__, __facade_register__, Dispatcher } from "./common";
8
- import type {
9
- WithMiddleware,
10
- WorkerEntrypointConstructor,
11
- } from "__ENTRY_POINT__";
8
+ import type { WorkerEntrypointConstructor } from "__ENTRY_POINT__";
12
9
 
13
10
  // Preserve all the exports from the worker
14
11
  export * from "__ENTRY_POINT__";
@@ -33,15 +30,16 @@ class __Facade_ScheduledController__ implements ScheduledController {
33
30
  }
34
31
  }
35
32
 
36
- function wrapExportedHandler(
37
- worker: WithMiddleware<ExportedHandler>
38
- ): ExportedHandler {
33
+ function wrapExportedHandler(worker: ExportedHandler): ExportedHandler {
39
34
  // If we don't have any middleware defined, just return the handler as is
40
- if (worker.middleware === undefined || worker.middleware.length === 0) {
35
+ if (
36
+ __INTERNAL_WRANGLER_MIDDLEWARE__ === undefined ||
37
+ __INTERNAL_WRANGLER_MIDDLEWARE__.length === 0
38
+ ) {
41
39
  return worker;
42
40
  }
43
41
  // Otherwise, register all middleware once
44
- for (const middleware of worker.middleware) {
42
+ for (const middleware of __INTERNAL_WRANGLER_MIDDLEWARE__) {
45
43
  __facade_register__(middleware);
46
44
  }
47
45
 
@@ -75,14 +73,17 @@ function wrapExportedHandler(
75
73
  }
76
74
 
77
75
  function wrapWorkerEntrypoint(
78
- klass: WithMiddleware<WorkerEntrypointConstructor>
76
+ klass: WorkerEntrypointConstructor
79
77
  ): WorkerEntrypointConstructor {
80
78
  // If we don't have any middleware defined, just return the handler as is
81
- if (klass.middleware === undefined || klass.middleware.length === 0) {
79
+ if (
80
+ __INTERNAL_WRANGLER_MIDDLEWARE__ === undefined ||
81
+ __INTERNAL_WRANGLER_MIDDLEWARE__.length === 0
82
+ ) {
82
83
  return klass;
83
84
  }
84
85
  // Otherwise, register all middleware once
85
- for (const middleware of klass.middleware) {
86
+ for (const middleware of __INTERNAL_WRANGLER_MIDDLEWARE__) {
86
87
  __facade_register__(middleware);
87
88
  }
88
89
 
@@ -0,0 +1,3 @@
1
+ declare module "config:middleware/mock-analytics-engine" {
2
+ export const bindings: string[];
3
+ }
@@ -0,0 +1,30 @@
1
+ /// <reference path="middleware-mock-analytics-engine.d.ts"/>
2
+
3
+ import { bindings } from "config:middleware/mock-analytics-engine";
4
+ import type { Middleware } from "./common";
5
+
6
+ const bindingsEnv = Object.fromEntries(
7
+ bindings.map((binding) => [
8
+ binding,
9
+ {
10
+ writeDataPoint() {
11
+ // no op in dev
12
+ },
13
+ },
14
+ ])
15
+ ) satisfies Record<string, AnalyticsEngineDataset>;
16
+
17
+ const analyticsEngine: Middleware = async (
18
+ request,
19
+ env,
20
+ _ctx,
21
+ middlewareCtx
22
+ ) => {
23
+ // we're going to directly modify env so it maintains referential equality
24
+ for (const binding of bindings) {
25
+ env[binding] ??= bindingsEnv[binding];
26
+ }
27
+ return await middlewareCtx.next(request, env);
28
+ };
29
+
30
+ export default analyticsEngine;
@@ -0,0 +1,3 @@
1
+ declare module "config:middleware/patch-console-prefix" {
2
+ export const prefix: string;
3
+ }
@@ -0,0 +1,21 @@
1
+ /// <reference path="middleware-patch-console-prefix.d.ts"/>
2
+
3
+ import { prefix } from "config:middleware/patch-console-prefix";
4
+ import type { Middleware } from "./common";
5
+
6
+ // @ts-expect-error globalThis.console _does_ exist
7
+ globalThis.console = new Proxy(globalThis.console, {
8
+ get(target, p, receiver) {
9
+ if (p === "log" || p === "debug" || p === "info") {
10
+ return (...args: unknown[]) =>
11
+ Reflect.get(target, p, receiver)(prefix, ...args);
12
+ }
13
+ return Reflect.get(target, p, receiver);
14
+ },
15
+ });
16
+
17
+ const passthrough: Middleware = (request, env, _ctx, middlewareCtx) => {
18
+ return middlewareCtx.next(request, env);
19
+ };
20
+
21
+ export default passthrough;
@@ -9,7 +9,21 @@ const scheduled: Middleware = async (request, env, _ctx, middlewareCtx) => {
9
9
 
10
10
  return new Response("Ran scheduled event");
11
11
  }
12
- return middlewareCtx.next(request, env);
12
+
13
+ const resp = await middlewareCtx.next(request, env);
14
+
15
+ // If you open the `/__scheduled` page in a browser, the browser will automatically make a request to `/favicon.ico`.
16
+ // For scheduled Workers _without_ a fetch handler, this will result in a 500 response that clutters the log with unhelpful error messages.
17
+ // To avoid this, inject a 404 response to favicon.ico loads on the `/__scheduled` page
18
+ if (
19
+ request.headers.get("referer")?.endsWith("/__scheduled") &&
20
+ url.pathname === "/favicon.ico" &&
21
+ resp.status === 500
22
+ ) {
23
+ return new Response(null, { status: 404 });
24
+ }
25
+
26
+ return resp;
13
27
  };
14
28
 
15
29
  export default scheduled;
@@ -14,7 +14,7 @@ import type * as kvAssetHandler from "@cloudflare/kv-asset-handler";
14
14
 
15
15
  const ASSET_MANIFEST = JSON.parse(manifest);
16
16
 
17
- const staticAssets: Middleware = async (request, env, _ctx, middlewareCtx) => {
17
+ const staticAssets: Middleware = async (request, env, ctx, middlewareCtx) => {
18
18
  let options: Partial<Options> = {
19
19
  ASSET_MANIFEST,
20
20
  ASSET_NAMESPACE: env.__STATIC_CONTENT,
@@ -27,7 +27,7 @@ const staticAssets: Middleware = async (request, env, _ctx, middlewareCtx) => {
27
27
  {
28
28
  request,
29
29
  waitUntil(promise) {
30
- return _ctx.waitUntil(promise);
30
+ return ctx.waitUntil(promise);
31
31
  },
32
32
  },
33
33
  options
@@ -124,8 +124,10 @@ export class ProxyWorker implements DurableObject {
124
124
  Object.assign(userWorkerUrl, proxyData.userWorkerUrl);
125
125
 
126
126
  // set request.url in the UserWorker
127
- const innerUrl = new URL(request.url);
128
- Object.assign(innerUrl, proxyData.userWorkerInnerUrlOverrides);
127
+ const innerUrl = urlFromParts(
128
+ proxyData.userWorkerInnerUrlOverrides ?? {},
129
+ request.url
130
+ );
129
131
  headers.set("MF-Original-URL", innerUrl.href);
130
132
  headers.set("MF-Disable-Pretty-Error", "true"); // disables the UserWorker miniflare instance from rendering the pretty error -- instead the ProxyWorker miniflare instance will intercept the json error response and render the pretty error page
131
133
 
@@ -276,28 +278,7 @@ function insertLiveReloadScript(
276
278
  websocketUrl.protocol =
277
279
  websocketUrl.protocol === "http:" ? "ws:" : "wss:";
278
280
 
279
- end.append(
280
- `
281
- <script>
282
- (function() {
283
- var ws;
284
- function recover() {
285
- ws = null;
286
- setTimeout(initLiveReload, 100);
287
- }
288
- function initLiveReload() {
289
- if (ws) return;
290
- var origin = (location.protocol === "http:" ? "ws://" : "wss://") + location.host;
291
- ws = new WebSocket(origin + "/cdn-cgi/live-reload", "${LIVE_RELOAD_PROTOCOL}");
292
- ws.onclose = recover;
293
- ws.onerror = recover;
294
- ws.onmessage = location.reload.bind(location);
295
- }
296
- })();
297
- </script>
298
- `,
299
- { html: true }
300
- );
281
+ end.append(liveReloadScript, { html: true });
301
282
  }
302
283
  },
303
284
  });
@@ -305,6 +286,27 @@ function insertLiveReloadScript(
305
286
  return htmlRewriter.transform(response);
306
287
  }
307
288
 
289
+ const liveReloadScript = `
290
+ <script defer type="application/javascript">
291
+ (function() {
292
+ var ws;
293
+ function recover() {
294
+ ws = null;
295
+ setTimeout(initLiveReload, 100);
296
+ }
297
+ function initLiveReload() {
298
+ if (ws) return;
299
+ var origin = (location.protocol === "http:" ? "ws://" : "wss://") + location.host;
300
+ ws = new WebSocket(origin + "/cdn-cgi/live-reload", "${LIVE_RELOAD_PROTOCOL}");
301
+ ws.onclose = recover;
302
+ ws.onerror = recover;
303
+ ws.onmessage = location.reload.bind(location);
304
+ }
305
+ initLiveReload();
306
+ })();
307
+ </script>
308
+ `;
309
+
308
310
  /**
309
311
  * Rewrite references to URLs in request/response headers.
310
312
  *
@@ -1,105 +1,22 @@
1
1
  {
2
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
3
  "target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
4
  "lib": [
16
5
  "es2021"
17
6
  ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
18
- "jsx": "react" /* Specify what JSX code is generated. */,
19
- // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
20
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
21
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
22
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
23
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
24
- // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
25
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
26
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
27
-
28
- /* Modules */
29
- "module": "es2022" /* Specify what module code is generated. */,
30
- // "rootDir": "./", /* Specify the root folder within your source files. */
31
- "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
32
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
35
- // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
7
+ "jsx": "react-jsx" /* Specify what JSX code is generated. */,
8
+ "module": "ESNext" /* Specify what module code is generated. */,
9
+ "moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
36
10
  "types": [
37
11
  "@cloudflare/workers-types"
38
12
  ] /* Specify type package names to be included without being referenced in a source file. */,
39
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
40
13
  "resolveJsonModule": true /* Enable importing .json files */,
41
- // "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
42
-
43
- /* JavaScript Support */
44
14
  "allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */,
45
- "checkJs": false /* Enable error reporting in type-checked JavaScript files. */,
46
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
47
-
48
- /* Emit */
49
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
50
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
51
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
52
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
53
- // "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. */
54
- // "outDir": "./", /* Specify an output folder for all emitted files. */
55
- // "removeComments": true, /* Disable emitting comments. */
56
15
  "noEmit": true /* Disable emitting files from a compilation. */,
57
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
58
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
59
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
60
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
61
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
62
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
63
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
64
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
65
- // "newLine": "crlf", /* Set the newline character for emitting files. */
66
- // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
67
- // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
68
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
69
- // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
70
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
71
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
72
-
73
- /* Interop Constraints */
74
16
  "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
75
17
  "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
76
- // "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
77
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
78
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
79
-
80
- /* Type Checking */
81
18
  "strict": true /* Enable all strict type-checking options. */,
82
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
83
- // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
84
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
85
- // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
86
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
87
- // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
88
- // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
89
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
90
- // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
91
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
92
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
93
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
94
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
95
- // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
96
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
97
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
98
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
99
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
100
-
101
- /* Completeness */
102
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
19
+ "noUncheckedIndexedAccess": true,
103
20
  "skipLibCheck": true /* Skip type checking all .d.ts files. */
104
21
  }
105
22
  }