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.
- package/README.md +3 -3
- package/miniflare-dist/index.mjs +2 -15
- package/package.json +9 -9
- package/src/__tests__/configuration.test.ts +70 -0
- package/src/__tests__/d1/d1.test.ts +3 -6
- package/src/__tests__/d1/execute.test.ts +64 -0
- package/src/__tests__/d1/migrate.test.ts +107 -0
- package/src/__tests__/deployments.test.ts +40 -16
- package/src/__tests__/dev.test.tsx +3 -3
- package/src/__tests__/generate.test.ts +1 -1
- package/src/__tests__/helpers/end-event-loop.ts +6 -0
- package/src/__tests__/helpers/mock-get-pages-upload-token.ts +25 -0
- package/src/__tests__/helpers/mock-set-timeout.ts +16 -0
- package/src/__tests__/helpers/msw/handlers/deployments.ts +40 -16
- package/src/__tests__/helpers/string-dynamic-values-matcher.ts +28 -0
- package/src/__tests__/index.test.ts +3 -4
- package/src/__tests__/init.test.ts +1 -1
- package/src/__tests__/kv.test.ts +8 -8
- package/src/__tests__/middleware.test.ts +65 -0
- package/src/__tests__/mtls-certificates.test.ts +585 -0
- package/src/__tests__/pages/deployment-list.test.ts +78 -0
- package/src/__tests__/pages/functions-build.test.ts +402 -0
- package/src/__tests__/pages/pages.test.ts +81 -0
- package/src/__tests__/pages/project-create.test.ts +63 -0
- package/src/__tests__/pages/project-list.test.ts +108 -0
- package/src/__tests__/pages/project-upload.test.ts +481 -0
- package/src/__tests__/pages/publish.test.ts +2745 -0
- package/src/__tests__/publish.test.ts +58 -27
- package/src/__tests__/queues.test.ts +2 -2
- package/src/__tests__/secret.test.ts +4 -4
- package/src/__tests__/tsconfig.tsbuildinfo +1 -1
- package/src/__tests__/user.test.ts +1 -1
- package/src/__tests__/whoami.test.tsx +1 -1
- package/src/__tests__/worker-namespace.test.ts +1 -1
- package/src/api/index.ts +8 -0
- package/src/api/mtls-certificate.ts +148 -0
- package/src/api/pages/create-worker-bundle-contents.ts +75 -0
- package/src/api/pages/publish.tsx +52 -8
- package/src/bundle.ts +6 -5
- package/src/config/config.ts +7 -7
- package/src/config/environment.ts +9 -2
- package/src/config/index.ts +13 -0
- package/src/config/validation.ts +50 -3
- package/src/create-worker-upload-form.ts +9 -0
- package/src/d1/execute.tsx +124 -91
- package/src/d1/migrations/apply.tsx +36 -29
- package/src/d1/migrations/create.tsx +10 -8
- package/src/d1/migrations/helpers.ts +63 -38
- package/src/d1/migrations/list.tsx +31 -20
- package/src/d1/migrations/options.ts +6 -1
- package/src/d1/types.ts +1 -0
- package/src/d1/utils.ts +2 -1
- package/src/deployments.ts +62 -39
- package/src/dev/dev.tsx +1 -15
- package/src/dev/remote.tsx +2 -2
- package/src/dev.tsx +9 -6
- package/src/generate/index.ts +1 -1
- package/src/index.ts +15 -5
- package/src/miniflare-cli/assets.ts +1 -1
- package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -1
- package/src/mtls-certificate/cli.ts +155 -0
- package/src/pages/build.ts +103 -23
- package/src/pages/buildFunctions.ts +32 -31
- package/src/pages/dev.ts +4 -2
- package/src/pages/functions/tsconfig.tsbuildinfo +1 -1
- package/src/pages/publish.tsx +12 -1
- package/src/pages/utils.ts +1 -1
- package/src/publish/publish.ts +3 -2
- package/src/secret/index.ts +1 -0
- package/src/sites.ts +1 -1
- package/src/tail/filters.ts +1 -1
- package/src/user/user.ts +4 -3
- package/src/worker.ts +6 -0
- package/templates/format-dev-errors.ts +1 -0
- package/templates/new-worker.ts +3 -0
- package/templates/serve-static-assets.ts +1 -0
- package/templates/service-bindings-module-facade.js +1 -0
- package/templates/tsconfig.init.json +1 -1
- package/templates/tsconfig.tsbuildinfo +1 -1
- package/wrangler-dist/cli.d.ts +82 -2
- package/wrangler-dist/cli.js +1726 -1616
- 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
|
-
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mIt looks like you have used Wrangler
|
|
212
|
+
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mIt looks like you have used Wrangler v1's \`config\` command to login with an API token.[0m
|
|
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
|
|
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
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
1470
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
1471
1471
|
`);
|
|
1472
1472
|
expect(std.err).toMatchInlineSnapshot(`
|
|
1473
1473
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -1629,7 +1629,7 @@ addEventListener('fetch', event => {});`
|
|
|
1629
1629
|
|
|
1630
1630
|
expect(std.out).toMatchInlineSnapshot(`
|
|
1631
1631
|
"
|
|
1632
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
1632
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
1633
1633
|
`);
|
|
1634
1634
|
expect(std.err).toMatchInlineSnapshot(`
|
|
1635
1635
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mMissing entry-point: The entry-point should be specified via the command line (e.g. \`wrangler publish path/to/script\`) or the \`main\` config field.[0m
|
|
@@ -1787,7 +1787,7 @@ addEventListener('fetch', event => {});`
|
|
|
1787
1787
|
|
|
1788
1788
|
",
|
|
1789
1789
|
"out": "
|
|
1790
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
1790
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m",
|
|
1791
1791
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe --assets argument is experimental and may change or break at any time[0m
|
|
1792
1792
|
|
|
1793
1793
|
",
|
|
@@ -1813,7 +1813,7 @@ addEventListener('fetch', event => {});`
|
|
|
1813
1813
|
|
|
1814
1814
|
",
|
|
1815
1815
|
"out": "
|
|
1816
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
1816
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m",
|
|
1817
1817
|
"warn": "",
|
|
1818
1818
|
}
|
|
1819
1819
|
`);
|
|
@@ -1840,7 +1840,7 @@ addEventListener('fetch', event => {});`
|
|
|
1840
1840
|
|
|
1841
1841
|
",
|
|
1842
1842
|
"out": "
|
|
1843
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
1843
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m",
|
|
1844
1844
|
"warn": "",
|
|
1845
1845
|
}
|
|
1846
1846
|
`);
|
|
@@ -1866,7 +1866,7 @@ addEventListener('fetch', event => {});`
|
|
|
1866
1866
|
|
|
1867
1867
|
",
|
|
1868
1868
|
"out": "
|
|
1869
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
1869
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m",
|
|
1870
1870
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
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
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
1902
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m",
|
|
1903
1903
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
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
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
2696
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
2697
2697
|
`);
|
|
2698
2698
|
expect(std.err).toMatchInlineSnapshot(`
|
|
2699
2699
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mFile too-large-file.txt is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits[0m
|
|
@@ -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
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
2837
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
2838
2838
|
`);
|
|
2839
2839
|
expect(std.err).toMatchInlineSnapshot(`
|
|
2840
2840
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mThe 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\\",[0m
|
|
@@ -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
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
3908
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
3909
3909
|
`);
|
|
3910
3910
|
expect(std.err).toMatchInlineSnapshot(`
|
|
3911
3911
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mThe expected output file at \\"index.js\\" was not found after running custom build: node -e \\"console.log('custom build');\\".[0m
|
|
@@ -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
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
3947
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
3948
3948
|
`);
|
|
3949
3949
|
expect(std.err).toMatchInlineSnapshot(`
|
|
3950
3950
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mThe expected output file at \\".\\" was not found after running custom build: node -e \\"console.log('custom build');\\".[0m
|
|
@@ -4830,7 +4830,7 @@ addEventListener('fetch', event => {});`
|
|
|
4830
4830
|
`);
|
|
4831
4831
|
expect(std.out).toMatchInlineSnapshot(`
|
|
4832
4832
|
"
|
|
4833
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
4833
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
4834
4834
|
`);
|
|
4835
4835
|
expect(std.err).toMatchInlineSnapshot(`
|
|
4836
4836
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -4940,7 +4940,7 @@ addEventListener('fetch', event => {});`
|
|
|
4940
4940
|
`);
|
|
4941
4941
|
expect(std.out).toMatchInlineSnapshot(`
|
|
4942
4942
|
"
|
|
4943
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
4943
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
4944
4944
|
`);
|
|
4945
4945
|
expect(std.err).toMatchInlineSnapshot(`
|
|
4946
4946
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -5094,7 +5094,7 @@ addEventListener('fetch', event => {});`
|
|
|
5094
5094
|
`);
|
|
5095
5095
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5096
5096
|
"
|
|
5097
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
5097
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
5098
5098
|
`);
|
|
5099
5099
|
expect(std.err).toMatchInlineSnapshot(`
|
|
5100
5100
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
@@ -5173,7 +5173,7 @@ addEventListener('fetch', event => {});`
|
|
|
5173
5173
|
);
|
|
5174
5174
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5175
5175
|
"
|
|
5176
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
5176
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
5177
5177
|
`);
|
|
5178
5178
|
expect(std.err).toMatchInlineSnapshot(`
|
|
5179
5179
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mYou cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code[0m
|
|
@@ -5316,7 +5316,7 @@ addEventListener('fetch', event => {});`
|
|
|
5316
5316
|
);
|
|
5317
5317
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5318
5318
|
"
|
|
5319
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
5319
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
5320
5320
|
`);
|
|
5321
5321
|
expect(std.err).toMatchInlineSnapshot(`
|
|
5322
5322
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mYou 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[0m
|
|
@@ -5429,7 +5429,7 @@ addEventListener('fetch', event => {});`
|
|
|
5429
5429
|
);
|
|
5430
5430
|
expect(std.out).toMatchInlineSnapshot(`
|
|
5431
5431
|
"
|
|
5432
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
5432
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
5433
5433
|
`);
|
|
5434
5434
|
expect(std.err).toMatchInlineSnapshot(`
|
|
5435
5435
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mYou 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[0m
|
|
@@ -5825,7 +5825,7 @@ addEventListener('fetch', event => {});`
|
|
|
5825
5825
|
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
|
|
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 [4mhttps://github.com/cloudflare/
|
|
5828
|
+
Please report any issues to [4mhttps://github.com/cloudflare/workers-sdk/issues/new/choose[0m
|
|
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/
|
|
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
|
|
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
|
-
[4mhttps://github.com/cloudflare/
|
|
6811
|
+
[4mhttps://github.com/cloudflare/workers-sdk/issues/new/choose[0m
|
|
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
|
-
[4mhttps://github.com/cloudflare/
|
|
6873
|
+
[4mhttps://github.com/cloudflare/workers-sdk/issues/new/choose[0m
|
|
6874
6874
|
|
|
6875
6875
|
",
|
|
6876
6876
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mHere are the 2 largest dependencies included in your script:[0m
|
|
@@ -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
|
-
[4mhttps://github.com/cloudflare/
|
|
6939
|
+
[4mhttps://github.com/cloudflare/workers-sdk/issues/new/choose[0m
|
|
6940
6940
|
|
|
6941
6941
|
",
|
|
6942
6942
|
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mYour Worker failed validation because it exceeded startup limits.[0m
|
|
@@ -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
|
-
[4mhttps://github.com/cloudflare/
|
|
218
|
+
[4mhttps://github.com/cloudflare/workers-sdk/issues/new/choose[0m
|
|
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
|
-
[4mhttps://github.com/cloudflare/
|
|
437
|
+
[4mhttps://github.com/cloudflare/workers-sdk/issues/new/choose[0m
|
|
438
438
|
|
|
439
439
|
"
|
|
440
440
|
`);
|
|
@@ -340,7 +340,7 @@ describe("wrangler secret", () => {
|
|
|
340
340
|
}
|
|
341
341
|
expect(std.out).toMatchInlineSnapshot(`
|
|
342
342
|
"
|
|
343
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
343
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
344
344
|
`);
|
|
345
345
|
expect(std.err).toMatchInlineSnapshot(`
|
|
346
346
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mRequired Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`[0m
|
|
@@ -401,7 +401,7 @@ describe("wrangler secret", () => {
|
|
|
401
401
|
|
|
402
402
|
expect(std.out).toMatchInlineSnapshot(`
|
|
403
403
|
"
|
|
404
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
404
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
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
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
575
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
576
576
|
`);
|
|
577
577
|
expect(std.err).toMatchInlineSnapshot(`
|
|
578
578
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mRequired Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`[0m
|
|
@@ -678,7 +678,7 @@ describe("wrangler secret", () => {
|
|
|
678
678
|
}
|
|
679
679
|
expect(std.out).toMatchInlineSnapshot(`
|
|
680
680
|
"
|
|
681
|
-
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/
|
|
681
|
+
[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose[0m"
|
|
682
682
|
`);
|
|
683
683
|
expect(std.err).toMatchInlineSnapshot(`
|
|
684
684
|
"[31mX [41;31m[[41;97mERROR[41;31m][0m [1mRequired Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`[0m
|