wrangler
Advanced tools
#!/usr/bin/env node | ||
const { spawn } = require("child_process"); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const os = require("os"); | ||
const MIN_NODE_VERSION = "16.13.0"; | ||
const debug = | ||
process.env["WRANGLER_LOG"] === "debug" | ||
? (...args) => console.log(...args) | ||
: () => {}; | ||
const MIN_NODE_VERSION = "18.0.0"; | ||
@@ -13,0 +7,0 @@ let wranglerProcess; |
{ | ||
"name": "wrangler", | ||
"version": "0.0.0-99f27df05", | ||
"version": "0.0.0-99f802591", | ||
"description": "Command-line interface for all things Cloudflare Workers", | ||
@@ -53,12 +53,10 @@ "keywords": [ | ||
"dependencies": { | ||
"@cloudflare/unenv-preset": "1.x", | ||
"@esbuild-plugins/node-globals-polyfill": "0.2.3", | ||
"@esbuild-plugins/node-modules-polyfill": "0.2.2", | ||
"@cloudflare/unenv-preset": "2.0.2", | ||
"blake3-wasm": "2.1.5", | ||
"esbuild": "0.17.19", | ||
"esbuild": "0.24.2", | ||
"path-to-regexp": "6.3.0", | ||
"unenv": "npm:unenv-nightly@2.0.0-20250109-100802-88ad671", | ||
"workerd": "1.20241230.0", | ||
"@cloudflare/kv-asset-handler": "0.3.4", | ||
"miniflare": "0.0.0-99f27df05" | ||
"unenv": "2.0.0-rc.14", | ||
"workerd": "1.20250310.0", | ||
"@cloudflare/kv-asset-handler": "0.4.0", | ||
"miniflare": "0.0.0-99f802591" | ||
}, | ||
@@ -68,3 +66,3 @@ "devDependencies": { | ||
"@cloudflare/types": "6.18.4", | ||
"@cloudflare/workers-types": "^4.20241230.0", | ||
"@cloudflare/workers-types": "^4.20250310.0", | ||
"@cspotcode/source-map-support": "0.8.1", | ||
@@ -82,2 +80,4 @@ "@iarna/toml": "^3.0.0", | ||
"@types/minimatch": "^5.1.2", | ||
"@types/node": "^18.19.75", | ||
"@types/node-forge": "^1.3.11", | ||
"@types/prompts": "^2.0.14", | ||
@@ -90,3 +90,3 @@ "@types/resolve": "^1.20.6", | ||
"@types/yargs": "^17.0.22", | ||
"@vitest/ui": "~2.1.8", | ||
"@vitest/ui": "~3.0.5", | ||
"@webcontainer/env": "^1.1.0", | ||
@@ -107,3 +107,2 @@ "chalk": "^5.2.0", | ||
"https-proxy-agent": "7.0.2", | ||
"ignore": "^5.2.0", | ||
"is-ci": "^3.0.1", | ||
@@ -117,2 +116,3 @@ "itty-time": "^1.0.6", | ||
"msw": "2.4.3", | ||
"node-forge": "^1.3.1", | ||
"open": "^8.4.0", | ||
@@ -135,18 +135,19 @@ "p-queue": "^7.2.0", | ||
"ts-json-schema-generator": "^1.5.0", | ||
"undici": "^5.28.4", | ||
"typescript": "^5.7.2", | ||
"undici": "^5.28.5", | ||
"update-check": "^1.5.4", | ||
"vitest": "~2.1.8", | ||
"vitest": "~3.0.5", | ||
"vitest-websocket-mock": "^0.4.0", | ||
"ws": "^8.18.0", | ||
"ws": "8.18.0", | ||
"xdg-app-paths": "^8.3.0", | ||
"xxhash-wasm": "^1.0.1", | ||
"yargs": "^17.7.2", | ||
"@cloudflare/eslint-config-worker": "1.1.0", | ||
"@cloudflare/cli": "1.1.1", | ||
"@cloudflare/pages-shared": "^0.13.1", | ||
"@cloudflare/eslint-config-worker": "1.1.0", | ||
"@cloudflare/workers-shared": "0.0.0-99f27df05", | ||
"@cloudflare/pages-shared": "^0.13.14", | ||
"@cloudflare/workers-shared": "0.0.0-99f802591", | ||
"@cloudflare/workers-tsconfig": "0.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@cloudflare/workers-types": "^4.20241230.0" | ||
"@cloudflare/workers-types": "^4.20250310.0" | ||
}, | ||
@@ -159,6 +160,7 @@ "peerDependenciesMeta": { | ||
"optionalDependencies": { | ||
"fsevents": "~2.3.2" | ||
"fsevents": "~2.3.2", | ||
"sharp": "^0.33.5" | ||
}, | ||
"engines": { | ||
"node": ">=16.17.0" | ||
"node": ">=18.0.0" | ||
}, | ||
@@ -176,3 +178,3 @@ "volta": { | ||
"check:lint": "eslint . --max-warnings=0", | ||
"check:type": "tsc", | ||
"check:type": "tsc -p ./tsconfig.json && tsc -p ./templates/tsconfig.json", | ||
"clean": "rimraf wrangler-dist miniflare-dist emitted-types", | ||
@@ -179,0 +181,0 @@ "dev": "pnpm run clean && concurrently -c black,blue --kill-others-on-fail false \"pnpm run bundle --watch\" \"pnpm run check:type --watch --preserveWatchOutput\"", |
@@ -11,6 +11,2 @@ <h1 align="center"> ⛅️ wrangler </h1> | ||
> [!WARNING] | ||
> | ||
> Wrangler v2 is **only receiving critical security updates.** We recommend you [migrate to Wrangler v3](https://developers.cloudflare.com/workers/wrangler/migration/update-v2-to-v3/) if you can. | ||
## Quick Start | ||
@@ -26,2 +22,10 @@ | ||
<details><summary>Wrangler System Requirements</summary> | ||
We support running the Wrangler CLI with the [Current, Active, and Maintenance](https://nodejs.org/en/about/previous-releases) versions of Node.js. Your Worker will always be executed in `workerd`, the open source Cloudflare Workers runtime. | ||
Wrangler is only supported on macOS 13.5+, Windows 11, and Linux distros that support glib 2.35. This follows [`workerd`'s OS support policy](https://github.com/cloudflare/workerd?tab=readme-ov-file#running-workerd). | ||
</details> | ||
## Documentation | ||
@@ -28,0 +32,0 @@ |
@@ -23,6 +23,7 @@ // @ts-ignore entry point will get replaced | ||
if (isRoutingRuleMatch(pathname, include)) { | ||
if (worker.fetch === undefined) { | ||
const workerAsHandler = worker as ExportedHandler; | ||
if (workerAsHandler.fetch === undefined) { | ||
throw new TypeError("Entry point missing `fetch` handler"); | ||
} | ||
return worker.fetch(request, env, context); | ||
return workerAsHandler.fetch(request, env, context); | ||
} | ||
@@ -29,0 +30,0 @@ } |
@@ -7,3 +7,10 @@ { | ||
"include": ["**/*.ts"], | ||
"exclude": ["__tests__", "./init-tests/**"] | ||
"exclude": [ | ||
"__tests__", | ||
"./init-tests/**", | ||
// Note: `startDevWorker` and `middleware` should also be included but some work is needed | ||
// for that first (see: https://github.com/cloudflare/workers-sdk/issues/8303) | ||
"startDevWorker", | ||
"middleware" | ||
] | ||
} |
@@ -191,4 +191,3 @@ // templates/startDevWorker/InspectorProxyWorker.ts | ||
tryDrainRuntimeMessageBuffer = () => { | ||
if (this.websockets.devtools === void 0) | ||
return; | ||
if (this.websockets.devtools === void 0) return; | ||
for (const msg of this.runtimeMessageBuffer.splice(0)) { | ||
@@ -348,4 +347,3 @@ if (isDevToolsEvent(msg, "Debugger.scriptParsed")) { | ||
let hostHeader = req.headers.get("Host"); | ||
if (hostHeader == null) | ||
return new Response(null, { status: 400 }); | ||
if (hostHeader == null) return new Response(null, { status: 400 }); | ||
try { | ||
@@ -369,6 +367,4 @@ const host = new URL(`http://${hostHeader}`); | ||
const allowed = ALLOWED_ORIGIN_HOSTNAMES.some((rule) => { | ||
if (typeof rule === "string") | ||
return origin.hostname === rule; | ||
else | ||
return rule.test(origin.hostname); | ||
if (typeof rule === "string") return origin.hostname === rule; | ||
else return rule.test(origin.hostname); | ||
}); | ||
@@ -375,0 +371,0 @@ if (!allowed) { |
@@ -88,4 +88,3 @@ // src/api/startDevWorker/utils.ts | ||
const { proxyData } = this; | ||
if (proxyData === void 0) | ||
return; | ||
if (proxyData === void 0) return; | ||
for (const [request, deferredResponse] of this.getOrderedQueue()) { | ||
@@ -105,8 +104,6 @@ this.requestRetryQueue.delete(request); | ||
const encoding = request.cf?.clientAcceptEncoding; | ||
if (encoding !== void 0) | ||
headers.set("Accept-Encoding", encoding); | ||
if (encoding !== void 0) headers.set("Accept-Encoding", encoding); | ||
rewriteUrlRelatedHeaders(headers, outerUrl, innerUrl); | ||
for (const [key, value] of Object.entries(proxyData.headers ?? {})) { | ||
if (value === void 0) | ||
continue; | ||
if (value === void 0) continue; | ||
if (key.toLowerCase() === "cookie") { | ||
@@ -113,0 +110,0 @@ const existing = request.headers.get("cookie") ?? ""; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
11
-8.33%75
5.63%0
-100%3
-25%6758932
-8.43%80
3.9%48
-2.04%31246
-3.32%