wrangler 2.0.27 → 2.1.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 (65) hide show
  1. package/bin/wrangler.js +1 -1
  2. package/miniflare-dist/index.mjs +1141 -369
  3. package/package.json +6 -4
  4. package/src/__tests__/api-dev.test.ts +19 -0
  5. package/src/__tests__/configuration.test.ts +27 -27
  6. package/src/__tests__/dev.test.tsx +8 -6
  7. package/src/__tests__/helpers/hello-world-worker.js +5 -0
  8. package/src/__tests__/helpers/mock-cfetch.ts +4 -4
  9. package/src/__tests__/helpers/mock-console.ts +11 -2
  10. package/src/__tests__/helpers/mock-get-zone-from-host.ts +8 -0
  11. package/src/__tests__/helpers/mock-known-routes.ts +7 -0
  12. package/src/__tests__/index.test.ts +37 -37
  13. package/src/__tests__/init.test.ts +356 -5
  14. package/src/__tests__/jest.setup.ts +13 -0
  15. package/src/__tests__/middleware.test.ts +768 -0
  16. package/src/__tests__/pages.test.ts +829 -104
  17. package/src/__tests__/paths.test.ts +17 -0
  18. package/src/__tests__/publish.test.ts +512 -445
  19. package/src/__tests__/tail.test.ts +79 -72
  20. package/src/__tests__/test-old-node-version.js +3 -3
  21. package/src/__tests__/worker-namespace.test.ts +37 -35
  22. package/src/api/dev.ts +93 -28
  23. package/src/bundle.ts +239 -12
  24. package/src/cfetch/internal.ts +64 -3
  25. package/src/cli.ts +1 -1
  26. package/src/config/environment.ts +1 -1
  27. package/src/config/index.ts +4 -4
  28. package/src/config/validation.ts +3 -3
  29. package/src/create-worker-upload-form.ts +29 -26
  30. package/src/dev/dev.tsx +3 -1
  31. package/src/dev/local.tsx +319 -171
  32. package/src/dev/remote.tsx +16 -4
  33. package/src/dev/start-server.ts +416 -0
  34. package/src/dev/use-esbuild.ts +4 -0
  35. package/src/dev.tsx +340 -166
  36. package/src/dialogs.tsx +12 -0
  37. package/src/{worker-namespace.ts → dispatch-namespace.ts} +18 -18
  38. package/src/entry.ts +2 -1
  39. package/src/index.tsx +59 -12
  40. package/src/init.ts +291 -16
  41. package/src/metrics/send-event.ts +6 -5
  42. package/src/miniflare-cli/assets.ts +130 -476
  43. package/src/miniflare-cli/index.ts +39 -33
  44. package/src/pages/constants.ts +3 -0
  45. package/src/pages/dev.tsx +8 -3
  46. package/src/pages/functions/buildPlugin.ts +2 -1
  47. package/src/pages/functions/buildWorker.ts +2 -1
  48. package/src/pages/functions/routes-transformation.test.ts +12 -1
  49. package/src/pages/functions/routes-transformation.ts +7 -1
  50. package/src/pages/hash.tsx +13 -0
  51. package/src/pages/publish.tsx +82 -38
  52. package/src/pages/upload.tsx +3 -18
  53. package/src/paths.ts +20 -1
  54. package/src/publish.ts +49 -8
  55. package/src/tail/filters.ts +1 -5
  56. package/src/tail/index.ts +6 -3
  57. package/src/worker.ts +10 -9
  58. package/src/zones.ts +91 -0
  59. package/templates/middleware/common.ts +62 -0
  60. package/templates/middleware/loader-modules.ts +84 -0
  61. package/templates/middleware/loader-sw.ts +213 -0
  62. package/templates/middleware/middleware-pretty-error.ts +40 -0
  63. package/templates/middleware/middleware-scheduled.ts +14 -0
  64. package/wrangler-dist/cli.d.ts +22 -8
  65. package/wrangler-dist/cli.js +71020 -65212
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "2.0.27",
3
+ "version": "2.1.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -97,7 +97,7 @@
97
97
  "blake3-wasm": "^2.1.5",
98
98
  "chokidar": "^3.5.3",
99
99
  "esbuild": "0.14.51",
100
- "miniflare": "^2.6.0",
100
+ "miniflare": "^2.8.1",
101
101
  "nanoid": "^3.3.3",
102
102
  "path-to-regexp": "^6.2.0",
103
103
  "selfsigned": "^2.0.1",
@@ -107,6 +107,7 @@
107
107
  "devDependencies": {
108
108
  "@iarna/toml": "^3.0.0",
109
109
  "@microsoft/api-extractor": "^7.28.3",
110
+ "@types/busboy": "^1.5.0",
110
111
  "@types/command-exists": "^1.2.0",
111
112
  "@types/express": "^4.17.13",
112
113
  "@types/glob-to-regexp": "0.4.1",
@@ -120,6 +121,7 @@
120
121
  "@types/yargs": "^17.0.10",
121
122
  "@webcontainer/env": "^1.0.1",
122
123
  "body-parser": "^1.20.0",
124
+ "busboy": "^1.6.0",
123
125
  "clipboardy": "^3.0.0",
124
126
  "cmd-shim": "^4.1.0",
125
127
  "command-exists": "^1.2.9",
@@ -158,7 +160,7 @@
158
160
  "timeago.js": "^4.0.2",
159
161
  "tmp-promise": "^3.0.3",
160
162
  "ts-dedent": "^2.2.0",
161
- "undici": "^5.5.1",
163
+ "undici": "^5.9.1",
162
164
  "update-check": "^1.5.4",
163
165
  "ws": "^8.5.0",
164
166
  "xdg-app-paths": "^7.3.0",
@@ -168,6 +170,6 @@
168
170
  "fsevents": "~2.3.2"
169
171
  },
170
172
  "engines": {
171
- "node": ">=16.7.0"
173
+ "node": ">=16.13.0"
172
174
  }
173
175
  }
@@ -0,0 +1,19 @@
1
+ import { unstable_dev } from "../api";
2
+
3
+ jest.unmock("undici");
4
+
5
+ describe("unstable_dev", () => {
6
+ it("should return Hello World", async () => {
7
+ const worker = await unstable_dev(
8
+ "src/__tests__/helpers/hello-world-worker.js",
9
+ {},
10
+ { disableExperimentalWarning: true }
11
+ );
12
+ const resp = await worker.fetch();
13
+ if (resp) {
14
+ const text = await resp.text();
15
+ expect(text).toMatchInlineSnapshot(`"Hello World!"`);
16
+ }
17
+ await worker.stop();
18
+ });
19
+ });
@@ -61,7 +61,7 @@ describe("normalizeAndValidateConfig()", () => {
61
61
  unsafe: {
62
62
  bindings: [],
63
63
  },
64
- worker_namespaces: [],
64
+ dispatch_namespaces: [],
65
65
  usage_model: undefined,
66
66
  vars: {},
67
67
  define: {},
@@ -1913,11 +1913,11 @@ describe("normalizeAndValidateConfig()", () => {
1913
1913
  });
1914
1914
  });
1915
1915
 
1916
- describe("[worker_namespaces]", () => {
1917
- it("should log an experimental warning when worker_namespaces is used", () => {
1916
+ describe("[dispatch_namespaces]", () => {
1917
+ it("should log an experimental warning when dispatch_namespaces is used", () => {
1918
1918
  const { config, diagnostics } = normalizeAndValidateConfig(
1919
1919
  {
1920
- worker_namespaces: [
1920
+ dispatch_namespaces: [
1921
1921
  {
1922
1922
  binding: "BINDING_1",
1923
1923
  namespace: "NAMESPACE_1",
@@ -1928,44 +1928,44 @@ describe("normalizeAndValidateConfig()", () => {
1928
1928
  { env: undefined }
1929
1929
  );
1930
1930
  expect(config).toEqual(
1931
- expect.not.objectContaining({ worker_namespaces: expect.anything })
1931
+ expect.not.objectContaining({ dispatch_namespaces: expect.anything })
1932
1932
  );
1933
1933
  expect(diagnostics.hasWarnings()).toBe(true);
1934
1934
  expect(diagnostics.hasErrors()).toBe(false);
1935
1935
  expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
1936
1936
  "Processing wrangler configuration:
1937
- - \\"worker_namespaces\\" fields are experimental and may change or break at any time."
1937
+ - \\"dispatch_namespaces\\" fields are experimental and may change or break at any time."
1938
1938
  `);
1939
1939
  });
1940
1940
 
1941
- it("should error if worker_namespaces is not an array", () => {
1941
+ it("should error if dispatch_namespaces is not an array", () => {
1942
1942
  const { config, diagnostics } = normalizeAndValidateConfig(
1943
1943
  {
1944
- worker_namespaces: "just a string",
1944
+ dispatch_namespaces: "just a string",
1945
1945
  } as unknown as RawConfig,
1946
1946
  undefined,
1947
1947
  { env: undefined }
1948
1948
  );
1949
1949
 
1950
1950
  expect(config).toEqual(
1951
- expect.not.objectContaining({ worker_namespaces: expect.anything })
1951
+ expect.not.objectContaining({ dispatch_namespaces: expect.anything })
1952
1952
  );
1953
1953
  expect(diagnostics.hasWarnings()).toBe(true);
1954
1954
  expect(diagnostics.hasErrors()).toBe(true);
1955
1955
  expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
1956
1956
  "Processing wrangler configuration:
1957
- - \\"worker_namespaces\\" fields are experimental and may change or break at any time."
1957
+ - \\"dispatch_namespaces\\" fields are experimental and may change or break at any time."
1958
1958
  `);
1959
1959
  expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
1960
1960
  "Processing wrangler configuration:
1961
- - The field \\"worker_namespaces\\" should be an array but got \\"just a string\\"."
1961
+ - The field \\"dispatch_namespaces\\" should be an array but got \\"just a string\\"."
1962
1962
  `);
1963
1963
  });
1964
1964
 
1965
- it("should error on non valid worker_namespaces", () => {
1965
+ it("should error on non valid dispatch_namespaces", () => {
1966
1966
  const { config, diagnostics } = normalizeAndValidateConfig(
1967
1967
  {
1968
- worker_namespaces: [
1968
+ dispatch_namespaces: [
1969
1969
  "a string",
1970
1970
  123,
1971
1971
  {
@@ -1973,17 +1973,17 @@ describe("normalizeAndValidateConfig()", () => {
1973
1973
  namespace: 456,
1974
1974
  },
1975
1975
  {
1976
- binding: "WORKER_NAMESPACE_BINDING_1",
1976
+ binding: "DISPATCH_NAMESPACE_BINDING_1",
1977
1977
  namespace: 456,
1978
1978
  },
1979
1979
  // this one is valid
1980
1980
  {
1981
- binding: "WORKER_NAMESPACE_BINDING_1",
1982
- namespace: "WORKER_NAMESPACE_BINDING_NAMESPACE_1",
1981
+ binding: "DISPATCH_NAMESPACE_BINDING_1",
1982
+ namespace: "DISPATCH_NAMESPACE_BINDING_NAMESPACE_1",
1983
1983
  },
1984
1984
  {
1985
1985
  binding: 123,
1986
- namespace: "WORKER_NAMESPACE_BINDING_SERVICE_1",
1986
+ namespace: "DISPATCH_NAMESPACE_BINDING_SERVICE_1",
1987
1987
  },
1988
1988
  {
1989
1989
  binding: 123,
@@ -1996,25 +1996,25 @@ describe("normalizeAndValidateConfig()", () => {
1996
1996
  );
1997
1997
  expect(config).toEqual(
1998
1998
  expect.not.objectContaining({
1999
- worker_namespaces: expect.anything,
1999
+ dispatch_namespaces: expect.anything,
2000
2000
  })
2001
2001
  );
2002
2002
  expect(diagnostics.hasWarnings()).toBe(true);
2003
2003
  expect(diagnostics.hasErrors()).toBe(true);
2004
2004
  expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
2005
2005
  "Processing wrangler configuration:
2006
- - \\"worker_namespaces\\" fields are experimental and may change or break at any time."
2006
+ - \\"dispatch_namespaces\\" fields are experimental and may change or break at any time."
2007
2007
  `);
2008
2008
  expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
2009
2009
  "Processing wrangler configuration:
2010
- - \\"worker_namespaces[0]\\" binding should be objects, but got \\"a string\\"
2011
- - \\"worker_namespaces[1]\\" binding should be objects, but got 123
2012
- - \\"worker_namespaces[2]\\" should have a string \\"binding\\" field but got {\\"binding\\":123,\\"namespace\\":456}.
2013
- - \\"worker_namespaces[2]\\" should have a string \\"namespace\\" field but got {\\"binding\\":123,\\"namespace\\":456}.
2014
- - \\"worker_namespaces[3]\\" should have a string \\"namespace\\" field but got {\\"binding\\":\\"WORKER_NAMESPACE_BINDING_1\\",\\"namespace\\":456}.
2015
- - \\"worker_namespaces[5]\\" should have a string \\"binding\\" field but got {\\"binding\\":123,\\"namespace\\":\\"WORKER_NAMESPACE_BINDING_SERVICE_1\\"}.
2016
- - \\"worker_namespaces[6]\\" should have a string \\"binding\\" field but got {\\"binding\\":123,\\"service\\":456}.
2017
- - \\"worker_namespaces[6]\\" should have a string \\"namespace\\" field but got {\\"binding\\":123,\\"service\\":456}."
2010
+ - \\"dispatch_namespaces[0]\\" binding should be objects, but got \\"a string\\"
2011
+ - \\"dispatch_namespaces[1]\\" binding should be objects, but got 123
2012
+ - \\"dispatch_namespaces[2]\\" should have a string \\"binding\\" field but got {\\"binding\\":123,\\"namespace\\":456}.
2013
+ - \\"dispatch_namespaces[2]\\" should have a string \\"namespace\\" field but got {\\"binding\\":123,\\"namespace\\":456}.
2014
+ - \\"dispatch_namespaces[3]\\" should have a string \\"namespace\\" field but got {\\"binding\\":\\"DISPATCH_NAMESPACE_BINDING_1\\",\\"namespace\\":456}.
2015
+ - \\"dispatch_namespaces[5]\\" should have a string \\"binding\\" field but got {\\"binding\\":123,\\"namespace\\":\\"DISPATCH_NAMESPACE_BINDING_SERVICE_1\\"}.
2016
+ - \\"dispatch_namespaces[6]\\" should have a string \\"binding\\" field but got {\\"binding\\":123,\\"service\\":456}.
2017
+ - \\"dispatch_namespaces[6]\\" should have a string \\"namespace\\" field but got {\\"binding\\":123,\\"service\\":456}."
2018
2018
  `);
2019
2019
  });
2020
2020
  });
@@ -668,12 +668,12 @@ describe("wrangler dev", () => {
668
668
  writeWranglerToml({
669
669
  main: "index.js",
670
670
  dev: {
671
- ip: "0.0.0.0",
671
+ ip: "1.2.3.4",
672
672
  },
673
673
  });
674
674
  fs.writeFileSync("index.js", `export default {};`);
675
675
  await runWrangler("dev");
676
- expect((Dev as jest.Mock).mock.calls[0][0].ip).toEqual("0.0.0.0");
676
+ expect((Dev as jest.Mock).mock.calls[0][0].ip).toEqual("1.2.3.4");
677
677
  expect(std.out).toMatchInlineSnapshot(`""`);
678
678
  expect(std.warn).toMatchInlineSnapshot(`""`);
679
679
  expect(std.err).toMatchInlineSnapshot(`""`);
@@ -683,12 +683,12 @@ describe("wrangler dev", () => {
683
683
  writeWranglerToml({
684
684
  main: "index.js",
685
685
  dev: {
686
- ip: "1.1.1.1",
686
+ ip: "1.2.3.4",
687
687
  },
688
688
  });
689
689
  fs.writeFileSync("index.js", `export default {};`);
690
- await runWrangler("dev --ip=0.0.0.0");
691
- expect((Dev as jest.Mock).mock.calls[0][0].ip).toEqual("0.0.0.0");
690
+ await runWrangler("dev --ip=5.6.7.8");
691
+ expect((Dev as jest.Mock).mock.calls[0][0].ip).toEqual("5.6.7.8");
692
692
  expect(std.out).toMatchInlineSnapshot(`""`);
693
693
  expect(std.warn).toMatchInlineSnapshot(`""`);
694
694
  expect(std.err).toMatchInlineSnapshot(`""`);
@@ -1005,7 +1005,7 @@ describe("wrangler dev", () => {
1005
1005
  --compatibility-date Date to use for compatibility checks [string]
1006
1006
  --compatibility-flags, --compatibility-flag Flags to use for compatibility checks [array]
1007
1007
  --latest Use the latest version of the worker runtime [boolean] [default: true]
1008
- --ip IP address to listen on [string] [default: \\"0.0.0.0\\"]
1008
+ --ip IP address to listen on [string]
1009
1009
  --port Port to listen on [number]
1010
1010
  --inspector-port Port for devtools to connect to [number]
1011
1011
  --routes, --route Routes to upload [array]
@@ -1017,6 +1017,8 @@ describe("wrangler dev", () => {
1017
1017
  --site-include Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded. [array]
1018
1018
  --site-exclude Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded. [array]
1019
1019
  --upstream-protocol Protocol to forward requests to host on, defaults to https. [choices: \\"http\\", \\"https\\"]
1020
+ --var A key-value pair to be injected into the script as a variable [array]
1021
+ --define A key-value pair to be substituted in the script [array]
1020
1022
  --jsx-factory The function that is called for each JSX element [string]
1021
1023
  --jsx-fragment The function that is called for each JSX fragment [string]
1022
1024
  --tsconfig Path to a custom tsconfig.json file [string]
@@ -0,0 +1,5 @@
1
+ export default {
2
+ async fetch() {
3
+ return new Response("Hello World!");
4
+ },
5
+ };
@@ -270,9 +270,7 @@ export function unsetSpecialMockFns() {
270
270
  */
271
271
  export async function mockFetchDashScript(resource: string): Promise<string> {
272
272
  if (dashScriptMocks.has(resource)) {
273
- const value = dashScriptMocks.get(resource) ?? "";
274
-
275
- return value;
273
+ return dashScriptMocks.get(resource) ?? "";
276
274
  }
277
275
  throw new Error(`no mock found for \`init from-dash\` - ${resource}`);
278
276
  }
@@ -283,14 +281,16 @@ export async function mockFetchDashScript(resource: string): Promise<string> {
283
281
  export function setMockFetchDashScript({
284
282
  accountId,
285
283
  fromDashScriptName,
284
+ environment,
286
285
  mockResponse,
287
286
  }: {
288
287
  accountId: string;
289
288
  fromDashScriptName: string;
289
+ environment: string;
290
290
  mockResponse?: string;
291
291
  }) {
292
292
  dashScriptMocks.set(
293
- `/accounts/${accountId}/workers/scripts/${fromDashScriptName}`,
293
+ `/accounts/${accountId}/workers/services/${fromDashScriptName}/environments/${environment}/content`,
294
294
  mockResponse
295
295
  );
296
296
  }
@@ -29,7 +29,9 @@ const std = {
29
29
  function normalizeOutput(spy: jest.SpyInstance): string {
30
30
  return normalizeErrorMarkers(
31
31
  replaceByte(
32
- stripTrailingWhitespace(normalizeSlashes(stripTimings(captureCalls(spy))))
32
+ stripTrailingWhitespace(
33
+ normalizeSlashes(normalizeTempDirs(stripTimings(captureCalls(spy))))
34
+ )
33
35
  )
34
36
  );
35
37
  }
@@ -93,5 +95,12 @@ export function stripTrailingWhitespace(str: string): string {
93
95
  * variation causing every few tests the value to change by ± .01
94
96
  */
95
97
  function replaceByte(stdout: string): string {
96
- return stdout.replaceAll(/.[0-9][0-9] KiB/g, "xx KiB");
98
+ return stdout.replaceAll(/\d+\.\d+ KiB/g, "xx KiB");
99
+ }
100
+
101
+ /**
102
+ * Temp directories are created with random names, so we replace all comments temp dirs in them
103
+ */
104
+ export function normalizeTempDirs(stdout: string): string {
105
+ return stdout.replaceAll(/\/\/.+\/tmp.+/g, "//tmpdir");
97
106
  }
@@ -0,0 +1,8 @@
1
+ import { setMockResponse } from "./mock-cfetch";
2
+
3
+ export function mockGetZoneFromHostRequest(host: string, zone?: string) {
4
+ setMockResponse("/zones", (_uri, _init, queryParams) => {
5
+ expect(queryParams.get("name")).toEqual(host);
6
+ return zone ? [{ id: zone }] : [];
7
+ });
8
+ }
@@ -0,0 +1,7 @@
1
+ import { setMockResponse } from "./mock-cfetch";
2
+
3
+ export function mockCollectKnownRoutesRequest(
4
+ routes: { pattern: string; script: string }[]
5
+ ) {
6
+ setMockResponse(`/zones/:zoneId/workers/routes`, "GET", () => routes);
7
+ }
@@ -31,21 +31,21 @@ describe("wrangler", () => {
31
31
  "wrangler
32
32
 
33
33
  Commands:
34
- wrangler init [name] 📥 Create a wrangler.toml configuration file
35
- wrangler dev [script] 👂 Start a local server for developing your worker
36
- wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
37
- wrangler tail [name] 🦚 Starts a log tailing session for a published Worker.
38
- wrangler secret 🤫 Generate a secret that can be referenced in a Worker
39
- wrangler kv:namespace 🗂️ Interact with your Workers KV Namespaces
40
- wrangler kv:key 🔑 Individually manage Workers KV key-value pairs
41
- wrangler kv:bulk 💪 Interact with multiple Workers KV key-value pairs at once
42
- wrangler pages ⚡️ Configure Cloudflare Pages
43
- wrangler r2 📦 Interact with an R2 store
44
- wrangler worker-namespace 📦 Interact with a worker namespace
45
- wrangler pubsub 📮 Interact and manage Pub/Sub Brokers
46
- wrangler login 🔓 Login to Cloudflare
47
- wrangler logout 🚪 Logout from Cloudflare
48
- wrangler whoami 🕵️ Retrieve your user info and test your auth config
34
+ wrangler init [name] 📥 Create a wrangler.toml configuration file
35
+ wrangler dev [script] 👂 Start a local server for developing your worker
36
+ wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
37
+ wrangler tail [worker] 🦚 Starts a log tailing session for a published Worker.
38
+ wrangler secret 🤫 Generate a secret that can be referenced in a Worker
39
+ wrangler kv:namespace 🗂️ Interact with your Workers KV Namespaces
40
+ wrangler kv:key 🔑 Individually manage Workers KV key-value pairs
41
+ wrangler kv:bulk 💪 Interact with multiple Workers KV key-value pairs at once
42
+ wrangler pages ⚡️ Configure Cloudflare Pages
43
+ wrangler r2 📦 Interact with an R2 store
44
+ wrangler dispatch-namespace 📦 Interact with a dispatch namespace
45
+ wrangler pubsub 📮 Interact and manage Pub/Sub Brokers
46
+ wrangler login 🔓 Login to Cloudflare
47
+ wrangler logout 🚪 Logout from Cloudflare
48
+ wrangler whoami 🕵️ Retrieve your user info and test your auth config
49
49
 
50
50
  Flags:
51
51
  -c, --config Path to .toml configuration file [string]
@@ -70,21 +70,21 @@ describe("wrangler", () => {
70
70
  wrangler
71
71
 
72
72
  Commands:
73
- wrangler init [name] 📥 Create a wrangler.toml configuration file
74
- wrangler dev [script] 👂 Start a local server for developing your worker
75
- wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
76
- wrangler tail [name] 🦚 Starts a log tailing session for a published Worker.
77
- wrangler secret 🤫 Generate a secret that can be referenced in a Worker
78
- wrangler kv:namespace 🗂️ Interact with your Workers KV Namespaces
79
- wrangler kv:key 🔑 Individually manage Workers KV key-value pairs
80
- wrangler kv:bulk 💪 Interact with multiple Workers KV key-value pairs at once
81
- wrangler pages ⚡️ Configure Cloudflare Pages
82
- wrangler r2 📦 Interact with an R2 store
83
- wrangler worker-namespace 📦 Interact with a worker namespace
84
- wrangler pubsub 📮 Interact and manage Pub/Sub Brokers
85
- wrangler login 🔓 Login to Cloudflare
86
- wrangler logout 🚪 Logout from Cloudflare
87
- wrangler whoami 🕵️ Retrieve your user info and test your auth config
73
+ wrangler init [name] 📥 Create a wrangler.toml configuration file
74
+ wrangler dev [script] 👂 Start a local server for developing your worker
75
+ wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
76
+ wrangler tail [worker] 🦚 Starts a log tailing session for a published Worker.
77
+ wrangler secret 🤫 Generate a secret that can be referenced in a Worker
78
+ wrangler kv:namespace 🗂️ Interact with your Workers KV Namespaces
79
+ wrangler kv:key 🔑 Individually manage Workers KV key-value pairs
80
+ wrangler kv:bulk 💪 Interact with multiple Workers KV key-value pairs at once
81
+ wrangler pages ⚡️ Configure Cloudflare Pages
82
+ wrangler r2 📦 Interact with an R2 store
83
+ wrangler dispatch-namespace 📦 Interact with a dispatch namespace
84
+ wrangler pubsub 📮 Interact and manage Pub/Sub Brokers
85
+ wrangler login 🔓 Login to Cloudflare
86
+ wrangler logout 🚪 Logout from Cloudflare
87
+ wrangler whoami 🕵️ Retrieve your user info and test your auth config
88
88
 
89
89
  Flags:
90
90
  -c, --config Path to .toml configuration file [string]
@@ -227,16 +227,16 @@ describe("wrangler", () => {
227
227
  await runWrangler("build");
228
228
  await endEventLoop();
229
229
  expect(std.out).toMatchInlineSnapshot(`
230
- "▲ [WARNING] Deprecation: \`wrangler build\` has been deprecated.
230
+ "▲ [WARNING] Deprecation: \`wrangler build\` has been deprecated.
231
231
 
232
- Please refer to https://developers.cloudflare.com/workers/wrangler/migration/deprecations/#build
233
- for more information.
234
- Attempting to run \`wrangler publish --dry-run --outdir=dist\` for you instead:
232
+ Please refer to https://developers.cloudflare.com/workers/wrangler/migration/deprecations/#build
233
+ for more information.
234
+ Attempting to run \`wrangler publish --dry-run --outdir=dist\` for you instead:
235
235
 
236
236
 
237
- --dry-run: exiting now.
238
- Total Upload: 0xx KiB / gzip: 0xx KiB"
239
- `);
237
+ Total Upload: xx KiB / gzip: xx KiB
238
+ --dry-run: exiting now."
239
+ `);
240
240
  });
241
241
  });
242
242