wrangler 0.0.0-e7cf0caa → 0.0.0-e87ad068
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/miniflare-dist/index.mjs +167 -93
- package/package.json +6 -6
- package/src/__tests__/configuration.test.ts +218 -0
- package/src/__tests__/constellation.test.ts +371 -0
- package/src/__tests__/d1/migrate.test.ts +100 -0
- package/src/__tests__/index.test.ts +4 -2
- package/src/__tests__/init.test.ts +109 -3
- package/src/__tests__/mtls-certificates.test.ts +2 -1
- package/src/__tests__/pages/functions-build.test.ts +77 -0
- package/src/__tests__/pages-deployment-tail.test.ts +2 -0
- package/src/__tests__/publish.test.ts +646 -187
- package/src/__tests__/tail.test.ts +49 -7
- package/src/__tests__/tsconfig.tsbuildinfo +1 -1
- package/src/__tests__/unstableDev.test.ts +61 -0
- package/src/__tests__/user.test.ts +1 -1
- package/src/api/dev.ts +12 -0
- package/src/api/pages/create-worker-bundle-contents.ts +4 -0
- package/src/api/pages/publish.tsx +28 -12
- package/src/bundle.ts +58 -14
- package/src/cfetch/internal.ts +19 -14
- package/src/config/environment.ts +41 -0
- package/src/config/index.ts +21 -0
- package/src/config/validation.ts +182 -0
- package/src/constellation/createProject.tsx +51 -0
- package/src/constellation/deleteProject.ts +51 -0
- package/src/constellation/deleteProjectModel.ts +76 -0
- package/src/constellation/index.ts +75 -0
- package/src/constellation/listCatalog.tsx +35 -0
- package/src/constellation/listModel.tsx +49 -0
- package/src/constellation/listProject.tsx +28 -0
- package/src/constellation/listRuntime.tsx +28 -0
- package/src/constellation/options.ts +17 -0
- package/src/constellation/types.ts +17 -0
- package/src/constellation/uploadModel.tsx +84 -0
- package/src/constellation/utils.ts +90 -0
- package/src/create-worker-upload-form.ts +25 -0
- package/src/d1/backups.tsx +4 -4
- package/src/d1/constants.ts +3 -0
- package/src/d1/create.tsx +77 -43
- package/src/d1/delete.ts +1 -1
- package/src/d1/execute.tsx +27 -13
- package/src/d1/list.tsx +13 -11
- package/src/d1/migrations/apply.tsx +29 -6
- package/src/d1/migrations/helpers.ts +8 -9
- package/src/d1/types.ts +7 -0
- package/src/dev/dev.tsx +9 -2
- package/src/dev/local.tsx +52 -20
- package/src/dev/remote.tsx +4 -0
- package/src/dev/start-server.ts +64 -40
- package/src/dev/use-esbuild.ts +70 -43
- package/src/dev-registry.ts +11 -0
- package/src/dev.tsx +23 -6
- package/src/docs/helpers.ts +50 -0
- package/src/docs/index.ts +25 -68
- package/src/entry.ts +8 -1
- package/src/environment-variables/factory.ts +2 -1
- package/src/generate/index.ts +5 -0
- package/src/index.ts +12 -1
- package/src/init.ts +52 -10
- package/src/inspect.ts +107 -6
- package/src/kv/helpers.ts +7 -4
- package/src/logger.ts +5 -1
- package/src/miniflare-cli/index.ts +2 -2
- package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -1
- package/src/module-collection.ts +1 -1
- package/src/pages/build.ts +30 -17
- package/src/pages/dev.ts +51 -8
- package/src/pages/functions/buildPlugin.ts +1 -0
- package/src/pages/functions/buildWorker.ts +92 -2
- package/src/pages/functions/tsconfig.tsbuildinfo +1 -1
- package/src/publish/publish.ts +9 -1
- package/src/secret/index.ts +4 -0
- package/src/sites.ts +164 -52
- package/src/tail/createTail.ts +9 -0
- package/src/tail/printing.ts +12 -0
- package/src/traverse-module-graph.ts +2 -1
- package/src/type-generation.ts +6 -0
- package/src/user/user.ts +1 -0
- package/src/utils/render.ts +1 -1
- package/src/worker.ts +26 -0
- package/templates/__tests__/tsconfig.tsbuildinfo +1 -1
- package/templates/pages-dev-util.ts +4 -1
- package/templates/tsconfig.tsbuildinfo +1 -1
- package/wrangler-dist/cli.d.ts +78 -2
- package/wrangler-dist/cli.js +65057 -63883
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
ScheduledEvent,
|
|
15
15
|
AlarmEvent,
|
|
16
16
|
EmailEvent,
|
|
17
|
+
TailInfo,
|
|
17
18
|
} from "../tail/createTail";
|
|
18
19
|
import type { RequestInit } from "undici";
|
|
19
20
|
import type WebSocket from "ws";
|
|
@@ -56,10 +57,10 @@ describe("tail", () => {
|
|
|
56
57
|
await runWrangler("tail durable-object--websocket--response");
|
|
57
58
|
expect(std.out).toMatchInlineSnapshot(`""`);
|
|
58
59
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
59
|
-
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mBeginning log collection requires restarting the Durable Objects associated with durable-object--websocket--response. Any WebSocket connections or other non-persisted state will be lost as part of this restart.[0m
|
|
60
|
+
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mBeginning log collection requires restarting the Durable Objects associated with durable-object--websocket--response. Any WebSocket connections or other non-persisted state will be lost as part of this restart.[0m
|
|
60
61
|
|
|
61
|
-
"
|
|
62
|
-
`);
|
|
62
|
+
"
|
|
63
|
+
`);
|
|
63
64
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
64
65
|
});
|
|
65
66
|
it("creates and then delete tails", async () => {
|
|
@@ -503,10 +504,36 @@ describe("tail", () => {
|
|
|
503
504
|
)
|
|
504
505
|
.replace(mockTailExpiration.toISOString(), "[mock expiration date]")
|
|
505
506
|
).toMatchInlineSnapshot(`
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
507
|
+
"Successfully created tail, expires at [mock expiration date]
|
|
508
|
+
Connected to test-worker, waiting for logs...
|
|
509
|
+
Email from:from@example.com to:to@example.com size:45416 @ [mock event timestamp] - Ok"
|
|
510
|
+
`);
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
it("logs tail overload message", async () => {
|
|
514
|
+
const api = mockWebsocketAPIs();
|
|
515
|
+
await runWrangler("tail test-worker --format pretty");
|
|
516
|
+
|
|
517
|
+
let event = generateTailInfo(true);
|
|
518
|
+
let message = generateMockEventMessage({ event });
|
|
519
|
+
let serializedMessage = serialize(message);
|
|
520
|
+
api.ws.send(serializedMessage);
|
|
521
|
+
|
|
522
|
+
event = generateTailInfo(false);
|
|
523
|
+
message = generateMockEventMessage({ event });
|
|
524
|
+
serializedMessage = serialize(message);
|
|
525
|
+
api.ws.send(serializedMessage);
|
|
526
|
+
expect(
|
|
527
|
+
std.out.replace(
|
|
528
|
+
mockTailExpiration.toISOString(),
|
|
529
|
+
"[mock expiration date]"
|
|
530
|
+
)
|
|
531
|
+
).toMatchInlineSnapshot(`
|
|
532
|
+
"Successfully created tail, expires at [mock expiration date]
|
|
533
|
+
Connected to test-worker, waiting for logs...
|
|
534
|
+
Tail is currently in sampling mode due to the high volume of messages. To prevent messages from being dropped consider adding filters.
|
|
535
|
+
Tail has exited sampling mode and is no longer dropping messages."
|
|
536
|
+
`);
|
|
510
537
|
});
|
|
511
538
|
|
|
512
539
|
it("should not crash when the tail message has a void event", async () => {
|
|
@@ -675,6 +702,7 @@ function isRequest(
|
|
|
675
702
|
| RequestEvent
|
|
676
703
|
| AlarmEvent
|
|
677
704
|
| EmailEvent
|
|
705
|
+
| TailInfo
|
|
678
706
|
| undefined
|
|
679
707
|
| null
|
|
680
708
|
): event is RequestEvent {
|
|
@@ -956,3 +984,17 @@ function generateMockEmailEvent(opts?: Partial<EmailEvent>): EmailEvent {
|
|
|
956
984
|
rawSize: opts?.rawSize || mockEmailEventSize,
|
|
957
985
|
};
|
|
958
986
|
}
|
|
987
|
+
|
|
988
|
+
function generateTailInfo(overload: boolean): TailInfo {
|
|
989
|
+
return overload
|
|
990
|
+
? {
|
|
991
|
+
message:
|
|
992
|
+
"Tail is currently in sampling mode due to the high volume of messages. To prevent messages from being dropped consider adding filters.",
|
|
993
|
+
type: "overload",
|
|
994
|
+
}
|
|
995
|
+
: {
|
|
996
|
+
message:
|
|
997
|
+
"Tail has exited sampling mode and is no longer dropping messages.",
|
|
998
|
+
type: "overload-stop",
|
|
999
|
+
};
|
|
1000
|
+
}
|