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.
Files changed (75) hide show
  1. package/miniflare-dist/index.mjs +3 -1
  2. package/package.json +2 -1
  3. package/src/__tests__/access.test.ts +25 -0
  4. package/src/__tests__/api-dev.test.ts +1 -1
  5. package/src/__tests__/api-devregistry.test.js +2 -2
  6. package/src/__tests__/configuration.test.ts +119 -2
  7. package/src/__tests__/d1.test.ts +2 -0
  8. package/src/__tests__/deployments.test.ts +22 -22
  9. package/src/__tests__/dev.test.tsx +167 -15
  10. package/src/__tests__/helpers/msw/handlers/access.ts +13 -0
  11. package/src/__tests__/helpers/msw/handlers/deployments.ts +22 -43
  12. package/src/__tests__/helpers/msw/handlers/zones.ts +22 -0
  13. package/src/__tests__/helpers/msw/index.ts +4 -0
  14. package/src/__tests__/index.test.ts +42 -33
  15. package/src/__tests__/init.test.ts +88 -4
  16. package/src/__tests__/jest.setup.ts +11 -0
  17. package/src/__tests__/kv.test.ts +400 -400
  18. package/src/__tests__/pages.test.ts +140 -28
  19. package/src/__tests__/publish.test.ts +1161 -647
  20. package/src/__tests__/pubsub.test.ts +3 -0
  21. package/src/__tests__/queues.test.ts +371 -0
  22. package/src/__tests__/r2.test.ts +57 -52
  23. package/src/__tests__/worker-namespace.test.ts +15 -10
  24. package/src/bundle-reporter.tsx +41 -2
  25. package/src/bundle.ts +59 -30
  26. package/src/cli.ts +0 -1
  27. package/src/config/environment.ts +50 -0
  28. package/src/config/index.ts +41 -0
  29. package/src/config/validation.ts +173 -0
  30. package/src/create-worker-preview.ts +10 -3
  31. package/src/create-worker-upload-form.ts +12 -0
  32. package/src/d1/backups.tsx +11 -5
  33. package/src/d1/execute.tsx +52 -47
  34. package/src/d1/index.ts +2 -1
  35. package/src/delete.ts +7 -10
  36. package/src/deployments.ts +73 -0
  37. package/src/deprecated/index.ts +9 -24
  38. package/src/dev/dev-vars.ts +11 -8
  39. package/src/dev/dev.tsx +12 -0
  40. package/src/dev/local.tsx +26 -0
  41. package/src/dev/remote.tsx +2 -0
  42. package/src/dev/start-server.ts +7 -0
  43. package/src/dev/use-esbuild.ts +12 -5
  44. package/src/dev.tsx +12 -9
  45. package/src/dispatch-namespace.ts +4 -3
  46. package/src/index.tsx +61 -45
  47. package/src/init.ts +4 -4
  48. package/src/inspect.ts +21 -1
  49. package/src/is-interactive.ts +4 -0
  50. package/src/kv/index.ts +5 -54
  51. package/src/logger.ts +12 -0
  52. package/src/pages/constants.ts +2 -0
  53. package/src/pages/upload.tsx +42 -15
  54. package/src/proxy.ts +38 -6
  55. package/src/publish/index.ts +11 -8
  56. package/src/publish/publish.ts +151 -30
  57. package/src/pubsub/pubsub-commands.tsx +3 -2
  58. package/src/queues/cli/commands/consumer/add.ts +71 -0
  59. package/src/queues/cli/commands/consumer/index.ts +22 -0
  60. package/src/queues/cli/commands/consumer/remove.ts +38 -0
  61. package/src/queues/cli/commands/create.ts +25 -0
  62. package/src/queues/cli/commands/delete.ts +26 -0
  63. package/src/queues/cli/commands/index.ts +33 -0
  64. package/src/queues/cli/commands/list.ts +25 -0
  65. package/src/queues/client.ts +135 -0
  66. package/src/secret/index.ts +14 -39
  67. package/src/tail/index.ts +5 -8
  68. package/src/user/access.ts +69 -0
  69. package/src/worker.ts +7 -0
  70. package/src/yargs-types.ts +15 -2
  71. package/src/zones.ts +31 -5
  72. package/templates/pages-template-plugin.ts +4 -0
  73. package/templates/pages-template-worker.ts +21 -4
  74. package/wrangler-dist/cli.d.ts +42 -0
  75. 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
  "▲ [WARNING] It looks like you have used Wrangler 1's \`config\` command to login with an API token.
@@ -187,11 +203,12 @@ describe("publish", () => {
187
203
  await runWrangler("publish index.js");
188
204
 
189
205
  expect(std.out).toMatchInlineSnapshot(`
190
- "Total Upload: xx KiB / gzip: xx KiB
191
- Uploaded test-name (TIMINGS)
192
- Published test-name (TIMINGS)
193
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
215
- Uploaded test-name (TIMINGS)
216
- Published test-name (TIMINGS)
217
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
317
- Uploaded test-name-some-env (TIMINGS)
318
- Published test-name-some-env (TIMINGS)
319
- https://test-name-some-env.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
336
- Uploaded test-name (TIMINGS)
337
- Published test-name (TIMINGS)
338
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
355
- Uploaded test-name-some-env (TIMINGS)
356
- Published test-name-some-env (TIMINGS)
357
- https://test-name-some-env.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
374
- Uploaded test-name-some-env (TIMINGS)
375
- Published test-name-some-env (TIMINGS)
376
- https://test-name-some-env.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Processing wrangler.toml configuration:
@@ -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
- "Total Upload: xx KiB / gzip: xx KiB
444
- Uploaded test-name (TIMINGS)
445
- Published test-name (TIMINGS)
446
- https://test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Processing wrangler.toml configuration:
@@ -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
- "Total Upload: xx KiB / gzip: xx KiB
470
- Uploaded test-name (some-env) (TIMINGS)
471
- Published test-name (some-env) (TIMINGS)
472
- https://some-env.test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Processing wrangler.toml configuration:
@@ -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": "▲ [WARNING] Processing wrangler.toml configuration:
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
- Object {
593
- "debug": "",
594
- "err": "",
595
- "out": "Total Upload: xx KiB / gzip: xx KiB
596
- Uploaded test-name (TIMINGS)
597
- Published test-name (TIMINGS)
598
- some-example.com/some-route/*
599
- *a-boring-website.com (zone id: 54sdf7fsda)
600
- *another-boring-website.com (zone name: some-zone.com)
601
- example.com/some-route/* (zone id: JGHFHG654gjcj)
602
- more-examples.com/*",
603
- "warn": "",
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
- Object {
654
- "debug": "",
655
- "err": "",
656
- "out": "Total Upload: xx KiB / gzip: xx KiB
657
- Uploaded test-name (staging) (TIMINGS)
658
- Published test-name (staging) (TIMINGS)
659
- some-example.com/some-route/*
660
- *a-boring-website.com (zone id: 54sdf7fsda)
661
- *another-boring-website.com (zone name: some-zone.com)
662
- example.com/some-route/* (zone id: JGHFHG654gjcj)
663
- more-examples.com/*",
664
- "warn": "▲ [WARNING] Processing wrangler.toml configuration:
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": "▲ [WARNING] Processing wrangler.toml configuration:
665
693
 
666
- - Experimental: Service environments are in beta, and their behaviour is guaranteed to change in
667
- the future. DO NOT USE IN PRODUCTION.
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
- "Total Upload: xx KiB / gzip: xx KiB
763
- Uploaded test-name (TIMINGS)
764
- Published test-name (TIMINGS)
765
- example.com/some-route/*"
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
- "Total Upload: xx KiB / gzip: xx KiB
1043
- Uploaded test-name (TIMINGS)
1044
- Published test-name (TIMINGS)
1045
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
1060
- Uploaded test-name (TIMINGS)
1061
- Published test-name (TIMINGS)
1062
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
1077
- Uploaded test-name (TIMINGS)
1078
- Published test-name (TIMINGS)
1079
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
1096
- Uploaded test-name (TIMINGS)
1097
- Published test-name (TIMINGS)
1098
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
1113
- Uploaded test-name (TIMINGS)
1114
- Published test-name (TIMINGS)
1115
- https://test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Processing wrangler.toml configuration:
@@ -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
- "Total Upload: xx KiB / gzip: xx KiB
1149
- Uploaded test-name (TIMINGS)
1150
- Published test-name (TIMINGS)
1151
- https://test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Processing ../wrangler.toml configuration:
@@ -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
- "Total Upload: xx KiB / gzip: xx KiB
1199
- Uploaded test-name (TIMINGS)
1200
- Published test-name (TIMINGS)
1201
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
1218
- Uploaded test-name (TIMINGS)
1219
- Published test-name (TIMINGS)
1220
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
1249
- Uploaded test-name (TIMINGS)
1250
- Published test-name (TIMINGS)
1251
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
1266
- Uploaded test-name (TIMINGS)
1267
- Published test-name (TIMINGS)
1268
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
1360
- Uploaded test-name (TIMINGS)
1361
- Published test-name (TIMINGS)
1362
- https://test-name.test-sub-domain.workers.dev"
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
- Object {
1434
- "debug": "",
1435
- "err": "",
1436
- "out": "Reading file-1.txt...
1437
- Uploading as file-1.2ca234f380.txt...
1438
- Reading file-2.txt...
1439
- Uploading as file-2.5938485188.txt...
1440
- ↗️ Done syncing assets
1441
- Total Upload: xx KiB / gzip: xx KiB
1442
- Uploaded test-name (TIMINGS)
1443
- Published test-name (TIMINGS)
1444
- https://test-name.test-sub-domain.workers.dev",
1445
- "warn": "▲ [WARNING] Processing wrangler.toml configuration:
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": "▲ [WARNING] Processing wrangler.toml configuration:
1446
1487
 
1447
- - Deprecation: \\"site.entry-point\\":
1448
- Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration
1449
- file:
1450
- \`\`\`
1451
- main = \\"index.js\\"
1452
- \`\`\`
1488
+ - Deprecation: \\"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
- "Reading file-1.txt...
1489
- Uploading as file-1.2ca234f380.txt...
1490
- Reading file-2.txt...
1491
- Uploading as file-2.5938485188.txt...
1492
- ↗️ Done syncing assets
1493
- Total Upload: xx KiB / gzip: xx KiB
1494
- Uploaded test-name (TIMINGS)
1495
- Published test-name (TIMINGS)
1496
- https://test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Processing my-site/wrangler.toml configuration:
@@ -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": "▲ [WARNING] The --assets argument is experimental and may change or break at any time
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
- "Reading file-1.txt...
1626
- Uploading as file-1.2ca234f380.txt...
1627
- Reading file-2.txt...
1628
- Uploading as file-2.5938485188.txt...
1629
- ↗️ Done syncing assets
1630
- Total Upload: xx KiB / gzip: xx KiB
1631
- Uploaded test-name (TIMINGS)
1632
- Published test-name (TIMINGS)
1633
- https://test-name.test-sub-domain.workers.dev"
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": "▲ [WARNING] The --assets argument is experimental and may change or break at any time
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": "▲ [WARNING] The --assets argument is experimental and may change or break at any time
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": "▲ [WARNING] Processing wrangler.toml configuration:
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
- "Reading subdir/file-1.txt...
1952
- Uploading as subdir/file-1.2ca234f380.txt...
1953
- Reading subdir/file-2.txt...
1954
- Uploading as subdir/file-2.5938485188.txt...
1955
- ↗️ Done syncing assets
1956
- Total Upload: xx KiB / gzip: xx KiB
1957
- Uploaded test-name (TIMINGS)
1958
- Published test-name (TIMINGS)
1959
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2009
- Uploading as file-1.2ca234f380.txt...
2010
- Reading file-2.txt...
2011
- Uploading as file-2.5938485188.txt...
2012
- ↗️ Done syncing assets
2013
- Total Upload: xx KiB / gzip: xx KiB
2014
- Uploaded test-name (TIMINGS)
2015
- Published test-name (TIMINGS)
2016
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2060
- Uploading as file-1.2ca234f380.txt...
2061
- Reading file-2.txt...
2062
- Uploading as file-2.5938485188.txt...
2063
- ↗️ Done syncing assets
2064
- Total Upload: xx KiB / gzip: xx KiB
2065
- Uploaded test-name (TIMINGS)
2066
- Published test-name (TIMINGS)
2067
- https://test-name.test-sub-domain.workers.dev"
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
- "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 (some-env) (TIMINGS)
2115
- Published test-name (some-env) (TIMINGS)
2116
- https://some-env.test-name.test-sub-domain.workers.dev"
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
- "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://test-name-some-env.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2202
- Skipping - already uploaded.
2203
- Reading file-2.txt...
2204
- Uploading as file-2.5938485188.txt...
2205
- ↗️ Done syncing assets
2206
- Total Upload: xx KiB / gzip: xx KiB
2207
- Uploaded test-name (TIMINGS)
2208
- Published test-name (TIMINGS)
2209
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2244
- Uploading as file-1.2ca234f380.txt...
2245
- ↗️ Done syncing assets
2246
- Total Upload: xx KiB / gzip: xx KiB
2247
- Uploaded test-name (TIMINGS)
2248
- Published test-name (TIMINGS)
2249
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2284
- Uploading as file-1.2ca234f380.txt...
2285
- ↗️ Done syncing assets
2286
- Total Upload: xx KiB / gzip: xx KiB
2287
- Uploaded test-name (TIMINGS)
2288
- Published test-name (TIMINGS)
2289
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2325
- Uploading as file-1.2ca234f380.txt...
2326
- ↗️ Done syncing assets
2327
- Total Upload: xx KiB / gzip: xx KiB
2328
- Uploaded test-name (TIMINGS)
2329
- Published test-name (TIMINGS)
2330
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2366
- Uploading as file-1.2ca234f380.txt...
2367
- ↗️ Done syncing assets
2368
- Total Upload: xx KiB / gzip: xx KiB
2369
- Uploaded test-name (TIMINGS)
2370
- Published test-name (TIMINGS)
2371
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2407
- Uploading as file-1.2ca234f380.txt...
2408
- ↗️ Done syncing assets
2409
- Total Upload: xx KiB / gzip: xx KiB
2410
- Uploaded test-name (TIMINGS)
2411
- Published test-name (TIMINGS)
2412
- https://test-name.test-sub-domain.workers.dev"
2413
- `);
2414
- expect(std.err).toMatchInlineSnapshot(`""`);
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
- "Reading file-1.txt...
2448
- Uploading as file-1.2ca234f380.txt...
2449
- ↗️ Done syncing assets
2450
- Total Upload: xx KiB / gzip: xx KiB
2451
- Uploaded test-name (TIMINGS)
2452
- Published test-name (TIMINGS)
2453
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading directory-1/file-1.txt...
2491
- Uploading as directory-1/file-1.2ca234f380.txt...
2492
- ↗️ Done syncing assets
2493
- Total Upload: xx KiB / gzip: xx KiB
2494
- Uploaded test-name (TIMINGS)
2495
- Published test-name (TIMINGS)
2496
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading .well-known/file-2.txt...
2538
- Uploading as .well-known/file-2.5938485188.txt...
2539
- ↗️ Done syncing assets
2540
- Total Upload: xx KiB / gzip: xx KiB
2541
- Uploaded test-name (TIMINGS)
2542
- Published test-name (TIMINGS)
2543
- https://test-name.test-sub-domain.workers.dev"
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
- Object {
2646
- "debug": "",
2647
- "err": "",
2648
- "out": "Reading file-00.txt...
2649
- Uploading as file-00.be5be5dd26.txt...
2650
- Reading file-01.txt...
2651
- Uploading as file-01.4842d35994.txt...
2652
- Reading file-02.txt...
2653
- Uploading as file-02.990572ec63.txt...
2654
- Reading file-03.txt...
2655
- Uploading as file-03.9d7dda9045.txt...
2656
- Reading file-04.txt...
2657
- Uploading as file-04.2b6fac6382.txt...
2658
- Reading file-05.txt...
2659
- Uploading as file-05.55762dc758.txt...
2660
- Reading file-06.txt...
2661
- Uploading as file-06.f408a6b020.txt...
2662
- Reading file-07.txt...
2663
- Uploading as file-07.64c051715b.txt...
2664
- Reading file-08.txt...
2665
- Uploading as file-08.d286789adb.txt...
2666
- Reading file-09.txt...
2667
- Uploading as file-09.6838c183a8.txt...
2668
- Reading file-10.txt...
2669
- Uploading as file-10.6e03221d2a.txt...
2670
- Reading file-11.txt...
2671
- Uploading as file-11.37d3fb2eff.txt...
2672
- Reading file-12.txt...
2673
- Uploading as file-12.b3556942f8.txt...
2674
- Reading file-13.txt...
2675
- Uploading as file-13.680caf51b1.txt...
2676
- Reading file-14.txt...
2677
- Uploading as file-14.51e88468f0.txt...
2678
- Reading file-15.txt...
2679
- Uploading as file-15.8e3fedb394.txt...
2680
- Reading file-16.txt...
2681
- Uploading as file-16.c81c5e426f.txt...
2682
- Reading file-17.txt...
2683
- Uploading as file-17.4b2ae3c47b.txt...
2684
- Reading file-18.txt...
2685
- Uploading as file-18.07f245e02b.txt...
2686
- Reading file-19.txt...
2687
- Uploading as file-19.f0d69f705d.txt...
2688
- ↗️ Done syncing assets
2689
- Total Upload: xx KiB / gzip: xx KiB
2690
- Uploaded test-name (TIMINGS)
2691
- Published test-name (TIMINGS)
2692
- https://test-name.test-sub-domain.workers.dev",
2693
- "warn": "",
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
- "Reading file-1.txt...
2782
- Skipping - already uploaded.
2783
- Reading file-2.txt...
2784
- Uploading as file-2.5938485188.txt...
2785
- Deleting file-3.somehash.txt from the asset store...
2786
- Deleting file-4.anotherhash.txt from the asset store...
2787
- ↗️ Done syncing assets
2788
- Total Upload: xx KiB / gzip: xx KiB
2789
- Uploaded test-name (TIMINGS)
2790
- Published test-name (TIMINGS)
2791
- https://test-name.test-sub-domain.workers.dev"
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
- "Reading file-1.txt...
2838
- Uploading as file-1.2ca234f380.txt...
2839
- Reading file-2.txt...
2840
- Uploading as file-2.5938485188.txt...
2841
- ↗️ Done syncing assets
2842
- Total Upload: xx KiB / gzip: xx KiB
2843
- Uploaded test-name (TIMINGS)
2844
- Published test-name (TIMINGS)
2845
- https://test-name.test-sub-domain.workers.dev"
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
- Object {
2876
- "debug": "",
2877
- "err": "",
2878
- "out": "Reading file-1.txt...
2879
- Uploading as file-1.2ca234f380.txt...
2880
- Reading file-2.txt...
2881
- Uploading as file-2.5938485188.txt...
2882
- ↗️ Done syncing assets
2883
- Total Upload: xx KiB / gzip: xx KiB
2884
- Uploaded test-name (TIMINGS)
2885
- Published test-name (TIMINGS)
2886
- https://test-name.test-sub-domain.workers.dev",
2887
- "warn": "",
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": "▲ [WARNING] The --assets argument is experimental and may change or break at any time
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
- "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
- `);
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
- "Total Upload: xx KiB / gzip: xx KiB
2968
- Uploaded test-name (TIMINGS)
2969
- Published test-name (TIMINGS)
2970
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
2987
- Uploaded test-name (TIMINGS)
2988
- Published test-name (TIMINGS)
2989
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3006
- Uploaded test-name (TIMINGS)
3007
- No publish targets for test-name (TIMINGS)"
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
- "Total Upload: xx KiB / gzip: xx KiB
3026
- Uploaded test-name (TIMINGS)
3027
- No publish targets for test-name (TIMINGS)"
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
- "Total Upload: xx KiB / gzip: xx KiB
3050
- Uploaded test-name (dev) (TIMINGS)
3051
- No publish targets for test-name (dev) (TIMINGS)"
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
- "Total Upload: xx KiB / gzip: xx KiB
3075
- Uploaded test-name (dev) (TIMINGS)
3076
- No publish targets for test-name (dev) (TIMINGS)"
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
- "Total Upload: xx KiB / gzip: xx KiB
3100
- Uploaded test-name (dev) (TIMINGS)
3101
- Published test-name (dev) (TIMINGS)
3102
- https://dev.test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3127
- Uploaded test-name (dev) (TIMINGS)
3128
- Published test-name (dev) (TIMINGS)
3129
- https://dev.test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3155
- Uploaded test-name (dev) (TIMINGS)
3156
- Published test-name (dev) (TIMINGS)
3157
- https://dev.test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3186
- Uploaded test-name (dev) (TIMINGS)
3187
- Published test-name (dev) (TIMINGS)
3188
- https://dev.test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3219
- Uploaded test-name (dev) (TIMINGS)
3220
- Published test-name (dev) (TIMINGS)
3221
- https://dev.test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3279
- Uploaded test-name (TIMINGS)
3280
- Published test-name (TIMINGS)
3281
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3297
- Uploaded test-name (TIMINGS)
3298
- Published test-name (TIMINGS)
3299
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3339
- Uploaded test-name (TIMINGS)
3340
- Published test-name (TIMINGS)
3341
- http://example.com/*"
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
- "Total Upload: xx KiB / gzip: xx KiB
3373
- Uploaded test-name-production (TIMINGS)
3374
- Published test-name-production (TIMINGS)
3375
- http://production.example.com/*"
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
- "Total Upload: xx KiB / gzip: xx KiB
3406
- Uploaded test-name-production (TIMINGS)
3407
- Published test-name-production (TIMINGS)
3408
- http://production.example.com/*"
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
- "Total Upload: xx KiB / gzip: xx KiB
3432
- Uploaded test-name (TIMINGS)
3433
- Published test-name (TIMINGS)
3434
- https://test-name.test-sub-domain.workers.dev
3435
- http://example.com/*"
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
- "Total Upload: xx KiB / gzip: xx KiB
3467
- Uploaded test-name-production (TIMINGS)
3468
- Published test-name-production (TIMINGS)
3469
- https://test-name-production.test-sub-domain.workers.dev
3470
- http://production.example.com/*"
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
- "Total Upload: xx KiB / gzip: xx KiB
3502
- Uploaded test-name-production (TIMINGS)
3503
- Published test-name-production (TIMINGS)
3504
- https://test-name-production.test-sub-domain.workers.dev
3505
- http://production.example.com/*"
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
- "Total Upload: xx KiB / gzip: xx KiB
3537
- Uploaded test-name-production (TIMINGS)
3538
- Published test-name-production (TIMINGS)
3539
- http://production.example.com/*"
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
- "Total Upload: xx KiB / gzip: xx KiB
3571
- Uploaded test-name-production (TIMINGS)
3572
- Published test-name-production (TIMINGS)
3573
- http://production.example.com/*"
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
- "Running custom build: echo \\"custom build\\" && echo \\"export default { fetch(){ return new Response(123) } }\\" > index.js
3746
- Total Upload: xx KiB / gzip: xx KiB
3747
- Uploaded test-name (TIMINGS)
3748
- Published test-name (TIMINGS)
3749
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3853
- Uploaded test-name (TIMINGS)
3854
- Published test-name (TIMINGS)
3855
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
3892
- Uploaded test-name (testEnv) (TIMINGS)
3893
- Published test-name (testEnv) (TIMINGS)
3894
- https://testEnv.test-name.test-sub-domain.workers.dev"
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": "▲ [WARNING] Processing wrangler.toml configuration:
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": "▲ [WARNING] Processing wrangler.toml configuration:
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
- "Total Upload: xx KiB / gzip: xx KiB
5047
- Uploaded test-name (TIMINGS)
5048
- Published test-name (TIMINGS)
5049
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
5786
- Uploaded test-name (TIMINGS)
5787
- Published test-name (TIMINGS)
5788
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
5815
- Uploaded test-name (TIMINGS)
5816
- Published test-name (TIMINGS)
5817
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
5848
- Uploaded test-name (TIMINGS)
5849
- Published test-name (TIMINGS)
5850
- https://test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Processing wrangler.toml configuration:
@@ -5893,11 +6022,12 @@ addEventListener('fetch', event => {});`
5893
6022
  });
5894
6023
  await runWrangler("publish index.js");
5895
6024
  expect(std.out).toMatchInlineSnapshot(`
5896
- "Total Upload: xx KiB / gzip: xx KiB
5897
- Uploaded test-name (TIMINGS)
5898
- Published test-name (TIMINGS)
5899
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
5994
- Uploaded test-name (TIMINGS)
5995
- Published test-name (TIMINGS)
5996
- https://test-name.test-sub-domain.workers.dev"
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
- "Total Upload: xx KiB / gzip: xx KiB
6024
- Uploaded test-name (TIMINGS)
6025
- Published test-name (TIMINGS)
6026
- https://test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Deprecation: detected a legacy module import in \\"./index.js\\". This will stop working in the future. Replace references to \\"text.file\\" with \\"./text.file\\";
@@ -6049,11 +6181,12 @@ addEventListener('fetch', event => {});`
6049
6181
  });
6050
6182
  await runWrangler("publish index.js");
6051
6183
  expect(std.out).toMatchInlineSnapshot(`
6052
- "Total Upload: xx KiB / gzip: xx KiB
6053
- Uploaded test-name (TIMINGS)
6054
- Published test-name (TIMINGS)
6055
- https://test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Deprecation: detected a legacy module import in \\"./index.js\\". This will stop working in the future. Replace references to \\"index.wasm\\" with \\"./index.wasm\\";
@@ -6080,11 +6213,12 @@ addEventListener('fetch', event => {});`
6080
6213
  });
6081
6214
  await runWrangler("publish index.js");
6082
6215
  expect(std.out).toMatchInlineSnapshot(`
6083
- "Total Upload: xx KiB / gzip: xx KiB
6084
- Uploaded test-name (TIMINGS)
6085
- Published test-name (TIMINGS)
6086
- https://test-name.test-sub-domain.workers.dev"
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
  "▲ [WARNING] Deprecation: 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\\";
@@ -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
- "Total Upload: xx KiB / gzip: xx KiB
6113
- Uploaded test-name (TIMINGS)
6114
- Published test-name (TIMINGS)
6115
- https://test-name.test-sub-domain.workers.dev"
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
- Object {
6151
- "debug": "",
6152
- "err": "",
6153
- "out": "Total Upload: xx KiB / gzip: xx KiB
6154
- Uploaded test-name (TIMINGS)
6155
- Published test-name (TIMINGS)
6156
- https://test-name.test-sub-domain.workers.dev",
6157
- "warn": "",
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
- Object {
6181
- "debug": "",
6182
- "err": "",
6183
- "out": "Total Upload: xx KiB / gzip: xx KiB
6184
- Uploaded test-name (TIMINGS)
6185
- Published test-name (TIMINGS)
6186
- https://test-name.test-sub-domain.workers.dev",
6187
- "warn": "",
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
- Object {
6204
- "debug": "",
6205
- "err": "",
6206
- "out": "Total Upload: xx KiB / gzip: xx KiB
6207
- Uploaded test-name (TIMINGS)
6208
- Published test-name (TIMINGS)
6209
- https://test-name.test-sub-domain.workers.dev",
6210
- "warn": "",
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: Error | undefined;
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 Error;
6414
+ err = e as esbuild.BuildFailure;
6277
6415
  }
6278
- expect(err?.message).toMatch(
6279
- `Detected a Node builtin module import while Node compatibility is disabled.\nAdd node_compat = true to your wrangler.toml file to enable Node compatibility.`
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
- Object {
6346
- "debug": "",
6347
- "err": "",
6348
- "out": "Total Upload: xx KiB / gzip: xx KiB
6349
- Uploaded test-name (TIMINGS)
6350
- Published test-name (TIMINGS)
6351
- https://test-name.test-sub-domain.workers.dev",
6352
- "warn": "",
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
+ X [ERROR] A request to the Cloudflare API (/accounts/some-account-id/workers/scripts/test-name) failed.
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
+ https://github.com/cloudflare/wrangler2/issues/new/choose
6602
+
6603
+ ",
6604
+ "warn": "▲ [WARNING] Here are the 2 largest dependencies included in your script:
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
+ X [ERROR] A request to the Cloudflare API (/accounts/some-account-id/workers/scripts/test-name) failed.
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
+ https://github.com/cloudflare/wrangler2/issues/new/choose
6660
+
6661
+ ",
6662
+ "warn": "▲ [WARNING] Here are the 2 largest dependencies included in your script:
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": "▲ [WARNING] We recommend keeping your script less than 1MiB (1024 KiB) after gzip. Exceeding past this can affect cold start time
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": "▲ [WARNING] Here are the 5 largest dependencies included in your script:
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
+ }