wrangler 2.7.0 → 2.8.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 (34) hide show
  1. package/package.json +1 -1
  2. package/src/__tests__/helpers/mock-dialogs.ts +2 -0
  3. package/src/__tests__/helpers/mock-get-zone-from-host.ts +8 -5
  4. package/src/__tests__/helpers/mock-known-routes.ts +7 -2
  5. package/src/__tests__/helpers/mock-kv.ts +29 -16
  6. package/src/__tests__/helpers/mock-oauth-flow.ts +90 -98
  7. package/src/__tests__/helpers/msw/handlers/deployments.ts +18 -0
  8. package/src/__tests__/helpers/msw/index.ts +30 -1
  9. package/src/__tests__/init.test.ts +3 -14
  10. package/src/__tests__/jest.setup.ts +0 -23
  11. package/src/__tests__/pages-deployment-tail.test.ts +72 -1
  12. package/src/__tests__/pages.test.ts +18 -16
  13. package/src/__tests__/publish.test.ts +744 -522
  14. package/src/__tests__/secret.test.ts +1 -9
  15. package/src/__tests__/tail.test.ts +66 -1
  16. package/src/__tests__/tsconfig.tsbuildinfo +1 -1
  17. package/src/__tests__/user.test.ts +5 -15
  18. package/src/api/dev.ts +17 -5
  19. package/src/cfetch/internal.ts +0 -3
  20. package/src/d1/backups.tsx +1 -5
  21. package/src/dev/remote.tsx +2 -0
  22. package/src/docs/index.ts +2 -1
  23. package/src/init.ts +1 -1
  24. package/src/pages/dev.ts +57 -62
  25. package/src/pages/functions/buildPlugin.ts +2 -20
  26. package/src/pages/functions/buildWorker.ts +136 -20
  27. package/src/pages/functions/tsconfig.tsbuildinfo +1 -1
  28. package/src/pages/publish.tsx +36 -9
  29. package/src/publish/publish.ts +29 -4
  30. package/src/tail/createTail.ts +28 -1
  31. package/src/tail/printing.ts +15 -0
  32. package/templates/checked-fetch.js +1 -3
  33. package/wrangler-dist/cli.js +2935 -2824
  34. package/src/__tests__/helpers/mock-cfetch.ts +0 -278
@@ -351,6 +351,7 @@ describe("pages", () => {
351
351
  --commit-message The commit message to attach to this deployment [string]
352
352
  --commit-dirty Whether or not the workspace should be considered dirty for this deployment [boolean]
353
353
  --skip-caching Skip asset caching which speeds up builds [boolean]
354
+ --no-bundle Whether to run bundling on \`_worker.js\` before deploying [boolean] [default: true]
354
355
 
355
356
  🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose"
356
357
  `);
@@ -1457,7 +1458,7 @@ describe("pages", () => {
1457
1458
  await runWrangler("pages publish public --project-name=foo");
1458
1459
 
1459
1460
  expect(std.out).toMatchInlineSnapshot(`
1460
- "Compiled Worker successfully.
1461
+ "✨ Compiled Worker successfully
1461
1462
  ✨ Success! Uploaded 1 files (TIMINGS)
1462
1463
 
1463
1464
  ✨ Uploading Functions
@@ -1480,6 +1481,7 @@ describe("pages", () => {
1480
1481
  async fetch(request, env) {
1481
1482
  const url = new URL(request.url);
1482
1483
  return url.pathname.startsWith('/api/') ? new Response('Ok') : env.ASSETS.fetch(request);
1484
+ }
1483
1485
  };
1484
1486
  `
1485
1487
  );
@@ -1559,6 +1561,7 @@ describe("pages", () => {
1559
1561
  async fetch(request, env) {
1560
1562
  const url = new URL(request.url);
1561
1563
  return url.pathname.startsWith('/api/') ? new Response('Ok') : env.ASSETS.fetch(request);
1564
+ }
1562
1565
  };
1563
1566
  "
1564
1567
  `);
@@ -1600,9 +1603,10 @@ describe("pages", () => {
1600
1603
  expect(std.out).toMatchInlineSnapshot(`
1601
1604
  "✨ Success! Uploaded 1 files (TIMINGS)
1602
1605
 
1606
+ ✨ Compiled Worker successfully
1603
1607
  ✨ Uploading _worker.js
1604
1608
  ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/"
1605
- `);
1609
+ `);
1606
1610
 
1607
1611
  expect(std.err).toMatchInlineSnapshot('""');
1608
1612
  });
@@ -1815,7 +1819,7 @@ describe("pages", () => {
1815
1819
  await runWrangler("pages publish public --project-name=foo");
1816
1820
 
1817
1821
  expect(std.out).toMatchInlineSnapshot(`
1818
- "Compiled Worker successfully.
1822
+ "✨ Compiled Worker successfully
1819
1823
  ✨ Success! Uploaded 1 files (TIMINGS)
1820
1824
 
1821
1825
  ✨ Uploading Functions
@@ -1823,12 +1827,7 @@ describe("pages", () => {
1823
1827
  ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/"
1824
1828
  `);
1825
1829
 
1826
- expect(std.warn).toMatchInlineSnapshot(`
1827
- "â–² [WARNING] _routes.json is an experimental feature and is subject to change. Please use with care.
1828
-
1829
- "
1830
- `);
1831
-
1830
+ expect(std.warn).toMatchInlineSnapshot(`""`);
1832
1831
  expect(std.err).toMatchInlineSnapshot('""');
1833
1832
  });
1834
1833
 
@@ -1969,6 +1968,7 @@ and that at least one include rule is provided.
1969
1968
  async fetch(request, env) {
1970
1969
  const url = new URL(request.url);
1971
1970
  return url.pathname.startsWith('/api/') ? new Response('Ok') : env.ASSETS.fetch(request);
1971
+ }
1972
1972
  };
1973
1973
  `
1974
1974
  );
@@ -2071,6 +2071,7 @@ and that at least one include rule is provided.
2071
2071
  async fetch(request, env) {
2072
2072
  const url = new URL(request.url);
2073
2073
  return url.pathname.startsWith('/api/') ? new Response('Ok') : env.ASSETS.fetch(request);
2074
+ }
2074
2075
  };
2075
2076
  "
2076
2077
  `);
@@ -2120,16 +2121,13 @@ and that at least one include rule is provided.
2120
2121
  expect(std.out).toMatchInlineSnapshot(`
2121
2122
  "✨ Success! Uploaded 1 files (TIMINGS)
2122
2123
 
2124
+ ✨ Compiled Worker successfully
2123
2125
  ✨ Uploading _worker.js
2124
2126
  ✨ Uploading _routes.json
2125
2127
  ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/"
2126
- `);
2127
-
2128
- expect(std.warn).toMatchInlineSnapshot(`
2129
- "â–² [WARNING] _routes.json is an experimental feature and is subject to change. Please use with care.
2130
-
2131
- "
2132
2128
  `);
2129
+
2130
+ expect(std.warn).toMatchInlineSnapshot(`""`);
2133
2131
  expect(std.err).toMatchInlineSnapshot(`""`);
2134
2132
  });
2135
2133
 
@@ -2158,6 +2156,7 @@ and that at least one include rule is provided.
2158
2156
  async fetch(request, env) {
2159
2157
  const url = new URL(request.url);
2160
2158
  return url.pathname.startsWith('/api/') ? new Response('Ok') : env.ASSETS.fetch(request);
2159
+ }
2161
2160
  };
2162
2161
  `
2163
2162
  );
@@ -2270,6 +2269,7 @@ and that at least one include rule is provided.
2270
2269
  async fetch(request, env) {
2271
2270
  const url = new URL(request.url);
2272
2271
  return url.pathname.startsWith('/api/') ? new Response('Ok') : env.ASSETS.fetch(request);
2272
+ }
2273
2273
  };
2274
2274
  `
2275
2275
  );
@@ -2349,6 +2349,7 @@ and that at least one include rule is provided.
2349
2349
  async fetch(request, env) {
2350
2350
  const url = new URL(request.url);
2351
2351
  return url.pathname.startsWith('/api/') ? new Response('Ok') : env.ASSETS.fetch(request);
2352
+ }
2352
2353
  };
2353
2354
  "
2354
2355
  `);
@@ -2391,9 +2392,10 @@ and that at least one include rule is provided.
2391
2392
  expect(std.out).toMatchInlineSnapshot(`
2392
2393
  "✨ Success! Uploaded 1 files (TIMINGS)
2393
2394
 
2395
+ ✨ Compiled Worker successfully
2394
2396
  ✨ Uploading _worker.js
2395
2397
  ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/"
2396
- `);
2398
+ `);
2397
2399
 
2398
2400
  expect(std.err).toMatchInlineSnapshot('""');
2399
2401
  });