wrangler 0.0.0-e178d6fb → 0.0.0-e1c2f5b9
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 +16 -2
- package/bin/wrangler.js +31 -11
- package/miniflare-dist/index.mjs +1340 -330
- package/package.json +40 -13
- package/src/__tests__/access.test.ts +25 -0
- package/src/__tests__/api-dev.test.ts +238 -0
- package/src/__tests__/api-devregistry.test.js +64 -0
- package/src/__tests__/api.test.ts +80 -0
- package/src/__tests__/configuration.test.ts +683 -470
- package/src/__tests__/d1.test.ts +123 -0
- package/src/__tests__/delete.test.ts +263 -0
- package/src/__tests__/deployments.test.ts +105 -0
- package/src/__tests__/dev.test.tsx +453 -70
- package/src/__tests__/dialogs.test.tsx +40 -0
- package/src/__tests__/generate.test.ts +235 -0
- package/src/__tests__/get-host-from-url.test.ts +16 -0
- package/src/__tests__/helpers/mock-auth-domain.ts +20 -0
- package/src/__tests__/helpers/mock-cfetch.ts +92 -26
- package/src/__tests__/helpers/mock-console.ts +11 -2
- package/src/__tests__/helpers/mock-dialogs.ts +1 -1
- package/src/__tests__/helpers/mock-get-zone-from-host.ts +8 -0
- package/src/__tests__/helpers/mock-known-routes.ts +7 -0
- package/src/__tests__/helpers/mock-kv.ts +1 -1
- package/src/__tests__/helpers/mock-oauth-flow.ts +74 -53
- package/src/__tests__/helpers/mock-process.ts +8 -13
- package/src/__tests__/helpers/msw/handlers/access.ts +13 -0
- package/src/__tests__/helpers/msw/handlers/deployments.ts +59 -0
- package/src/__tests__/helpers/msw/handlers/namespaces.ts +104 -0
- package/src/__tests__/helpers/msw/handlers/oauth.ts +31 -0
- package/src/__tests__/helpers/msw/handlers/r2.ts +80 -0
- package/src/__tests__/helpers/msw/handlers/script.ts +75 -0
- package/src/__tests__/helpers/msw/handlers/user.ts +63 -0
- package/src/__tests__/helpers/msw/handlers/zones.ts +22 -0
- package/src/__tests__/helpers/msw/index.ts +21 -0
- package/src/__tests__/helpers/worker-scripts/child-wrangler.toml +1 -0
- package/src/__tests__/helpers/worker-scripts/hello-world-worker.js +5 -0
- package/src/__tests__/helpers/worker-scripts/hello-world-wrangler.toml +1 -0
- package/src/__tests__/helpers/worker-scripts/parent-worker.js +8 -0
- package/src/__tests__/helpers/worker-scripts/parent-wrangler.toml +5 -0
- package/src/__tests__/index.test.ts +103 -97
- package/src/__tests__/init.test.ts +1484 -382
- package/src/__tests__/jest.setup.ts +88 -5
- package/src/__tests__/kv.test.ts +655 -540
- package/src/__tests__/logout.test.ts +47 -0
- package/src/__tests__/metrics.test.ts +95 -45
- package/src/__tests__/middleware.scheduled.test.ts +145 -0
- package/src/__tests__/middleware.test.ts +750 -0
- package/src/__tests__/pages-deployment-tail.test.ts +884 -0
- package/src/__tests__/pages.test.ts +1301 -119
- package/src/__tests__/paths.test.ts +39 -0
- package/src/__tests__/publish.test.ts +2266 -1180
- package/src/__tests__/pubsub.test.ts +211 -88
- package/src/__tests__/queues.test.ts +522 -0
- package/src/__tests__/r2.test.ts +363 -203
- package/src/__tests__/secret.test.ts +261 -59
- package/src/__tests__/tail.test.ts +352 -151
- package/src/__tests__/test-old-node-version.js +3 -3
- package/src/__tests__/tsconfig-sanity.ts +12 -0
- package/src/__tests__/tsconfig.json +8 -0
- package/src/__tests__/tsconfig.tsbuildinfo +1 -0
- package/src/__tests__/type-generation.test.ts +233 -0
- package/src/__tests__/user.test.ts +59 -73
- package/src/__tests__/utils-collectKeyValues.test.ts +47 -0
- package/src/__tests__/validate-dev-props.test.ts +56 -0
- package/src/__tests__/whoami.test.tsx +114 -66
- package/src/__tests__/worker-namespace.test.ts +154 -155
- package/src/api/dev.ts +170 -38
- package/src/api/index.ts +1 -0
- package/src/bundle-reporter.tsx +41 -2
- package/src/bundle.ts +668 -81
- package/src/cfetch/index.ts +40 -3
- package/src/cfetch/internal.ts +144 -32
- package/src/cli.ts +4 -3
- package/src/config/config.ts +27 -3
- package/src/config/environment.ts +131 -7
- package/src/config/index.ts +128 -8
- package/src/config/validation-helpers.ts +19 -6
- package/src/config/validation.ts +411 -14
- package/src/config-cache.ts +3 -2
- package/src/create-worker-preview.ts +31 -6
- package/src/create-worker-upload-form.ts +84 -22
- package/src/d1/backups.tsx +223 -0
- package/src/d1/constants.ts +2 -0
- package/src/d1/create.tsx +63 -0
- package/src/d1/delete.tsx +56 -0
- package/src/d1/execute.tsx +352 -0
- package/src/d1/formatTimeAgo.ts +14 -0
- package/src/d1/index.ts +101 -0
- package/src/d1/list.tsx +48 -0
- package/src/d1/migrations/apply.tsx +196 -0
- package/src/d1/migrations/create.tsx +77 -0
- package/src/d1/migrations/helpers.ts +147 -0
- package/src/d1/migrations/index.tsx +3 -0
- package/src/d1/migrations/list.tsx +79 -0
- package/src/d1/migrations/options.ts +18 -0
- package/src/d1/options.ts +22 -0
- package/src/d1/types.tsx +24 -0
- package/src/d1/utils.ts +48 -0
- package/src/delete.ts +108 -0
- package/src/deployments.ts +83 -0
- package/src/deprecated/index.ts +145 -0
- package/src/dev/dev-vars.ts +11 -8
- package/src/dev/dev.tsx +220 -58
- package/src/dev/get-local-persistence-path.tsx +31 -0
- package/src/dev/local.tsx +740 -181
- package/src/dev/remote.tsx +340 -123
- package/src/dev/start-server.ts +543 -0
- package/src/dev/use-esbuild.ts +61 -7
- package/src/dev/validate-dev-props.ts +31 -0
- package/src/dev-registry.tsx +201 -0
- package/src/dev.tsx +614 -258
- package/src/dialogs.tsx +41 -8
- package/src/{worker-namespace.ts → dispatch-namespace.ts} +23 -22
- package/src/docs/index.ts +97 -0
- package/src/entry.ts +3 -2
- package/src/environment-variables/factory.ts +88 -0
- package/src/environment-variables/misc-variables.ts +30 -0
- package/src/generate/index.ts +300 -0
- package/src/git-client.ts +100 -7
- package/src/index.tsx +249 -1560
- package/src/init.ts +626 -150
- package/src/inspect.ts +137 -32
- package/src/{metrics/is-ci.ts → is-ci.ts} +0 -0
- package/src/is-interactive.ts +4 -0
- package/src/jest.d.ts +4 -0
- package/src/{kv.ts → kv/helpers.ts} +3 -3
- package/src/kv/index.ts +596 -0
- package/src/logger.ts +27 -8
- package/src/metrics/index.ts +1 -0
- package/src/metrics/metrics-config.ts +4 -4
- package/src/metrics/metrics-dispatcher.ts +1 -0
- package/src/metrics/metrics-usage-headers.ts +24 -0
- package/src/metrics/send-event.ts +13 -8
- package/src/miniflare-cli/assets.ts +172 -465
- package/src/miniflare-cli/index.ts +149 -24
- package/src/miniflare-cli/tsconfig.json +9 -0
- package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -0
- package/src/miniflare-cli/types.ts +11 -0
- package/src/module-collection.ts +12 -3
- package/src/pages/build.tsx +108 -42
- package/src/pages/constants.ts +11 -0
- package/src/pages/deployment-tails.tsx +284 -0
- package/src/pages/deployments.tsx +9 -31
- package/src/pages/dev.tsx +417 -108
- package/src/pages/errors.ts +66 -0
- package/src/pages/functions/buildPlugin.ts +86 -84
- package/src/pages/functions/buildWorker.ts +121 -106
- package/src/pages/functions/routes-consolidation.test.ts +250 -0
- package/src/pages/functions/routes-consolidation.ts +73 -0
- package/src/pages/functions/routes-transformation.test.ts +282 -0
- package/src/pages/functions/routes-transformation.ts +115 -0
- package/src/pages/functions/routes-validation.test.ts +403 -0
- package/src/pages/functions/routes-validation.ts +202 -0
- package/src/pages/functions/tsconfig.json +8 -0
- package/src/pages/functions/tsconfig.tsbuildinfo +1 -0
- package/src/pages/functions.tsx +82 -0
- package/src/pages/hash.tsx +13 -0
- package/src/pages/index.tsx +73 -55
- package/src/pages/projects.tsx +9 -3
- package/src/pages/prompt-select-project.tsx +31 -0
- package/src/pages/publish.tsx +183 -60
- package/src/pages/types.ts +1 -0
- package/src/pages/upload.tsx +107 -56
- package/src/pages/utils.ts +13 -2
- package/src/paths.ts +49 -4
- package/src/proxy.ts +375 -157
- package/src/publish/index.ts +270 -0
- package/src/{publish.ts → publish/publish.ts} +431 -188
- package/src/pubsub/pubsub-commands.tsx +4 -3
- package/src/queues/cli/commands/consumer/add.ts +71 -0
- package/src/queues/cli/commands/consumer/index.ts +22 -0
- package/src/queues/cli/commands/consumer/remove.ts +38 -0
- package/src/queues/cli/commands/create.ts +25 -0
- package/src/queues/cli/commands/delete.ts +26 -0
- package/src/queues/cli/commands/index.ts +36 -0
- package/src/queues/cli/commands/list.ts +25 -0
- package/src/queues/client.ts +135 -0
- package/src/queues/utils.ts +18 -0
- package/src/r2/constants.ts +4 -0
- package/src/r2/helpers.ts +131 -0
- package/src/r2/index.ts +289 -0
- package/src/routes.ts +140 -0
- package/src/secret/index.ts +379 -0
- package/src/sites.tsx +3 -3
- package/src/tail/createTail.ts +379 -0
- package/src/tail/filters.ts +4 -6
- package/src/tail/index.ts +199 -284
- package/src/tail/printing.ts +43 -3
- package/src/tsconfig-sanity.ts +16 -0
- package/src/type-generation.ts +181 -0
- package/src/user/access.ts +68 -0
- package/src/user/auth-variables.ts +113 -0
- package/src/user/choose-account.tsx +1 -1
- package/src/user/index.ts +0 -1
- package/src/user/user.tsx +116 -49
- package/src/utils/collectKeyValues.ts +14 -0
- package/src/whoami.tsx +80 -2
- package/src/worker.ts +69 -9
- package/src/yargs-types.ts +24 -0
- package/src/zones.ts +124 -9
- package/templates/__tests__/pages-dev-util.test.ts +128 -0
- package/templates/__tests__/tsconfig-sanity.ts +12 -0
- package/templates/__tests__/tsconfig.json +8 -0
- package/templates/__tests__/tsconfig.tsbuildinfo +1 -0
- package/templates/d1-beta-facade.js +205 -0
- package/templates/facade.d.ts +14 -0
- package/templates/first-party-worker-module-facade.ts +19 -0
- package/templates/format-dev-errors.ts +33 -0
- package/templates/init-tests/test-jest-new-worker.js +23 -0
- package/templates/init-tests/test-vitest-new-worker.js +24 -0
- package/templates/init-tests/test-vitest-new-worker.ts +25 -0
- package/templates/middleware/common.ts +62 -0
- package/templates/middleware/loader-modules.ts +82 -0
- package/templates/middleware/loader-sw.ts +233 -0
- package/templates/middleware/middleware-miniflare3-json-error.ts +20 -0
- package/templates/middleware/middleware-pretty-error.ts +40 -0
- package/templates/middleware/middleware-scheduled.ts +15 -0
- package/templates/new-worker.js +1 -1
- package/templates/pages-dev-pipeline.ts +31 -0
- package/templates/pages-dev-util.ts +52 -0
- package/templates/pages-shim.ts +4 -1
- package/templates/pages-template-plugin.ts +21 -5
- package/templates/pages-template-worker.ts +37 -9
- package/templates/{static-asset-facade.js → serve-static-assets.ts} +23 -7
- package/templates/service-bindings-module-facade.js +54 -0
- package/templates/service-bindings-sw-facade.js +42 -0
- package/templates/tsconfig-sanity.ts +11 -0
- package/templates/tsconfig.init.json +106 -0
- package/templates/tsconfig.json +5 -102
- package/templates/tsconfig.tsbuildinfo +1 -0
- package/wrangler-dist/cli.d.ts +621 -42
- package/wrangler-dist/cli.js +144441 -102606
- package/src/environment-variables.ts +0 -35
- package/src/faye-websocket.d.ts +0 -6
- package/src/generate.ts +0 -33
- package/src/miniflare-cli/enum-keys.ts +0 -17
- package/src/preview.ts +0 -31
- package/src/r2.ts +0 -50
- package/src/user/env-vars.ts +0 -46
package/src/inspect.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFile } from "fs/promises";
|
|
1
2
|
import assert from "node:assert";
|
|
2
3
|
import { createServer } from "node:http";
|
|
3
4
|
import os from "node:os";
|
|
@@ -5,10 +6,12 @@ import { URL } from "node:url";
|
|
|
5
6
|
|
|
6
7
|
import open from "open";
|
|
7
8
|
import { useEffect, useRef, useState } from "react";
|
|
9
|
+
import { SourceMapConsumer } from "source-map";
|
|
8
10
|
import WebSocket, { WebSocketServer } from "ws";
|
|
9
11
|
import { version } from "../package.json";
|
|
10
12
|
import { logger } from "./logger";
|
|
11
13
|
import { waitForPortToBeAvailable } from "./proxy";
|
|
14
|
+
import { getAccessToken } from "./user/access";
|
|
12
15
|
import type Protocol from "devtools-protocol";
|
|
13
16
|
import type { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
14
17
|
import type { MessageEvent } from "ws";
|
|
@@ -52,6 +55,12 @@ interface InspectorProps {
|
|
|
52
55
|
* logged to the terminal by nature of them actually running in node locally.)
|
|
53
56
|
*/
|
|
54
57
|
logToTerminal: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Sourcemap path, so that stacktraces can be interpretted
|
|
60
|
+
*/
|
|
61
|
+
sourceMapPath?: string | undefined;
|
|
62
|
+
|
|
63
|
+
host?: string;
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
export default function useInspector(props: InspectorProps) {
|
|
@@ -198,14 +207,31 @@ export default function useInspector(props: InspectorProps) {
|
|
|
198
207
|
/** A simple incrementing id to attach to messages we send to devtools */
|
|
199
208
|
const messageCounterRef = useRef(1);
|
|
200
209
|
|
|
210
|
+
const cfAccessRef = useRef<string>();
|
|
211
|
+
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
const run = async () => {
|
|
214
|
+
if (props.host && !cfAccessRef.current) {
|
|
215
|
+
const token = await getAccessToken(props.host);
|
|
216
|
+
cfAccessRef.current = token;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
if (props.host) void run();
|
|
220
|
+
}, [props.host]);
|
|
221
|
+
|
|
201
222
|
// This effect tracks the connection to the remote websocket
|
|
202
223
|
// (stored in, no surprises here, `remoteWebSocket`)
|
|
203
224
|
useEffect(() => {
|
|
204
225
|
if (!props.inspectorUrl) {
|
|
205
226
|
return;
|
|
206
227
|
}
|
|
228
|
+
|
|
207
229
|
// The actual websocket instance
|
|
208
|
-
const ws = new WebSocket(props.inspectorUrl
|
|
230
|
+
const ws = new WebSocket(props.inspectorUrl, {
|
|
231
|
+
headers: {
|
|
232
|
+
cookie: `CF_Authorization=${cfAccessRef.current}`,
|
|
233
|
+
},
|
|
234
|
+
});
|
|
209
235
|
setRemoteWebSocket(ws);
|
|
210
236
|
|
|
211
237
|
/**
|
|
@@ -252,15 +278,93 @@ export default function useInspector(props: InspectorProps) {
|
|
|
252
278
|
* without having to open the devtools).
|
|
253
279
|
*/
|
|
254
280
|
if (props.logToTerminal) {
|
|
255
|
-
ws.addEventListener("message", (event: MessageEvent) => {
|
|
281
|
+
ws.addEventListener("message", async (event: MessageEvent) => {
|
|
256
282
|
if (typeof event.data === "string") {
|
|
257
283
|
const evt = JSON.parse(event.data);
|
|
258
284
|
if (evt.method === "Runtime.exceptionThrown") {
|
|
259
285
|
const params = evt.params as Protocol.Runtime.ExceptionThrownEvent;
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
286
|
+
|
|
287
|
+
// Parse stack trace with source map.
|
|
288
|
+
if (props.sourceMapPath) {
|
|
289
|
+
// Parse in the sourcemap
|
|
290
|
+
const mapContent = JSON.parse(
|
|
291
|
+
await readFile(props.sourceMapPath, "utf-8")
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
// Create the lines for the exception details log
|
|
295
|
+
const exceptionLines = [
|
|
296
|
+
params.exceptionDetails.exception?.description?.split("\n")[0],
|
|
297
|
+
];
|
|
298
|
+
|
|
299
|
+
await SourceMapConsumer.with(
|
|
300
|
+
mapContent,
|
|
301
|
+
null,
|
|
302
|
+
async (consumer) => {
|
|
303
|
+
// Pass each of the callframes into the consumer, and format the error
|
|
304
|
+
const stack = params.exceptionDetails.stackTrace?.callFrames;
|
|
305
|
+
|
|
306
|
+
stack?.forEach(
|
|
307
|
+
({ functionName, lineNumber, columnNumber }, i) => {
|
|
308
|
+
try {
|
|
309
|
+
if (lineNumber) {
|
|
310
|
+
// The line and column numbers in the stackTrace are zero indexed,
|
|
311
|
+
// whereas the sourcemap consumer indexes from one.
|
|
312
|
+
const pos = consumer.originalPositionFor({
|
|
313
|
+
line: lineNumber + 1,
|
|
314
|
+
column: columnNumber + 1,
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// Print out line which caused error:
|
|
318
|
+
if (i === 0 && pos.source && pos.line) {
|
|
319
|
+
const fileSource = consumer.sourceContentFor(
|
|
320
|
+
pos.source
|
|
321
|
+
);
|
|
322
|
+
const fileSourceLine =
|
|
323
|
+
fileSource?.split("\n")[pos.line - 1] || "";
|
|
324
|
+
exceptionLines.push(fileSourceLine.trim());
|
|
325
|
+
|
|
326
|
+
// If we have a column, we can mark the position underneath
|
|
327
|
+
if (pos.column) {
|
|
328
|
+
exceptionLines.push(
|
|
329
|
+
`${" ".repeat(
|
|
330
|
+
pos.column - fileSourceLine.search(/\S/)
|
|
331
|
+
)}^`
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// From the way esbuild implements the "names" field:
|
|
337
|
+
// > To save space, the original name is only recorded when it's different from the final name.
|
|
338
|
+
// however, source-map consumer does not handle this
|
|
339
|
+
if (pos && pos.line != null) {
|
|
340
|
+
const convertedFnName =
|
|
341
|
+
pos.name || functionName || "";
|
|
342
|
+
exceptionLines.push(
|
|
343
|
+
` at ${convertedFnName} (${pos.source}:${pos.line}:${pos.column})`
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
} catch {
|
|
348
|
+
// Line failed to parse through the sourcemap consumer
|
|
349
|
+
// We should handle this better
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
|
|
356
|
+
// Log the parsed stacktrace
|
|
357
|
+
logger.error(
|
|
358
|
+
params.exceptionDetails.text,
|
|
359
|
+
exceptionLines.join("\n")
|
|
360
|
+
);
|
|
361
|
+
} else {
|
|
362
|
+
// We log the stacktrace to the terminal
|
|
363
|
+
logger.error(
|
|
364
|
+
params.exceptionDetails.text,
|
|
365
|
+
params.exceptionDetails.exception?.description ?? ""
|
|
366
|
+
);
|
|
367
|
+
}
|
|
264
368
|
}
|
|
265
369
|
if (evt.method === "Runtime.consoleAPICalled") {
|
|
266
370
|
logConsoleMessage(
|
|
@@ -333,6 +437,7 @@ export default function useInspector(props: InspectorProps) {
|
|
|
333
437
|
}, [
|
|
334
438
|
props.inspectorUrl,
|
|
335
439
|
props.logToTerminal,
|
|
440
|
+
props.sourceMapPath,
|
|
336
441
|
wsServer,
|
|
337
442
|
// We use a state value as a sigil to trigger a retry of the
|
|
338
443
|
// remote websocket connection. It's not used inside the effect,
|
|
@@ -525,36 +630,36 @@ function logConsoleMessage(evt: Protocol.Runtime.ConsoleAPICalledEvent): void {
|
|
|
525
630
|
break;
|
|
526
631
|
case "weakmap":
|
|
527
632
|
case "map":
|
|
528
|
-
|
|
529
|
-
"{
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
633
|
+
ro.preview.entries === undefined
|
|
634
|
+
? args.push("{}")
|
|
635
|
+
: args.push(
|
|
636
|
+
"{\n" +
|
|
637
|
+
ro.preview.entries
|
|
638
|
+
.map(({ key, value }) => {
|
|
639
|
+
return ` ${key?.description ?? "<unknown>"} => ${
|
|
640
|
+
value.description
|
|
641
|
+
}`;
|
|
642
|
+
})
|
|
643
|
+
.join(",\n") +
|
|
644
|
+
(ro.preview.overflow ? "\n ..." : "") +
|
|
645
|
+
"\n}"
|
|
646
|
+
);
|
|
542
647
|
|
|
543
648
|
break;
|
|
544
649
|
case "weakset":
|
|
545
650
|
case "set":
|
|
546
|
-
|
|
547
|
-
"{
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
651
|
+
ro.preview.entries === undefined
|
|
652
|
+
? args.push("{}")
|
|
653
|
+
: args.push(
|
|
654
|
+
"{ " +
|
|
655
|
+
ro.preview.entries
|
|
656
|
+
.map(({ value }) => {
|
|
657
|
+
return `${value.description}`;
|
|
658
|
+
})
|
|
659
|
+
.join(", ") +
|
|
660
|
+
(ro.preview.overflow ? ", ..." : "") +
|
|
661
|
+
" }"
|
|
662
|
+
);
|
|
558
663
|
break;
|
|
559
664
|
case "regexp":
|
|
560
665
|
break;
|
|
File without changes
|
package/src/is-interactive.ts
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* or you're piping values from / to another process, etc
|
|
5
5
|
*/
|
|
6
6
|
export default function isInteractive(): boolean {
|
|
7
|
+
if (process.env.CF_PAGES === "1") {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
try {
|
|
8
12
|
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
9
13
|
} catch {
|
package/src/jest.d.ts
ADDED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { URLSearchParams } from "node:url";
|
|
2
2
|
import { FormData } from "undici";
|
|
3
|
-
import { fetchListResult, fetchResult, fetchKVGetValue } from "
|
|
4
|
-
import { logger } from "
|
|
5
|
-
import type { Config } from "
|
|
3
|
+
import { fetchListResult, fetchResult, fetchKVGetValue } from "../cfetch";
|
|
4
|
+
import { logger } from "../logger";
|
|
5
|
+
import type { Config } from "../config";
|
|
6
6
|
|
|
7
7
|
/** The largest number of kv items we can pass to the API in a single request. */
|
|
8
8
|
const API_MAX = 10000;
|