wrangler 2.9.0 → 2.10.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 (82) hide show
  1. package/README.md +3 -3
  2. package/miniflare-dist/index.mjs +2 -15
  3. package/package.json +9 -9
  4. package/src/__tests__/configuration.test.ts +70 -0
  5. package/src/__tests__/d1/d1.test.ts +3 -6
  6. package/src/__tests__/d1/execute.test.ts +64 -0
  7. package/src/__tests__/d1/migrate.test.ts +107 -0
  8. package/src/__tests__/deployments.test.ts +40 -16
  9. package/src/__tests__/dev.test.tsx +3 -3
  10. package/src/__tests__/generate.test.ts +1 -1
  11. package/src/__tests__/helpers/end-event-loop.ts +6 -0
  12. package/src/__tests__/helpers/mock-get-pages-upload-token.ts +25 -0
  13. package/src/__tests__/helpers/mock-set-timeout.ts +16 -0
  14. package/src/__tests__/helpers/msw/handlers/deployments.ts +40 -16
  15. package/src/__tests__/helpers/string-dynamic-values-matcher.ts +28 -0
  16. package/src/__tests__/index.test.ts +3 -4
  17. package/src/__tests__/init.test.ts +1 -1
  18. package/src/__tests__/kv.test.ts +8 -8
  19. package/src/__tests__/middleware.test.ts +65 -0
  20. package/src/__tests__/mtls-certificates.test.ts +585 -0
  21. package/src/__tests__/pages/deployment-list.test.ts +78 -0
  22. package/src/__tests__/pages/functions-build.test.ts +402 -0
  23. package/src/__tests__/pages/pages.test.ts +81 -0
  24. package/src/__tests__/pages/project-create.test.ts +63 -0
  25. package/src/__tests__/pages/project-list.test.ts +108 -0
  26. package/src/__tests__/pages/project-upload.test.ts +481 -0
  27. package/src/__tests__/pages/publish.test.ts +2745 -0
  28. package/src/__tests__/publish.test.ts +58 -27
  29. package/src/__tests__/queues.test.ts +2 -2
  30. package/src/__tests__/secret.test.ts +4 -4
  31. package/src/__tests__/tsconfig.tsbuildinfo +1 -1
  32. package/src/__tests__/user.test.ts +1 -1
  33. package/src/__tests__/whoami.test.tsx +1 -1
  34. package/src/__tests__/worker-namespace.test.ts +1 -1
  35. package/src/api/index.ts +8 -0
  36. package/src/api/mtls-certificate.ts +148 -0
  37. package/src/api/pages/create-worker-bundle-contents.ts +75 -0
  38. package/src/api/pages/publish.tsx +52 -8
  39. package/src/bundle.ts +6 -5
  40. package/src/config/config.ts +7 -7
  41. package/src/config/environment.ts +9 -2
  42. package/src/config/index.ts +13 -0
  43. package/src/config/validation.ts +50 -3
  44. package/src/create-worker-upload-form.ts +9 -0
  45. package/src/d1/execute.tsx +124 -91
  46. package/src/d1/migrations/apply.tsx +36 -29
  47. package/src/d1/migrations/create.tsx +10 -8
  48. package/src/d1/migrations/helpers.ts +63 -38
  49. package/src/d1/migrations/list.tsx +31 -20
  50. package/src/d1/migrations/options.ts +6 -1
  51. package/src/d1/types.ts +1 -0
  52. package/src/d1/utils.ts +2 -1
  53. package/src/deployments.ts +62 -39
  54. package/src/dev/dev.tsx +1 -15
  55. package/src/dev/remote.tsx +2 -2
  56. package/src/dev.tsx +9 -6
  57. package/src/generate/index.ts +1 -1
  58. package/src/index.ts +15 -5
  59. package/src/miniflare-cli/assets.ts +1 -1
  60. package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -1
  61. package/src/mtls-certificate/cli.ts +155 -0
  62. package/src/pages/build.ts +103 -23
  63. package/src/pages/buildFunctions.ts +32 -31
  64. package/src/pages/dev.ts +4 -2
  65. package/src/pages/functions/tsconfig.tsbuildinfo +1 -1
  66. package/src/pages/publish.tsx +12 -1
  67. package/src/pages/utils.ts +1 -1
  68. package/src/publish/publish.ts +3 -2
  69. package/src/secret/index.ts +1 -0
  70. package/src/sites.ts +1 -1
  71. package/src/tail/filters.ts +1 -1
  72. package/src/user/user.ts +4 -3
  73. package/src/worker.ts +6 -0
  74. package/templates/format-dev-errors.ts +1 -0
  75. package/templates/new-worker.ts +3 -0
  76. package/templates/serve-static-assets.ts +1 -0
  77. package/templates/service-bindings-module-facade.js +1 -0
  78. package/templates/tsconfig.init.json +1 -1
  79. package/templates/tsconfig.tsbuildinfo +1 -1
  80. package/wrangler-dist/cli.d.ts +82 -2
  81. package/wrangler-dist/cli.js +1726 -1616
  82. package/src/__tests__/pages.test.ts +0 -2905
@@ -137,7 +137,7 @@ describe("publish", () => {
137
137
 
138
138
  expect(std.out).toMatchInlineSnapshot(`
139
139
  "Attempting to login via OAuth...
140
- 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%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
140
+ 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
141
141
  Successfully logged in.
142
142
  Total Upload: xx KiB / gzip: xx KiB
143
143
  Uploaded test-name (TIMINGS)
@@ -177,7 +177,7 @@ describe("publish", () => {
177
177
 
178
178
  expect(std.out).toMatchInlineSnapshot(`
179
179
  "Attempting to login via OAuth...
180
- 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%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
180
+ 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
181
181
  Successfully logged in.
182
182
  Total Upload: xx KiB / gzip: xx KiB
183
183
  Uploaded test-name (TIMINGS)
@@ -209,7 +209,7 @@ describe("publish", () => {
209
209
  Current Deployment ID: Galaxy-Class"
210
210
  `);
211
211
  expect(std.warn).toMatchInlineSnapshot(`
212
- "▲ [WARNING] It looks like you have used Wrangler 1's \`config\` command to login with an API token.
212
+ "▲ [WARNING] It looks like you have used Wrangler v1's \`config\` command to login with an API token.
213
213
 
214
214
  This is no longer supported in the current version of Wrangler.
215
215
  If you wish to authenticate via an API token then please set the \`CLOUDFLARE_API_TOKEN\`
@@ -791,7 +791,7 @@ describe("publish", () => {
791
791
  await runWrangler("publish ./index --env dev --legacy-env false");
792
792
  });
793
793
 
794
- it("should fallback to the Wrangler 1 zone-based API if the bulk-routes API fails", async () => {
794
+ it("should fallback to the Wrangler v1 zone-based API if the bulk-routes API fails", async () => {
795
795
  writeWranglerToml({
796
796
  routes: ["example.com/some-route/*"],
797
797
  });
@@ -1467,7 +1467,7 @@ addEventListener('fetch', event => {});`
1467
1467
 
1468
1468
  expect(std.out).toMatchInlineSnapshot(`
1469
1469
  "
1470
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
1470
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
1471
1471
  `);
1472
1472
  expect(std.err).toMatchInlineSnapshot(`
1473
1473
  "X [ERROR] Processing wrangler.toml configuration:
@@ -1629,7 +1629,7 @@ addEventListener('fetch', event => {});`
1629
1629
 
1630
1630
  expect(std.out).toMatchInlineSnapshot(`
1631
1631
  "
1632
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
1632
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
1633
1633
  `);
1634
1634
  expect(std.err).toMatchInlineSnapshot(`
1635
1635
  "X [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. \`wrangler publish path/to/script\`) or the \`main\` config field.
@@ -1787,7 +1787,7 @@ addEventListener('fetch', event => {});`
1787
1787
 
1788
1788
  ",
1789
1789
  "out": "
1790
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose",
1790
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose",
1791
1791
  "warn": "▲ [WARNING] The --assets argument is experimental and may change or break at any time
1792
1792
 
1793
1793
  ",
@@ -1813,7 +1813,7 @@ addEventListener('fetch', event => {});`
1813
1813
 
1814
1814
  ",
1815
1815
  "out": "
1816
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose",
1816
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose",
1817
1817
  "warn": "",
1818
1818
  }
1819
1819
  `);
@@ -1840,7 +1840,7 @@ addEventListener('fetch', event => {});`
1840
1840
 
1841
1841
  ",
1842
1842
  "out": "
1843
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose",
1843
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose",
1844
1844
  "warn": "",
1845
1845
  }
1846
1846
  `);
@@ -1866,7 +1866,7 @@ addEventListener('fetch', event => {});`
1866
1866
 
1867
1867
  ",
1868
1868
  "out": "
1869
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose",
1869
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose",
1870
1870
  "warn": "▲ [WARNING] Processing wrangler.toml configuration:
1871
1871
 
1872
1872
  - \\"assets\\" fields are experimental and may change or break at any time.
@@ -1899,7 +1899,7 @@ addEventListener('fetch', event => {});`
1899
1899
 
1900
1900
  ",
1901
1901
  "out": "
1902
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose",
1902
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose",
1903
1903
  "warn": "▲ [WARNING] Processing wrangler.toml configuration:
1904
1904
 
1905
1905
  - \\"assets\\" fields are experimental and may change or break at any time.
@@ -2693,7 +2693,7 @@ addEventListener('fetch', event => {});`
2693
2693
  Uploading as large-file.0ea0637a45.txt...
2694
2694
  Reading too-large-file.txt...
2695
2695
 
2696
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
2696
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
2697
2697
  `);
2698
2698
  expect(std.err).toMatchInlineSnapshot(`
2699
2699
  "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
@@ -2834,7 +2834,7 @@ addEventListener('fetch', event => {});`
2834
2834
  expect(std.out).toMatchInlineSnapshot(`
2835
2835
  "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...
2836
2836
 
2837
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
2837
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
2838
2838
  `);
2839
2839
  expect(std.err).toMatchInlineSnapshot(`
2840
2840
  "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\\",
@@ -3905,7 +3905,7 @@ addEventListener('fetch', event => {});`
3905
3905
  expect(std.out).toMatchInlineSnapshot(`
3906
3906
  "Running custom build: node -e \\"console.log('custom build');\\"
3907
3907
 
3908
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
3908
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
3909
3909
  `);
3910
3910
  expect(std.err).toMatchInlineSnapshot(`
3911
3911
  "X [ERROR] The expected output file at \\"index.js\\" was not found after running custom build: node -e \\"console.log('custom build');\\".
@@ -3944,7 +3944,7 @@ addEventListener('fetch', event => {});`
3944
3944
  expect(std.out).toMatchInlineSnapshot(`
3945
3945
  "Running custom build: node -e \\"console.log('custom build');\\"
3946
3946
 
3947
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
3947
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
3948
3948
  `);
3949
3949
  expect(std.err).toMatchInlineSnapshot(`
3950
3950
  "X [ERROR] The expected output file at \\".\\" was not found after running custom build: node -e \\"console.log('custom build');\\".
@@ -4830,7 +4830,7 @@ addEventListener('fetch', event => {});`
4830
4830
  `);
4831
4831
  expect(std.out).toMatchInlineSnapshot(`
4832
4832
  "
4833
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
4833
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
4834
4834
  `);
4835
4835
  expect(std.err).toMatchInlineSnapshot(`
4836
4836
  "X [ERROR] Processing wrangler.toml configuration:
@@ -4940,7 +4940,7 @@ addEventListener('fetch', event => {});`
4940
4940
  `);
4941
4941
  expect(std.out).toMatchInlineSnapshot(`
4942
4942
  "
4943
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
4943
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
4944
4944
  `);
4945
4945
  expect(std.err).toMatchInlineSnapshot(`
4946
4946
  "X [ERROR] Processing wrangler.toml configuration:
@@ -5094,7 +5094,7 @@ addEventListener('fetch', event => {});`
5094
5094
  `);
5095
5095
  expect(std.out).toMatchInlineSnapshot(`
5096
5096
  "
5097
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
5097
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
5098
5098
  `);
5099
5099
  expect(std.err).toMatchInlineSnapshot(`
5100
5100
  "X [ERROR] Processing wrangler.toml configuration:
@@ -5173,7 +5173,7 @@ addEventListener('fetch', event => {});`
5173
5173
  );
5174
5174
  expect(std.out).toMatchInlineSnapshot(`
5175
5175
  "
5176
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
5176
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
5177
5177
  `);
5178
5178
  expect(std.err).toMatchInlineSnapshot(`
5179
5179
  "X [ERROR] You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code
@@ -5316,7 +5316,7 @@ addEventListener('fetch', event => {});`
5316
5316
  );
5317
5317
  expect(std.out).toMatchInlineSnapshot(`
5318
5318
  "
5319
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
5319
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
5320
5320
  `);
5321
5321
  expect(std.err).toMatchInlineSnapshot(`
5322
5322
  "X [ERROR] You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your wrangler.toml
@@ -5429,7 +5429,7 @@ addEventListener('fetch', event => {});`
5429
5429
  );
5430
5430
  expect(std.out).toMatchInlineSnapshot(`
5431
5431
  "
5432
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
5432
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
5433
5433
  `);
5434
5434
  expect(std.err).toMatchInlineSnapshot(`
5435
5435
  "X [ERROR] You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your wrangler.toml
@@ -5825,7 +5825,7 @@ addEventListener('fetch', event => {});`
5825
5825
  "▲ [WARNING] Processing wrangler.toml configuration:
5826
5826
 
5827
5827
  - D1 Bindings are currently in alpha to allow the API to evolve before general availability.
5828
- Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
5828
+ Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose
5829
5829
  Note: Run this command with the environment variable NO_D1_WARNING=true to hide this message
5830
5830
 
5831
5831
  For example: \`export NO_D1_WARNING=true && wrangler <YOUR COMMAND HERE>\`
@@ -6422,7 +6422,7 @@ addEventListener('fetch', event => {});`
6422
6422
  });
6423
6423
 
6424
6424
  it("should not match regular module specifiers when there aren't any possible legacy module matches", async () => {
6425
- // see https://github.com/cloudflare/wrangler2/issues/655 for bug details
6425
+ // see https://github.com/cloudflare/workers-sdk/issues/655 for bug details
6426
6426
 
6427
6427
  fs.writeFileSync(
6428
6428
  "./index.js",
@@ -6544,7 +6544,7 @@ addEventListener('fetch', event => {});`
6544
6544
  `);
6545
6545
  });
6546
6546
 
6547
- it("should copy any module imports related assets at --outdir if specified", async () => {
6547
+ it("should copy any module imports related assets to --outdir if specified", async () => {
6548
6548
  writeWranglerToml();
6549
6549
  fs.writeFileSync(
6550
6550
  "./index.js",
@@ -6808,7 +6808,7 @@ export default{
6808
6808
  the global scope. [code: 11337]
6809
6809
 
6810
6810
  If you think this is a bug, please open an issue at:
6811
- https://github.com/cloudflare/wrangler2/issues/new/choose
6811
+ https://github.com/cloudflare/workers-sdk/issues/new/choose
6812
6812
 
6813
6813
  ",
6814
6814
  "warn": "",
@@ -6870,7 +6870,7 @@ export default{
6870
6870
  workers.api.error.script_too_large [code: 10027]
6871
6871
 
6872
6872
  If you think this is a bug, please open an issue at:
6873
- https://github.com/cloudflare/wrangler2/issues/new/choose
6873
+ https://github.com/cloudflare/workers-sdk/issues/new/choose
6874
6874
 
6875
6875
  ",
6876
6876
  "warn": "▲ [WARNING] Here are the 2 largest dependencies included in your script:
@@ -6936,7 +6936,7 @@ export default{
6936
6936
  Error: Script startup exceeded CPU time limit. [code: 10021]
6937
6937
 
6938
6938
  If you think this is a bug, please open an issue at:
6939
- https://github.com/cloudflare/wrangler2/issues/new/choose
6939
+ https://github.com/cloudflare/workers-sdk/issues/new/choose
6940
6940
 
6941
6941
  ",
6942
6942
  "warn": "▲ [WARNING] Your Worker failed validation because it exceeded startup limits.
@@ -7339,6 +7339,37 @@ export default{
7339
7339
  });
7340
7340
  });
7341
7341
 
7342
+ describe("mtls_certificates", () => {
7343
+ it("should upload mtls_certificate bindings", async () => {
7344
+ writeWranglerToml({
7345
+ mtls_certificates: [{ binding: "CERT_ONE", certificate_id: "1234" }],
7346
+ });
7347
+ await fs.promises.writeFile("index.js", `export default {};`);
7348
+ mockSubDomainRequest();
7349
+ mockUploadWorkerRequest({
7350
+ expectedBindings: [
7351
+ {
7352
+ type: "mtls_certificate",
7353
+ name: "CERT_ONE",
7354
+ certificate_id: "1234",
7355
+ },
7356
+ ],
7357
+ });
7358
+
7359
+ await runWrangler("publish index.js");
7360
+ expect(std.out).toMatchInlineSnapshot(`
7361
+ "Total Upload: xx KiB / gzip: xx KiB
7362
+ Your worker has access to the following bindings:
7363
+ - mTLS Certificates:
7364
+ - CERT_ONE: 1234
7365
+ Uploaded test-name (TIMINGS)
7366
+ Published test-name (TIMINGS)
7367
+ https://test-name.test-sub-domain.workers.dev
7368
+ Current Deployment ID: Galaxy-Class"
7369
+ `);
7370
+ });
7371
+ });
7372
+
7342
7373
  describe("--keep-vars", () => {
7343
7374
  it("should send keepVars when keep-vars is passed in", async () => {
7344
7375
  process.env = {
@@ -215,7 +215,7 @@ describe("wrangler", () => {
215
215
  workers.api.error.unauthorized [code: 10023]
216
216
 
217
217
  If you think this is a bug, please open an issue at:
218
- https://github.com/cloudflare/wrangler2/issues/new/choose
218
+ https://github.com/cloudflare/workers-sdk/issues/new/choose
219
219
 
220
220
  "
221
221
  `);
@@ -434,7 +434,7 @@ describe("wrangler", () => {
434
434
  workers.api.error.unauthorized [code: 10023]
435
435
 
436
436
  If you think this is a bug, please open an issue at:
437
- https://github.com/cloudflare/wrangler2/issues/new/choose
437
+ https://github.com/cloudflare/workers-sdk/issues/new/choose
438
438
 
439
439
  "
440
440
  `);
@@ -340,7 +340,7 @@ describe("wrangler secret", () => {
340
340
  }
341
341
  expect(std.out).toMatchInlineSnapshot(`
342
342
  "
343
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
343
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
344
344
  `);
345
345
  expect(std.err).toMatchInlineSnapshot(`
346
346
  "X [ERROR] Required Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`
@@ -401,7 +401,7 @@ describe("wrangler secret", () => {
401
401
 
402
402
  expect(std.out).toMatchInlineSnapshot(`
403
403
  "
404
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
404
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
405
405
  `);
406
406
  expect(std.warn).toMatchInlineSnapshot(`""`);
407
407
  });
@@ -572,7 +572,7 @@ describe("wrangler secret", () => {
572
572
  }
573
573
  expect(std.out).toMatchInlineSnapshot(`
574
574
  "
575
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
575
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
576
576
  `);
577
577
  expect(std.err).toMatchInlineSnapshot(`
578
578
  "X [ERROR] Required Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`
@@ -678,7 +678,7 @@ describe("wrangler secret", () => {
678
678
  }
679
679
  expect(std.out).toMatchInlineSnapshot(`
680
680
  "
681
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
681
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
682
682
  `);
683
683
  expect(std.err).toMatchInlineSnapshot(`
684
684
  "X [ERROR] Required Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`