wrangler 0.0.0-e8df68ee → 0.0.0-e9106dfa5
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 +33 -41
- package/bin/wrangler.js +6 -35
- package/config-schema.json +2277 -0
- package/package.json +182 -195
- package/templates/checked-fetch.js +10 -3
- package/templates/facade.d.ts +7 -5
- package/templates/gitignore +2 -4
- package/templates/init-tests/test-vitest-new-worker.js +1 -1
- package/templates/init-tests/test-vitest-new-worker.ts +3 -3
- package/templates/middleware/loader-modules.ts +92 -85
- package/templates/middleware/loader-sw.ts +4 -3
- package/templates/middleware/middleware-ensure-req-body-drained.ts +18 -0
- package/templates/middleware/middleware-mock-analytics-engine.d.ts +3 -0
- package/templates/middleware/middleware-mock-analytics-engine.ts +30 -0
- package/templates/middleware/middleware-patch-console-prefix.d.ts +3 -0
- package/templates/middleware/middleware-patch-console-prefix.ts +21 -0
- package/templates/middleware/middleware-scheduled.ts +15 -1
- package/templates/modules-watch-stub.js +4 -0
- package/templates/pages-dev-pipeline.ts +5 -3
- package/templates/pages-template-plugin.ts +2 -2
- package/templates/pages-template-worker.ts +1 -1
- package/templates/startDevWorker/InspectorProxyWorker.ts +679 -0
- package/templates/startDevWorker/ProxyWorker.ts +336 -0
- package/templates/tsconfig.init.json +4 -87
- package/templates/tsconfig.json +8 -1
- package/templates/tsconfig.tsbuildinfo +1 -0
- package/wrangler-dist/InspectorProxyWorker.js +471 -0
- package/wrangler-dist/InspectorProxyWorker.js.map +6 -0
- package/wrangler-dist/ProxyWorker.js +238 -0
- package/wrangler-dist/ProxyWorker.js.map +6 -0
- package/wrangler-dist/cli.d.ts +25339 -372
- package/wrangler-dist/cli.js +150132 -144938
- package/Cloudflare_CA.pem +0 -18
- package/templates/middleware/middleware-d1-beta.d.ts +0 -3
- package/templates/middleware/middleware-d1-beta.ts +0 -244
- package/templates/middleware/middleware-multiworker-dev.d.ts +0 -4
- package/templates/middleware/middleware-multiworker-dev.ts +0 -59
- package/templates/middleware/middleware-serve-static-assets.d.ts +0 -6
- package/templates/middleware/middleware-serve-static-assets.ts +0 -56
- package/wrangler-dist/wasm-sync.wasm +0 -0
package/package.json
CHANGED
|
@@ -1,196 +1,183 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
"vitest": "^0.31.0",
|
|
185
|
-
"ws": "^8.5.0",
|
|
186
|
-
"xdg-app-paths": "^7.3.0",
|
|
187
|
-
"yargs": "^17.4.1",
|
|
188
|
-
"yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz"
|
|
189
|
-
},
|
|
190
|
-
"optionalDependencies": {
|
|
191
|
-
"fsevents": "~2.3.2"
|
|
192
|
-
},
|
|
193
|
-
"engines": {
|
|
194
|
-
"node": ">=16.13.0"
|
|
195
|
-
}
|
|
196
|
-
}
|
|
2
|
+
"name": "wrangler",
|
|
3
|
+
"version": "0.0.0-e9106dfa5",
|
|
4
|
+
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"wrangler",
|
|
7
|
+
"cloudflare",
|
|
8
|
+
"workers",
|
|
9
|
+
"cloudflare workers",
|
|
10
|
+
"edge",
|
|
11
|
+
"compute",
|
|
12
|
+
"serverless",
|
|
13
|
+
"serverless application",
|
|
14
|
+
"serverless module",
|
|
15
|
+
"wasm",
|
|
16
|
+
"web",
|
|
17
|
+
"assembly",
|
|
18
|
+
"webassembly",
|
|
19
|
+
"rust",
|
|
20
|
+
"emscripten",
|
|
21
|
+
"typescript",
|
|
22
|
+
"graphql",
|
|
23
|
+
"router",
|
|
24
|
+
"http",
|
|
25
|
+
"cli"
|
|
26
|
+
],
|
|
27
|
+
"homepage": "https://github.com/cloudflare/workers-sdk#readme",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/cloudflare/workers-sdk/issues"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/cloudflare/workers-sdk.git",
|
|
34
|
+
"directory": "packages/wrangler"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT OR Apache-2.0",
|
|
37
|
+
"author": "wrangler@cloudflare.com",
|
|
38
|
+
"main": "wrangler-dist/cli.js",
|
|
39
|
+
"types": "wrangler-dist/cli.d.ts",
|
|
40
|
+
"bin": {
|
|
41
|
+
"wrangler": "./bin/wrangler.js",
|
|
42
|
+
"wrangler2": "./bin/wrangler.js"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"bin",
|
|
46
|
+
"miniflare-dist",
|
|
47
|
+
"wrangler-dist",
|
|
48
|
+
"templates",
|
|
49
|
+
"kv-asset-handler.js",
|
|
50
|
+
"config-schema.json"
|
|
51
|
+
],
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@cloudflare/unenv-preset": "2.3.1",
|
|
54
|
+
"blake3-wasm": "2.1.5",
|
|
55
|
+
"esbuild": "0.24.2",
|
|
56
|
+
"path-to-regexp": "6.3.0",
|
|
57
|
+
"unenv": "2.0.0-rc.15",
|
|
58
|
+
"workerd": "1.20250321.0",
|
|
59
|
+
"@cloudflare/kv-asset-handler": "0.4.0",
|
|
60
|
+
"miniflare": "0.0.0-e9106dfa5"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@aws-sdk/client-s3": "^3.721.0",
|
|
64
|
+
"@cloudflare/types": "6.18.4",
|
|
65
|
+
"@cloudflare/workers-types": "^4.20250321.0",
|
|
66
|
+
"@cspotcode/source-map-support": "0.8.1",
|
|
67
|
+
"@iarna/toml": "^3.0.0",
|
|
68
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
69
|
+
"@sentry/node": "^7.86.0",
|
|
70
|
+
"@sentry/types": "^7.86.0",
|
|
71
|
+
"@sentry/utils": "^7.86.0",
|
|
72
|
+
"@types/command-exists": "^1.2.0",
|
|
73
|
+
"@types/glob-to-regexp": "^0.4.1",
|
|
74
|
+
"@types/is-ci": "^3.0.0",
|
|
75
|
+
"@types/javascript-time-ago": "^2.0.3",
|
|
76
|
+
"@types/mime": "^3.0.4",
|
|
77
|
+
"@types/minimatch": "^5.1.2",
|
|
78
|
+
"@types/node": "^18.19.75",
|
|
79
|
+
"@types/node-forge": "^1.3.11",
|
|
80
|
+
"@types/prompts": "^2.0.14",
|
|
81
|
+
"@types/resolve": "^1.20.6",
|
|
82
|
+
"@types/shell-quote": "^1.7.2",
|
|
83
|
+
"@types/signal-exit": "^3.0.1",
|
|
84
|
+
"@types/supports-color": "^8.1.1",
|
|
85
|
+
"@types/ws": "^8.5.7",
|
|
86
|
+
"@types/yargs": "^17.0.22",
|
|
87
|
+
"@vitest/ui": "~3.0.8",
|
|
88
|
+
"@webcontainer/env": "^1.1.0",
|
|
89
|
+
"chalk": "^5.2.0",
|
|
90
|
+
"chokidar": "^4.0.1",
|
|
91
|
+
"cli-table3": "^0.6.3",
|
|
92
|
+
"cmd-shim": "^4.1.0",
|
|
93
|
+
"command-exists": "^1.2.9",
|
|
94
|
+
"concurrently": "^8.2.2",
|
|
95
|
+
"date-fns": "^4.1.0",
|
|
96
|
+
"devtools-protocol": "^0.0.1182435",
|
|
97
|
+
"dotenv": "^16.3.1",
|
|
98
|
+
"execa": "^6.1.0",
|
|
99
|
+
"find-up": "^6.3.0",
|
|
100
|
+
"get-port": "^7.0.0",
|
|
101
|
+
"glob-to-regexp": "^0.4.1",
|
|
102
|
+
"https-proxy-agent": "7.0.2",
|
|
103
|
+
"is-ci": "^3.0.1",
|
|
104
|
+
"itty-time": "^1.0.6",
|
|
105
|
+
"javascript-time-ago": "^2.5.4",
|
|
106
|
+
"md5-file": "5.0.0",
|
|
107
|
+
"mime": "^3.0.0",
|
|
108
|
+
"minimatch": "^5.1.0",
|
|
109
|
+
"mock-socket": "^9.3.1",
|
|
110
|
+
"msw": "2.4.3",
|
|
111
|
+
"node-forge": "^1.3.1",
|
|
112
|
+
"open": "^8.4.0",
|
|
113
|
+
"p-queue": "^7.2.0",
|
|
114
|
+
"patch-console": "^1.0.0",
|
|
115
|
+
"pretty-bytes": "^6.0.0",
|
|
116
|
+
"prompts": "^2.4.2",
|
|
117
|
+
"resolve": "^1.22.8",
|
|
118
|
+
"rimraf": "^5.0.10",
|
|
119
|
+
"selfsigned": "^2.0.1",
|
|
120
|
+
"semiver": "^1.1.0",
|
|
121
|
+
"shell-quote": "^1.8.1",
|
|
122
|
+
"signal-exit": "^3.0.7",
|
|
123
|
+
"source-map": "^0.6.1",
|
|
124
|
+
"strip-ansi": "^7.1.0",
|
|
125
|
+
"supports-color": "^9.2.2",
|
|
126
|
+
"timeago.js": "^4.0.2",
|
|
127
|
+
"ts-dedent": "^2.2.0",
|
|
128
|
+
"ts-json-schema-generator": "^1.5.0",
|
|
129
|
+
"typescript": "^5.7.2",
|
|
130
|
+
"undici": "^5.28.5",
|
|
131
|
+
"update-check": "^1.5.4",
|
|
132
|
+
"vitest": "~3.0.8",
|
|
133
|
+
"vitest-websocket-mock": "^0.4.0",
|
|
134
|
+
"ws": "8.18.0",
|
|
135
|
+
"xdg-app-paths": "^8.3.0",
|
|
136
|
+
"xxhash-wasm": "^1.0.1",
|
|
137
|
+
"yargs": "^17.7.2",
|
|
138
|
+
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
139
|
+
"@cloudflare/pages-shared": "^0.13.20",
|
|
140
|
+
"@cloudflare/cli": "1.1.1",
|
|
141
|
+
"@cloudflare/workers-shared": "0.0.0-e9106dfa5",
|
|
142
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
143
|
+
},
|
|
144
|
+
"peerDependencies": {
|
|
145
|
+
"@cloudflare/workers-types": "^4.20250321.0"
|
|
146
|
+
},
|
|
147
|
+
"peerDependenciesMeta": {
|
|
148
|
+
"@cloudflare/workers-types": {
|
|
149
|
+
"optional": true
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"optionalDependencies": {
|
|
153
|
+
"fsevents": "~2.3.2",
|
|
154
|
+
"sharp": "^0.33.5"
|
|
155
|
+
},
|
|
156
|
+
"engines": {
|
|
157
|
+
"node": ">=18.0.0"
|
|
158
|
+
},
|
|
159
|
+
"volta": {
|
|
160
|
+
"extends": "../../package.json"
|
|
161
|
+
},
|
|
162
|
+
"workers-sdk": {
|
|
163
|
+
"prerelease": true
|
|
164
|
+
},
|
|
165
|
+
"scripts": {
|
|
166
|
+
"assert-git-version": "node -r esbuild-register scripts/assert-git-version.ts",
|
|
167
|
+
"build": "pnpm run clean && pnpm run bundle && pnpm run emit-types && pnpm run generate-json-schema",
|
|
168
|
+
"bundle": "node -r esbuild-register scripts/bundle.ts",
|
|
169
|
+
"check:lint": "eslint . --max-warnings=0",
|
|
170
|
+
"check:type": "tsc -p ./tsconfig.json && tsc -p ./templates/tsconfig.json",
|
|
171
|
+
"clean": "rimraf wrangler-dist miniflare-dist emitted-types",
|
|
172
|
+
"dev": "pnpm run clean && concurrently -c black,blue --kill-others-on-fail false \"pnpm run bundle --watch\" \"pnpm run check:type --watch --preserveWatchOutput\"",
|
|
173
|
+
"emit-types": "tsc -p tsconfig.emit.json && node -r esbuild-register scripts/emit-types.ts",
|
|
174
|
+
"generate-json-schema": "node -r esbuild-register scripts/generate-json-schema.ts",
|
|
175
|
+
"start": "pnpm run bundle && cross-env NODE_OPTIONS=--enable-source-maps ./bin/wrangler.js",
|
|
176
|
+
"test": "dotenv -- pnpm run assert-git-version && dotenv -- vitest",
|
|
177
|
+
"test:ci": "pnpm run test run",
|
|
178
|
+
"test:debug": "pnpm run test --silent=false --verbose=true",
|
|
179
|
+
"test:e2e": "dotenv -- vitest -c ./e2e/vitest.config.mts",
|
|
180
|
+
"test:watch": "pnpm run test --testTimeout=50000 --watch",
|
|
181
|
+
"type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const urls = new Set();
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function checkURL(request, init) {
|
|
4
4
|
const url =
|
|
5
5
|
request instanceof URL
|
|
6
6
|
? request
|
|
@@ -9,7 +9,7 @@ export function checkedFetch(request, init) {
|
|
|
9
9
|
? new Request(request, init)
|
|
10
10
|
: request
|
|
11
11
|
).url
|
|
12
|
-
|
|
12
|
+
);
|
|
13
13
|
if (url.port && url.port !== "443" && url.protocol === "https:") {
|
|
14
14
|
if (!urls.has(url.toString())) {
|
|
15
15
|
urls.add(url.toString());
|
|
@@ -19,5 +19,12 @@ export function checkedFetch(request, init) {
|
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
return globalThis.fetch(request, init);
|
|
23
22
|
}
|
|
23
|
+
|
|
24
|
+
globalThis.fetch = new Proxy(globalThis.fetch, {
|
|
25
|
+
apply(target, thisArg, argArray) {
|
|
26
|
+
const [request, init] = argArray;
|
|
27
|
+
checkURL(request, init);
|
|
28
|
+
return Reflect.apply(target, thisArg, argArray);
|
|
29
|
+
},
|
|
30
|
+
});
|
package/templates/facade.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
declare module "__ENTRY_POINT__" {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { Middleware } from "./middleware/common";
|
|
3
|
+
import { WorkerEntrypoint } from "cloudflare:workers";
|
|
4
|
+
|
|
5
|
+
export type WorkerEntrypointConstructor = typeof WorkerEntrypoint;
|
|
6
|
+
|
|
7
|
+
const worker: ExportedHandler | WorkerEntrypointConstructor;
|
|
7
8
|
export default worker;
|
|
9
|
+
export const __INTERNAL_WRANGLER_MIDDLEWARE__: Middleware[];
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
declare module "__KV_ASSET_HANDLER__" {
|
package/templates/gitignore
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
1
2
|
import { unstable_dev } from "wrangler";
|
|
2
|
-
import type {
|
|
3
|
-
import { describe, expect, it, beforeAll, afterAll } from "vitest";
|
|
3
|
+
import type { Unstable_DevWorker } from "wrangler";
|
|
4
4
|
|
|
5
5
|
describe("Worker", () => {
|
|
6
|
-
let worker:
|
|
6
|
+
let worker: Unstable_DevWorker;
|
|
7
7
|
|
|
8
8
|
beforeAll(async () => {
|
|
9
9
|
worker = await unstable_dev("src/index.ts", {
|