wrangler 2.1.14 → 2.2.0
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 +3 -1
- package/package.json +2 -1
- package/src/__tests__/access.test.ts +25 -0
- package/src/__tests__/api-dev.test.ts +1 -1
- package/src/__tests__/api-devregistry.test.js +2 -2
- package/src/__tests__/configuration.test.ts +119 -2
- package/src/__tests__/d1.test.ts +2 -0
- package/src/__tests__/deployments.test.ts +22 -22
- package/src/__tests__/dev.test.tsx +167 -15
- package/src/__tests__/helpers/msw/handlers/access.ts +13 -0
- package/src/__tests__/helpers/msw/handlers/deployments.ts +22 -43
- package/src/__tests__/helpers/msw/handlers/zones.ts +22 -0
- package/src/__tests__/helpers/msw/index.ts +4 -0
- package/src/__tests__/index.test.ts +42 -33
- package/src/__tests__/init.test.ts +88 -4
- package/src/__tests__/jest.setup.ts +11 -0
- package/src/__tests__/kv.test.ts +400 -400
- package/src/__tests__/pages.test.ts +140 -28
- package/src/__tests__/publish.test.ts +1161 -647
- package/src/__tests__/pubsub.test.ts +3 -0
- package/src/__tests__/queues.test.ts +371 -0
- package/src/__tests__/r2.test.ts +57 -52
- package/src/__tests__/worker-namespace.test.ts +15 -10
- package/src/bundle-reporter.tsx +41 -2
- package/src/bundle.ts +59 -30
- package/src/cli.ts +0 -1
- package/src/config/environment.ts +50 -0
- package/src/config/index.ts +41 -0
- package/src/config/validation.ts +173 -0
- package/src/create-worker-preview.ts +10 -3
- package/src/create-worker-upload-form.ts +12 -0
- package/src/d1/backups.tsx +11 -5
- package/src/d1/execute.tsx +52 -47
- package/src/d1/index.ts +2 -1
- package/src/delete.ts +7 -10
- package/src/deployments.ts +73 -0
- package/src/deprecated/index.ts +9 -24
- package/src/dev/dev-vars.ts +11 -8
- package/src/dev/dev.tsx +12 -0
- package/src/dev/local.tsx +26 -0
- package/src/dev/remote.tsx +2 -0
- package/src/dev/start-server.ts +7 -0
- package/src/dev/use-esbuild.ts +12 -5
- package/src/dev.tsx +12 -9
- package/src/dispatch-namespace.ts +4 -3
- package/src/index.tsx +61 -45
- package/src/init.ts +4 -4
- package/src/inspect.ts +21 -1
- package/src/is-interactive.ts +4 -0
- package/src/kv/index.ts +5 -54
- package/src/logger.ts +12 -0
- package/src/pages/constants.ts +2 -0
- package/src/pages/upload.tsx +42 -15
- package/src/proxy.ts +38 -6
- package/src/publish/index.ts +11 -8
- package/src/publish/publish.ts +151 -30
- package/src/pubsub/pubsub-commands.tsx +3 -2
- 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 +33 -0
- package/src/queues/cli/commands/list.ts +25 -0
- package/src/queues/client.ts +135 -0
- package/src/secret/index.ts +14 -39
- package/src/tail/index.ts +5 -8
- package/src/user/access.ts +69 -0
- package/src/worker.ts +7 -0
- package/src/yargs-types.ts +15 -2
- package/src/zones.ts +31 -5
- package/templates/pages-template-plugin.ts +4 -0
- package/templates/pages-template-worker.ts +21 -4
- package/wrangler-dist/cli.d.ts +42 -0
- package/wrangler-dist/cli.js +4559 -3228
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { randomFillSync } from "node:crypto";
|
|
1
3
|
import * as fs from "node:fs";
|
|
2
4
|
import * as path from "node:path";
|
|
3
5
|
import * as TOML from "@iarna/toml";
|
|
4
6
|
import * as esbuild from "esbuild";
|
|
7
|
+
import {
|
|
8
|
+
printBundleSize,
|
|
9
|
+
printOffendingDependencies,
|
|
10
|
+
} from "../bundle-reporter";
|
|
5
11
|
import { writeAuthConfigFile } from "../user";
|
|
6
12
|
import { mockAccountId, mockApiToken } from "./helpers/mock-account-id";
|
|
7
13
|
import {
|
|
@@ -30,6 +36,7 @@ import type { Config } from "../config";
|
|
|
30
36
|
import type { WorkerMetadata } from "../create-worker-upload-form";
|
|
31
37
|
import type { KVNamespaceInfo } from "../kv/helpers";
|
|
32
38
|
import type { CustomDomainChangeset, CustomDomain } from "../publish/publish";
|
|
39
|
+
import type { PutConsumerBody } from "../queues/client";
|
|
33
40
|
import type { CfWorkerInit } from "../worker";
|
|
34
41
|
import type { FormData, File } from "undici";
|
|
35
42
|
|
|
@@ -57,6 +64,12 @@ describe("publish", () => {
|
|
|
57
64
|
default_environment: { script: { last_deployed_from: "dash" } },
|
|
58
65
|
})
|
|
59
66
|
);
|
|
67
|
+
setMockResponse(
|
|
68
|
+
"/accounts/:accountId/workers/versions/by-script/:scriptTag",
|
|
69
|
+
() => ({
|
|
70
|
+
latest: { number: "2" },
|
|
71
|
+
})
|
|
72
|
+
);
|
|
60
73
|
});
|
|
61
74
|
|
|
62
75
|
afterEach(() => {
|
|
@@ -93,7 +106,8 @@ describe("publish", () => {
|
|
|
93
106
|
Worker PipelineHash: hash9999
|
|
94
107
|
Uploaded test-name (TIMINGS)
|
|
95
108
|
Published test-name (TIMINGS)
|
|
96
|
-
https://test-name.test-sub-domain.workers.dev
|
|
109
|
+
https://test-name.test-sub-domain.workers.dev
|
|
110
|
+
Current Deployment ID: undefined"
|
|
97
111
|
`);
|
|
98
112
|
});
|
|
99
113
|
});
|
|
@@ -129,7 +143,8 @@ describe("publish", () => {
|
|
|
129
143
|
Total Upload: xx KiB / gzip: xx KiB
|
|
130
144
|
Uploaded test-name (TIMINGS)
|
|
131
145
|
Published test-name (TIMINGS)
|
|
132
|
-
https://test-name.test-sub-domain.workers.dev
|
|
146
|
+
https://test-name.test-sub-domain.workers.dev
|
|
147
|
+
Current Deployment ID: undefined"
|
|
133
148
|
`);
|
|
134
149
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
135
150
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
@@ -150,7 +165,8 @@ describe("publish", () => {
|
|
|
150
165
|
"Total Upload: xx KiB / gzip: xx KiB
|
|
151
166
|
Uploaded test-name (TIMINGS)
|
|
152
167
|
Published test-name (TIMINGS)
|
|
153
|
-
https://test-name.test-sub-domain.workers.dev
|
|
168
|
+
https://test-name.test-sub-domain.workers.dev
|
|
169
|
+
Current Deployment ID: undefined"
|
|
154
170
|
`);
|
|
155
171
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
156
172
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mIt looks like you have used Wrangler 1's \`config\` command to login with an API token.[0m
|
|
@@ -187,11 +203,12 @@ describe("publish", () => {
|
|
|
187
203
|
await runWrangler("publish index.js");
|
|
188
204
|
|
|
189
205
|
expect(std.out).toMatchInlineSnapshot(`
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
206
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
207
|
+
Uploaded test-name (TIMINGS)
|
|
208
|
+
Published test-name (TIMINGS)
|
|
209
|
+
https://test-name.test-sub-domain.workers.dev
|
|
210
|
+
Current Deployment ID: undefined"
|
|
211
|
+
`);
|
|
195
212
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
196
213
|
});
|
|
197
214
|
|
|
@@ -211,11 +228,12 @@ describe("publish", () => {
|
|
|
211
228
|
await runWrangler("publish index.js");
|
|
212
229
|
|
|
213
230
|
expect(std.out).toMatchInlineSnapshot(`
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
231
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
232
|
+
Uploaded test-name (TIMINGS)
|
|
233
|
+
Published test-name (TIMINGS)
|
|
234
|
+
https://test-name.test-sub-domain.workers.dev
|
|
235
|
+
Current Deployment ID: undefined"
|
|
236
|
+
`);
|
|
219
237
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
220
238
|
});
|
|
221
239
|
|
|
@@ -313,11 +331,12 @@ describe("publish", () => {
|
|
|
313
331
|
});
|
|
314
332
|
await runWrangler("publish index.js --env some-env");
|
|
315
333
|
expect(std.out).toMatchInlineSnapshot(`
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
334
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
335
|
+
Uploaded test-name-some-env (TIMINGS)
|
|
336
|
+
Published test-name-some-env (TIMINGS)
|
|
337
|
+
https://test-name-some-env.test-sub-domain.workers.dev
|
|
338
|
+
Current Deployment ID: undefined"
|
|
339
|
+
`);
|
|
321
340
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
322
341
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
323
342
|
});
|
|
@@ -332,11 +351,12 @@ describe("publish", () => {
|
|
|
332
351
|
});
|
|
333
352
|
await runWrangler("publish index.js --legacy-env true");
|
|
334
353
|
expect(std.out).toMatchInlineSnapshot(`
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
354
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
355
|
+
Uploaded test-name (TIMINGS)
|
|
356
|
+
Published test-name (TIMINGS)
|
|
357
|
+
https://test-name.test-sub-domain.workers.dev
|
|
358
|
+
Current Deployment ID: undefined"
|
|
359
|
+
`);
|
|
340
360
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
341
361
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
342
362
|
});
|
|
@@ -351,11 +371,12 @@ describe("publish", () => {
|
|
|
351
371
|
});
|
|
352
372
|
await runWrangler("publish index.js --env some-env --legacy-env true");
|
|
353
373
|
expect(std.out).toMatchInlineSnapshot(`
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
374
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
375
|
+
Uploaded test-name-some-env (TIMINGS)
|
|
376
|
+
Published test-name-some-env (TIMINGS)
|
|
377
|
+
https://test-name-some-env.test-sub-domain.workers.dev
|
|
378
|
+
Current Deployment ID: undefined"
|
|
379
|
+
`);
|
|
359
380
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
360
381
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
361
382
|
});
|
|
@@ -370,11 +391,12 @@ describe("publish", () => {
|
|
|
370
391
|
});
|
|
371
392
|
await runWrangler("publish index.js --env some-env --legacy-env true");
|
|
372
393
|
expect(std.out).toMatchInlineSnapshot(`
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
394
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
395
|
+
Uploaded test-name-some-env (TIMINGS)
|
|
396
|
+
Published test-name-some-env (TIMINGS)
|
|
397
|
+
https://test-name-some-env.test-sub-domain.workers.dev
|
|
398
|
+
Current Deployment ID: undefined"
|
|
399
|
+
`);
|
|
378
400
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
379
401
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
380
402
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -440,11 +462,12 @@ describe("publish", () => {
|
|
|
440
462
|
});
|
|
441
463
|
await runWrangler("publish index.js --legacy-env false");
|
|
442
464
|
expect(std.out).toMatchInlineSnapshot(`
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
465
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
466
|
+
Uploaded test-name (TIMINGS)
|
|
467
|
+
Published test-name (TIMINGS)
|
|
468
|
+
https://test-name.test-sub-domain.workers.dev
|
|
469
|
+
Current Deployment ID: undefined"
|
|
470
|
+
`);
|
|
448
471
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
449
472
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
450
473
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -466,11 +489,12 @@ describe("publish", () => {
|
|
|
466
489
|
});
|
|
467
490
|
await runWrangler("publish index.js --env some-env --legacy-env false");
|
|
468
491
|
expect(std.out).toMatchInlineSnapshot(`
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
492
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
493
|
+
Uploaded test-name (some-env) (TIMINGS)
|
|
494
|
+
Published test-name (some-env) (TIMINGS)
|
|
495
|
+
https://some-env.test-name.test-sub-domain.workers.dev
|
|
496
|
+
Current Deployment ID: undefined"
|
|
497
|
+
`);
|
|
474
498
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
475
499
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
476
500
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -515,7 +539,8 @@ describe("publish", () => {
|
|
|
515
539
|
- xyz: 123
|
|
516
540
|
Uploaded test-name (TIMINGS)
|
|
517
541
|
Published test-name (TIMINGS)
|
|
518
|
-
https://test-name.test-sub-domain.workers.dev
|
|
542
|
+
https://test-name.test-sub-domain.workers.dev
|
|
543
|
+
Current Deployment ID: undefined"
|
|
519
544
|
`);
|
|
520
545
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
521
546
|
});
|
|
@@ -549,7 +574,8 @@ describe("publish", () => {
|
|
|
549
574
|
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
550
575
|
Uploaded test-name (TIMINGS)
|
|
551
576
|
Published test-name (TIMINGS)
|
|
552
|
-
https://test-name.test-sub-domain.workers.dev
|
|
577
|
+
https://test-name.test-sub-domain.workers.dev
|
|
578
|
+
Current Deployment ID: undefined",
|
|
553
579
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
554
580
|
|
|
555
581
|
- The \\"route\\" field in your configuration is an empty string and will be ignored.
|
|
@@ -589,20 +615,21 @@ describe("publish", () => {
|
|
|
589
615
|
});
|
|
590
616
|
await runWrangler("publish ./index");
|
|
591
617
|
expect(std).toMatchInlineSnapshot(`
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
618
|
+
Object {
|
|
619
|
+
"debug": "",
|
|
620
|
+
"err": "",
|
|
621
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
622
|
+
Uploaded test-name (TIMINGS)
|
|
623
|
+
Published test-name (TIMINGS)
|
|
624
|
+
some-example.com/some-route/*
|
|
625
|
+
*a-boring-website.com (zone id: 54sdf7fsda)
|
|
626
|
+
*another-boring-website.com (zone name: some-zone.com)
|
|
627
|
+
example.com/some-route/* (zone id: JGHFHG654gjcj)
|
|
628
|
+
more-examples.com/*
|
|
629
|
+
Current Deployment ID: undefined",
|
|
630
|
+
"warn": "",
|
|
631
|
+
}
|
|
632
|
+
`);
|
|
606
633
|
});
|
|
607
634
|
|
|
608
635
|
it("should publish to a route with a pattern/{zone_id|zone_name} combo (service environments)", async () => {
|
|
@@ -650,25 +677,26 @@ describe("publish", () => {
|
|
|
650
677
|
});
|
|
651
678
|
await runWrangler("publish ./index --legacy-env false --env staging");
|
|
652
679
|
expect(std).toMatchInlineSnapshot(`
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
680
|
+
Object {
|
|
681
|
+
"debug": "",
|
|
682
|
+
"err": "",
|
|
683
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
684
|
+
Uploaded test-name (staging) (TIMINGS)
|
|
685
|
+
Published test-name (staging) (TIMINGS)
|
|
686
|
+
some-example.com/some-route/*
|
|
687
|
+
*a-boring-website.com (zone id: 54sdf7fsda)
|
|
688
|
+
*another-boring-website.com (zone name: some-zone.com)
|
|
689
|
+
example.com/some-route/* (zone id: JGHFHG654gjcj)
|
|
690
|
+
more-examples.com/*
|
|
691
|
+
Current Deployment ID: undefined",
|
|
692
|
+
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
665
693
|
|
|
666
|
-
|
|
667
|
-
|
|
694
|
+
- Experimental: Service environments are in beta, and their behaviour is guaranteed to change in
|
|
695
|
+
the future. DO NOT USE IN PRODUCTION.
|
|
668
696
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
697
|
+
",
|
|
698
|
+
}
|
|
699
|
+
`);
|
|
672
700
|
});
|
|
673
701
|
|
|
674
702
|
it("should publish to legacy environment specific routes", async () => {
|
|
@@ -759,11 +787,12 @@ describe("publish", () => {
|
|
|
759
787
|
"
|
|
760
788
|
`);
|
|
761
789
|
expect(std.out).toMatchInlineSnapshot(`
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
790
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
791
|
+
Uploaded test-name (TIMINGS)
|
|
792
|
+
Published test-name (TIMINGS)
|
|
793
|
+
example.com/some-route/*
|
|
794
|
+
Current Deployment ID: undefined"
|
|
795
|
+
`);
|
|
767
796
|
});
|
|
768
797
|
|
|
769
798
|
it("should error if the bulk-routes API fails and trying to push to a non-production environment", async () => {
|
|
@@ -1039,11 +1068,12 @@ Update them to point to this script instead?`,
|
|
|
1039
1068
|
await runWrangler("publish ./index");
|
|
1040
1069
|
|
|
1041
1070
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1071
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1072
|
+
Uploaded test-name (TIMINGS)
|
|
1073
|
+
Published test-name (TIMINGS)
|
|
1074
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1075
|
+
Current Deployment ID: undefined"
|
|
1076
|
+
`);
|
|
1047
1077
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1048
1078
|
});
|
|
1049
1079
|
|
|
@@ -1056,11 +1086,12 @@ Update them to point to this script instead?`,
|
|
|
1056
1086
|
await runWrangler("publish ./index");
|
|
1057
1087
|
|
|
1058
1088
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1089
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1090
|
+
Uploaded test-name (TIMINGS)
|
|
1091
|
+
Published test-name (TIMINGS)
|
|
1092
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1093
|
+
Current Deployment ID: undefined"
|
|
1094
|
+
`);
|
|
1064
1095
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1065
1096
|
});
|
|
1066
1097
|
|
|
@@ -1073,11 +1104,12 @@ Update them to point to this script instead?`,
|
|
|
1073
1104
|
await runWrangler("publish");
|
|
1074
1105
|
|
|
1075
1106
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1107
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1108
|
+
Uploaded test-name (TIMINGS)
|
|
1109
|
+
Published test-name (TIMINGS)
|
|
1110
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1111
|
+
Current Deployment ID: undefined"
|
|
1112
|
+
`);
|
|
1081
1113
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1082
1114
|
});
|
|
1083
1115
|
|
|
@@ -1092,11 +1124,12 @@ Update them to point to this script instead?`,
|
|
|
1092
1124
|
await runWrangler("publish");
|
|
1093
1125
|
|
|
1094
1126
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1127
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1128
|
+
Uploaded test-name (TIMINGS)
|
|
1129
|
+
Published test-name (TIMINGS)
|
|
1130
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1131
|
+
Current Deployment ID: undefined"
|
|
1132
|
+
`);
|
|
1100
1133
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1101
1134
|
});
|
|
1102
1135
|
|
|
@@ -1109,11 +1142,12 @@ Update them to point to this script instead?`,
|
|
|
1109
1142
|
await runWrangler("publish");
|
|
1110
1143
|
|
|
1111
1144
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1145
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1146
|
+
Uploaded test-name (TIMINGS)
|
|
1147
|
+
Published test-name (TIMINGS)
|
|
1148
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1149
|
+
Current Deployment ID: undefined"
|
|
1150
|
+
`);
|
|
1117
1151
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1118
1152
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
1119
1153
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -1145,11 +1179,12 @@ Update them to point to this script instead?`,
|
|
|
1145
1179
|
await runWrangler("publish");
|
|
1146
1180
|
|
|
1147
1181
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1182
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1183
|
+
Uploaded test-name (TIMINGS)
|
|
1184
|
+
Published test-name (TIMINGS)
|
|
1185
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1186
|
+
Current Deployment ID: undefined"
|
|
1187
|
+
`);
|
|
1153
1188
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1154
1189
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
1155
1190
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing ../wrangler.toml configuration:[0m
|
|
@@ -1195,11 +1230,12 @@ Update them to point to this script instead?`,
|
|
|
1195
1230
|
await runWrangler("publish index.ts");
|
|
1196
1231
|
|
|
1197
1232
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1233
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1234
|
+
Uploaded test-name (TIMINGS)
|
|
1235
|
+
Published test-name (TIMINGS)
|
|
1236
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1237
|
+
Current Deployment ID: undefined"
|
|
1238
|
+
`);
|
|
1203
1239
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1204
1240
|
});
|
|
1205
1241
|
|
|
@@ -1214,11 +1250,12 @@ Update them to point to this script instead?`,
|
|
|
1214
1250
|
await runWrangler("publish index.ts");
|
|
1215
1251
|
|
|
1216
1252
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1253
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1254
|
+
Uploaded test-name (TIMINGS)
|
|
1255
|
+
Published test-name (TIMINGS)
|
|
1256
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1257
|
+
Current Deployment ID: undefined"
|
|
1258
|
+
`);
|
|
1222
1259
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1223
1260
|
});
|
|
1224
1261
|
|
|
@@ -1245,11 +1282,12 @@ export default{
|
|
|
1245
1282
|
mockSubDomainRequest();
|
|
1246
1283
|
await runWrangler("publish index.js");
|
|
1247
1284
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1285
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1286
|
+
Uploaded test-name (TIMINGS)
|
|
1287
|
+
Published test-name (TIMINGS)
|
|
1288
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1289
|
+
Current Deployment ID: undefined"
|
|
1290
|
+
`);
|
|
1253
1291
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1254
1292
|
});
|
|
1255
1293
|
|
|
@@ -1262,11 +1300,12 @@ export default{
|
|
|
1262
1300
|
await runWrangler("publish ./src/index.js");
|
|
1263
1301
|
|
|
1264
1302
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1303
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1304
|
+
Uploaded test-name (TIMINGS)
|
|
1305
|
+
Published test-name (TIMINGS)
|
|
1306
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1307
|
+
Current Deployment ID: undefined"
|
|
1308
|
+
`);
|
|
1270
1309
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1271
1310
|
});
|
|
1272
1311
|
|
|
@@ -1356,11 +1395,12 @@ addEventListener('fetch', event => {});`
|
|
|
1356
1395
|
await runWrangler("publish ./src/index.js");
|
|
1357
1396
|
|
|
1358
1397
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1398
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
1399
|
+
Uploaded test-name (TIMINGS)
|
|
1400
|
+
Published test-name (TIMINGS)
|
|
1401
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1402
|
+
Current Deployment ID: undefined"
|
|
1403
|
+
`);
|
|
1364
1404
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1365
1405
|
});
|
|
1366
1406
|
|
|
@@ -1430,30 +1470,31 @@ addEventListener('fetch', event => {});`
|
|
|
1430
1470
|
await runWrangler("publish ./index.js");
|
|
1431
1471
|
|
|
1432
1472
|
expect(std).toMatchInlineSnapshot(`
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1473
|
+
Object {
|
|
1474
|
+
"debug": "",
|
|
1475
|
+
"err": "",
|
|
1476
|
+
"out": "Reading file-1.txt...
|
|
1477
|
+
Uploading as file-1.2ca234f380.txt...
|
|
1478
|
+
Reading file-2.txt...
|
|
1479
|
+
Uploading as file-2.5938485188.txt...
|
|
1480
|
+
↗️ Done syncing assets
|
|
1481
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
1482
|
+
Uploaded test-name (TIMINGS)
|
|
1483
|
+
Published test-name (TIMINGS)
|
|
1484
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1485
|
+
Current Deployment ID: undefined",
|
|
1486
|
+
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
1446
1487
|
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1488
|
+
- [1mDeprecation[0m: \\"site.entry-point\\":
|
|
1489
|
+
Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration
|
|
1490
|
+
file:
|
|
1491
|
+
\`\`\`
|
|
1492
|
+
main = \\"index.js\\"
|
|
1493
|
+
\`\`\`
|
|
1453
1494
|
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1495
|
+
",
|
|
1496
|
+
}
|
|
1497
|
+
`);
|
|
1457
1498
|
});
|
|
1458
1499
|
|
|
1459
1500
|
it("should resolve site.entry-point relative to wrangler.toml", async () => {
|
|
@@ -1485,16 +1526,17 @@ addEventListener('fetch', event => {});`
|
|
|
1485
1526
|
await runWrangler("publish --config ./my-site/wrangler.toml");
|
|
1486
1527
|
|
|
1487
1528
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1529
|
+
"Reading file-1.txt...
|
|
1530
|
+
Uploading as file-1.2ca234f380.txt...
|
|
1531
|
+
Reading file-2.txt...
|
|
1532
|
+
Uploading as file-2.5938485188.txt...
|
|
1533
|
+
↗️ Done syncing assets
|
|
1534
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
1535
|
+
Uploaded test-name (TIMINGS)
|
|
1536
|
+
Published test-name (TIMINGS)
|
|
1537
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1538
|
+
Current Deployment ID: undefined"
|
|
1539
|
+
`);
|
|
1498
1540
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1499
1541
|
expect(normalizeSlashes(std.warn)).toMatchInlineSnapshot(`
|
|
1500
1542
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing my-site/wrangler.toml configuration:[0m
|
|
@@ -1582,7 +1624,8 @@ addEventListener('fetch', event => {});`
|
|
|
1582
1624
|
Total Upload: xx KiB / gzip: xx KiB
|
|
1583
1625
|
Uploaded test-name (TIMINGS)
|
|
1584
1626
|
Published test-name (TIMINGS)
|
|
1585
|
-
https://test-name.test-sub-domain.workers.dev
|
|
1627
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1628
|
+
Current Deployment ID: undefined",
|
|
1586
1629
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe --assets argument is experimental and may change or break at any time[0m
|
|
1587
1630
|
|
|
1588
1631
|
|
|
@@ -1622,16 +1665,17 @@ addEventListener('fetch', event => {});`
|
|
|
1622
1665
|
await runWrangler("publish");
|
|
1623
1666
|
|
|
1624
1667
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1668
|
+
"Reading file-1.txt...
|
|
1669
|
+
Uploading as file-1.2ca234f380.txt...
|
|
1670
|
+
Reading file-2.txt...
|
|
1671
|
+
Uploading as file-2.5938485188.txt...
|
|
1672
|
+
↗️ Done syncing assets
|
|
1673
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
1674
|
+
Uploaded test-name (TIMINGS)
|
|
1675
|
+
Published test-name (TIMINGS)
|
|
1676
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1677
|
+
Current Deployment ID: undefined"
|
|
1678
|
+
`);
|
|
1635
1679
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1636
1680
|
});
|
|
1637
1681
|
|
|
@@ -1670,7 +1714,8 @@ addEventListener('fetch', event => {});`
|
|
|
1670
1714
|
Total Upload: xx KiB / gzip: xx KiB
|
|
1671
1715
|
Uploaded test-name (TIMINGS)
|
|
1672
1716
|
Published test-name (TIMINGS)
|
|
1673
|
-
https://test-name.test-sub-domain.workers.dev
|
|
1717
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1718
|
+
Current Deployment ID: undefined",
|
|
1674
1719
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe --assets argument is experimental and may change or break at any time[0m
|
|
1675
1720
|
|
|
1676
1721
|
",
|
|
@@ -1854,7 +1899,8 @@ addEventListener('fetch', event => {});`
|
|
|
1854
1899
|
Total Upload: xx KiB / gzip: xx KiB
|
|
1855
1900
|
Uploaded test-name (TIMINGS)
|
|
1856
1901
|
Published test-name (TIMINGS)
|
|
1857
|
-
https://test-name.test-sub-domain.workers.dev
|
|
1902
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1903
|
+
Current Deployment ID: undefined",
|
|
1858
1904
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe --assets argument is experimental and may change or break at any time[0m
|
|
1859
1905
|
|
|
1860
1906
|
",
|
|
@@ -1900,7 +1946,8 @@ addEventListener('fetch', event => {});`
|
|
|
1900
1946
|
Total Upload: xx KiB / gzip: xx KiB
|
|
1901
1947
|
Uploaded test-name (TIMINGS)
|
|
1902
1948
|
Published test-name (TIMINGS)
|
|
1903
|
-
https://test-name.test-sub-domain.workers.dev
|
|
1949
|
+
https://test-name.test-sub-domain.workers.dev
|
|
1950
|
+
Current Deployment ID: undefined",
|
|
1904
1951
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
1905
1952
|
|
|
1906
1953
|
- \\"assets\\" fields are experimental and may change or break at any time.
|
|
@@ -1948,16 +1995,17 @@ addEventListener('fetch', event => {});`
|
|
|
1948
1995
|
await runWrangler("publish");
|
|
1949
1996
|
|
|
1950
1997
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1998
|
+
"Reading subdir/file-1.txt...
|
|
1999
|
+
Uploading as subdir/file-1.2ca234f380.txt...
|
|
2000
|
+
Reading subdir/file-2.txt...
|
|
2001
|
+
Uploading as subdir/file-2.5938485188.txt...
|
|
2002
|
+
↗️ Done syncing assets
|
|
2003
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2004
|
+
Uploaded test-name (TIMINGS)
|
|
2005
|
+
Published test-name (TIMINGS)
|
|
2006
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2007
|
+
Current Deployment ID: undefined"
|
|
2008
|
+
`);
|
|
1961
2009
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
1962
2010
|
});
|
|
1963
2011
|
|
|
@@ -2005,16 +2053,17 @@ addEventListener('fetch', event => {});`
|
|
|
2005
2053
|
await runWrangler("publish");
|
|
2006
2054
|
|
|
2007
2055
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2056
|
+
"Reading file-1.txt...
|
|
2057
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2058
|
+
Reading file-2.txt...
|
|
2059
|
+
Uploading as file-2.5938485188.txt...
|
|
2060
|
+
↗️ Done syncing assets
|
|
2061
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2062
|
+
Uploaded test-name (TIMINGS)
|
|
2063
|
+
Published test-name (TIMINGS)
|
|
2064
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2065
|
+
Current Deployment ID: undefined"
|
|
2066
|
+
`);
|
|
2018
2067
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2019
2068
|
});
|
|
2020
2069
|
|
|
@@ -2056,16 +2105,17 @@ addEventListener('fetch', event => {});`
|
|
|
2056
2105
|
await runWrangler("publish");
|
|
2057
2106
|
|
|
2058
2107
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2108
|
+
"Reading file-1.txt...
|
|
2109
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2110
|
+
Reading file-2.txt...
|
|
2111
|
+
Uploading as file-2.5938485188.txt...
|
|
2112
|
+
↗️ Done syncing assets
|
|
2113
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2114
|
+
Uploaded test-name (TIMINGS)
|
|
2115
|
+
Published test-name (TIMINGS)
|
|
2116
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2117
|
+
Current Deployment ID: undefined"
|
|
2118
|
+
`);
|
|
2069
2119
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2070
2120
|
});
|
|
2071
2121
|
|
|
@@ -2105,16 +2155,17 @@ addEventListener('fetch', event => {});`
|
|
|
2105
2155
|
await runWrangler("publish --env some-env --legacy-env false");
|
|
2106
2156
|
|
|
2107
2157
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2158
|
+
"Reading file-1.txt...
|
|
2159
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2160
|
+
Reading file-2.txt...
|
|
2161
|
+
Uploading as file-2.5938485188.txt...
|
|
2162
|
+
↗️ Done syncing assets
|
|
2163
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2164
|
+
Uploaded test-name (some-env) (TIMINGS)
|
|
2165
|
+
Published test-name (some-env) (TIMINGS)
|
|
2166
|
+
https://some-env.test-name.test-sub-domain.workers.dev
|
|
2167
|
+
Current Deployment ID: undefined"
|
|
2168
|
+
`);
|
|
2118
2169
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2119
2170
|
});
|
|
2120
2171
|
|
|
@@ -2155,16 +2206,17 @@ addEventListener('fetch', event => {});`
|
|
|
2155
2206
|
await runWrangler("publish --env some-env --legacy-env true");
|
|
2156
2207
|
|
|
2157
2208
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2209
|
+
"Reading file-1.txt...
|
|
2210
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2211
|
+
Reading file-2.txt...
|
|
2212
|
+
Uploading as file-2.5938485188.txt...
|
|
2213
|
+
↗️ Done syncing assets
|
|
2214
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2215
|
+
Uploaded test-name-some-env (TIMINGS)
|
|
2216
|
+
Published test-name-some-env (TIMINGS)
|
|
2217
|
+
https://test-name-some-env.test-sub-domain.workers.dev
|
|
2218
|
+
Current Deployment ID: undefined"
|
|
2219
|
+
`);
|
|
2168
2220
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2169
2221
|
});
|
|
2170
2222
|
|
|
@@ -2198,16 +2250,17 @@ addEventListener('fetch', event => {});`
|
|
|
2198
2250
|
await runWrangler("publish");
|
|
2199
2251
|
|
|
2200
2252
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2253
|
+
"Reading file-1.txt...
|
|
2254
|
+
Skipping - already uploaded.
|
|
2255
|
+
Reading file-2.txt...
|
|
2256
|
+
Uploading as file-2.5938485188.txt...
|
|
2257
|
+
↗️ Done syncing assets
|
|
2258
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2259
|
+
Uploaded test-name (TIMINGS)
|
|
2260
|
+
Published test-name (TIMINGS)
|
|
2261
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2262
|
+
Current Deployment ID: undefined"
|
|
2263
|
+
`);
|
|
2211
2264
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2212
2265
|
});
|
|
2213
2266
|
|
|
@@ -2240,14 +2293,15 @@ addEventListener('fetch', event => {});`
|
|
|
2240
2293
|
await runWrangler("publish --site-include file-1.txt");
|
|
2241
2294
|
|
|
2242
2295
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2296
|
+
"Reading file-1.txt...
|
|
2297
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2298
|
+
↗️ Done syncing assets
|
|
2299
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2300
|
+
Uploaded test-name (TIMINGS)
|
|
2301
|
+
Published test-name (TIMINGS)
|
|
2302
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2303
|
+
Current Deployment ID: undefined"
|
|
2304
|
+
`);
|
|
2251
2305
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2252
2306
|
});
|
|
2253
2307
|
|
|
@@ -2280,14 +2334,15 @@ addEventListener('fetch', event => {});`
|
|
|
2280
2334
|
await runWrangler("publish --site-exclude file-2.txt");
|
|
2281
2335
|
|
|
2282
2336
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2337
|
+
"Reading file-1.txt...
|
|
2338
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2339
|
+
↗️ Done syncing assets
|
|
2340
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2341
|
+
Uploaded test-name (TIMINGS)
|
|
2342
|
+
Published test-name (TIMINGS)
|
|
2343
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2344
|
+
Current Deployment ID: undefined"
|
|
2345
|
+
`);
|
|
2291
2346
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2292
2347
|
});
|
|
2293
2348
|
|
|
@@ -2321,14 +2376,15 @@ addEventListener('fetch', event => {});`
|
|
|
2321
2376
|
await runWrangler("publish");
|
|
2322
2377
|
|
|
2323
2378
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2379
|
+
"Reading file-1.txt...
|
|
2380
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2381
|
+
↗️ Done syncing assets
|
|
2382
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2383
|
+
Uploaded test-name (TIMINGS)
|
|
2384
|
+
Published test-name (TIMINGS)
|
|
2385
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2386
|
+
Current Deployment ID: undefined"
|
|
2387
|
+
`);
|
|
2332
2388
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2333
2389
|
});
|
|
2334
2390
|
|
|
@@ -2362,14 +2418,15 @@ addEventListener('fetch', event => {});`
|
|
|
2362
2418
|
await runWrangler("publish");
|
|
2363
2419
|
|
|
2364
2420
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2421
|
+
"Reading file-1.txt...
|
|
2422
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2423
|
+
↗️ Done syncing assets
|
|
2424
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2425
|
+
Uploaded test-name (TIMINGS)
|
|
2426
|
+
Published test-name (TIMINGS)
|
|
2427
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2428
|
+
Current Deployment ID: undefined"
|
|
2429
|
+
`);
|
|
2373
2430
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2374
2431
|
});
|
|
2375
2432
|
|
|
@@ -2403,16 +2460,17 @@ addEventListener('fetch', event => {});`
|
|
|
2403
2460
|
await runWrangler("publish --site-include file-1.txt");
|
|
2404
2461
|
|
|
2405
2462
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2463
|
+
"Reading file-1.txt...
|
|
2464
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2465
|
+
↗️ Done syncing assets
|
|
2466
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2467
|
+
Uploaded test-name (TIMINGS)
|
|
2468
|
+
Published test-name (TIMINGS)
|
|
2469
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2470
|
+
Current Deployment ID: undefined"
|
|
2471
|
+
`);
|
|
2472
|
+
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2473
|
+
});
|
|
2416
2474
|
|
|
2417
2475
|
it("should use `site-exclude` arg over `site.exclude` config", async () => {
|
|
2418
2476
|
const assets = [
|
|
@@ -2444,14 +2502,15 @@ addEventListener('fetch', event => {});`
|
|
|
2444
2502
|
await runWrangler("publish --site-exclude file-2.txt");
|
|
2445
2503
|
|
|
2446
2504
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2505
|
+
"Reading file-1.txt...
|
|
2506
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2507
|
+
↗️ Done syncing assets
|
|
2508
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2509
|
+
Uploaded test-name (TIMINGS)
|
|
2510
|
+
Published test-name (TIMINGS)
|
|
2511
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2512
|
+
Current Deployment ID: undefined"
|
|
2513
|
+
`);
|
|
2455
2514
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2456
2515
|
});
|
|
2457
2516
|
|
|
@@ -2487,14 +2546,15 @@ addEventListener('fetch', event => {});`
|
|
|
2487
2546
|
await runWrangler("publish");
|
|
2488
2547
|
|
|
2489
2548
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2549
|
+
"Reading directory-1/file-1.txt...
|
|
2550
|
+
Uploading as directory-1/file-1.2ca234f380.txt...
|
|
2551
|
+
↗️ Done syncing assets
|
|
2552
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2553
|
+
Uploaded test-name (TIMINGS)
|
|
2554
|
+
Published test-name (TIMINGS)
|
|
2555
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2556
|
+
Current Deployment ID: undefined"
|
|
2557
|
+
`);
|
|
2498
2558
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2499
2559
|
});
|
|
2500
2560
|
|
|
@@ -2534,14 +2594,15 @@ addEventListener('fetch', event => {});`
|
|
|
2534
2594
|
await runWrangler("publish");
|
|
2535
2595
|
|
|
2536
2596
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2597
|
+
"Reading .well-known/file-2.txt...
|
|
2598
|
+
Uploading as .well-known/file-2.5938485188.txt...
|
|
2599
|
+
↗️ Done syncing assets
|
|
2600
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2601
|
+
Uploaded test-name (TIMINGS)
|
|
2602
|
+
Published test-name (TIMINGS)
|
|
2603
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2604
|
+
Current Deployment ID: undefined"
|
|
2605
|
+
`);
|
|
2545
2606
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2546
2607
|
});
|
|
2547
2608
|
|
|
@@ -2642,57 +2703,58 @@ addEventListener('fetch', event => {});`
|
|
|
2642
2703
|
}
|
|
2643
2704
|
|
|
2644
2705
|
expect(std).toMatchInlineSnapshot(`
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2706
|
+
Object {
|
|
2707
|
+
"debug": "",
|
|
2708
|
+
"err": "",
|
|
2709
|
+
"out": "Reading file-00.txt...
|
|
2710
|
+
Uploading as file-00.be5be5dd26.txt...
|
|
2711
|
+
Reading file-01.txt...
|
|
2712
|
+
Uploading as file-01.4842d35994.txt...
|
|
2713
|
+
Reading file-02.txt...
|
|
2714
|
+
Uploading as file-02.990572ec63.txt...
|
|
2715
|
+
Reading file-03.txt...
|
|
2716
|
+
Uploading as file-03.9d7dda9045.txt...
|
|
2717
|
+
Reading file-04.txt...
|
|
2718
|
+
Uploading as file-04.2b6fac6382.txt...
|
|
2719
|
+
Reading file-05.txt...
|
|
2720
|
+
Uploading as file-05.55762dc758.txt...
|
|
2721
|
+
Reading file-06.txt...
|
|
2722
|
+
Uploading as file-06.f408a6b020.txt...
|
|
2723
|
+
Reading file-07.txt...
|
|
2724
|
+
Uploading as file-07.64c051715b.txt...
|
|
2725
|
+
Reading file-08.txt...
|
|
2726
|
+
Uploading as file-08.d286789adb.txt...
|
|
2727
|
+
Reading file-09.txt...
|
|
2728
|
+
Uploading as file-09.6838c183a8.txt...
|
|
2729
|
+
Reading file-10.txt...
|
|
2730
|
+
Uploading as file-10.6e03221d2a.txt...
|
|
2731
|
+
Reading file-11.txt...
|
|
2732
|
+
Uploading as file-11.37d3fb2eff.txt...
|
|
2733
|
+
Reading file-12.txt...
|
|
2734
|
+
Uploading as file-12.b3556942f8.txt...
|
|
2735
|
+
Reading file-13.txt...
|
|
2736
|
+
Uploading as file-13.680caf51b1.txt...
|
|
2737
|
+
Reading file-14.txt...
|
|
2738
|
+
Uploading as file-14.51e88468f0.txt...
|
|
2739
|
+
Reading file-15.txt...
|
|
2740
|
+
Uploading as file-15.8e3fedb394.txt...
|
|
2741
|
+
Reading file-16.txt...
|
|
2742
|
+
Uploading as file-16.c81c5e426f.txt...
|
|
2743
|
+
Reading file-17.txt...
|
|
2744
|
+
Uploading as file-17.4b2ae3c47b.txt...
|
|
2745
|
+
Reading file-18.txt...
|
|
2746
|
+
Uploading as file-18.07f245e02b.txt...
|
|
2747
|
+
Reading file-19.txt...
|
|
2748
|
+
Uploading as file-19.f0d69f705d.txt...
|
|
2749
|
+
↗️ Done syncing assets
|
|
2750
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2751
|
+
Uploaded test-name (TIMINGS)
|
|
2752
|
+
Published test-name (TIMINGS)
|
|
2753
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2754
|
+
Current Deployment ID: undefined",
|
|
2755
|
+
"warn": "",
|
|
2756
|
+
}
|
|
2757
|
+
`);
|
|
2696
2758
|
});
|
|
2697
2759
|
|
|
2698
2760
|
it("should error if the asset key is over 512 characters", async () => {
|
|
@@ -2778,18 +2840,19 @@ addEventListener('fetch', event => {});`
|
|
|
2778
2840
|
await runWrangler("publish");
|
|
2779
2841
|
|
|
2780
2842
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2843
|
+
"Reading file-1.txt...
|
|
2844
|
+
Skipping - already uploaded.
|
|
2845
|
+
Reading file-2.txt...
|
|
2846
|
+
Uploading as file-2.5938485188.txt...
|
|
2847
|
+
Deleting file-3.somehash.txt from the asset store...
|
|
2848
|
+
Deleting file-4.anotherhash.txt from the asset store...
|
|
2849
|
+
↗️ Done syncing assets
|
|
2850
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2851
|
+
Uploaded test-name (TIMINGS)
|
|
2852
|
+
Published test-name (TIMINGS)
|
|
2853
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2854
|
+
Current Deployment ID: undefined"
|
|
2855
|
+
`);
|
|
2793
2856
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2794
2857
|
});
|
|
2795
2858
|
|
|
@@ -2834,16 +2897,17 @@ addEventListener('fetch', event => {});`
|
|
|
2834
2897
|
process.chdir("../");
|
|
2835
2898
|
|
|
2836
2899
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2900
|
+
"Reading file-1.txt...
|
|
2901
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2902
|
+
Reading file-2.txt...
|
|
2903
|
+
Uploading as file-2.5938485188.txt...
|
|
2904
|
+
↗️ Done syncing assets
|
|
2905
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2906
|
+
Uploaded test-name (TIMINGS)
|
|
2907
|
+
Published test-name (TIMINGS)
|
|
2908
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2909
|
+
Current Deployment ID: undefined"
|
|
2910
|
+
`);
|
|
2847
2911
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2848
2912
|
});
|
|
2849
2913
|
|
|
@@ -2872,21 +2936,22 @@ addEventListener('fetch', event => {});`
|
|
|
2872
2936
|
await runWrangler("publish --site .");
|
|
2873
2937
|
|
|
2874
2938
|
expect(std).toMatchInlineSnapshot(`
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2939
|
+
Object {
|
|
2940
|
+
"debug": "",
|
|
2941
|
+
"err": "",
|
|
2942
|
+
"out": "Reading file-1.txt...
|
|
2943
|
+
Uploading as file-1.2ca234f380.txt...
|
|
2944
|
+
Reading file-2.txt...
|
|
2945
|
+
Uploading as file-2.5938485188.txt...
|
|
2946
|
+
↗️ Done syncing assets
|
|
2947
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
2948
|
+
Uploaded test-name (TIMINGS)
|
|
2949
|
+
Published test-name (TIMINGS)
|
|
2950
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2951
|
+
Current Deployment ID: undefined",
|
|
2952
|
+
"warn": "",
|
|
2953
|
+
}
|
|
2954
|
+
`);
|
|
2890
2955
|
});
|
|
2891
2956
|
|
|
2892
2957
|
it("should use the relative path from current working directory to Worker directory when using `--assets`", async () => {
|
|
@@ -2925,7 +2990,8 @@ addEventListener('fetch', event => {});`
|
|
|
2925
2990
|
Total Upload: xx KiB / gzip: xx KiB
|
|
2926
2991
|
Uploaded test-name (TIMINGS)
|
|
2927
2992
|
Published test-name (TIMINGS)
|
|
2928
|
-
https://test-name.test-sub-domain.workers.dev
|
|
2993
|
+
https://test-name.test-sub-domain.workers.dev
|
|
2994
|
+
Current Deployment ID: undefined",
|
|
2929
2995
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe --assets argument is experimental and may change or break at any time[0m
|
|
2930
2996
|
|
|
2931
2997
|
",
|
|
@@ -2944,11 +3010,12 @@ addEventListener('fetch', event => {});`
|
|
|
2944
3010
|
await runWrangler("publish ./index");
|
|
2945
3011
|
|
|
2946
3012
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
3013
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3014
|
+
Uploaded test-name (TIMINGS)
|
|
3015
|
+
Published test-name (TIMINGS)
|
|
3016
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3017
|
+
Current Deployment ID: undefined"
|
|
3018
|
+
`);
|
|
2952
3019
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2953
3020
|
});
|
|
2954
3021
|
|
|
@@ -2964,11 +3031,12 @@ addEventListener('fetch', event => {});`
|
|
|
2964
3031
|
await runWrangler("publish ./index");
|
|
2965
3032
|
|
|
2966
3033
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
3034
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3035
|
+
Uploaded test-name (TIMINGS)
|
|
3036
|
+
Published test-name (TIMINGS)
|
|
3037
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3038
|
+
Current Deployment ID: undefined"
|
|
3039
|
+
`);
|
|
2972
3040
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2973
3041
|
});
|
|
2974
3042
|
|
|
@@ -2983,11 +3051,12 @@ addEventListener('fetch', event => {});`
|
|
|
2983
3051
|
await runWrangler("publish ./index");
|
|
2984
3052
|
|
|
2985
3053
|
expect(std.out).toMatchInlineSnapshot(`
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
3054
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3055
|
+
Uploaded test-name (TIMINGS)
|
|
3056
|
+
Published test-name (TIMINGS)
|
|
3057
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3058
|
+
Current Deployment ID: undefined"
|
|
3059
|
+
`);
|
|
2991
3060
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
2992
3061
|
});
|
|
2993
3062
|
|
|
@@ -3002,10 +3071,11 @@ addEventListener('fetch', event => {});`
|
|
|
3002
3071
|
await runWrangler("publish ./index");
|
|
3003
3072
|
|
|
3004
3073
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3074
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3075
|
+
Uploaded test-name (TIMINGS)
|
|
3076
|
+
No publish targets for test-name (TIMINGS)
|
|
3077
|
+
Current Deployment ID: undefined"
|
|
3078
|
+
`);
|
|
3009
3079
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3010
3080
|
});
|
|
3011
3081
|
|
|
@@ -3022,10 +3092,11 @@ addEventListener('fetch', event => {});`
|
|
|
3022
3092
|
await runWrangler("publish ./index");
|
|
3023
3093
|
|
|
3024
3094
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3095
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3096
|
+
Uploaded test-name (TIMINGS)
|
|
3097
|
+
No publish targets for test-name (TIMINGS)
|
|
3098
|
+
Current Deployment ID: undefined"
|
|
3099
|
+
`);
|
|
3029
3100
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3030
3101
|
});
|
|
3031
3102
|
|
|
@@ -3046,10 +3117,11 @@ addEventListener('fetch', event => {});`
|
|
|
3046
3117
|
await runWrangler("publish ./index --env dev --legacy-env false");
|
|
3047
3118
|
|
|
3048
3119
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3120
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3121
|
+
Uploaded test-name (dev) (TIMINGS)
|
|
3122
|
+
No publish targets for test-name (dev) (TIMINGS)
|
|
3123
|
+
Current Deployment ID: undefined"
|
|
3124
|
+
`);
|
|
3053
3125
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3054
3126
|
});
|
|
3055
3127
|
|
|
@@ -3071,10 +3143,11 @@ addEventListener('fetch', event => {});`
|
|
|
3071
3143
|
await runWrangler("publish ./index --env dev --legacy-env false");
|
|
3072
3144
|
|
|
3073
3145
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3146
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3147
|
+
Uploaded test-name (dev) (TIMINGS)
|
|
3148
|
+
No publish targets for test-name (dev) (TIMINGS)
|
|
3149
|
+
Current Deployment ID: undefined"
|
|
3150
|
+
`);
|
|
3078
3151
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3079
3152
|
});
|
|
3080
3153
|
|
|
@@ -3096,11 +3169,12 @@ addEventListener('fetch', event => {});`
|
|
|
3096
3169
|
await runWrangler("publish ./index --env dev --legacy-env false");
|
|
3097
3170
|
|
|
3098
3171
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3172
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3173
|
+
Uploaded test-name (dev) (TIMINGS)
|
|
3174
|
+
Published test-name (dev) (TIMINGS)
|
|
3175
|
+
https://dev.test-name.test-sub-domain.workers.dev
|
|
3176
|
+
Current Deployment ID: undefined"
|
|
3177
|
+
`);
|
|
3104
3178
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3105
3179
|
});
|
|
3106
3180
|
|
|
@@ -3123,11 +3197,12 @@ addEventListener('fetch', event => {});`
|
|
|
3123
3197
|
await runWrangler("publish ./index --env dev --legacy-env false");
|
|
3124
3198
|
|
|
3125
3199
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3200
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3201
|
+
Uploaded test-name (dev) (TIMINGS)
|
|
3202
|
+
Published test-name (dev) (TIMINGS)
|
|
3203
|
+
https://dev.test-name.test-sub-domain.workers.dev
|
|
3204
|
+
Current Deployment ID: undefined"
|
|
3205
|
+
`);
|
|
3131
3206
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3132
3207
|
});
|
|
3133
3208
|
|
|
@@ -3151,11 +3226,12 @@ addEventListener('fetch', event => {});`
|
|
|
3151
3226
|
await runWrangler("publish ./index --env dev --legacy-env false");
|
|
3152
3227
|
|
|
3153
3228
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3229
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3230
|
+
Uploaded test-name (dev) (TIMINGS)
|
|
3231
|
+
Published test-name (dev) (TIMINGS)
|
|
3232
|
+
https://dev.test-name.test-sub-domain.workers.dev
|
|
3233
|
+
Current Deployment ID: undefined"
|
|
3234
|
+
`);
|
|
3159
3235
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3160
3236
|
});
|
|
3161
3237
|
|
|
@@ -3182,11 +3258,12 @@ addEventListener('fetch', event => {});`
|
|
|
3182
3258
|
await runWrangler("publish ./index --env dev --legacy-env false");
|
|
3183
3259
|
|
|
3184
3260
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3261
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3262
|
+
Uploaded test-name (dev) (TIMINGS)
|
|
3263
|
+
Published test-name (dev) (TIMINGS)
|
|
3264
|
+
https://dev.test-name.test-sub-domain.workers.dev
|
|
3265
|
+
Current Deployment ID: undefined"
|
|
3266
|
+
`);
|
|
3190
3267
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3191
3268
|
});
|
|
3192
3269
|
|
|
@@ -3215,11 +3292,12 @@ addEventListener('fetch', event => {});`
|
|
|
3215
3292
|
);
|
|
3216
3293
|
|
|
3217
3294
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3295
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3296
|
+
Uploaded test-name (dev) (TIMINGS)
|
|
3297
|
+
Published test-name (dev) (TIMINGS)
|
|
3298
|
+
https://dev.test-name.test-sub-domain.workers.dev
|
|
3299
|
+
Current Deployment ID: undefined"
|
|
3300
|
+
`);
|
|
3223
3301
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3224
3302
|
});
|
|
3225
3303
|
|
|
@@ -3275,11 +3353,12 @@ addEventListener('fetch', event => {});`
|
|
|
3275
3353
|
await runWrangler("publish ./index");
|
|
3276
3354
|
|
|
3277
3355
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3356
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3357
|
+
Uploaded test-name (TIMINGS)
|
|
3358
|
+
Published test-name (TIMINGS)
|
|
3359
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3360
|
+
Current Deployment ID: undefined"
|
|
3361
|
+
`);
|
|
3283
3362
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3284
3363
|
});
|
|
3285
3364
|
|
|
@@ -3293,11 +3372,12 @@ addEventListener('fetch', event => {});`
|
|
|
3293
3372
|
await runWrangler("publish ./index");
|
|
3294
3373
|
|
|
3295
3374
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3375
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3376
|
+
Uploaded test-name (TIMINGS)
|
|
3377
|
+
Published test-name (TIMINGS)
|
|
3378
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3379
|
+
Current Deployment ID: undefined"
|
|
3380
|
+
`);
|
|
3301
3381
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3302
3382
|
});
|
|
3303
3383
|
|
|
@@ -3335,11 +3415,12 @@ addEventListener('fetch', event => {});`
|
|
|
3335
3415
|
await runWrangler("publish index.js");
|
|
3336
3416
|
|
|
3337
3417
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3418
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3419
|
+
Uploaded test-name (TIMINGS)
|
|
3420
|
+
Published test-name (TIMINGS)
|
|
3421
|
+
http://example.com/*
|
|
3422
|
+
Current Deployment ID: undefined"
|
|
3423
|
+
`);
|
|
3343
3424
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3344
3425
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3345
3426
|
});
|
|
@@ -3369,11 +3450,12 @@ addEventListener('fetch', event => {});`
|
|
|
3369
3450
|
await runWrangler("publish index.js --env production");
|
|
3370
3451
|
|
|
3371
3452
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3453
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3454
|
+
Uploaded test-name-production (TIMINGS)
|
|
3455
|
+
Published test-name-production (TIMINGS)
|
|
3456
|
+
http://production.example.com/*
|
|
3457
|
+
Current Deployment ID: undefined"
|
|
3458
|
+
`);
|
|
3377
3459
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3378
3460
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3379
3461
|
});
|
|
@@ -3402,11 +3484,12 @@ addEventListener('fetch', event => {});`
|
|
|
3402
3484
|
await runWrangler("publish index.js --env production");
|
|
3403
3485
|
|
|
3404
3486
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3487
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3488
|
+
Uploaded test-name-production (TIMINGS)
|
|
3489
|
+
Published test-name-production (TIMINGS)
|
|
3490
|
+
http://production.example.com/*
|
|
3491
|
+
Current Deployment ID: undefined"
|
|
3492
|
+
`);
|
|
3410
3493
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3411
3494
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3412
3495
|
});
|
|
@@ -3428,12 +3511,13 @@ addEventListener('fetch', event => {});`
|
|
|
3428
3511
|
await runWrangler("publish index.js");
|
|
3429
3512
|
|
|
3430
3513
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3514
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3515
|
+
Uploaded test-name (TIMINGS)
|
|
3516
|
+
Published test-name (TIMINGS)
|
|
3517
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3518
|
+
http://example.com/*
|
|
3519
|
+
Current Deployment ID: undefined"
|
|
3520
|
+
`);
|
|
3437
3521
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3438
3522
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3439
3523
|
});
|
|
@@ -3463,12 +3547,13 @@ addEventListener('fetch', event => {});`
|
|
|
3463
3547
|
await runWrangler("publish index.js --env production");
|
|
3464
3548
|
|
|
3465
3549
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3550
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3551
|
+
Uploaded test-name-production (TIMINGS)
|
|
3552
|
+
Published test-name-production (TIMINGS)
|
|
3553
|
+
https://test-name-production.test-sub-domain.workers.dev
|
|
3554
|
+
http://production.example.com/*
|
|
3555
|
+
Current Deployment ID: undefined"
|
|
3556
|
+
`);
|
|
3472
3557
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3473
3558
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3474
3559
|
});
|
|
@@ -3498,12 +3583,13 @@ addEventListener('fetch', event => {});`
|
|
|
3498
3583
|
await runWrangler("publish index.js --env production");
|
|
3499
3584
|
|
|
3500
3585
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3586
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3587
|
+
Uploaded test-name-production (TIMINGS)
|
|
3588
|
+
Published test-name-production (TIMINGS)
|
|
3589
|
+
https://test-name-production.test-sub-domain.workers.dev
|
|
3590
|
+
http://production.example.com/*
|
|
3591
|
+
Current Deployment ID: undefined"
|
|
3592
|
+
`);
|
|
3507
3593
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3508
3594
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3509
3595
|
});
|
|
@@ -3533,11 +3619,12 @@ addEventListener('fetch', event => {});`
|
|
|
3533
3619
|
await runWrangler("publish index.js --env production");
|
|
3534
3620
|
|
|
3535
3621
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3622
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3623
|
+
Uploaded test-name-production (TIMINGS)
|
|
3624
|
+
Published test-name-production (TIMINGS)
|
|
3625
|
+
http://production.example.com/*
|
|
3626
|
+
Current Deployment ID: undefined"
|
|
3627
|
+
`);
|
|
3541
3628
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3542
3629
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3543
3630
|
});
|
|
@@ -3567,11 +3654,12 @@ addEventListener('fetch', event => {});`
|
|
|
3567
3654
|
await runWrangler("publish index.js --env production");
|
|
3568
3655
|
|
|
3569
3656
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3657
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3658
|
+
Uploaded test-name-production (TIMINGS)
|
|
3659
|
+
Published test-name-production (TIMINGS)
|
|
3660
|
+
http://production.example.com/*
|
|
3661
|
+
Current Deployment ID: undefined"
|
|
3662
|
+
`);
|
|
3575
3663
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3576
3664
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3577
3665
|
});
|
|
@@ -3721,7 +3809,8 @@ addEventListener('fetch', event => {});`
|
|
|
3721
3809
|
Total Upload: xx KiB / gzip: xx KiB
|
|
3722
3810
|
Uploaded test-name (TIMINGS)
|
|
3723
3811
|
Published test-name (TIMINGS)
|
|
3724
|
-
https://test-name.test-sub-domain.workers.dev
|
|
3812
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3813
|
+
Current Deployment ID: undefined"
|
|
3725
3814
|
`);
|
|
3726
3815
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3727
3816
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -3742,12 +3831,13 @@ addEventListener('fetch', event => {});`
|
|
|
3742
3831
|
|
|
3743
3832
|
await runWrangler("publish index.js");
|
|
3744
3833
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3834
|
+
"Running custom build: echo \\"custom build\\" && echo \\"export default { fetch(){ return new Response(123) } }\\" > index.js
|
|
3835
|
+
Total Upload: xx KiB / gzip: xx KiB
|
|
3836
|
+
Uploaded test-name (TIMINGS)
|
|
3837
|
+
Published test-name (TIMINGS)
|
|
3838
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3839
|
+
Current Deployment ID: undefined"
|
|
3840
|
+
`);
|
|
3751
3841
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3752
3842
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
3753
3843
|
});
|
|
@@ -3849,11 +3939,12 @@ addEventListener('fetch', event => {});`
|
|
|
3849
3939
|
mockSubDomainRequest();
|
|
3850
3940
|
await runWrangler("publish index.js --minify");
|
|
3851
3941
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3942
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3943
|
+
Uploaded test-name (TIMINGS)
|
|
3944
|
+
Published test-name (TIMINGS)
|
|
3945
|
+
https://test-name.test-sub-domain.workers.dev
|
|
3946
|
+
Current Deployment ID: undefined"
|
|
3947
|
+
`);
|
|
3857
3948
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3858
3949
|
});
|
|
3859
3950
|
|
|
@@ -3888,11 +3979,12 @@ addEventListener('fetch', event => {});`
|
|
|
3888
3979
|
mockSubDomainRequest();
|
|
3889
3980
|
await runWrangler("publish -e testEnv index.js");
|
|
3890
3981
|
expect(std.out).toMatchInlineSnapshot(`
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3982
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
3983
|
+
Uploaded test-name (testEnv) (TIMINGS)
|
|
3984
|
+
Published test-name (testEnv) (TIMINGS)
|
|
3985
|
+
https://testEnv.test-name.test-sub-domain.workers.dev
|
|
3986
|
+
Current Deployment ID: undefined"
|
|
3987
|
+
`);
|
|
3896
3988
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3897
3989
|
});
|
|
3898
3990
|
});
|
|
@@ -3918,7 +4010,8 @@ addEventListener('fetch', event => {});`
|
|
|
3918
4010
|
- SOMENAME: SomeClass
|
|
3919
4011
|
Uploaded test-name (TIMINGS)
|
|
3920
4012
|
Published test-name (TIMINGS)
|
|
3921
|
-
https://test-name.test-sub-domain.workers.dev
|
|
4013
|
+
https://test-name.test-sub-domain.workers.dev
|
|
4014
|
+
Current Deployment ID: undefined"
|
|
3922
4015
|
`);
|
|
3923
4016
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3924
4017
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
@@ -3968,7 +4061,8 @@ addEventListener('fetch', event => {});`
|
|
|
3968
4061
|
- SOMENAME: SomeClass (defined in some-script)
|
|
3969
4062
|
Uploaded test-name (TIMINGS)
|
|
3970
4063
|
Published test-name (TIMINGS)
|
|
3971
|
-
https://test-name.test-sub-domain.workers.dev
|
|
4064
|
+
https://test-name.test-sub-domain.workers.dev
|
|
4065
|
+
Current Deployment ID: undefined"
|
|
3972
4066
|
`);
|
|
3973
4067
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
3974
4068
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -4012,7 +4106,8 @@ addEventListener('fetch', event => {});`
|
|
|
4012
4106
|
- SOMEOTHERNAME: SomeOtherClass
|
|
4013
4107
|
Uploaded test-name (TIMINGS)
|
|
4014
4108
|
Published test-name (TIMINGS)
|
|
4015
|
-
https://test-name.test-sub-domain.workers.dev
|
|
4109
|
+
https://test-name.test-sub-domain.workers.dev
|
|
4110
|
+
Current Deployment ID: undefined"
|
|
4016
4111
|
`);
|
|
4017
4112
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
4018
4113
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -4063,7 +4158,8 @@ addEventListener('fetch', event => {});`
|
|
|
4063
4158
|
- SOMEOTHERNAME: SomeOtherClass
|
|
4064
4159
|
Uploaded test-name (TIMINGS)
|
|
4065
4160
|
Published test-name (TIMINGS)
|
|
4066
|
-
https://test-name.test-sub-domain.workers.dev
|
|
4161
|
+
https://test-name.test-sub-domain.workers.dev
|
|
4162
|
+
Current Deployment ID: undefined",
|
|
4067
4163
|
"warn": "",
|
|
4068
4164
|
}
|
|
4069
4165
|
`);
|
|
@@ -4107,7 +4203,8 @@ addEventListener('fetch', event => {});`
|
|
|
4107
4203
|
- SOMEOTHERNAME: SomeOtherClass
|
|
4108
4204
|
Uploaded test-name (TIMINGS)
|
|
4109
4205
|
Published test-name (TIMINGS)
|
|
4110
|
-
https://test-name.test-sub-domain.workers.dev
|
|
4206
|
+
https://test-name.test-sub-domain.workers.dev
|
|
4207
|
+
Current Deployment ID: undefined",
|
|
4111
4208
|
"warn": "",
|
|
4112
4209
|
}
|
|
4113
4210
|
`);
|
|
@@ -4153,7 +4250,8 @@ addEventListener('fetch', event => {});`
|
|
|
4153
4250
|
- SOMEOTHERNAME: SomeOtherClass
|
|
4154
4251
|
Uploaded test-name (TIMINGS)
|
|
4155
4252
|
Published test-name (TIMINGS)
|
|
4156
|
-
https://test-name.test-sub-domain.workers.dev
|
|
4253
|
+
https://test-name.test-sub-domain.workers.dev
|
|
4254
|
+
Current Deployment ID: undefined"
|
|
4157
4255
|
`);
|
|
4158
4256
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
4159
4257
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
@@ -4216,7 +4314,8 @@ addEventListener('fetch', event => {});`
|
|
|
4216
4314
|
- SOMEOTHERNAME: SomeOtherClass
|
|
4217
4315
|
Uploaded test-name (xyz) (TIMINGS)
|
|
4218
4316
|
Published test-name (xyz) (TIMINGS)
|
|
4219
|
-
https://xyz.test-name.test-sub-domain.workers.dev
|
|
4317
|
+
https://xyz.test-name.test-sub-domain.workers.dev
|
|
4318
|
+
Current Deployment ID: undefined"
|
|
4220
4319
|
`);
|
|
4221
4320
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
4222
4321
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
@@ -4263,6 +4362,12 @@ addEventListener('fetch', event => {});`
|
|
|
4263
4362
|
],
|
|
4264
4363
|
},
|
|
4265
4364
|
});
|
|
4365
|
+
setMockResponse(
|
|
4366
|
+
"/accounts/:accountId/workers/versions/by-script/:scriptTag",
|
|
4367
|
+
() => ({
|
|
4368
|
+
latest: { number: "2" },
|
|
4369
|
+
})
|
|
4370
|
+
);
|
|
4266
4371
|
|
|
4267
4372
|
await runWrangler("publish index.js --legacy-env false");
|
|
4268
4373
|
expect(std).toMatchInlineSnapshot(`
|
|
@@ -4276,7 +4381,8 @@ addEventListener('fetch', event => {});`
|
|
|
4276
4381
|
- SOMEOTHERNAME: SomeOtherClass
|
|
4277
4382
|
Uploaded test-name (TIMINGS)
|
|
4278
4383
|
Published test-name (TIMINGS)
|
|
4279
|
-
https://test-name.test-sub-domain.workers.dev
|
|
4384
|
+
https://test-name.test-sub-domain.workers.dev
|
|
4385
|
+
Current Deployment ID: undefined",
|
|
4280
4386
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
4281
4387
|
|
|
4282
4388
|
- Experimental: Service environments are in beta, and their behaviour is guaranteed to change in
|
|
@@ -4345,7 +4451,8 @@ addEventListener('fetch', event => {});`
|
|
|
4345
4451
|
- SOMEOTHERNAME: SomeOtherClass
|
|
4346
4452
|
Uploaded test-name (xyz) (TIMINGS)
|
|
4347
4453
|
Published test-name (xyz) (TIMINGS)
|
|
4348
|
-
https://xyz.test-name.test-sub-domain.workers.dev
|
|
4454
|
+
https://xyz.test-name.test-sub-domain.workers.dev
|
|
4455
|
+
Current Deployment ID: undefined",
|
|
4349
4456
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
4350
4457
|
|
|
4351
4458
|
- Experimental: Service environments are in beta, and their behaviour is guaranteed to change in
|
|
@@ -4563,7 +4670,8 @@ addEventListener('fetch', event => {});`
|
|
|
4563
4670
|
- WASM_MODULE_TWO: more_wasm.wasm
|
|
4564
4671
|
Uploaded test-name (TIMINGS)
|
|
4565
4672
|
Published test-name (TIMINGS)
|
|
4566
|
-
https://test-name.test-sub-domain.workers.dev
|
|
4673
|
+
https://test-name.test-sub-domain.workers.dev
|
|
4674
|
+
Current Deployment ID: undefined"
|
|
4567
4675
|
`);
|
|
4568
4676
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
4569
4677
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
@@ -4943,7 +5051,8 @@ addEventListener('fetch', event => {});`
|
|
|
4943
5051
|
- TESTWASMNAME: path/to/test.wasm
|
|
4944
5052
|
Uploaded test-name (TIMINGS)
|
|
4945
5053
|
Published test-name (TIMINGS)
|
|
4946
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5054
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5055
|
+
Current Deployment ID: undefined"
|
|
4947
5056
|
`);
|
|
4948
5057
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
4949
5058
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5013,7 +5122,8 @@ addEventListener('fetch', event => {});`
|
|
|
5013
5122
|
- TESTWASMNAME: path/to/and/the/path/to/test.wasm
|
|
5014
5123
|
Uploaded test-name (TIMINGS)
|
|
5015
5124
|
Published test-name (TIMINGS)
|
|
5016
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5125
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5126
|
+
Current Deployment ID: undefined"
|
|
5017
5127
|
`);
|
|
5018
5128
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5019
5129
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5043,11 +5153,12 @@ addEventListener('fetch', event => {});`
|
|
|
5043
5153
|
mockSubDomainRequest();
|
|
5044
5154
|
await runWrangler("publish index.js");
|
|
5045
5155
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5156
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
5157
|
+
Uploaded test-name (TIMINGS)
|
|
5158
|
+
Published test-name (TIMINGS)
|
|
5159
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5160
|
+
Current Deployment ID: undefined"
|
|
5161
|
+
`);
|
|
5051
5162
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5052
5163
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
5053
5164
|
});
|
|
@@ -5083,7 +5194,8 @@ addEventListener('fetch', event => {});`
|
|
|
5083
5194
|
- TESTTEXTBLOBNAME: path/to/text.file
|
|
5084
5195
|
Uploaded test-name (TIMINGS)
|
|
5085
5196
|
Published test-name (TIMINGS)
|
|
5086
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5197
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5198
|
+
Current Deployment ID: undefined"
|
|
5087
5199
|
`);
|
|
5088
5200
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5089
5201
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5157,7 +5269,8 @@ addEventListener('fetch', event => {});`
|
|
|
5157
5269
|
- TESTTEXTBLOBNAME: path/to/and/the/path/to/text.file
|
|
5158
5270
|
Uploaded test-name (TIMINGS)
|
|
5159
5271
|
Published test-name (TIMINGS)
|
|
5160
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5272
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5273
|
+
Current Deployment ID: undefined"
|
|
5161
5274
|
`);
|
|
5162
5275
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5163
5276
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5194,7 +5307,8 @@ addEventListener('fetch', event => {});`
|
|
|
5194
5307
|
- TESTDATABLOBNAME: path/to/data.bin
|
|
5195
5308
|
Uploaded test-name (TIMINGS)
|
|
5196
5309
|
Published test-name (TIMINGS)
|
|
5197
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5310
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5311
|
+
Current Deployment ID: undefined"
|
|
5198
5312
|
`);
|
|
5199
5313
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5200
5314
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5268,7 +5382,8 @@ addEventListener('fetch', event => {});`
|
|
|
5268
5382
|
- TESTDATABLOBNAME: path/to/and/the/path/to/data.bin
|
|
5269
5383
|
Uploaded test-name (TIMINGS)
|
|
5270
5384
|
Published test-name (TIMINGS)
|
|
5271
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5385
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5386
|
+
Current Deployment ID: undefined"
|
|
5272
5387
|
`);
|
|
5273
5388
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5274
5389
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5311,7 +5426,8 @@ addEventListener('fetch', event => {});`
|
|
|
5311
5426
|
}
|
|
5312
5427
|
Uploaded test-name (TIMINGS)
|
|
5313
5428
|
Published test-name (TIMINGS)
|
|
5314
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5429
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5430
|
+
Current Deployment ID: undefined"
|
|
5315
5431
|
`);
|
|
5316
5432
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5317
5433
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5334,7 +5450,8 @@ addEventListener('fetch', event => {});`
|
|
|
5334
5450
|
- COUNT: \\"(hidden)\\"
|
|
5335
5451
|
Uploaded test-name (TIMINGS)
|
|
5336
5452
|
Published test-name (TIMINGS)
|
|
5337
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5453
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5454
|
+
Current Deployment ID: undefined",
|
|
5338
5455
|
"warn": "",
|
|
5339
5456
|
}
|
|
5340
5457
|
`);
|
|
@@ -5362,7 +5479,8 @@ addEventListener('fetch', event => {});`
|
|
|
5362
5479
|
- FOO: foo-bucket
|
|
5363
5480
|
Uploaded test-name (TIMINGS)
|
|
5364
5481
|
Published test-name (TIMINGS)
|
|
5365
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5482
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5483
|
+
Current Deployment ID: undefined"
|
|
5366
5484
|
`);
|
|
5367
5485
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5368
5486
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5414,7 +5532,8 @@ addEventListener('fetch', event => {});`
|
|
|
5414
5532
|
- trace: trace
|
|
5415
5533
|
Uploaded test-name (TIMINGS)
|
|
5416
5534
|
Published test-name (TIMINGS)
|
|
5417
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5535
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5536
|
+
Current Deployment ID: undefined"
|
|
5418
5537
|
`);
|
|
5419
5538
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5420
5539
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5460,7 +5579,8 @@ addEventListener('fetch', event => {});`
|
|
|
5460
5579
|
- EXAMPLE_DO_BINDING: ExampleDurableObject
|
|
5461
5580
|
Uploaded test-name (TIMINGS)
|
|
5462
5581
|
Published test-name (TIMINGS)
|
|
5463
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5582
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5583
|
+
Current Deployment ID: undefined"
|
|
5464
5584
|
`);
|
|
5465
5585
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5466
5586
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5500,7 +5620,8 @@ addEventListener('fetch', event => {});`
|
|
|
5500
5620
|
- EXAMPLE_DO_BINDING: ExampleDurableObject (defined in example-do-binding-worker)
|
|
5501
5621
|
Uploaded test-name (TIMINGS)
|
|
5502
5622
|
Published test-name (TIMINGS)
|
|
5503
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5623
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5624
|
+
Current Deployment ID: undefined"
|
|
5504
5625
|
`);
|
|
5505
5626
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5506
5627
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5545,7 +5666,8 @@ addEventListener('fetch', event => {});`
|
|
|
5545
5666
|
- EXAMPLE_DO_BINDING: ExampleDurableObject
|
|
5546
5667
|
Uploaded test-name (TIMINGS)
|
|
5547
5668
|
Published test-name (TIMINGS)
|
|
5548
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5669
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5670
|
+
Current Deployment ID: undefined"
|
|
5549
5671
|
`);
|
|
5550
5672
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5551
5673
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
@@ -5608,7 +5730,8 @@ addEventListener('fetch', event => {});`
|
|
|
5608
5730
|
- FOO: foo-service - production
|
|
5609
5731
|
Uploaded test-name (TIMINGS)
|
|
5610
5732
|
Published test-name (TIMINGS)
|
|
5611
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5733
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5734
|
+
Current Deployment ID: undefined"
|
|
5612
5735
|
`);
|
|
5613
5736
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5614
5737
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
@@ -5650,7 +5773,8 @@ addEventListener('fetch', event => {});`
|
|
|
5650
5773
|
- foo: Foo
|
|
5651
5774
|
Uploaded test-name (TIMINGS)
|
|
5652
5775
|
Published test-name (TIMINGS)
|
|
5653
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5776
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5777
|
+
Current Deployment ID: undefined"
|
|
5654
5778
|
`);
|
|
5655
5779
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5656
5780
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
@@ -5696,7 +5820,8 @@ addEventListener('fetch', event => {});`
|
|
|
5696
5820
|
- binding-type: my-binding
|
|
5697
5821
|
Uploaded test-name (TIMINGS)
|
|
5698
5822
|
Published test-name (TIMINGS)
|
|
5699
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5823
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5824
|
+
Current Deployment ID: undefined"
|
|
5700
5825
|
`);
|
|
5701
5826
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5702
5827
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
@@ -5739,7 +5864,8 @@ addEventListener('fetch', event => {});`
|
|
|
5739
5864
|
- plain_text: my-binding
|
|
5740
5865
|
Uploaded test-name (TIMINGS)
|
|
5741
5866
|
Published test-name (TIMINGS)
|
|
5742
|
-
https://test-name.test-sub-domain.workers.dev
|
|
5867
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5868
|
+
Current Deployment ID: undefined"
|
|
5743
5869
|
`);
|
|
5744
5870
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5745
5871
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
@@ -5782,11 +5908,12 @@ addEventListener('fetch', event => {});`
|
|
|
5782
5908
|
});
|
|
5783
5909
|
await runWrangler("publish index.js");
|
|
5784
5910
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5911
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
5912
|
+
Uploaded test-name (TIMINGS)
|
|
5913
|
+
Published test-name (TIMINGS)
|
|
5914
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5915
|
+
Current Deployment ID: undefined"
|
|
5916
|
+
`);
|
|
5790
5917
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5791
5918
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
5792
5919
|
});
|
|
@@ -5811,11 +5938,12 @@ addEventListener('fetch', event => {});`
|
|
|
5811
5938
|
});
|
|
5812
5939
|
await runWrangler("publish index.js");
|
|
5813
5940
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5941
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
5942
|
+
Uploaded test-name (TIMINGS)
|
|
5943
|
+
Published test-name (TIMINGS)
|
|
5944
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5945
|
+
Current Deployment ID: undefined"
|
|
5946
|
+
`);
|
|
5819
5947
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5820
5948
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
5821
5949
|
});
|
|
@@ -5844,11 +5972,12 @@ addEventListener('fetch', event => {});`
|
|
|
5844
5972
|
});
|
|
5845
5973
|
await runWrangler("publish index.js");
|
|
5846
5974
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5975
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
5976
|
+
Uploaded test-name (TIMINGS)
|
|
5977
|
+
Published test-name (TIMINGS)
|
|
5978
|
+
https://test-name.test-sub-domain.workers.dev
|
|
5979
|
+
Current Deployment ID: undefined"
|
|
5980
|
+
`);
|
|
5852
5981
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5853
5982
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
5854
5983
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -5893,11 +6022,12 @@ addEventListener('fetch', event => {});`
|
|
|
5893
6022
|
});
|
|
5894
6023
|
await runWrangler("publish index.js");
|
|
5895
6024
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
6025
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
6026
|
+
Uploaded test-name (TIMINGS)
|
|
6027
|
+
Published test-name (TIMINGS)
|
|
6028
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6029
|
+
Current Deployment ID: undefined"
|
|
6030
|
+
`);
|
|
5901
6031
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5902
6032
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
5903
6033
|
});
|
|
@@ -5990,11 +6120,12 @@ addEventListener('fetch', event => {});`
|
|
|
5990
6120
|
});
|
|
5991
6121
|
await runWrangler("publish index.js");
|
|
5992
6122
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
6123
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
6124
|
+
Uploaded test-name (TIMINGS)
|
|
6125
|
+
Published test-name (TIMINGS)
|
|
6126
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6127
|
+
Current Deployment ID: undefined"
|
|
6128
|
+
`);
|
|
5998
6129
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
5999
6130
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
6000
6131
|
});
|
|
@@ -6020,11 +6151,12 @@ addEventListener('fetch', event => {});`
|
|
|
6020
6151
|
});
|
|
6021
6152
|
await runWrangler("publish index.js");
|
|
6022
6153
|
expect(std.out).toMatchInlineSnapshot(`
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6154
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
6155
|
+
Uploaded test-name (TIMINGS)
|
|
6156
|
+
Published test-name (TIMINGS)
|
|
6157
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6158
|
+
Current Deployment ID: undefined"
|
|
6159
|
+
`);
|
|
6028
6160
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
6029
6161
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
6030
6162
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mDeprecation: detected a legacy module import in \\"./index.js\\". This will stop working in the future. Replace references to \\"text.file\\" with \\"./text.file\\";[0m
|
|
@@ -6049,11 +6181,12 @@ addEventListener('fetch', event => {});`
|
|
|
6049
6181
|
});
|
|
6050
6182
|
await runWrangler("publish index.js");
|
|
6051
6183
|
expect(std.out).toMatchInlineSnapshot(`
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6184
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
6185
|
+
Uploaded test-name (TIMINGS)
|
|
6186
|
+
Published test-name (TIMINGS)
|
|
6187
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6188
|
+
Current Deployment ID: undefined"
|
|
6189
|
+
`);
|
|
6057
6190
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
6058
6191
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
6059
6192
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mDeprecation: detected a legacy module import in \\"./index.js\\". This will stop working in the future. Replace references to \\"index.wasm\\" with \\"./index.wasm\\";[0m
|
|
@@ -6080,11 +6213,12 @@ addEventListener('fetch', event => {});`
|
|
|
6080
6213
|
});
|
|
6081
6214
|
await runWrangler("publish index.js");
|
|
6082
6215
|
expect(std.out).toMatchInlineSnapshot(`
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6216
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
6217
|
+
Uploaded test-name (TIMINGS)
|
|
6218
|
+
Published test-name (TIMINGS)
|
|
6219
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6220
|
+
Current Deployment ID: undefined"
|
|
6221
|
+
`);
|
|
6088
6222
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
6089
6223
|
expect(std.warn).toMatchInlineSnapshot(`
|
|
6090
6224
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mDeprecation: detected a legacy module import in \\"./index.js\\". This will stop working in the future. Replace references to \\"text+name.file\\" with \\"./text+name.file\\";[0m
|
|
@@ -6109,11 +6243,12 @@ addEventListener('fetch', event => {});`
|
|
|
6109
6243
|
"publish index.js --compatibility-date 2022-03-17 --name test-name"
|
|
6110
6244
|
);
|
|
6111
6245
|
expect(std.out).toMatchInlineSnapshot(`
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6246
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
6247
|
+
Uploaded test-name (TIMINGS)
|
|
6248
|
+
Published test-name (TIMINGS)
|
|
6249
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6250
|
+
Current Deployment ID: undefined"
|
|
6251
|
+
`);
|
|
6117
6252
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
6118
6253
|
expect(std.warn).toMatchInlineSnapshot(`""`);
|
|
6119
6254
|
});
|
|
@@ -6147,16 +6282,17 @@ addEventListener('fetch', event => {});`
|
|
|
6147
6282
|
});
|
|
6148
6283
|
await runWrangler("publish index.ts");
|
|
6149
6284
|
expect(std).toMatchInlineSnapshot(`
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6285
|
+
Object {
|
|
6286
|
+
"debug": "",
|
|
6287
|
+
"err": "",
|
|
6288
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
6289
|
+
Uploaded test-name (TIMINGS)
|
|
6290
|
+
Published test-name (TIMINGS)
|
|
6291
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6292
|
+
Current Deployment ID: undefined",
|
|
6293
|
+
"warn": "",
|
|
6294
|
+
}
|
|
6295
|
+
`);
|
|
6160
6296
|
});
|
|
6161
6297
|
|
|
6162
6298
|
it("should output to target es2020 even if tsconfig says otherwise", async () => {
|
|
@@ -6177,16 +6313,17 @@ addEventListener('fetch', event => {});`
|
|
|
6177
6313
|
});
|
|
6178
6314
|
await runWrangler("publish index.js"); // this would throw if we tried to compile with es5
|
|
6179
6315
|
expect(std).toMatchInlineSnapshot(`
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6316
|
+
Object {
|
|
6317
|
+
"debug": "",
|
|
6318
|
+
"err": "",
|
|
6319
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
6320
|
+
Uploaded test-name (TIMINGS)
|
|
6321
|
+
Published test-name (TIMINGS)
|
|
6322
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6323
|
+
Current Deployment ID: undefined",
|
|
6324
|
+
"warn": "",
|
|
6325
|
+
}
|
|
6326
|
+
`);
|
|
6190
6327
|
});
|
|
6191
6328
|
});
|
|
6192
6329
|
|
|
@@ -6200,16 +6337,17 @@ addEventListener('fetch', event => {});`
|
|
|
6200
6337
|
expect(fs.existsSync("some-dir/index.js")).toBe(true);
|
|
6201
6338
|
expect(fs.existsSync("some-dir/index.js.map")).toBe(true);
|
|
6202
6339
|
expect(std).toMatchInlineSnapshot(`
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6340
|
+
Object {
|
|
6341
|
+
"debug": "",
|
|
6342
|
+
"err": "",
|
|
6343
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
6344
|
+
Uploaded test-name (TIMINGS)
|
|
6345
|
+
Published test-name (TIMINGS)
|
|
6346
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6347
|
+
Current Deployment ID: undefined",
|
|
6348
|
+
"warn": "",
|
|
6349
|
+
}
|
|
6350
|
+
`);
|
|
6213
6351
|
});
|
|
6214
6352
|
});
|
|
6215
6353
|
|
|
@@ -6269,14 +6407,16 @@ addEventListener('fetch', event => {});`
|
|
|
6269
6407
|
export default {}
|
|
6270
6408
|
`
|
|
6271
6409
|
);
|
|
6272
|
-
let err:
|
|
6410
|
+
let err: esbuild.BuildFailure | undefined;
|
|
6273
6411
|
try {
|
|
6274
6412
|
await runWrangler("publish index.js --dry-run"); // expecting this to throw, as node compatibility isn't enabled
|
|
6275
6413
|
} catch (e) {
|
|
6276
|
-
err = e as
|
|
6414
|
+
err = e as esbuild.BuildFailure;
|
|
6277
6415
|
}
|
|
6278
|
-
expect(
|
|
6279
|
-
|
|
6416
|
+
expect(
|
|
6417
|
+
esbuild.formatMessagesSync(err?.errors ?? [], { kind: "error" }).join()
|
|
6418
|
+
).toMatch(
|
|
6419
|
+
/The package "path" wasn't found on the file system but is built into node\.\s+Add "node_compat = true" to your wrangler\.toml file to enable Node compatibility\./
|
|
6280
6420
|
);
|
|
6281
6421
|
});
|
|
6282
6422
|
|
|
@@ -6342,16 +6482,17 @@ addEventListener('fetch', event => {});`
|
|
|
6342
6482
|
mockUploadWorkerRequest();
|
|
6343
6483
|
await runWrangler("publish");
|
|
6344
6484
|
expect(std).toMatchInlineSnapshot(`
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6485
|
+
Object {
|
|
6486
|
+
"debug": "",
|
|
6487
|
+
"err": "",
|
|
6488
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
6489
|
+
Uploaded test-name (TIMINGS)
|
|
6490
|
+
Published test-name (TIMINGS)
|
|
6491
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6492
|
+
Current Deployment ID: undefined",
|
|
6493
|
+
"warn": "",
|
|
6494
|
+
}
|
|
6495
|
+
`);
|
|
6355
6496
|
});
|
|
6356
6497
|
|
|
6357
6498
|
it("should print the bundle size, with API errors", async () => {
|
|
@@ -6415,6 +6556,200 @@ addEventListener('fetch', event => {});`
|
|
|
6415
6556
|
}
|
|
6416
6557
|
`);
|
|
6417
6558
|
});
|
|
6559
|
+
|
|
6560
|
+
test("should check biggest dependencies when upload fails with script size error", async () => {
|
|
6561
|
+
fs.writeFileSync("dependency.js", `export const thing = "a string dep";`);
|
|
6562
|
+
|
|
6563
|
+
fs.writeFileSync(
|
|
6564
|
+
"index.js",
|
|
6565
|
+
`import { thing } from "./dependency";
|
|
6566
|
+
|
|
6567
|
+
export default {
|
|
6568
|
+
async fetch() {
|
|
6569
|
+
return new Response('response plus ' + thing);
|
|
6570
|
+
}
|
|
6571
|
+
}`
|
|
6572
|
+
);
|
|
6573
|
+
setMockRawResponse(
|
|
6574
|
+
"/accounts/:accountId/workers/scripts/:scriptName",
|
|
6575
|
+
"PUT",
|
|
6576
|
+
() => {
|
|
6577
|
+
return createFetchResult({}, false, [
|
|
6578
|
+
{ code: 10027, message: "workers.api.error.script_too_large" },
|
|
6579
|
+
]);
|
|
6580
|
+
}
|
|
6581
|
+
);
|
|
6582
|
+
writeWranglerToml({
|
|
6583
|
+
main: "index.js",
|
|
6584
|
+
});
|
|
6585
|
+
mockSubDomainRequest();
|
|
6586
|
+
mockUploadWorkerRequest();
|
|
6587
|
+
await expect(runWrangler("publish")).rejects.toMatchInlineSnapshot(
|
|
6588
|
+
`[ParseError: A request to the Cloudflare API (/accounts/some-account-id/workers/scripts/test-name) failed.]`
|
|
6589
|
+
);
|
|
6590
|
+
expect(std).toMatchInlineSnapshot(`
|
|
6591
|
+
Object {
|
|
6592
|
+
"debug": "",
|
|
6593
|
+
"err": "",
|
|
6594
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
6595
|
+
|
|
6596
|
+
[31mX [41;31m[[41;97mERROR[41;31m][0m [1mA request to the Cloudflare API (/accounts/some-account-id/workers/scripts/test-name) failed.[0m
|
|
6597
|
+
|
|
6598
|
+
workers.api.error.script_too_large [code: 10027]
|
|
6599
|
+
|
|
6600
|
+
If you think this is a bug, please open an issue at:
|
|
6601
|
+
[4mhttps://github.com/cloudflare/wrangler2/issues/new/choose[0m
|
|
6602
|
+
|
|
6603
|
+
",
|
|
6604
|
+
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mHere are the 2 largest dependencies included in your script:[0m
|
|
6605
|
+
|
|
6606
|
+
- index.js - xx KiB
|
|
6607
|
+
- dependency.js - xx KiB
|
|
6608
|
+
If these are unnecessary, consider removing them
|
|
6609
|
+
|
|
6610
|
+
",
|
|
6611
|
+
}
|
|
6612
|
+
`);
|
|
6613
|
+
});
|
|
6614
|
+
|
|
6615
|
+
test("should check biggest dependencies when upload fails with script startup error", async () => {
|
|
6616
|
+
fs.writeFileSync("dependency.js", `export const thing = "a string dep";`);
|
|
6617
|
+
|
|
6618
|
+
fs.writeFileSync(
|
|
6619
|
+
"index.js",
|
|
6620
|
+
`import { thing } from "./dependency";
|
|
6621
|
+
|
|
6622
|
+
export default {
|
|
6623
|
+
async fetch() {
|
|
6624
|
+
return new Response('response plus ' + thing);
|
|
6625
|
+
}
|
|
6626
|
+
}`
|
|
6627
|
+
);
|
|
6628
|
+
setMockRawResponse(
|
|
6629
|
+
"/accounts/:accountId/workers/scripts/:scriptName",
|
|
6630
|
+
"PUT",
|
|
6631
|
+
() => {
|
|
6632
|
+
return createFetchResult({}, false, [
|
|
6633
|
+
{
|
|
6634
|
+
code: 10021,
|
|
6635
|
+
message: "Error: Script startup exceeded CPU time limit.",
|
|
6636
|
+
},
|
|
6637
|
+
]);
|
|
6638
|
+
}
|
|
6639
|
+
);
|
|
6640
|
+
writeWranglerToml({
|
|
6641
|
+
main: "index.js",
|
|
6642
|
+
});
|
|
6643
|
+
mockSubDomainRequest();
|
|
6644
|
+
mockUploadWorkerRequest();
|
|
6645
|
+
await expect(runWrangler("publish")).rejects.toMatchInlineSnapshot(
|
|
6646
|
+
`[ParseError: A request to the Cloudflare API (/accounts/some-account-id/workers/scripts/test-name) failed.]`
|
|
6647
|
+
);
|
|
6648
|
+
expect(std).toMatchInlineSnapshot(`
|
|
6649
|
+
Object {
|
|
6650
|
+
"debug": "",
|
|
6651
|
+
"err": "",
|
|
6652
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
6653
|
+
|
|
6654
|
+
[31mX [41;31m[[41;97mERROR[41;31m][0m [1mA request to the Cloudflare API (/accounts/some-account-id/workers/scripts/test-name) failed.[0m
|
|
6655
|
+
|
|
6656
|
+
Error: Script startup exceeded CPU time limit. [code: 10021]
|
|
6657
|
+
|
|
6658
|
+
If you think this is a bug, please open an issue at:
|
|
6659
|
+
[4mhttps://github.com/cloudflare/wrangler2/issues/new/choose[0m
|
|
6660
|
+
|
|
6661
|
+
",
|
|
6662
|
+
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mHere are the 2 largest dependencies included in your script:[0m
|
|
6663
|
+
|
|
6664
|
+
- index.js - xx KiB
|
|
6665
|
+
- dependency.js - xx KiB
|
|
6666
|
+
If these are unnecessary, consider removing them
|
|
6667
|
+
|
|
6668
|
+
",
|
|
6669
|
+
}
|
|
6670
|
+
`);
|
|
6671
|
+
});
|
|
6672
|
+
|
|
6673
|
+
describe("unit tests", () => {
|
|
6674
|
+
// keeping these as unit tests to try and keep them snappy, as they often deal with
|
|
6675
|
+
// big files that would take a while to deal with in a full wrangler test
|
|
6676
|
+
|
|
6677
|
+
test("should print the bundle size and warn about large scripts when > 1MiB", async () => {
|
|
6678
|
+
const bigModule = Buffer.alloc(10_000_000);
|
|
6679
|
+
randomFillSync(bigModule);
|
|
6680
|
+
await printBundleSize({ name: "index.js", content: "" }, [
|
|
6681
|
+
{ name: "index.js", content: bigModule, type: "buffer" },
|
|
6682
|
+
]);
|
|
6683
|
+
|
|
6684
|
+
expect(std).toMatchInlineSnapshot(`
|
|
6685
|
+
Object {
|
|
6686
|
+
"debug": "",
|
|
6687
|
+
"err": "",
|
|
6688
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB",
|
|
6689
|
+
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mWe recommend keeping your script less than 1MiB (1024 KiB) after gzip. Exceeding past this can affect cold start time[0m
|
|
6690
|
+
|
|
6691
|
+
",
|
|
6692
|
+
}
|
|
6693
|
+
`);
|
|
6694
|
+
});
|
|
6695
|
+
|
|
6696
|
+
test("should not warn about bundle sizes when NO_SCRIPT_SIZE_WARNING is set", async () => {
|
|
6697
|
+
const previousValue = process.env.NO_SCRIPT_SIZE_WARNING;
|
|
6698
|
+
process.env.NO_SCRIPT_SIZE_WARNING = "true";
|
|
6699
|
+
|
|
6700
|
+
const bigModule = Buffer.alloc(10_000_000);
|
|
6701
|
+
randomFillSync(bigModule);
|
|
6702
|
+
await printBundleSize({ name: "index.js", content: "" }, [
|
|
6703
|
+
{ name: "index.js", content: bigModule, type: "buffer" },
|
|
6704
|
+
]);
|
|
6705
|
+
|
|
6706
|
+
expect(std).toMatchInlineSnapshot(`
|
|
6707
|
+
Object {
|
|
6708
|
+
"debug": "",
|
|
6709
|
+
"err": "",
|
|
6710
|
+
"out": "Total Upload: xx KiB / gzip: xx KiB",
|
|
6711
|
+
"warn": "",
|
|
6712
|
+
}
|
|
6713
|
+
`);
|
|
6714
|
+
|
|
6715
|
+
process.env.NO_SCRIPT_SIZE_WARNING = previousValue;
|
|
6716
|
+
});
|
|
6717
|
+
|
|
6718
|
+
test("should print the top biggest dependencies in the bundle when upload fails", () => {
|
|
6719
|
+
const deps = {
|
|
6720
|
+
"node_modules/a-mod/module.js": { bytesInOutput: 450 },
|
|
6721
|
+
"node_modules/b-mod/module.js": { bytesInOutput: 10 },
|
|
6722
|
+
"node_modules/c-mod/module.js": { bytesInOutput: 200 },
|
|
6723
|
+
"node_modules/d-mod/module.js": { bytesInOutput: 2111200 }, // 1
|
|
6724
|
+
"node_modules/e-mod/module.js": { bytesInOutput: 8209 }, // 3
|
|
6725
|
+
"node_modules/f-mod/module.js": { bytesInOutput: 770 },
|
|
6726
|
+
"node_modules/g-mod/module.js": { bytesInOutput: 78902 }, // 2
|
|
6727
|
+
"node_modules/h-mod/module.js": { bytesInOutput: 899 },
|
|
6728
|
+
"node_modules/i-mod/module.js": { bytesInOutput: 2001 }, // 4
|
|
6729
|
+
"node_modules/j-mod/module.js": { bytesInOutput: 900 }, // 5
|
|
6730
|
+
"node_modules/k-mod/module.js": { bytesInOutput: 79 },
|
|
6731
|
+
};
|
|
6732
|
+
|
|
6733
|
+
printOffendingDependencies(deps);
|
|
6734
|
+
expect(std).toMatchInlineSnapshot(`
|
|
6735
|
+
Object {
|
|
6736
|
+
"debug": "",
|
|
6737
|
+
"err": "",
|
|
6738
|
+
"out": "",
|
|
6739
|
+
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mHere are the 5 largest dependencies included in your script:[0m
|
|
6740
|
+
|
|
6741
|
+
- node_modules/d-mod/module.js - xx KiB
|
|
6742
|
+
- node_modules/g-mod/module.js - xx KiB
|
|
6743
|
+
- node_modules/e-mod/module.js - xx KiB
|
|
6744
|
+
- node_modules/i-mod/module.js - xx KiB
|
|
6745
|
+
- node_modules/j-mod/module.js - xx KiB
|
|
6746
|
+
If these are unnecessary, consider removing them
|
|
6747
|
+
|
|
6748
|
+
",
|
|
6749
|
+
}
|
|
6750
|
+
`);
|
|
6751
|
+
});
|
|
6752
|
+
});
|
|
6418
6753
|
});
|
|
6419
6754
|
|
|
6420
6755
|
describe("--no-bundle", () => {
|
|
@@ -6525,6 +6860,12 @@ addEventListener('fetch', event => {});`
|
|
|
6525
6860
|
writeWranglerToml();
|
|
6526
6861
|
mockSubDomainRequest();
|
|
6527
6862
|
mockUploadWorkerRequest();
|
|
6863
|
+
setMockResponse(
|
|
6864
|
+
"/accounts/:accountId/workers/versions/by-script/:scriptTag",
|
|
6865
|
+
() => ({
|
|
6866
|
+
latest: { number: "2" },
|
|
6867
|
+
})
|
|
6868
|
+
);
|
|
6528
6869
|
setMockRawResponse(
|
|
6529
6870
|
"/accounts/:accountId/workers/services/:scriptName",
|
|
6530
6871
|
"GET",
|
|
@@ -6543,7 +6884,8 @@ addEventListener('fetch', event => {});`
|
|
|
6543
6884
|
"out": "Total Upload: xx KiB / gzip: xx KiB
|
|
6544
6885
|
Uploaded test-name (TIMINGS)
|
|
6545
6886
|
Published test-name (TIMINGS)
|
|
6546
|
-
https://test-name.test-sub-domain.workers.dev
|
|
6887
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6888
|
+
Current Deployment ID: undefined",
|
|
6547
6889
|
"warn": "",
|
|
6548
6890
|
}
|
|
6549
6891
|
`);
|
|
@@ -6564,6 +6906,12 @@ addEventListener('fetch', event => {});`
|
|
|
6564
6906
|
]);
|
|
6565
6907
|
}
|
|
6566
6908
|
);
|
|
6909
|
+
setMockResponse(
|
|
6910
|
+
"/accounts/:accountId/workers/versions/by-script/:scriptTag",
|
|
6911
|
+
() => ({
|
|
6912
|
+
latest: { number: "2" },
|
|
6913
|
+
})
|
|
6914
|
+
);
|
|
6567
6915
|
|
|
6568
6916
|
await runWrangler("publish index.js");
|
|
6569
6917
|
expect(std.err).toContain(
|
|
@@ -6571,6 +6919,123 @@ addEventListener('fetch', event => {});`
|
|
|
6571
6919
|
);
|
|
6572
6920
|
});
|
|
6573
6921
|
|
|
6922
|
+
describe("queues", () => {
|
|
6923
|
+
it("should upload producer bindings", async () => {
|
|
6924
|
+
writeWranglerToml({
|
|
6925
|
+
queues: {
|
|
6926
|
+
producers: [{ binding: "QUEUE_ONE", queue: "queue1" }],
|
|
6927
|
+
},
|
|
6928
|
+
});
|
|
6929
|
+
await fs.promises.writeFile("index.js", `export default {};`);
|
|
6930
|
+
mockSubDomainRequest();
|
|
6931
|
+
mockUploadWorkerRequest({
|
|
6932
|
+
expectedBindings: [
|
|
6933
|
+
{
|
|
6934
|
+
type: "queue",
|
|
6935
|
+
name: "QUEUE_ONE",
|
|
6936
|
+
queue_name: "queue1",
|
|
6937
|
+
},
|
|
6938
|
+
],
|
|
6939
|
+
});
|
|
6940
|
+
mockGetQueue("queue1");
|
|
6941
|
+
|
|
6942
|
+
await runWrangler("publish index.js");
|
|
6943
|
+
expect(std.out).toMatchInlineSnapshot(`
|
|
6944
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
6945
|
+
Your worker has access to the following bindings:
|
|
6946
|
+
- Queues:
|
|
6947
|
+
- QUEUE_ONE: queue1
|
|
6948
|
+
Uploaded test-name (TIMINGS)
|
|
6949
|
+
Published test-name (TIMINGS)
|
|
6950
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6951
|
+
Current Deployment ID: undefined"
|
|
6952
|
+
`);
|
|
6953
|
+
});
|
|
6954
|
+
|
|
6955
|
+
it("should update queue consumers on publish", async () => {
|
|
6956
|
+
writeWranglerToml({
|
|
6957
|
+
queues: {
|
|
6958
|
+
consumers: [
|
|
6959
|
+
{
|
|
6960
|
+
queue: "queue1",
|
|
6961
|
+
dead_letter_queue: "myDLQ",
|
|
6962
|
+
max_batch_size: 5,
|
|
6963
|
+
max_batch_timeout: 3,
|
|
6964
|
+
max_retries: 10,
|
|
6965
|
+
},
|
|
6966
|
+
],
|
|
6967
|
+
},
|
|
6968
|
+
});
|
|
6969
|
+
await fs.promises.writeFile("index.js", `export default {};`);
|
|
6970
|
+
mockSubDomainRequest();
|
|
6971
|
+
mockUploadWorkerRequest();
|
|
6972
|
+
mockGetQueue("queue1");
|
|
6973
|
+
mockPutQueueConsumer("queue1", "test-name", {
|
|
6974
|
+
dead_letter_queue: "myDLQ",
|
|
6975
|
+
settings: {
|
|
6976
|
+
batch_size: 5,
|
|
6977
|
+
max_retries: 10,
|
|
6978
|
+
max_wait_time_ms: 3000,
|
|
6979
|
+
},
|
|
6980
|
+
});
|
|
6981
|
+
await runWrangler("publish index.js");
|
|
6982
|
+
expect(std.out).toMatchInlineSnapshot(`
|
|
6983
|
+
"Total Upload: xx KiB / gzip: xx KiB
|
|
6984
|
+
Uploaded test-name (TIMINGS)
|
|
6985
|
+
Published test-name (TIMINGS)
|
|
6986
|
+
https://test-name.test-sub-domain.workers.dev
|
|
6987
|
+
Consumer for queue1
|
|
6988
|
+
Current Deployment ID: undefined"
|
|
6989
|
+
`);
|
|
6990
|
+
});
|
|
6991
|
+
|
|
6992
|
+
it("consumer should error when a queue doesn't exist", async () => {
|
|
6993
|
+
writeWranglerToml({
|
|
6994
|
+
queues: {
|
|
6995
|
+
producers: [],
|
|
6996
|
+
consumers: [
|
|
6997
|
+
{
|
|
6998
|
+
queue: "queue1",
|
|
6999
|
+
dead_letter_queue: "myDLQ",
|
|
7000
|
+
max_batch_size: 5,
|
|
7001
|
+
max_batch_timeout: 3,
|
|
7002
|
+
max_retries: 10,
|
|
7003
|
+
},
|
|
7004
|
+
],
|
|
7005
|
+
},
|
|
7006
|
+
});
|
|
7007
|
+
await fs.promises.writeFile("index.js", `export default {};`);
|
|
7008
|
+
mockSubDomainRequest();
|
|
7009
|
+
mockUploadWorkerRequest();
|
|
7010
|
+
mockGetQueueMissing("queue1");
|
|
7011
|
+
|
|
7012
|
+
await expect(
|
|
7013
|
+
runWrangler("publish index.js")
|
|
7014
|
+
).rejects.toMatchInlineSnapshot(
|
|
7015
|
+
`[Error: Queue "queue1" does not exist. To create it, run: wrangler queues create queue1]`
|
|
7016
|
+
);
|
|
7017
|
+
});
|
|
7018
|
+
|
|
7019
|
+
it("producer should error when a queue doesn't exist", async () => {
|
|
7020
|
+
writeWranglerToml({
|
|
7021
|
+
queues: {
|
|
7022
|
+
producers: [{ queue: "queue1", binding: "QUEUE_ONE" }],
|
|
7023
|
+
consumers: [],
|
|
7024
|
+
},
|
|
7025
|
+
});
|
|
7026
|
+
await fs.promises.writeFile("index.js", `export default {};`);
|
|
7027
|
+
mockSubDomainRequest();
|
|
7028
|
+
mockUploadWorkerRequest();
|
|
7029
|
+
mockGetQueueMissing("queue1");
|
|
7030
|
+
|
|
7031
|
+
await expect(
|
|
7032
|
+
runWrangler("publish index.js")
|
|
7033
|
+
).rejects.toMatchInlineSnapshot(
|
|
7034
|
+
`[Error: Queue "queue1" does not exist. To create it, run: wrangler queues create queue1]`
|
|
7035
|
+
);
|
|
7036
|
+
});
|
|
7037
|
+
});
|
|
7038
|
+
|
|
6574
7039
|
describe("--keep-vars", () => {
|
|
6575
7040
|
it("should send keepVars when keep-vars is passed in", async () => {
|
|
6576
7041
|
process.env = {
|
|
@@ -6591,7 +7056,8 @@ addEventListener('fetch', event => {});`
|
|
|
6591
7056
|
"Total Upload: xx KiB / gzip: xx KiB
|
|
6592
7057
|
Uploaded test-name (TIMINGS)
|
|
6593
7058
|
Published test-name (TIMINGS)
|
|
6594
|
-
https://test-name.test-sub-domain.workers.dev
|
|
7059
|
+
https://test-name.test-sub-domain.workers.dev
|
|
7060
|
+
Current Deployment ID: undefined"
|
|
6595
7061
|
`);
|
|
6596
7062
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
6597
7063
|
});
|
|
@@ -6615,7 +7081,8 @@ addEventListener('fetch', event => {});`
|
|
|
6615
7081
|
"Total Upload: xx KiB / gzip: xx KiB
|
|
6616
7082
|
Uploaded test-name (TIMINGS)
|
|
6617
7083
|
Published test-name (TIMINGS)
|
|
6618
|
-
https://test-name.test-sub-domain.workers.dev
|
|
7084
|
+
https://test-name.test-sub-domain.workers.dev
|
|
7085
|
+
Current Deployment ID: undefined"
|
|
6619
7086
|
`);
|
|
6620
7087
|
expect(std.err).toMatchInlineSnapshot(`""`);
|
|
6621
7088
|
});
|
|
@@ -6652,6 +7119,7 @@ function mockUploadWorkerRequest(
|
|
|
6652
7119
|
legacyEnv?: boolean;
|
|
6653
7120
|
sendScriptIds?: boolean;
|
|
6654
7121
|
keepVars?: boolean;
|
|
7122
|
+
tag?: string;
|
|
6655
7123
|
} = {}
|
|
6656
7124
|
) {
|
|
6657
7125
|
const {
|
|
@@ -6730,6 +7198,7 @@ function mockUploadWorkerRequest(
|
|
|
6730
7198
|
id: "abc12345",
|
|
6731
7199
|
etag: "etag98765",
|
|
6732
7200
|
pipeline_hash: "hash9999",
|
|
7201
|
+
tag: "sample-tag",
|
|
6733
7202
|
}
|
|
6734
7203
|
: {}),
|
|
6735
7204
|
};
|
|
@@ -7117,3 +7586,48 @@ function mockServiceScriptData(options: {
|
|
|
7117
7586
|
);
|
|
7118
7587
|
}
|
|
7119
7588
|
}
|
|
7589
|
+
|
|
7590
|
+
function mockGetQueue(expectedQueueName: string) {
|
|
7591
|
+
const requests = { count: 0 };
|
|
7592
|
+
setMockResponse(
|
|
7593
|
+
`/accounts/:accountId/workers/queues/${expectedQueueName}`,
|
|
7594
|
+
"GET",
|
|
7595
|
+
([_url, accountId]) => {
|
|
7596
|
+
expect(accountId).toEqual("some-account-id");
|
|
7597
|
+
requests.count += 1;
|
|
7598
|
+
return { queue: expectedQueueName };
|
|
7599
|
+
}
|
|
7600
|
+
);
|
|
7601
|
+
return requests;
|
|
7602
|
+
}
|
|
7603
|
+
|
|
7604
|
+
function mockGetQueueMissing(expectedQueueName: string) {
|
|
7605
|
+
const requests = { count: 0 };
|
|
7606
|
+
setMockResponse(
|
|
7607
|
+
`/accounts/:accountId/workers/queues/${expectedQueueName}`,
|
|
7608
|
+
"GET",
|
|
7609
|
+
([_url, _accountId]) => {
|
|
7610
|
+
throw { code: 100123 };
|
|
7611
|
+
}
|
|
7612
|
+
);
|
|
7613
|
+
return requests;
|
|
7614
|
+
}
|
|
7615
|
+
|
|
7616
|
+
function mockPutQueueConsumer(
|
|
7617
|
+
expectedQueueName: string,
|
|
7618
|
+
expectedConsumerName: string,
|
|
7619
|
+
expectedBody: PutConsumerBody
|
|
7620
|
+
) {
|
|
7621
|
+
const requests = { count: 0 };
|
|
7622
|
+
setMockResponse(
|
|
7623
|
+
`/accounts/:accountId/workers/queues/${expectedQueueName}/consumers/${expectedConsumerName}`,
|
|
7624
|
+
"PUT",
|
|
7625
|
+
([_url, accountId], { body }) => {
|
|
7626
|
+
expect(accountId).toEqual("some-account-id");
|
|
7627
|
+
expect(JSON.parse(body as string)).toEqual(expectedBody);
|
|
7628
|
+
requests.count += 1;
|
|
7629
|
+
return { queue: expectedQueueName };
|
|
7630
|
+
}
|
|
7631
|
+
);
|
|
7632
|
+
return requests;
|
|
7633
|
+
}
|