wrangler 2.17.0 → 2.19.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.
@@ -10,6 +10,7 @@ import {
10
10
  printBundleSize,
11
11
  printOffendingDependencies,
12
12
  } from "../bundle-reporter";
13
+ import { logger } from "../logger";
13
14
  import { writeAuthConfigFile } from "../user";
14
15
  import { mockAccountId, mockApiToken } from "./helpers/mock-account-id";
15
16
  import { mockAuthDomain } from "./helpers/mock-auth-domain";
@@ -68,6 +69,7 @@ describe("publish", () => {
68
69
  setIsTTY(true);
69
70
  mockLastDeploymentRequest();
70
71
  mockDeploymentsListRequest();
72
+ logger.loggerLevel = "log";
71
73
  });
72
74
 
73
75
  afterEach(() => {
@@ -138,7 +140,7 @@ describe("publish", () => {
138
140
 
139
141
  expect(std.out).toMatchInlineSnapshot(`
140
142
  "Attempting to login via OAuth...
141
- Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
143
+ Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20constellation%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
142
144
  Successfully logged in.
143
145
  Total Upload: xx KiB / gzip: xx KiB
144
146
  Uploaded test-name (TIMINGS)
@@ -178,7 +180,7 @@ describe("publish", () => {
178
180
 
179
181
  expect(std.out).toMatchInlineSnapshot(`
180
182
  "Attempting to login via OAuth...
181
- Opening a link in your default browser: https://dash.staging.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
183
+ Opening a link in your default browser: https://dash.staging.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20constellation%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
182
184
  Successfully logged in.
183
185
  Total Upload: xx KiB / gzip: xx KiB
184
186
  Uploaded test-name (TIMINGS)
@@ -1551,12 +1553,13 @@ addEventListener('fetch', event => {});`
1551
1553
  Object {
1552
1554
  "debug": "",
1553
1555
  "err": "",
1554
- "info": "",
1555
- "out": "Reading file-1.txt...
1556
- Uploading as file-1.2ca234f380.txt...
1557
- Reading file-2.txt...
1558
- Uploading as file-2.5938485188.txt...
1559
- ↗️ Done syncing assets
1556
+ "info": "Fetching list of already uploaded assets...
1557
+ Building list of assets to upload...
1558
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
1559
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
1560
+ Uploading 2 new assets...
1561
+ Uploaded 100% [2 out of 2]",
1562
+ "out": "↗️ Done syncing assets
1560
1563
  Total Upload: xx KiB / gzip: xx KiB
1561
1564
  Uploaded test-name (TIMINGS)
1562
1565
  Published test-name (TIMINGS)
@@ -1604,12 +1607,16 @@ addEventListener('fetch', event => {});`
1604
1607
  mockUploadAssetsToKVRequest(kvNamespace.id, assets);
1605
1608
  await runWrangler("publish --config ./my-site/wrangler.toml");
1606
1609
 
1610
+ expect(std.info).toMatchInlineSnapshot(`
1611
+ "Fetching list of already uploaded assets...
1612
+ Building list of assets to upload...
1613
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
1614
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
1615
+ Uploading 2 new assets...
1616
+ Uploaded 100% [2 out of 2]"
1617
+ `);
1607
1618
  expect(std.out).toMatchInlineSnapshot(`
1608
- "Reading file-1.txt...
1609
- Uploading as file-1.2ca234f380.txt...
1610
- Reading file-2.txt...
1611
- Uploading as file-2.5938485188.txt...
1612
- ↗️ Done syncing assets
1619
+ "↗️ Done syncing assets
1613
1620
  Total Upload: xx KiB / gzip: xx KiB
1614
1621
  Uploaded test-name (TIMINGS)
1615
1622
  Published test-name (TIMINGS)
@@ -1695,12 +1702,13 @@ addEventListener('fetch', event => {});`
1695
1702
  Object {
1696
1703
  "debug": "",
1697
1704
  "err": "",
1698
- "info": "",
1699
- "out": "Reading file-1.txt...
1700
- Uploading as file-1.2ca234f380.txt...
1701
- Reading file-2.txt...
1702
- Uploading as file-2.5938485188.txt...
1703
- ↗️ Done syncing assets
1705
+ "info": "Fetching list of already uploaded assets...
1706
+ Building list of assets to upload...
1707
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
1708
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
1709
+ Uploading 2 new assets...
1710
+ Uploaded 100% [2 out of 2]",
1711
+ "out": "↗️ Done syncing assets
1704
1712
  Total Upload: xx KiB / gzip: xx KiB
1705
1713
  Uploaded test-name (TIMINGS)
1706
1714
  Published test-name (TIMINGS)
@@ -1744,12 +1752,16 @@ addEventListener('fetch', event => {});`
1744
1752
  mockUploadAssetsToKVRequest(kvNamespace.id, assets);
1745
1753
  await runWrangler("publish");
1746
1754
 
1755
+ expect(std.info).toMatchInlineSnapshot(`
1756
+ "Fetching list of already uploaded assets...
1757
+ Building list of assets to upload...
1758
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
1759
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
1760
+ Uploading 2 new assets...
1761
+ Uploaded 100% [2 out of 2]"
1762
+ `);
1747
1763
  expect(std.out).toMatchInlineSnapshot(`
1748
- "Reading file-1.txt...
1749
- Uploading as file-1.2ca234f380.txt...
1750
- Reading file-2.txt...
1751
- Uploading as file-2.5938485188.txt...
1752
- ↗️ Done syncing assets
1764
+ "↗️ Done syncing assets
1753
1765
  Total Upload: xx KiB / gzip: xx KiB
1754
1766
  Uploaded test-name (TIMINGS)
1755
1767
  Published test-name (TIMINGS)
@@ -1786,12 +1798,13 @@ addEventListener('fetch', event => {});`
1786
1798
  Object {
1787
1799
  "debug": "",
1788
1800
  "err": "",
1789
- "info": "",
1790
- "out": "Reading file-1.txt...
1791
- Uploading as file-1.2ca234f380.txt...
1792
- Reading file-2.txt...
1793
- Uploading as file-2.5938485188.txt...
1794
- ↗️ Done syncing assets
1801
+ "info": "Fetching list of already uploaded assets...
1802
+ Building list of assets to upload...
1803
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
1804
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
1805
+ Uploading 2 new assets...
1806
+ Uploaded 100% [2 out of 2]",
1807
+ "out": "↗️ Done syncing assets
1795
1808
  Total Upload: xx KiB / gzip: xx KiB
1796
1809
  Uploaded test-name (TIMINGS)
1797
1810
  Published test-name (TIMINGS)
@@ -1977,12 +1990,13 @@ addEventListener('fetch', event => {});`
1977
1990
  Object {
1978
1991
  "debug": "",
1979
1992
  "err": "",
1980
- "info": "",
1981
- "out": "Reading subdir/file-1.txt...
1982
- Uploading as subdir/file-1.2ca234f380.txt...
1983
- Reading subdir/file-2.txt...
1984
- Uploading as subdir/file-2.5938485188.txt...
1985
- ↗️ Done syncing assets
1993
+ "info": "Fetching list of already uploaded assets...
1994
+ Building list of assets to upload...
1995
+ + subdir/file-1.2ca234f380.txt (uploading new version of subdir/file-1.txt)
1996
+ + subdir/file-2.5938485188.txt (uploading new version of subdir/file-2.txt)
1997
+ Uploading 2 new assets...
1998
+ Uploaded 100% [2 out of 2]",
1999
+ "out": "↗️ Done syncing assets
1986
2000
  Total Upload: xx KiB / gzip: xx KiB
1987
2001
  Uploaded test-name (TIMINGS)
1988
2002
  Published test-name (TIMINGS)
@@ -2025,12 +2039,13 @@ addEventListener('fetch', event => {});`
2025
2039
  Object {
2026
2040
  "debug": "",
2027
2041
  "err": "",
2028
- "info": "",
2029
- "out": "Reading subdir/file-1.txt...
2030
- Uploading as subdir/file-1.2ca234f380.txt...
2031
- Reading subdir/file-2.txt...
2032
- Uploading as subdir/file-2.5938485188.txt...
2033
- ↗️ Done syncing assets
2042
+ "info": "Fetching list of already uploaded assets...
2043
+ Building list of assets to upload...
2044
+ + subdir/file-1.2ca234f380.txt (uploading new version of subdir/file-1.txt)
2045
+ + subdir/file-2.5938485188.txt (uploading new version of subdir/file-2.txt)
2046
+ Uploading 2 new assets...
2047
+ Uploaded 100% [2 out of 2]",
2048
+ "out": "↗️ Done syncing assets
2034
2049
  Total Upload: xx KiB / gzip: xx KiB
2035
2050
  Uploaded test-name (TIMINGS)
2036
2051
  Published test-name (TIMINGS)
@@ -2082,12 +2097,16 @@ addEventListener('fetch', event => {});`
2082
2097
 
2083
2098
  await runWrangler("publish");
2084
2099
 
2100
+ expect(std.info).toMatchInlineSnapshot(`
2101
+ "Fetching list of already uploaded assets...
2102
+ Building list of assets to upload...
2103
+ + subdir/file-1.2ca234f380.txt (uploading new version of subdir/file-1.txt)
2104
+ + subdir/file-2.5938485188.txt (uploading new version of subdir/file-2.txt)
2105
+ Uploading 2 new assets...
2106
+ Uploaded 100% [2 out of 2]"
2107
+ `);
2085
2108
  expect(std.out).toMatchInlineSnapshot(`
2086
- "Reading subdir/file-1.txt...
2087
- Uploading as subdir/file-1.2ca234f380.txt...
2088
- Reading subdir/file-2.txt...
2089
- Uploading as subdir/file-2.5938485188.txt...
2090
- ↗️ Done syncing assets
2109
+ "↗️ Done syncing assets
2091
2110
  Total Upload: xx KiB / gzip: xx KiB
2092
2111
  Uploaded test-name (TIMINGS)
2093
2112
  Published test-name (TIMINGS)
@@ -2140,12 +2159,16 @@ addEventListener('fetch', event => {});`
2140
2159
 
2141
2160
  await runWrangler("publish");
2142
2161
 
2162
+ expect(std.info).toMatchInlineSnapshot(`
2163
+ "Fetching list of already uploaded assets...
2164
+ Building list of assets to upload...
2165
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2166
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
2167
+ Uploading 2 new assets...
2168
+ Uploaded 100% [2 out of 2]"
2169
+ `);
2143
2170
  expect(std.out).toMatchInlineSnapshot(`
2144
- "Reading file-1.txt...
2145
- Uploading as file-1.2ca234f380.txt...
2146
- Reading file-2.txt...
2147
- Uploading as file-2.5938485188.txt...
2148
- ↗️ Done syncing assets
2171
+ "↗️ Done syncing assets
2149
2172
  Total Upload: xx KiB / gzip: xx KiB
2150
2173
  Uploaded test-name (TIMINGS)
2151
2174
  Published test-name (TIMINGS)
@@ -2192,12 +2215,16 @@ addEventListener('fetch', event => {});`
2192
2215
 
2193
2216
  await runWrangler("publish");
2194
2217
 
2218
+ expect(std.info).toMatchInlineSnapshot(`
2219
+ "Fetching list of already uploaded assets...
2220
+ Building list of assets to upload...
2221
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2222
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
2223
+ Uploading 2 new assets...
2224
+ Uploaded 100% [2 out of 2]"
2225
+ `);
2195
2226
  expect(std.out).toMatchInlineSnapshot(`
2196
- "Reading file-1.txt...
2197
- Uploading as file-1.2ca234f380.txt...
2198
- Reading file-2.txt...
2199
- Uploading as file-2.5938485188.txt...
2200
- ↗️ Done syncing assets
2227
+ "↗️ Done syncing assets
2201
2228
  Total Upload: xx KiB / gzip: xx KiB
2202
2229
  Uploaded test-name (TIMINGS)
2203
2230
  Published test-name (TIMINGS)
@@ -2242,12 +2269,16 @@ addEventListener('fetch', event => {});`
2242
2269
  mockUploadAssetsToKVRequest(kvNamespace.id, assets);
2243
2270
  await runWrangler("publish --env some-env --legacy-env false");
2244
2271
 
2272
+ expect(std.info).toMatchInlineSnapshot(`
2273
+ "Fetching list of already uploaded assets...
2274
+ Building list of assets to upload...
2275
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2276
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
2277
+ Uploading 2 new assets...
2278
+ Uploaded 100% [2 out of 2]"
2279
+ `);
2245
2280
  expect(std.out).toMatchInlineSnapshot(`
2246
- "Reading file-1.txt...
2247
- Uploading as file-1.2ca234f380.txt...
2248
- Reading file-2.txt...
2249
- Uploading as file-2.5938485188.txt...
2250
- ↗️ Done syncing assets
2281
+ "↗️ Done syncing assets
2251
2282
  Total Upload: xx KiB / gzip: xx KiB
2252
2283
  Uploaded test-name (some-env) (TIMINGS)
2253
2284
  Published test-name (some-env) (TIMINGS)
@@ -2293,12 +2324,16 @@ addEventListener('fetch', event => {});`
2293
2324
  mockUploadAssetsToKVRequest(kvNamespace.id, assets);
2294
2325
  await runWrangler("publish --env some-env --legacy-env true");
2295
2326
 
2327
+ expect(std.info).toMatchInlineSnapshot(`
2328
+ "Fetching list of already uploaded assets...
2329
+ Building list of assets to upload...
2330
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2331
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
2332
+ Uploading 2 new assets...
2333
+ Uploaded 100% [2 out of 2]"
2334
+ `);
2296
2335
  expect(std.out).toMatchInlineSnapshot(`
2297
- "Reading file-1.txt...
2298
- Uploading as file-1.2ca234f380.txt...
2299
- Reading file-2.txt...
2300
- Uploading as file-2.5938485188.txt...
2301
- ↗️ Done syncing assets
2336
+ "↗️ Done syncing assets
2302
2337
  Total Upload: xx KiB / gzip: xx KiB
2303
2338
  Uploaded test-name-some-env (TIMINGS)
2304
2339
  Published test-name-some-env (TIMINGS)
@@ -2338,11 +2373,7 @@ addEventListener('fetch', event => {});`
2338
2373
  await runWrangler("publish");
2339
2374
 
2340
2375
  expect(std.out).toMatchInlineSnapshot(`
2341
- "Reading file-1.txt...
2342
- Skipping - already uploaded.
2343
- Reading file-2.txt...
2344
- Uploading as file-2.5938485188.txt...
2345
- ↗️ Done syncing assets
2376
+ "↗️ Done syncing assets
2346
2377
  Total Upload: xx KiB / gzip: xx KiB
2347
2378
  Uploaded test-name (TIMINGS)
2348
2379
  Published test-name (TIMINGS)
@@ -2380,10 +2411,15 @@ addEventListener('fetch', event => {});`
2380
2411
  );
2381
2412
  await runWrangler("publish --site-include file-1.txt");
2382
2413
 
2414
+ expect(std.info).toMatchInlineSnapshot(`
2415
+ "Fetching list of already uploaded assets...
2416
+ Building list of assets to upload...
2417
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2418
+ Uploading 1 new asset...
2419
+ Uploaded 100% [1 out of 1]"
2420
+ `);
2383
2421
  expect(std.out).toMatchInlineSnapshot(`
2384
- "Reading file-1.txt...
2385
- Uploading as file-1.2ca234f380.txt...
2386
- ↗️ Done syncing assets
2422
+ "↗️ Done syncing assets
2387
2423
  Total Upload: xx KiB / gzip: xx KiB
2388
2424
  Uploaded test-name (TIMINGS)
2389
2425
  Published test-name (TIMINGS)
@@ -2421,10 +2457,15 @@ addEventListener('fetch', event => {});`
2421
2457
  );
2422
2458
  await runWrangler("publish --site-exclude file-2.txt");
2423
2459
 
2460
+ expect(std.info).toMatchInlineSnapshot(`
2461
+ "Fetching list of already uploaded assets...
2462
+ Building list of assets to upload...
2463
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2464
+ Uploading 1 new asset...
2465
+ Uploaded 100% [1 out of 1]"
2466
+ `);
2424
2467
  expect(std.out).toMatchInlineSnapshot(`
2425
- "Reading file-1.txt...
2426
- Uploading as file-1.2ca234f380.txt...
2427
- ↗️ Done syncing assets
2468
+ "↗️ Done syncing assets
2428
2469
  Total Upload: xx KiB / gzip: xx KiB
2429
2470
  Uploaded test-name (TIMINGS)
2430
2471
  Published test-name (TIMINGS)
@@ -2463,10 +2504,15 @@ addEventListener('fetch', event => {});`
2463
2504
  );
2464
2505
  await runWrangler("publish");
2465
2506
 
2507
+ expect(std.info).toMatchInlineSnapshot(`
2508
+ "Fetching list of already uploaded assets...
2509
+ Building list of assets to upload...
2510
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2511
+ Uploading 1 new asset...
2512
+ Uploaded 100% [1 out of 1]"
2513
+ `);
2466
2514
  expect(std.out).toMatchInlineSnapshot(`
2467
- "Reading file-1.txt...
2468
- Uploading as file-1.2ca234f380.txt...
2469
- ↗️ Done syncing assets
2515
+ "↗️ Done syncing assets
2470
2516
  Total Upload: xx KiB / gzip: xx KiB
2471
2517
  Uploaded test-name (TIMINGS)
2472
2518
  Published test-name (TIMINGS)
@@ -2505,10 +2551,15 @@ addEventListener('fetch', event => {});`
2505
2551
  );
2506
2552
  await runWrangler("publish");
2507
2553
 
2554
+ expect(std.info).toMatchInlineSnapshot(`
2555
+ "Fetching list of already uploaded assets...
2556
+ Building list of assets to upload...
2557
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2558
+ Uploading 1 new asset...
2559
+ Uploaded 100% [1 out of 1]"
2560
+ `);
2508
2561
  expect(std.out).toMatchInlineSnapshot(`
2509
- "Reading file-1.txt...
2510
- Uploading as file-1.2ca234f380.txt...
2511
- ↗️ Done syncing assets
2562
+ "↗️ Done syncing assets
2512
2563
  Total Upload: xx KiB / gzip: xx KiB
2513
2564
  Uploaded test-name (TIMINGS)
2514
2565
  Published test-name (TIMINGS)
@@ -2547,10 +2598,15 @@ addEventListener('fetch', event => {});`
2547
2598
  );
2548
2599
  await runWrangler("publish --site-include file-1.txt");
2549
2600
 
2601
+ expect(std.info).toMatchInlineSnapshot(`
2602
+ "Fetching list of already uploaded assets...
2603
+ Building list of assets to upload...
2604
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2605
+ Uploading 1 new asset...
2606
+ Uploaded 100% [1 out of 1]"
2607
+ `);
2550
2608
  expect(std.out).toMatchInlineSnapshot(`
2551
- "Reading file-1.txt...
2552
- Uploading as file-1.2ca234f380.txt...
2553
- ↗️ Done syncing assets
2609
+ "↗️ Done syncing assets
2554
2610
  Total Upload: xx KiB / gzip: xx KiB
2555
2611
  Uploaded test-name (TIMINGS)
2556
2612
  Published test-name (TIMINGS)
@@ -2589,10 +2645,15 @@ addEventListener('fetch', event => {});`
2589
2645
  );
2590
2646
  await runWrangler("publish --site-exclude file-2.txt");
2591
2647
 
2648
+ expect(std.info).toMatchInlineSnapshot(`
2649
+ "Fetching list of already uploaded assets...
2650
+ Building list of assets to upload...
2651
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
2652
+ Uploading 1 new asset...
2653
+ Uploaded 100% [1 out of 1]"
2654
+ `);
2592
2655
  expect(std.out).toMatchInlineSnapshot(`
2593
- "Reading file-1.txt...
2594
- Uploading as file-1.2ca234f380.txt...
2595
- ↗️ Done syncing assets
2656
+ "↗️ Done syncing assets
2596
2657
  Total Upload: xx KiB / gzip: xx KiB
2597
2658
  Uploaded test-name (TIMINGS)
2598
2659
  Published test-name (TIMINGS)
@@ -2633,10 +2694,15 @@ addEventListener('fetch', event => {});`
2633
2694
  mockUploadAssetsToKVRequest(kvNamespace.id, assets.slice(0, 1));
2634
2695
  await runWrangler("publish");
2635
2696
 
2697
+ expect(std.info).toMatchInlineSnapshot(`
2698
+ "Fetching list of already uploaded assets...
2699
+ Building list of assets to upload...
2700
+ + directory-1/file-1.2ca234f380.txt (uploading new version of directory-1/file-1.txt)
2701
+ Uploading 1 new asset...
2702
+ Uploaded 100% [1 out of 1]"
2703
+ `);
2636
2704
  expect(std.out).toMatchInlineSnapshot(`
2637
- "Reading directory-1/file-1.txt...
2638
- Uploading as directory-1/file-1.2ca234f380.txt...
2639
- ↗️ Done syncing assets
2705
+ "↗️ Done syncing assets
2640
2706
  Total Upload: xx KiB / gzip: xx KiB
2641
2707
  Uploaded test-name (TIMINGS)
2642
2708
  Published test-name (TIMINGS)
@@ -2681,10 +2747,15 @@ addEventListener('fetch', event => {});`
2681
2747
  mockUploadAssetsToKVRequest(kvNamespace.id, assets.slice(2));
2682
2748
  await runWrangler("publish");
2683
2749
 
2750
+ expect(std.info).toMatchInlineSnapshot(`
2751
+ "Fetching list of already uploaded assets...
2752
+ Building list of assets to upload...
2753
+ + .well-known/file-2.5938485188.txt (uploading new version of .well-known/file-2.txt)
2754
+ Uploading 1 new asset...
2755
+ Uploaded 100% [1 out of 1]"
2756
+ `);
2684
2757
  expect(std.out).toMatchInlineSnapshot(`
2685
- "Reading .well-known/file-2.txt...
2686
- Uploading as .well-known/file-2.5938485188.txt...
2687
- ↗️ Done syncing assets
2758
+ "↗️ Done syncing assets
2688
2759
  Total Upload: xx KiB / gzip: xx KiB
2689
2760
  Uploaded test-name (TIMINGS)
2690
2761
  Published test-name (TIMINGS)
@@ -2730,13 +2801,15 @@ addEventListener('fetch', event => {});`
2730
2801
  `"File too-large-file.txt is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits"`
2731
2802
  );
2732
2803
 
2804
+ expect(std.info).toMatchInlineSnapshot(`
2805
+ "Fetching list of already uploaded assets...
2806
+ Building list of assets to upload...
2807
+ + large-file.0ea0637a45.txt (uploading new version of large-file.txt)"
2808
+ `);
2733
2809
  expect(std.out).toMatchInlineSnapshot(`
2734
- "Reading large-file.txt...
2735
- Uploading as large-file.0ea0637a45.txt...
2736
- Reading too-large-file.txt...
2737
-
2738
- If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
2739
- `);
2810
+ "
2811
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
2812
+ `);
2740
2813
  expect(std.err).toMatchInlineSnapshot(`
2741
2814
  "X [ERROR] File too-large-file.txt is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits
2742
2815
 
@@ -2772,7 +2845,9 @@ addEventListener('fetch', event => {});`
2772
2845
  await runWrangler("publish");
2773
2846
 
2774
2847
  // We expect this to be uploaded in 4 batches
2775
-
2848
+ expect(requests.length).toEqual(4);
2849
+ // Buckets may be uploaded in any order, so sort them before we assert
2850
+ requests.sort((a, b) => a.uploads[0].key.localeCompare(b.uploads[0].key));
2776
2851
  // The first batch has 11 files
2777
2852
  expect(requests[0].uploads.length).toEqual(11);
2778
2853
  // The next batch has 5 files
@@ -2790,60 +2865,49 @@ addEventListener('fetch', event => {});`
2790
2865
  }
2791
2866
  }
2792
2867
 
2793
- expect(std).toMatchInlineSnapshot(`
2794
- Object {
2795
- "debug": "",
2796
- "err": "",
2797
- "info": "",
2798
- "out": "Reading file-00.txt...
2799
- Uploading as file-00.be5be5dd26.txt...
2800
- Reading file-01.txt...
2801
- Uploading as file-01.4842d35994.txt...
2802
- Reading file-02.txt...
2803
- Uploading as file-02.990572ec63.txt...
2804
- Reading file-03.txt...
2805
- Uploading as file-03.9d7dda9045.txt...
2806
- Reading file-04.txt...
2807
- Uploading as file-04.2b6fac6382.txt...
2808
- Reading file-05.txt...
2809
- Uploading as file-05.55762dc758.txt...
2810
- Reading file-06.txt...
2811
- Uploading as file-06.f408a6b020.txt...
2812
- Reading file-07.txt...
2813
- Uploading as file-07.64c051715b.txt...
2814
- Reading file-08.txt...
2815
- Uploading as file-08.d286789adb.txt...
2816
- Reading file-09.txt...
2817
- Uploading as file-09.6838c183a8.txt...
2818
- Reading file-10.txt...
2819
- Uploading as file-10.6e03221d2a.txt...
2820
- Reading file-11.txt...
2821
- Uploading as file-11.37d3fb2eff.txt...
2822
- Reading file-12.txt...
2823
- Uploading as file-12.b3556942f8.txt...
2824
- Reading file-13.txt...
2825
- Uploading as file-13.680caf51b1.txt...
2826
- Reading file-14.txt...
2827
- Uploading as file-14.51e88468f0.txt...
2828
- Reading file-15.txt...
2829
- Uploading as file-15.8e3fedb394.txt...
2830
- Reading file-16.txt...
2831
- Uploading as file-16.c81c5e426f.txt...
2832
- Reading file-17.txt...
2833
- Uploading as file-17.4b2ae3c47b.txt...
2834
- Reading file-18.txt...
2835
- Uploading as file-18.07f245e02b.txt...
2836
- Reading file-19.txt...
2837
- Uploading as file-19.f0d69f705d.txt...
2838
- ↗️ Done syncing assets
2868
+ expect(std.debug).toMatchInlineSnapshot(`""`);
2869
+ expect(std.out).toMatchInlineSnapshot(`
2870
+ "↗️ Done syncing assets
2839
2871
  Total Upload: xx KiB / gzip: xx KiB
2840
2872
  Uploaded test-name (TIMINGS)
2841
2873
  Published test-name (TIMINGS)
2842
2874
  https://test-name.test-sub-domain.workers.dev
2843
- Current Deployment ID: Galaxy-Class",
2844
- "warn": "",
2845
- }
2875
+ Current Deployment ID: Galaxy-Class"
2876
+ `);
2877
+ // Mask all but last upload progress message as upload order unknown
2878
+ // (regexp replaces all single/double-digit percentages, i.e. not 100%)
2879
+ expect(std.info.replace(/Uploaded \d\d?% \[\d+/g, "Uploaded X% [X"))
2880
+ .toMatchInlineSnapshot(`
2881
+ "Fetching list of already uploaded assets...
2882
+ Building list of assets to upload...
2883
+ + file-00.be5be5dd26.txt (uploading new version of file-00.txt)
2884
+ + file-01.4842d35994.txt (uploading new version of file-01.txt)
2885
+ + file-02.990572ec63.txt (uploading new version of file-02.txt)
2886
+ + file-03.9d7dda9045.txt (uploading new version of file-03.txt)
2887
+ + file-04.2b6fac6382.txt (uploading new version of file-04.txt)
2888
+ + file-05.55762dc758.txt (uploading new version of file-05.txt)
2889
+ + file-06.f408a6b020.txt (uploading new version of file-06.txt)
2890
+ + file-07.64c051715b.txt (uploading new version of file-07.txt)
2891
+ + file-08.d286789adb.txt (uploading new version of file-08.txt)
2892
+ + file-09.6838c183a8.txt (uploading new version of file-09.txt)
2893
+ + file-10.6e03221d2a.txt (uploading new version of file-10.txt)
2894
+ + file-11.37d3fb2eff.txt (uploading new version of file-11.txt)
2895
+ + file-12.b3556942f8.txt (uploading new version of file-12.txt)
2896
+ + file-13.680caf51b1.txt (uploading new version of file-13.txt)
2897
+ + file-14.51e88468f0.txt (uploading new version of file-14.txt)
2898
+ + file-15.8e3fedb394.txt (uploading new version of file-15.txt)
2899
+ + file-16.c81c5e426f.txt (uploading new version of file-16.txt)
2900
+ + file-17.4b2ae3c47b.txt (uploading new version of file-17.txt)
2901
+ + file-18.07f245e02b.txt (uploading new version of file-18.txt)
2902
+ + file-19.f0d69f705d.txt (uploading new version of file-19.txt)
2903
+ Uploading 20 new assets...
2904
+ Uploaded X% [X out of 20]
2905
+ Uploaded X% [X out of 20]
2906
+ Uploaded X% [X out of 20]
2907
+ Uploaded 100% [20 out of 20]"
2846
2908
  `);
2909
+ expect(std.warn).toMatchInlineSnapshot(`""`);
2910
+ expect(std.err).toMatchInlineSnapshot(`""`);
2847
2911
  });
2848
2912
 
2849
2913
  it("should error if the asset key is over 512 characters", async () => {
@@ -2874,11 +2938,14 @@ addEventListener('fetch', event => {});`
2874
2938
  `"The asset path key \\"folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/file.3da0d0cd12.txt\\" exceeds the maximum key size limit of 512. See https://developers.cloudflare.com/workers/platform/limits#kv-limits\\","`
2875
2939
  );
2876
2940
 
2941
+ expect(std.info).toMatchInlineSnapshot(`
2942
+ "Fetching list of already uploaded assets...
2943
+ Building list of assets to upload..."
2944
+ `);
2877
2945
  expect(std.out).toMatchInlineSnapshot(`
2878
- "Reading folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/file.txt...
2879
-
2880
- If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
2881
- `);
2946
+ "
2947
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
2948
+ `);
2882
2949
  expect(std.err).toMatchInlineSnapshot(`
2883
2950
  "X [ERROR] The asset path key \\"folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/file.3da0d0cd12.txt\\" exceeds the maximum key size limit of 512. See https://developers.cloudflare.com/workers/platform/limits#kv-limits\\",
2884
2951
 
@@ -2928,14 +2995,20 @@ addEventListener('fetch', event => {});`
2928
2995
 
2929
2996
  await runWrangler("publish");
2930
2997
 
2998
+ expect(std.info).toMatchInlineSnapshot(`
2999
+ "Fetching list of already uploaded assets...
3000
+ Building list of assets to upload...
3001
+ = file-1.2ca234f380.txt (already uploaded file-1.txt)
3002
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
3003
+ - file-3.somehash.txt (removing as stale)
3004
+ - file-4.anotherhash.txt (removing as stale)
3005
+ Uploading 1 new asset...
3006
+ Skipped uploading 1 existing asset.
3007
+ Uploaded 100% [1 out of 1]
3008
+ Removing 2 stale assets..."
3009
+ `);
2931
3010
  expect(std.out).toMatchInlineSnapshot(`
2932
- "Reading file-1.txt...
2933
- Skipping - already uploaded.
2934
- Reading file-2.txt...
2935
- Uploading as file-2.5938485188.txt...
2936
- Deleting file-3.somehash.txt from the asset store...
2937
- Deleting file-4.anotherhash.txt from the asset store...
2938
- ↗️ Done syncing assets
3011
+ "↗️ Done syncing assets
2939
3012
  Total Upload: xx KiB / gzip: xx KiB
2940
3013
  Uploaded test-name (TIMINGS)
2941
3014
  Published test-name (TIMINGS)
@@ -2985,12 +3058,16 @@ addEventListener('fetch', event => {});`
2985
3058
  await runWrangler("publish");
2986
3059
  process.chdir("../");
2987
3060
 
3061
+ expect(std.info).toMatchInlineSnapshot(`
3062
+ "Fetching list of already uploaded assets...
3063
+ Building list of assets to upload...
3064
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
3065
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
3066
+ Uploading 2 new assets...
3067
+ Uploaded 100% [2 out of 2]"
3068
+ `);
2988
3069
  expect(std.out).toMatchInlineSnapshot(`
2989
- "Reading file-1.txt...
2990
- Uploading as file-1.2ca234f380.txt...
2991
- Reading file-2.txt...
2992
- Uploading as file-2.5938485188.txt...
2993
- ↗️ Done syncing assets
3070
+ "↗️ Done syncing assets
2994
3071
  Total Upload: xx KiB / gzip: xx KiB
2995
3072
  Uploaded test-name (TIMINGS)
2996
3073
  Published test-name (TIMINGS)
@@ -3028,12 +3105,13 @@ addEventListener('fetch', event => {});`
3028
3105
  Object {
3029
3106
  "debug": "",
3030
3107
  "err": "",
3031
- "info": "",
3032
- "out": "Reading file-1.txt...
3033
- Uploading as file-1.2ca234f380.txt...
3034
- Reading file-2.txt...
3035
- Uploading as file-2.5938485188.txt...
3036
- ↗️ Done syncing assets
3108
+ "info": "Fetching list of already uploaded assets...
3109
+ Building list of assets to upload...
3110
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
3111
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
3112
+ Uploading 2 new assets...
3113
+ Uploaded 100% [2 out of 2]",
3114
+ "out": "↗️ Done syncing assets
3037
3115
  Total Upload: xx KiB / gzip: xx KiB
3038
3116
  Uploaded test-name (TIMINGS)
3039
3117
  Published test-name (TIMINGS)
@@ -3072,12 +3150,13 @@ addEventListener('fetch', event => {});`
3072
3150
  Object {
3073
3151
  "debug": "",
3074
3152
  "err": "",
3075
- "info": "",
3076
- "out": "Reading file-1.txt...
3077
- Uploading as file-1.2ca234f380.txt...
3078
- Reading file-2.txt...
3079
- Uploading as file-2.5938485188.txt...
3080
- ↗️ Done syncing assets
3153
+ "info": "Fetching list of already uploaded assets...
3154
+ Building list of assets to upload...
3155
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
3156
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
3157
+ Uploading 2 new assets...
3158
+ Uploaded 100% [2 out of 2]",
3159
+ "out": "↗️ Done syncing assets
3081
3160
  Total Upload: xx KiB / gzip: xx KiB
3082
3161
  Uploaded test-name (TIMINGS)
3083
3162
  Published test-name (TIMINGS)
@@ -3089,6 +3168,352 @@ addEventListener('fetch', event => {});`
3089
3168
  }
3090
3169
  `);
3091
3170
  });
3171
+
3172
+ it("should abort other bucket uploads if one bucket upload fails", async () => {
3173
+ // Write 9 20MiB files, should end up with 3 buckets
3174
+ const content = "X".repeat(20 * 1024 * 1024);
3175
+ const assets = Array.from({ length: 9 }, (_, index) => ({
3176
+ filePath: `file-${index}.txt`,
3177
+ content,
3178
+ }));
3179
+
3180
+ const kvNamespace = {
3181
+ title: "__test-name-workers_sites_assets",
3182
+ id: "__test-name-workers_sites_assets-id",
3183
+ };
3184
+ writeWranglerToml({
3185
+ main: "./index.js",
3186
+ site: {
3187
+ bucket: "assets",
3188
+ },
3189
+ });
3190
+ writeWorkerSource();
3191
+ writeAssets(assets);
3192
+ mockUploadWorkerRequest();
3193
+ mockSubDomainRequest();
3194
+ mockListKVNamespacesRequest(kvNamespace);
3195
+ mockKeyListRequest(kvNamespace.id, []);
3196
+
3197
+ let requestCount = 0;
3198
+ const bulkUrl =
3199
+ "*/accounts/:accountId/storage/kv/namespaces/:namespaceId/bulk";
3200
+ msw.use(
3201
+ rest.put(bulkUrl, async (req, res, ctx) => {
3202
+ expect(req.params.accountId).toEqual("some-account-id");
3203
+ expect(req.params.namespaceId).toEqual(kvNamespace.id);
3204
+ requestCount++;
3205
+ return res(
3206
+ ctx.status(500),
3207
+ ctx.json(
3208
+ createFetchResult([], false, [
3209
+ { code: 1000, message: "Whoops! Something went wrong!" },
3210
+ ])
3211
+ )
3212
+ );
3213
+ })
3214
+ );
3215
+
3216
+ await expect(
3217
+ runWrangler("publish")
3218
+ ).rejects.toThrowErrorMatchingInlineSnapshot(
3219
+ `"A request to the Cloudflare API (/accounts/some-account-id/storage/kv/namespaces/__test-name-workers_sites_assets-id/bulk) failed."`
3220
+ );
3221
+
3222
+ expect(requestCount).toBeLessThan(3);
3223
+ expect(std.info).toMatchInlineSnapshot(`
3224
+ "Fetching list of already uploaded assets...
3225
+ Building list of assets to upload...
3226
+ + file-0.f0d69f705d.txt (uploading new version of file-0.txt)
3227
+ + file-1.f0d69f705d.txt (uploading new version of file-1.txt)
3228
+ + file-2.f0d69f705d.txt (uploading new version of file-2.txt)
3229
+ + file-3.f0d69f705d.txt (uploading new version of file-3.txt)
3230
+ + file-4.f0d69f705d.txt (uploading new version of file-4.txt)
3231
+ + file-5.f0d69f705d.txt (uploading new version of file-5.txt)
3232
+ + file-6.f0d69f705d.txt (uploading new version of file-6.txt)
3233
+ + file-7.f0d69f705d.txt (uploading new version of file-7.txt)
3234
+ + file-8.f0d69f705d.txt (uploading new version of file-8.txt)
3235
+ Uploading 9 new assets...
3236
+ Upload failed, aborting..."
3237
+ `);
3238
+ });
3239
+
3240
+ describe("should truncate diff with over 100 assets unless debug log level set", () => {
3241
+ beforeEach(() => {
3242
+ const assets = Array.from({ length: 110 }, (_, index) => ({
3243
+ filePath: `file-${`${index}`.padStart(3, "0")}.txt`,
3244
+ content: "X",
3245
+ }));
3246
+
3247
+ const kvNamespace = {
3248
+ title: "__test-name-workers_sites_assets",
3249
+ id: "__test-name-workers_sites_assets-id",
3250
+ };
3251
+ writeWranglerToml({
3252
+ main: "./index.js",
3253
+ site: {
3254
+ bucket: "assets",
3255
+ },
3256
+ });
3257
+ writeWorkerSource();
3258
+ writeAssets(assets);
3259
+ mockUploadWorkerRequest();
3260
+ mockSubDomainRequest();
3261
+ mockListKVNamespacesRequest(kvNamespace);
3262
+ mockKeyListRequest(kvNamespace.id, []);
3263
+ mockUploadAssetsToKVRequest(kvNamespace.id);
3264
+ });
3265
+
3266
+ it("default log level", async () => {
3267
+ await runWrangler("publish");
3268
+ expect(std).toMatchInlineSnapshot(`
3269
+ Object {
3270
+ "debug": "",
3271
+ "err": "",
3272
+ "info": "Fetching list of already uploaded assets...
3273
+ Building list of assets to upload...
3274
+ + file-000.010257e8bb.txt (uploading new version of file-000.txt)
3275
+ + file-001.010257e8bb.txt (uploading new version of file-001.txt)
3276
+ + file-002.010257e8bb.txt (uploading new version of file-002.txt)
3277
+ + file-003.010257e8bb.txt (uploading new version of file-003.txt)
3278
+ + file-004.010257e8bb.txt (uploading new version of file-004.txt)
3279
+ + file-005.010257e8bb.txt (uploading new version of file-005.txt)
3280
+ + file-006.010257e8bb.txt (uploading new version of file-006.txt)
3281
+ + file-007.010257e8bb.txt (uploading new version of file-007.txt)
3282
+ + file-008.010257e8bb.txt (uploading new version of file-008.txt)
3283
+ + file-009.010257e8bb.txt (uploading new version of file-009.txt)
3284
+ + file-010.010257e8bb.txt (uploading new version of file-010.txt)
3285
+ + file-011.010257e8bb.txt (uploading new version of file-011.txt)
3286
+ + file-012.010257e8bb.txt (uploading new version of file-012.txt)
3287
+ + file-013.010257e8bb.txt (uploading new version of file-013.txt)
3288
+ + file-014.010257e8bb.txt (uploading new version of file-014.txt)
3289
+ + file-015.010257e8bb.txt (uploading new version of file-015.txt)
3290
+ + file-016.010257e8bb.txt (uploading new version of file-016.txt)
3291
+ + file-017.010257e8bb.txt (uploading new version of file-017.txt)
3292
+ + file-018.010257e8bb.txt (uploading new version of file-018.txt)
3293
+ + file-019.010257e8bb.txt (uploading new version of file-019.txt)
3294
+ + file-020.010257e8bb.txt (uploading new version of file-020.txt)
3295
+ + file-021.010257e8bb.txt (uploading new version of file-021.txt)
3296
+ + file-022.010257e8bb.txt (uploading new version of file-022.txt)
3297
+ + file-023.010257e8bb.txt (uploading new version of file-023.txt)
3298
+ + file-024.010257e8bb.txt (uploading new version of file-024.txt)
3299
+ + file-025.010257e8bb.txt (uploading new version of file-025.txt)
3300
+ + file-026.010257e8bb.txt (uploading new version of file-026.txt)
3301
+ + file-027.010257e8bb.txt (uploading new version of file-027.txt)
3302
+ + file-028.010257e8bb.txt (uploading new version of file-028.txt)
3303
+ + file-029.010257e8bb.txt (uploading new version of file-029.txt)
3304
+ + file-030.010257e8bb.txt (uploading new version of file-030.txt)
3305
+ + file-031.010257e8bb.txt (uploading new version of file-031.txt)
3306
+ + file-032.010257e8bb.txt (uploading new version of file-032.txt)
3307
+ + file-033.010257e8bb.txt (uploading new version of file-033.txt)
3308
+ + file-034.010257e8bb.txt (uploading new version of file-034.txt)
3309
+ + file-035.010257e8bb.txt (uploading new version of file-035.txt)
3310
+ + file-036.010257e8bb.txt (uploading new version of file-036.txt)
3311
+ + file-037.010257e8bb.txt (uploading new version of file-037.txt)
3312
+ + file-038.010257e8bb.txt (uploading new version of file-038.txt)
3313
+ + file-039.010257e8bb.txt (uploading new version of file-039.txt)
3314
+ + file-040.010257e8bb.txt (uploading new version of file-040.txt)
3315
+ + file-041.010257e8bb.txt (uploading new version of file-041.txt)
3316
+ + file-042.010257e8bb.txt (uploading new version of file-042.txt)
3317
+ + file-043.010257e8bb.txt (uploading new version of file-043.txt)
3318
+ + file-044.010257e8bb.txt (uploading new version of file-044.txt)
3319
+ + file-045.010257e8bb.txt (uploading new version of file-045.txt)
3320
+ + file-046.010257e8bb.txt (uploading new version of file-046.txt)
3321
+ + file-047.010257e8bb.txt (uploading new version of file-047.txt)
3322
+ + file-048.010257e8bb.txt (uploading new version of file-048.txt)
3323
+ + file-049.010257e8bb.txt (uploading new version of file-049.txt)
3324
+ + file-050.010257e8bb.txt (uploading new version of file-050.txt)
3325
+ + file-051.010257e8bb.txt (uploading new version of file-051.txt)
3326
+ + file-052.010257e8bb.txt (uploading new version of file-052.txt)
3327
+ + file-053.010257e8bb.txt (uploading new version of file-053.txt)
3328
+ + file-054.010257e8bb.txt (uploading new version of file-054.txt)
3329
+ + file-055.010257e8bb.txt (uploading new version of file-055.txt)
3330
+ + file-056.010257e8bb.txt (uploading new version of file-056.txt)
3331
+ + file-057.010257e8bb.txt (uploading new version of file-057.txt)
3332
+ + file-058.010257e8bb.txt (uploading new version of file-058.txt)
3333
+ + file-059.010257e8bb.txt (uploading new version of file-059.txt)
3334
+ + file-060.010257e8bb.txt (uploading new version of file-060.txt)
3335
+ + file-061.010257e8bb.txt (uploading new version of file-061.txt)
3336
+ + file-062.010257e8bb.txt (uploading new version of file-062.txt)
3337
+ + file-063.010257e8bb.txt (uploading new version of file-063.txt)
3338
+ + file-064.010257e8bb.txt (uploading new version of file-064.txt)
3339
+ + file-065.010257e8bb.txt (uploading new version of file-065.txt)
3340
+ + file-066.010257e8bb.txt (uploading new version of file-066.txt)
3341
+ + file-067.010257e8bb.txt (uploading new version of file-067.txt)
3342
+ + file-068.010257e8bb.txt (uploading new version of file-068.txt)
3343
+ + file-069.010257e8bb.txt (uploading new version of file-069.txt)
3344
+ + file-070.010257e8bb.txt (uploading new version of file-070.txt)
3345
+ + file-071.010257e8bb.txt (uploading new version of file-071.txt)
3346
+ + file-072.010257e8bb.txt (uploading new version of file-072.txt)
3347
+ + file-073.010257e8bb.txt (uploading new version of file-073.txt)
3348
+ + file-074.010257e8bb.txt (uploading new version of file-074.txt)
3349
+ + file-075.010257e8bb.txt (uploading new version of file-075.txt)
3350
+ + file-076.010257e8bb.txt (uploading new version of file-076.txt)
3351
+ + file-077.010257e8bb.txt (uploading new version of file-077.txt)
3352
+ + file-078.010257e8bb.txt (uploading new version of file-078.txt)
3353
+ + file-079.010257e8bb.txt (uploading new version of file-079.txt)
3354
+ + file-080.010257e8bb.txt (uploading new version of file-080.txt)
3355
+ + file-081.010257e8bb.txt (uploading new version of file-081.txt)
3356
+ + file-082.010257e8bb.txt (uploading new version of file-082.txt)
3357
+ + file-083.010257e8bb.txt (uploading new version of file-083.txt)
3358
+ + file-084.010257e8bb.txt (uploading new version of file-084.txt)
3359
+ + file-085.010257e8bb.txt (uploading new version of file-085.txt)
3360
+ + file-086.010257e8bb.txt (uploading new version of file-086.txt)
3361
+ + file-087.010257e8bb.txt (uploading new version of file-087.txt)
3362
+ + file-088.010257e8bb.txt (uploading new version of file-088.txt)
3363
+ + file-089.010257e8bb.txt (uploading new version of file-089.txt)
3364
+ + file-090.010257e8bb.txt (uploading new version of file-090.txt)
3365
+ + file-091.010257e8bb.txt (uploading new version of file-091.txt)
3366
+ + file-092.010257e8bb.txt (uploading new version of file-092.txt)
3367
+ + file-093.010257e8bb.txt (uploading new version of file-093.txt)
3368
+ + file-094.010257e8bb.txt (uploading new version of file-094.txt)
3369
+ + file-095.010257e8bb.txt (uploading new version of file-095.txt)
3370
+ + file-096.010257e8bb.txt (uploading new version of file-096.txt)
3371
+ + file-097.010257e8bb.txt (uploading new version of file-097.txt)
3372
+ + file-098.010257e8bb.txt (uploading new version of file-098.txt)
3373
+ + file-099.010257e8bb.txt (uploading new version of file-099.txt)
3374
+ (truncating changed assets log, set \`WRANGLER_LOG=debug\` environment variable to see full diff)
3375
+ Uploading 110 new assets...
3376
+ Uploaded 100% [110 out of 110]",
3377
+ "out": "↗️ Done syncing assets
3378
+ Total Upload: xx KiB / gzip: xx KiB
3379
+ Uploaded test-name (TIMINGS)
3380
+ Published test-name (TIMINGS)
3381
+ https://test-name.test-sub-domain.workers.dev
3382
+ Current Deployment ID: Galaxy-Class",
3383
+ "warn": "",
3384
+ }
3385
+ `);
3386
+ });
3387
+
3388
+ it("debug log level", async () => {
3389
+ logger.loggerLevel = "debug";
3390
+ await runWrangler("publish");
3391
+
3392
+ const diffRegexp = /^ [+=-]/;
3393
+ const diff = std.debug
3394
+ .split("\n")
3395
+ .filter((line) => diffRegexp.test(line))
3396
+ .join("\n");
3397
+ expect(diff).toMatchInlineSnapshot(`
3398
+ " + file-000.010257e8bb.txt (uploading new version of file-000.txt)
3399
+ + file-001.010257e8bb.txt (uploading new version of file-001.txt)
3400
+ + file-002.010257e8bb.txt (uploading new version of file-002.txt)
3401
+ + file-003.010257e8bb.txt (uploading new version of file-003.txt)
3402
+ + file-004.010257e8bb.txt (uploading new version of file-004.txt)
3403
+ + file-005.010257e8bb.txt (uploading new version of file-005.txt)
3404
+ + file-006.010257e8bb.txt (uploading new version of file-006.txt)
3405
+ + file-007.010257e8bb.txt (uploading new version of file-007.txt)
3406
+ + file-008.010257e8bb.txt (uploading new version of file-008.txt)
3407
+ + file-009.010257e8bb.txt (uploading new version of file-009.txt)
3408
+ + file-010.010257e8bb.txt (uploading new version of file-010.txt)
3409
+ + file-011.010257e8bb.txt (uploading new version of file-011.txt)
3410
+ + file-012.010257e8bb.txt (uploading new version of file-012.txt)
3411
+ + file-013.010257e8bb.txt (uploading new version of file-013.txt)
3412
+ + file-014.010257e8bb.txt (uploading new version of file-014.txt)
3413
+ + file-015.010257e8bb.txt (uploading new version of file-015.txt)
3414
+ + file-016.010257e8bb.txt (uploading new version of file-016.txt)
3415
+ + file-017.010257e8bb.txt (uploading new version of file-017.txt)
3416
+ + file-018.010257e8bb.txt (uploading new version of file-018.txt)
3417
+ + file-019.010257e8bb.txt (uploading new version of file-019.txt)
3418
+ + file-020.010257e8bb.txt (uploading new version of file-020.txt)
3419
+ + file-021.010257e8bb.txt (uploading new version of file-021.txt)
3420
+ + file-022.010257e8bb.txt (uploading new version of file-022.txt)
3421
+ + file-023.010257e8bb.txt (uploading new version of file-023.txt)
3422
+ + file-024.010257e8bb.txt (uploading new version of file-024.txt)
3423
+ + file-025.010257e8bb.txt (uploading new version of file-025.txt)
3424
+ + file-026.010257e8bb.txt (uploading new version of file-026.txt)
3425
+ + file-027.010257e8bb.txt (uploading new version of file-027.txt)
3426
+ + file-028.010257e8bb.txt (uploading new version of file-028.txt)
3427
+ + file-029.010257e8bb.txt (uploading new version of file-029.txt)
3428
+ + file-030.010257e8bb.txt (uploading new version of file-030.txt)
3429
+ + file-031.010257e8bb.txt (uploading new version of file-031.txt)
3430
+ + file-032.010257e8bb.txt (uploading new version of file-032.txt)
3431
+ + file-033.010257e8bb.txt (uploading new version of file-033.txt)
3432
+ + file-034.010257e8bb.txt (uploading new version of file-034.txt)
3433
+ + file-035.010257e8bb.txt (uploading new version of file-035.txt)
3434
+ + file-036.010257e8bb.txt (uploading new version of file-036.txt)
3435
+ + file-037.010257e8bb.txt (uploading new version of file-037.txt)
3436
+ + file-038.010257e8bb.txt (uploading new version of file-038.txt)
3437
+ + file-039.010257e8bb.txt (uploading new version of file-039.txt)
3438
+ + file-040.010257e8bb.txt (uploading new version of file-040.txt)
3439
+ + file-041.010257e8bb.txt (uploading new version of file-041.txt)
3440
+ + file-042.010257e8bb.txt (uploading new version of file-042.txt)
3441
+ + file-043.010257e8bb.txt (uploading new version of file-043.txt)
3442
+ + file-044.010257e8bb.txt (uploading new version of file-044.txt)
3443
+ + file-045.010257e8bb.txt (uploading new version of file-045.txt)
3444
+ + file-046.010257e8bb.txt (uploading new version of file-046.txt)
3445
+ + file-047.010257e8bb.txt (uploading new version of file-047.txt)
3446
+ + file-048.010257e8bb.txt (uploading new version of file-048.txt)
3447
+ + file-049.010257e8bb.txt (uploading new version of file-049.txt)
3448
+ + file-050.010257e8bb.txt (uploading new version of file-050.txt)
3449
+ + file-051.010257e8bb.txt (uploading new version of file-051.txt)
3450
+ + file-052.010257e8bb.txt (uploading new version of file-052.txt)
3451
+ + file-053.010257e8bb.txt (uploading new version of file-053.txt)
3452
+ + file-054.010257e8bb.txt (uploading new version of file-054.txt)
3453
+ + file-055.010257e8bb.txt (uploading new version of file-055.txt)
3454
+ + file-056.010257e8bb.txt (uploading new version of file-056.txt)
3455
+ + file-057.010257e8bb.txt (uploading new version of file-057.txt)
3456
+ + file-058.010257e8bb.txt (uploading new version of file-058.txt)
3457
+ + file-059.010257e8bb.txt (uploading new version of file-059.txt)
3458
+ + file-060.010257e8bb.txt (uploading new version of file-060.txt)
3459
+ + file-061.010257e8bb.txt (uploading new version of file-061.txt)
3460
+ + file-062.010257e8bb.txt (uploading new version of file-062.txt)
3461
+ + file-063.010257e8bb.txt (uploading new version of file-063.txt)
3462
+ + file-064.010257e8bb.txt (uploading new version of file-064.txt)
3463
+ + file-065.010257e8bb.txt (uploading new version of file-065.txt)
3464
+ + file-066.010257e8bb.txt (uploading new version of file-066.txt)
3465
+ + file-067.010257e8bb.txt (uploading new version of file-067.txt)
3466
+ + file-068.010257e8bb.txt (uploading new version of file-068.txt)
3467
+ + file-069.010257e8bb.txt (uploading new version of file-069.txt)
3468
+ + file-070.010257e8bb.txt (uploading new version of file-070.txt)
3469
+ + file-071.010257e8bb.txt (uploading new version of file-071.txt)
3470
+ + file-072.010257e8bb.txt (uploading new version of file-072.txt)
3471
+ + file-073.010257e8bb.txt (uploading new version of file-073.txt)
3472
+ + file-074.010257e8bb.txt (uploading new version of file-074.txt)
3473
+ + file-075.010257e8bb.txt (uploading new version of file-075.txt)
3474
+ + file-076.010257e8bb.txt (uploading new version of file-076.txt)
3475
+ + file-077.010257e8bb.txt (uploading new version of file-077.txt)
3476
+ + file-078.010257e8bb.txt (uploading new version of file-078.txt)
3477
+ + file-079.010257e8bb.txt (uploading new version of file-079.txt)
3478
+ + file-080.010257e8bb.txt (uploading new version of file-080.txt)
3479
+ + file-081.010257e8bb.txt (uploading new version of file-081.txt)
3480
+ + file-082.010257e8bb.txt (uploading new version of file-082.txt)
3481
+ + file-083.010257e8bb.txt (uploading new version of file-083.txt)
3482
+ + file-084.010257e8bb.txt (uploading new version of file-084.txt)
3483
+ + file-085.010257e8bb.txt (uploading new version of file-085.txt)
3484
+ + file-086.010257e8bb.txt (uploading new version of file-086.txt)
3485
+ + file-087.010257e8bb.txt (uploading new version of file-087.txt)
3486
+ + file-088.010257e8bb.txt (uploading new version of file-088.txt)
3487
+ + file-089.010257e8bb.txt (uploading new version of file-089.txt)
3488
+ + file-090.010257e8bb.txt (uploading new version of file-090.txt)
3489
+ + file-091.010257e8bb.txt (uploading new version of file-091.txt)
3490
+ + file-092.010257e8bb.txt (uploading new version of file-092.txt)
3491
+ + file-093.010257e8bb.txt (uploading new version of file-093.txt)
3492
+ + file-094.010257e8bb.txt (uploading new version of file-094.txt)
3493
+ + file-095.010257e8bb.txt (uploading new version of file-095.txt)
3494
+ + file-096.010257e8bb.txt (uploading new version of file-096.txt)
3495
+ + file-097.010257e8bb.txt (uploading new version of file-097.txt)
3496
+ + file-098.010257e8bb.txt (uploading new version of file-098.txt)
3497
+ + file-099.010257e8bb.txt (uploading new version of file-099.txt)
3498
+ + file-100.010257e8bb.txt (uploading new version of file-100.txt)
3499
+ + file-101.010257e8bb.txt (uploading new version of file-101.txt)
3500
+ + file-102.010257e8bb.txt (uploading new version of file-102.txt)
3501
+ + file-103.010257e8bb.txt (uploading new version of file-103.txt)
3502
+ + file-104.010257e8bb.txt (uploading new version of file-104.txt)
3503
+ + file-105.010257e8bb.txt (uploading new version of file-105.txt)
3504
+ + file-106.010257e8bb.txt (uploading new version of file-106.txt)
3505
+ + file-107.010257e8bb.txt (uploading new version of file-107.txt)
3506
+ + file-108.010257e8bb.txt (uploading new version of file-108.txt)
3507
+ + file-109.010257e8bb.txt (uploading new version of file-109.txt)"
3508
+ `);
3509
+ expect(std.info).toMatchInlineSnapshot(`
3510
+ "Fetching list of already uploaded assets...
3511
+ Building list of assets to upload...
3512
+ Uploading 110 new assets...
3513
+ Uploaded 100% [110 out of 110]"
3514
+ `);
3515
+ });
3516
+ });
3092
3517
  });
3093
3518
 
3094
3519
  describe("workers_dev setting", () => {
@@ -6656,12 +7081,13 @@ addEventListener('fetch', event => {});`
6656
7081
  Object {
6657
7082
  "debug": "",
6658
7083
  "err": "",
6659
- "info": "",
6660
- "out": "Reading file-1.txt...
6661
- Uploading as file-1.2ca234f380.txt...
6662
- Reading file-2.txt...
6663
- Uploading as file-2.5938485188.txt...
6664
- ↗️ Done syncing assets
7084
+ "info": "Fetching list of already uploaded assets...
7085
+ Building list of assets to upload...
7086
+ + file-1.2ca234f380.txt (uploading new version of file-1.txt)
7087
+ + file-2.5938485188.txt (uploading new version of file-2.txt)
7088
+ Uploading 2 new assets...
7089
+ Uploaded 100% [2 out of 2]",
7090
+ "out": "↗️ Done syncing assets
6665
7091
  Total Upload: xx KiB / gzip: xx KiB
6666
7092
  Uploaded test-name (TIMINGS)
6667
7093
  Published test-name (TIMINGS)