wrangler 2.6.2 → 2.7.1
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/bin/wrangler.js +9 -1
- package/miniflare-dist/index.mjs +1 -1
- package/package.json +12 -10
- package/src/__tests__/api-dev.test.ts +65 -36
- package/src/__tests__/api-devregistry.test.js +14 -6
- package/src/__tests__/configuration.test.ts +2 -31
- package/src/__tests__/{d1.test.ts → d1/d1.test.ts} +48 -5
- package/src/__tests__/d1/splitter.test.ts +255 -0
- package/src/__tests__/delete.test.ts +5 -2
- package/src/__tests__/deployments.test.ts +20 -6
- package/src/__tests__/dev.test.tsx +52 -19
- package/src/__tests__/generate.test.ts +7 -4
- package/src/__tests__/helpers/mock-auth-domain.ts +20 -0
- package/src/__tests__/helpers/mock-cfetch.ts +2 -57
- package/src/__tests__/helpers/mock-dialogs.ts +70 -86
- package/src/__tests__/helpers/mock-oauth-flow.ts +64 -49
- package/src/__tests__/helpers/mock-process.ts +8 -13
- package/src/__tests__/helpers/msw/blob-worker.cjs +19 -0
- package/src/__tests__/helpers/msw/read-file-sync.js +61 -0
- package/src/__tests__/index.test.ts +46 -44
- package/src/__tests__/init.test.ts +761 -537
- package/src/__tests__/jest.setup.ts +20 -24
- package/src/__tests__/kv.test.ts +286 -173
- package/src/__tests__/logout.test.ts +1 -1
- package/src/__tests__/metrics.test.ts +5 -7
- package/src/__tests__/middleware.scheduled.test.ts +40 -30
- package/src/__tests__/middleware.test.ts +144 -120
- package/src/__tests__/pages.test.ts +1617 -1161
- package/src/__tests__/publish.test.ts +174 -125
- package/src/__tests__/r2.test.ts +2 -2
- package/src/__tests__/secret.test.ts +183 -126
- package/src/__tests__/tail.test.ts +6 -0
- package/src/__tests__/tsconfig-sanity.ts +12 -0
- package/src/__tests__/tsconfig.json +8 -0
- package/src/__tests__/tsconfig.tsbuildinfo +1 -0
- package/src/__tests__/whoami.test.tsx +1 -96
- package/src/api/dev.ts +90 -41
- package/src/api/index.ts +1 -1
- package/src/{bundle-reporter.tsx → bundle-reporter.ts} +0 -0
- package/src/cfetch/index.ts +0 -2
- package/src/cfetch/internal.ts +6 -15
- package/src/cli.ts +2 -2
- package/src/config/validation.ts +1 -2
- package/src/create-worker-upload-form.ts +2 -2
- package/src/d1/{delete.tsx → delete.ts} +0 -0
- package/src/d1/execute.tsx +8 -37
- package/src/d1/migrations/apply.tsx +29 -19
- package/src/d1/migrations/{index.tsx → index.ts} +0 -0
- package/src/d1/splitter.ts +161 -0
- package/src/d1/{types.tsx → types.ts} +0 -0
- package/src/delete.ts +3 -8
- package/src/deployments.ts +6 -0
- package/src/deprecated/index.ts +2 -295
- package/src/dev/dev.tsx +2 -2
- package/src/dev/{get-local-persistence-path.tsx → get-local-persistence-path.ts} +0 -0
- package/src/dev/local.tsx +16 -4
- package/src/dev/remote.tsx +28 -1
- package/src/dev/start-server.ts +19 -11
- package/src/dev/use-esbuild.ts +1 -1
- package/src/{dev-registry.tsx → dev-registry.ts} +0 -0
- package/src/dev.tsx +21 -2
- package/src/dialogs.ts +136 -0
- package/src/dispatch-namespace.ts +1 -1
- package/src/docs/index.ts +3 -0
- package/src/environment-variables/factory.ts +88 -0
- package/src/environment-variables/misc-variables.ts +30 -0
- package/src/generate/index.ts +300 -0
- package/src/{index.tsx → index.ts} +10 -13
- package/src/init.ts +92 -52
- package/src/jest.d.ts +4 -0
- package/src/logger.ts +15 -3
- package/src/metrics/metrics-config.ts +1 -1
- package/src/miniflare-cli/assets.ts +4 -0
- package/src/miniflare-cli/index.ts +1 -5
- package/src/miniflare-cli/tsconfig.json +9 -0
- package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -0
- package/src/miniflare-cli/types.ts +11 -0
- package/src/pages/{build.tsx → build.ts} +0 -0
- package/src/pages/{deployment-tails.tsx → deployment-tails.ts} +0 -0
- package/src/pages/{dev.tsx → dev.ts} +53 -55
- package/src/pages/functions/buildWorker.ts +1 -1
- package/src/pages/functions/tsconfig.json +8 -0
- package/src/pages/functions/tsconfig.tsbuildinfo +1 -0
- package/src/pages/{functions.tsx → functions.ts} +0 -0
- package/src/pages/{hash.tsx → hash.ts} +0 -0
- package/src/pages/{index.tsx → index.ts} +0 -0
- package/src/pages/projects.tsx +3 -5
- package/src/pages/publish.tsx +5 -4
- package/src/pages/upload.tsx +1 -1
- package/src/publish/publish.ts +9 -7
- package/src/pubsub/{pubsub-commands.tsx → pubsub-commands.ts} +1 -1
- package/src/secret/index.ts +1 -1
- package/src/{sites.tsx → sites.ts} +0 -0
- package/src/tail/index.ts +2 -3
- package/src/tsconfig-sanity.ts +16 -0
- package/src/user/access.ts +0 -1
- package/src/user/auth-variables.ts +113 -0
- package/src/user/choose-account.tsx +1 -31
- package/src/user/index.ts +0 -1
- package/src/user/{user.tsx → user.ts} +107 -73
- package/src/{whoami.tsx → whoami.ts} +37 -71
- package/templates/__tests__/tsconfig-sanity.ts +12 -0
- package/templates/__tests__/tsconfig.json +8 -0
- package/templates/__tests__/tsconfig.tsbuildinfo +1 -0
- package/templates/d1-beta-facade.js +36 -0
- package/templates/facade.d.ts +14 -0
- package/templates/first-party-worker-module-facade.ts +4 -3
- package/templates/format-dev-errors.ts +7 -6
- package/templates/init-tests/test-jest-new-worker.js +3 -5
- package/templates/init-tests/test-vitest-new-worker.js +3 -5
- package/templates/init-tests/test-vitest-new-worker.ts +25 -0
- package/templates/middleware/loader-modules.ts +0 -2
- package/templates/middleware/loader-sw.ts +6 -0
- package/templates/pages-dev-pipeline.ts +4 -1
- package/templates/pages-shim.ts +4 -1
- package/templates/pages-template-plugin.ts +12 -7
- package/templates/serve-static-assets.ts +16 -14
- package/templates/tsconfig-sanity.ts +11 -0
- package/templates/tsconfig.init.json +106 -0
- package/templates/tsconfig.json +5 -103
- package/templates/tsconfig.tsbuildinfo +1 -0
- package/wrangler-dist/cli.d.ts +58 -60
- package/wrangler-dist/cli.js +34447 -55514
- package/wrangler-dist/wasm-sync.wasm +0 -0
- package/src/__tests__/dialogs.test.tsx +0 -40
- package/src/dialogs.tsx +0 -168
- package/src/environment-variables.ts +0 -50
- package/src/user/env-vars.ts +0 -46
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import fetchMock from "jest-fetch-mock";
|
|
2
2
|
import { Request } from "undici";
|
|
3
3
|
import openInBrowser from "../../open-in-browser";
|
|
4
|
-
import {
|
|
5
|
-
createFetchResult,
|
|
6
|
-
setMockRawResponse,
|
|
7
|
-
setMockResponse,
|
|
8
|
-
} from "./mock-cfetch";
|
|
4
|
+
import { setMockResponse } from "./mock-cfetch";
|
|
9
5
|
import { mockHttpServer } from "./mock-http-server";
|
|
10
6
|
|
|
11
7
|
export function mockGetMemberships(
|
|
@@ -16,12 +12,6 @@ export function mockGetMemberships(
|
|
|
16
12
|
});
|
|
17
13
|
}
|
|
18
14
|
|
|
19
|
-
export function mockGetMembershipsFail() {
|
|
20
|
-
setMockRawResponse("/memberships", () => {
|
|
21
|
-
return createFetchResult([], false);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
15
|
// the response to send when wrangler wants an oauth grant
|
|
26
16
|
let oauthGrantResponse: GrantResponseOptions | "timeout" = {};
|
|
27
17
|
|
|
@@ -92,10 +82,12 @@ export const mockOAuthFlow = () => {
|
|
|
92
82
|
}
|
|
93
83
|
};
|
|
94
84
|
|
|
95
|
-
const mockRevokeAuthorization = (
|
|
85
|
+
const mockRevokeAuthorization = ({
|
|
86
|
+
domain = "dash.cloudflare.com",
|
|
87
|
+
}: { domain?: string } = {}) => {
|
|
96
88
|
const outcome = {
|
|
97
89
|
actual: new Request("https://example.org"),
|
|
98
|
-
expected: new Request(
|
|
90
|
+
expected: new Request(`https://${domain}/oauth2/revoke`, {
|
|
99
91
|
method: "POST",
|
|
100
92
|
}),
|
|
101
93
|
};
|
|
@@ -111,12 +103,14 @@ export const mockOAuthFlow = () => {
|
|
|
111
103
|
|
|
112
104
|
const mockGrantAccessToken = ({
|
|
113
105
|
respondWith,
|
|
106
|
+
domain = "dash.cloudflare.com",
|
|
114
107
|
}: {
|
|
115
108
|
respondWith: MockTokenResponse;
|
|
109
|
+
domain?: string;
|
|
116
110
|
}) => {
|
|
117
111
|
const outcome = {
|
|
118
112
|
actual: new Request("https://example.org"),
|
|
119
|
-
expected: new Request(
|
|
113
|
+
expected: new Request(`https://${domain}/oauth2/token`, {
|
|
120
114
|
method: "POST",
|
|
121
115
|
}),
|
|
122
116
|
};
|
|
@@ -132,49 +126,70 @@ export const mockOAuthFlow = () => {
|
|
|
132
126
|
|
|
133
127
|
const mockExchangeRefreshTokenForAccessToken = ({
|
|
134
128
|
respondWith,
|
|
129
|
+
domain = "dash.cloudlfare.com",
|
|
135
130
|
}: {
|
|
136
131
|
respondWith: "refreshSuccess" | "refreshError" | "badResponse";
|
|
132
|
+
domain?: string;
|
|
137
133
|
}) => {
|
|
138
|
-
fetchMock.mockOnceIf(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
134
|
+
fetchMock.mockOnceIf(`https://${domain}/oauth2/token`, async () => {
|
|
135
|
+
switch (respondWith) {
|
|
136
|
+
case "refreshSuccess":
|
|
137
|
+
return {
|
|
138
|
+
status: 200,
|
|
139
|
+
body: JSON.stringify({
|
|
140
|
+
access_token: "access_token_success_mock",
|
|
141
|
+
expires_in: 1701,
|
|
142
|
+
refresh_token: "refresh_token_success_mock",
|
|
143
|
+
scope: "scope_success_mock",
|
|
144
|
+
token_type: "bearer",
|
|
145
|
+
}),
|
|
146
|
+
};
|
|
147
|
+
case "refreshError":
|
|
148
|
+
return {
|
|
149
|
+
status: 400,
|
|
150
|
+
body: JSON.stringify({
|
|
151
|
+
error: "invalid_request",
|
|
152
|
+
error_description: "error_description_mock",
|
|
153
|
+
error_hint: "error_hint_mock",
|
|
154
|
+
error_verbose: "error_verbose_mock",
|
|
155
|
+
status_code: 400,
|
|
156
|
+
}),
|
|
157
|
+
};
|
|
158
|
+
case "badResponse":
|
|
159
|
+
return {
|
|
160
|
+
status: 400,
|
|
161
|
+
body: `<html> <body> This shouldn't be sent, but should be handled </body> </html>`,
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
default:
|
|
165
|
+
return "Not a respondWith option for `mockExchangeRefreshTokenForAccessToken`";
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
const mockDomainUsesAccess = ({
|
|
171
|
+
usesAccess,
|
|
172
|
+
domain = "dash.cloudflare.com",
|
|
173
|
+
}: {
|
|
174
|
+
usesAccess: boolean;
|
|
175
|
+
domain?: string;
|
|
176
|
+
}) => {
|
|
177
|
+
// If the domain relies upon Cloudflare Access, then a request to the domain
|
|
178
|
+
// will result in a redirect to the `cloudflareaccess.com` domain.
|
|
179
|
+
fetchMock.mockOnceIf(`https://${domain}/`, async () => {
|
|
180
|
+
if (usesAccess) {
|
|
181
|
+
return {
|
|
182
|
+
status: 302,
|
|
183
|
+
headers: { location: "cloudflareaccess.com" },
|
|
184
|
+
};
|
|
185
|
+
} else {
|
|
186
|
+
return { status: 200 };
|
|
173
187
|
}
|
|
174
|
-
);
|
|
188
|
+
});
|
|
175
189
|
};
|
|
176
190
|
|
|
177
191
|
return {
|
|
192
|
+
mockDomainUsesAccess,
|
|
178
193
|
mockGrantAccessToken,
|
|
179
194
|
mockGrantAuthorization,
|
|
180
195
|
mockOAuthServerCallback,
|
|
@@ -5,22 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
let writeSpy: jest.SpyInstance;
|
|
7
7
|
|
|
8
|
-
function captureLastWriteCall(spy: jest.SpyInstance): Buffer {
|
|
8
|
+
function captureLastWriteCall(spy: jest.SpyInstance): Buffer | undefined {
|
|
9
9
|
const calls = spy.mock.calls;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
|
|
11
|
+
// Loop through and find the buffer in calls
|
|
12
|
+
// (we don't know the index of the buffer in the calls array)
|
|
13
|
+
const buffer = calls
|
|
14
|
+
.map((call) => call[0])
|
|
15
|
+
.find((call) => call instanceof Buffer);
|
|
16
|
+
|
|
16
17
|
if (buffer instanceof Buffer) {
|
|
17
18
|
return buffer;
|
|
18
|
-
} else {
|
|
19
|
-
throw new Error(
|
|
20
|
-
`Unexpected non-Buffer passed to \`stdout.write()\`: "${JSON.stringify(
|
|
21
|
-
buffer
|
|
22
|
-
)}"`
|
|
23
|
-
);
|
|
24
19
|
}
|
|
25
20
|
}
|
|
26
21
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*! Read blob sync in NodeJS. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource>
|
|
2
|
+
* Special Thanks to Jimmy Wärting helping in https://github.com/nodejs/undici/issues/1830
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const { workerData } = require("worker_threads");
|
|
6
|
+
|
|
7
|
+
const { signal, port, blob } = workerData;
|
|
8
|
+
|
|
9
|
+
blob.arrayBuffer().then((ab) => {
|
|
10
|
+
// Post the result back to the main thread before unlocking 'signal'
|
|
11
|
+
port.postMessage(ab, [ab]);
|
|
12
|
+
port.close();
|
|
13
|
+
|
|
14
|
+
// Change the value of signal[0] to 1
|
|
15
|
+
Atomics.store(signal, 0, 1);
|
|
16
|
+
|
|
17
|
+
// This will unlock the main thread when we notify it
|
|
18
|
+
Atomics.notify(signal, 0);
|
|
19
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*! Read blob sync in NodeJS. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource>
|
|
2
|
+
* Special Thanks to Jimmy Wärting helping in https://github.com/nodejs/undici/issues/1830
|
|
3
|
+
*/
|
|
4
|
+
const { join } = require("path");
|
|
5
|
+
const {
|
|
6
|
+
Worker,
|
|
7
|
+
receiveMessageOnPort,
|
|
8
|
+
MessageChannel,
|
|
9
|
+
} = require("worker_threads");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* blob-worker & read-file-sync are part of a polyfill to synchronously read a blob in NodeJS
|
|
13
|
+
* this is needed for MSW FormData patching to work and support Blobs, serializing them to a string before recreating the FormData.
|
|
14
|
+
*/
|
|
15
|
+
function read(blob) {
|
|
16
|
+
const subChannel = new MessageChannel();
|
|
17
|
+
const signal = new Int32Array(new SharedArrayBuffer(4));
|
|
18
|
+
signal[0] = 0;
|
|
19
|
+
|
|
20
|
+
const path = join(__dirname, "blob-worker.cjs");
|
|
21
|
+
|
|
22
|
+
const worker = new Worker(path, {
|
|
23
|
+
transferList: [subChannel.port1],
|
|
24
|
+
workerData: {
|
|
25
|
+
signal,
|
|
26
|
+
port: subChannel.port1,
|
|
27
|
+
blob,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Sleep until the other thread sets signal[0] to 1
|
|
32
|
+
Atomics.wait(signal, 0, 0);
|
|
33
|
+
|
|
34
|
+
// Close the worker thread
|
|
35
|
+
worker.terminate();
|
|
36
|
+
|
|
37
|
+
return receiveMessageOnPort(subChannel.port2)?.message;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
class FileReaderSync {
|
|
41
|
+
readAsArrayBuffer(blob) {
|
|
42
|
+
this.result = read(blob);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
readAsDataURL(blob) {
|
|
46
|
+
const ab = read(blob);
|
|
47
|
+
this.result = `data:${blob.type};base64,${Buffer.from(ab).toString(
|
|
48
|
+
"base64"
|
|
49
|
+
)}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
readAsText(blob) {
|
|
53
|
+
const ab = read(blob);
|
|
54
|
+
this.result = new TextDecoder().decode(ab);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Should not be used, use readAsArrayBuffer instead
|
|
58
|
+
// readAsBinaryString(blob) { ... }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
exports.FileReaderSync = FileReaderSync;
|
|
@@ -31,28 +31,29 @@ describe("wrangler", () => {
|
|
|
31
31
|
"wrangler
|
|
32
32
|
|
|
33
33
|
Commands:
|
|
34
|
-
wrangler docs [command]
|
|
35
|
-
wrangler init [name]
|
|
36
|
-
wrangler
|
|
37
|
-
wrangler
|
|
38
|
-
wrangler
|
|
39
|
-
wrangler
|
|
40
|
-
wrangler
|
|
41
|
-
wrangler secret
|
|
42
|
-
wrangler
|
|
43
|
-
wrangler kv:
|
|
44
|
-
wrangler kv:
|
|
45
|
-
wrangler
|
|
46
|
-
wrangler
|
|
47
|
-
wrangler
|
|
48
|
-
wrangler
|
|
49
|
-
wrangler
|
|
50
|
-
wrangler
|
|
51
|
-
wrangler
|
|
52
|
-
wrangler
|
|
53
|
-
wrangler
|
|
54
|
-
wrangler
|
|
55
|
-
wrangler
|
|
34
|
+
wrangler docs [command] 📚 Open wrangler's docs in your browser
|
|
35
|
+
wrangler init [name] 📥 Initialize a basic Worker project, including a wrangler.toml file
|
|
36
|
+
wrangler generate [name] [template] ✨ Generate a new Worker project from an existing Worker template. See https://github.com/cloudflare/templates
|
|
37
|
+
wrangler dev [script] 👂 Start a local server for developing your worker
|
|
38
|
+
wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
|
|
39
|
+
wrangler delete [script] 🗑 Delete your Worker from Cloudflare.
|
|
40
|
+
wrangler tail [worker] 🦚 Starts a log tailing session for a published Worker.
|
|
41
|
+
wrangler secret 🤫 Generate a secret that can be referenced in a Worker
|
|
42
|
+
wrangler secret:bulk <json> 🗄️ Bulk upload secrets for a Worker
|
|
43
|
+
wrangler kv:namespace 🗂️ Interact with your Workers KV Namespaces
|
|
44
|
+
wrangler kv:key 🔑 Individually manage Workers KV key-value pairs
|
|
45
|
+
wrangler kv:bulk 💪 Interact with multiple Workers KV key-value pairs at once
|
|
46
|
+
wrangler pages ⚡️ Configure Cloudflare Pages
|
|
47
|
+
wrangler queues 🇶 Configure Workers Queues
|
|
48
|
+
wrangler r2 📦 Interact with an R2 store
|
|
49
|
+
wrangler dispatch-namespace 📦 Interact with a dispatch namespace
|
|
50
|
+
wrangler d1 🗄 Interact with a D1 database
|
|
51
|
+
wrangler pubsub 📮 Interact and manage Pub/Sub Brokers
|
|
52
|
+
wrangler login 🔓 Login to Cloudflare
|
|
53
|
+
wrangler logout 🚪 Logout from Cloudflare
|
|
54
|
+
wrangler whoami 🕵️ Retrieve your user info and test your auth config
|
|
55
|
+
wrangler types 📝 Generate types from bindings & module rules in config
|
|
56
|
+
wrangler deployments 🚢 Displays the 10 most recent deployments for a worker
|
|
56
57
|
|
|
57
58
|
Flags:
|
|
58
59
|
-c, --config Path to .toml configuration file [string]
|
|
@@ -78,28 +79,29 @@ describe("wrangler", () => {
|
|
|
78
79
|
wrangler
|
|
79
80
|
|
|
80
81
|
Commands:
|
|
81
|
-
wrangler docs [command]
|
|
82
|
-
wrangler init [name]
|
|
83
|
-
wrangler
|
|
84
|
-
wrangler
|
|
85
|
-
wrangler
|
|
86
|
-
wrangler
|
|
87
|
-
wrangler
|
|
88
|
-
wrangler secret
|
|
89
|
-
wrangler
|
|
90
|
-
wrangler kv:
|
|
91
|
-
wrangler kv:
|
|
92
|
-
wrangler
|
|
93
|
-
wrangler
|
|
94
|
-
wrangler
|
|
95
|
-
wrangler
|
|
96
|
-
wrangler
|
|
97
|
-
wrangler
|
|
98
|
-
wrangler
|
|
99
|
-
wrangler
|
|
100
|
-
wrangler
|
|
101
|
-
wrangler
|
|
102
|
-
wrangler
|
|
82
|
+
wrangler docs [command] 📚 Open wrangler's docs in your browser
|
|
83
|
+
wrangler init [name] 📥 Initialize a basic Worker project, including a wrangler.toml file
|
|
84
|
+
wrangler generate [name] [template] ✨ Generate a new Worker project from an existing Worker template. See https://github.com/cloudflare/templates
|
|
85
|
+
wrangler dev [script] 👂 Start a local server for developing your worker
|
|
86
|
+
wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
|
|
87
|
+
wrangler delete [script] 🗑 Delete your Worker from Cloudflare.
|
|
88
|
+
wrangler tail [worker] 🦚 Starts a log tailing session for a published Worker.
|
|
89
|
+
wrangler secret 🤫 Generate a secret that can be referenced in a Worker
|
|
90
|
+
wrangler secret:bulk <json> 🗄️ Bulk upload secrets for a Worker
|
|
91
|
+
wrangler kv:namespace 🗂️ Interact with your Workers KV Namespaces
|
|
92
|
+
wrangler kv:key 🔑 Individually manage Workers KV key-value pairs
|
|
93
|
+
wrangler kv:bulk 💪 Interact with multiple Workers KV key-value pairs at once
|
|
94
|
+
wrangler pages ⚡️ Configure Cloudflare Pages
|
|
95
|
+
wrangler queues 🇶 Configure Workers Queues
|
|
96
|
+
wrangler r2 📦 Interact with an R2 store
|
|
97
|
+
wrangler dispatch-namespace 📦 Interact with a dispatch namespace
|
|
98
|
+
wrangler d1 🗄 Interact with a D1 database
|
|
99
|
+
wrangler pubsub 📮 Interact and manage Pub/Sub Brokers
|
|
100
|
+
wrangler login 🔓 Login to Cloudflare
|
|
101
|
+
wrangler logout 🚪 Logout from Cloudflare
|
|
102
|
+
wrangler whoami 🕵️ Retrieve your user info and test your auth config
|
|
103
|
+
wrangler types 📝 Generate types from bindings & module rules in config
|
|
104
|
+
wrangler deployments 🚢 Displays the 10 most recent deployments for a worker
|
|
103
105
|
|
|
104
106
|
Flags:
|
|
105
107
|
-c, --config Path to .toml configuration file [string]
|