wrangler 0.0.0-e4aff81a → 0.0.0-e4c703ba
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/package.json +30 -15
- package/templates/gitignore +0 -5
- package/templates/init-tests/test-vitest-new-worker.js +1 -1
- package/templates/init-tests/test-vitest-new-worker.ts +1 -1
- package/templates/middleware/loader-modules.ts +3 -4
- package/templates/middleware/loader-sw.ts +4 -3
- package/templates/middleware/middleware-ensure-req-body-drained.ts +19 -0
- package/templates/middleware/middleware-serve-static-assets.ts +5 -5
- package/templates/pages-dev-pipeline.ts +2 -1
- package/templates/startDevWorker/InspectorProxyWorker.ts +661 -0
- package/templates/startDevWorker/ProxyWorker.ts +326 -0
- package/wrangler-dist/InspectorProxyWorker.js +464 -0
- package/wrangler-dist/InspectorProxyWorker.js.map +6 -0
- package/wrangler-dist/ProxyWorker.js +237 -0
- package/wrangler-dist/ProxyWorker.js.map +6 -0
- package/wrangler-dist/cli.d.ts +22272 -111
- package/wrangler-dist/cli.js +72888 -54456
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-e4c703ba",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wrangler",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
"transformIgnorePatterns": [
|
|
78
|
-
"node_modules/.pnpm/(?!find-up|locate-path|p-locate|p-limit|p-timeout|p-queue|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream|get-port|supports-color|pretty-bytes
|
|
78
|
+
"node_modules/.pnpm/(?!find-up|locate-path|p-locate|p-limit|p-timeout|p-queue|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream|get-port|supports-color|pretty-bytes)"
|
|
79
79
|
],
|
|
80
80
|
"snapshotFormat": {
|
|
81
81
|
"escapeString": true,
|
|
@@ -83,28 +83,32 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@cloudflare/kv-asset-handler": "^0.2.0",
|
|
87
86
|
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
88
87
|
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
89
88
|
"blake3-wasm": "^2.1.5",
|
|
90
89
|
"chokidar": "^3.5.3",
|
|
91
90
|
"esbuild": "0.17.19",
|
|
92
|
-
"miniflare": "3.20231025.0",
|
|
93
91
|
"nanoid": "^3.3.3",
|
|
94
92
|
"path-to-regexp": "^6.2.0",
|
|
93
|
+
"resolve": "^1.22.8",
|
|
95
94
|
"resolve.exports": "^2.0.2",
|
|
96
95
|
"selfsigned": "^2.0.1",
|
|
97
96
|
"source-map": "0.6.1",
|
|
98
|
-
"
|
|
99
|
-
"
|
|
97
|
+
"xxhash-wasm": "^1.0.1",
|
|
98
|
+
"@cloudflare/kv-asset-handler": "0.3.1",
|
|
99
|
+
"miniflare": "3.20240223.1"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
|
+
"@cloudflare/ai": "^1.0.35",
|
|
102
103
|
"@cloudflare/eslint-config-worker": "*",
|
|
103
104
|
"@cloudflare/types": "^6.18.4",
|
|
104
|
-
"https-proxy-agent": "7.0.2",
|
|
105
105
|
"@cloudflare/workers-types": "^4.20230914.0",
|
|
106
|
+
"@cspotcode/source-map-support": "0.8.1",
|
|
106
107
|
"@iarna/toml": "^3.0.0",
|
|
107
108
|
"@microsoft/api-extractor": "^7.28.3",
|
|
109
|
+
"@sentry/node": "^7.86.0",
|
|
110
|
+
"@sentry/types": "^7.86.0",
|
|
111
|
+
"@sentry/utils": "^7.86.0",
|
|
108
112
|
"@types/body-parser": "^1.19.2",
|
|
109
113
|
"@types/busboy": "^1.5.0",
|
|
110
114
|
"@types/command-exists": "^1.2.0",
|
|
@@ -117,6 +121,7 @@
|
|
|
117
121
|
"@types/minimatch": "^5.1.2",
|
|
118
122
|
"@types/prompts": "^2.0.14",
|
|
119
123
|
"@types/react": "^17.0.37",
|
|
124
|
+
"@types/resolve": "^1.20.6",
|
|
120
125
|
"@types/serve-static": "^1.13.10",
|
|
121
126
|
"@types/shell-quote": "^1.7.2",
|
|
122
127
|
"@types/signal-exit": "^3.0.1",
|
|
@@ -142,6 +147,7 @@
|
|
|
142
147
|
"get-port": "^6.1.2",
|
|
143
148
|
"glob-to-regexp": "0.4.1",
|
|
144
149
|
"http-terminator": "^3.2.0",
|
|
150
|
+
"https-proxy-agent": "7.0.2",
|
|
145
151
|
"ignore": "^5.2.0",
|
|
146
152
|
"ink": "^3.2.0",
|
|
147
153
|
"ink-select-input": "^4.2.1",
|
|
@@ -157,7 +163,6 @@
|
|
|
157
163
|
"mime": "^3.0.0",
|
|
158
164
|
"minimatch": "^5.1.0",
|
|
159
165
|
"msw": "^0.49.1",
|
|
160
|
-
"npx-import": "^1.1.3",
|
|
161
166
|
"open": "^8.4.0",
|
|
162
167
|
"p-queue": "^7.2.0",
|
|
163
168
|
"patch-console": "^1.0.0",
|
|
@@ -175,23 +180,33 @@
|
|
|
175
180
|
"supports-color": "^9.2.2",
|
|
176
181
|
"timeago.js": "^4.0.2",
|
|
177
182
|
"ts-dedent": "^2.2.0",
|
|
178
|
-
"undici": "5.
|
|
183
|
+
"undici": "5.28.3",
|
|
179
184
|
"update-check": "^1.5.4",
|
|
180
|
-
"vitest": "^0.34.4",
|
|
181
185
|
"ws": "^8.5.0",
|
|
182
186
|
"xdg-app-paths": "^8.3.0",
|
|
183
187
|
"yargs": "^17.7.2",
|
|
184
188
|
"yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
|
|
185
|
-
"@cloudflare/cli": "1.
|
|
186
|
-
"@cloudflare/
|
|
187
|
-
"@cloudflare/
|
|
189
|
+
"@cloudflare/cli": "1.1.1",
|
|
190
|
+
"@cloudflare/pages-shared": "^0.11.16",
|
|
191
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
188
192
|
},
|
|
189
193
|
"optionalDependencies": {
|
|
190
194
|
"fsevents": "~2.3.2"
|
|
191
195
|
},
|
|
196
|
+
"peerDependencies": {
|
|
197
|
+
"@cloudflare/workers-types": "^4.20230914.0"
|
|
198
|
+
},
|
|
199
|
+
"peerDependenciesMeta": {
|
|
200
|
+
"@cloudflare/workers-types": {
|
|
201
|
+
"optional": true
|
|
202
|
+
}
|
|
203
|
+
},
|
|
192
204
|
"engines": {
|
|
193
205
|
"node": ">=16.17.0"
|
|
194
206
|
},
|
|
207
|
+
"workers-sdk": {
|
|
208
|
+
"prerelease": true
|
|
209
|
+
},
|
|
195
210
|
"scripts": {
|
|
196
211
|
"assert-git-version": "node -r esbuild-register scripts/assert-git-version.ts",
|
|
197
212
|
"build": "pnpm run clean && pnpm run bundle && pnpm run emit-types",
|
|
@@ -205,8 +220,8 @@
|
|
|
205
220
|
"test": "pnpm run assert-git-version && jest",
|
|
206
221
|
"test:ci": "pnpm run test --coverage",
|
|
207
222
|
"test:debug": "pnpm run test --silent=false --verbose=true",
|
|
208
|
-
"test:e2e": "vitest
|
|
209
|
-
"test:watch": "pnpm run test --
|
|
223
|
+
"test:e2e": "vitest -c ./e2e/vitest.config.ts",
|
|
224
|
+
"test:watch": "pnpm run test --testTimeout=50000 --watch",
|
|
210
225
|
"type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json"
|
|
211
226
|
}
|
|
212
227
|
}
|
package/templates/gitignore
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
1
2
|
import { unstable_dev } from "wrangler";
|
|
2
3
|
import type { UnstableDevWorker } from "wrangler";
|
|
3
|
-
import { describe, expect, it, beforeAll, afterAll } from "vitest";
|
|
4
4
|
|
|
5
5
|
describe("Worker", () => {
|
|
6
6
|
let worker: UnstableDevWorker;
|
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
// // through wrangler, or we can potentially let users directly add them as a sort
|
|
5
5
|
// // of "plugin" system.
|
|
6
6
|
|
|
7
|
+
import worker from "__ENTRY_POINT__";
|
|
7
8
|
import {
|
|
8
|
-
Dispatcher,
|
|
9
|
-
Middleware,
|
|
10
9
|
__facade_invoke__,
|
|
11
10
|
__facade_register__,
|
|
11
|
+
Dispatcher,
|
|
12
|
+
Middleware,
|
|
12
13
|
} from "./common";
|
|
13
14
|
|
|
14
|
-
import worker from "__ENTRY_POINT__";
|
|
15
|
-
|
|
16
15
|
// We need to preserve all of the exports from the worker
|
|
17
16
|
export * from "__ENTRY_POINT__";
|
|
18
17
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
__facade_invoke__,
|
|
3
|
+
__facade_register__,
|
|
4
|
+
__facade_registerInternal__,
|
|
2
5
|
Awaitable,
|
|
3
6
|
Dispatcher,
|
|
4
7
|
IncomingRequest,
|
|
5
8
|
Middleware,
|
|
6
|
-
__facade_invoke__,
|
|
7
|
-
__facade_register__,
|
|
8
|
-
__facade_registerInternal__,
|
|
9
9
|
} from "./common";
|
|
10
|
+
|
|
10
11
|
export { __facade_register__, __facade_registerInternal__ };
|
|
11
12
|
|
|
12
13
|
// Miniflare 2's `EventTarget` follows the spec and doesn't allow exceptions to
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Middleware } from "./common";
|
|
2
|
+
|
|
3
|
+
const drainBody: Middleware = async (request, env, _ctx, middlewareCtx) => {
|
|
4
|
+
try {
|
|
5
|
+
return await middlewareCtx.next(request, env);
|
|
6
|
+
} finally {
|
|
7
|
+
try {
|
|
8
|
+
if (request.body !== null && !request.bodyUsed) {
|
|
9
|
+
const reader = request.body.getReader();
|
|
10
|
+
while (!(await reader.read()).done) {}
|
|
11
|
+
}
|
|
12
|
+
} catch (e) {
|
|
13
|
+
console.error("Failed to drain the unused request body.", e);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default drainBody;
|
|
19
|
+
export const wrap = undefined;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/// <reference path="middleware-serve-static-assets.d.ts"/>
|
|
2
2
|
|
|
3
|
+
import manifest from "__STATIC_CONTENT_MANIFEST";
|
|
3
4
|
import {
|
|
4
5
|
getAssetFromKV,
|
|
5
|
-
NotFoundError,
|
|
6
6
|
MethodNotAllowedError,
|
|
7
|
+
NotFoundError,
|
|
7
8
|
serveSinglePageApp,
|
|
8
9
|
} from "@cloudflare/kv-asset-handler";
|
|
10
|
+
import { cacheControl, spaMode } from "config:middleware/serve-static-assets";
|
|
11
|
+
import type { Middleware } from "./common";
|
|
9
12
|
import type { Options } from "@cloudflare/kv-asset-handler";
|
|
10
|
-
import { spaMode, cacheControl } from "config:middleware/serve-static-assets";
|
|
11
13
|
import type * as kvAssetHandler from "@cloudflare/kv-asset-handler";
|
|
12
|
-
import manifest from "__STATIC_CONTENT_MANIFEST";
|
|
13
|
-
const ASSET_MANIFEST = JSON.parse(manifest);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const ASSET_MANIFEST = JSON.parse(manifest);
|
|
16
16
|
|
|
17
17
|
const staticAssets: Middleware = async (request, env, _ctx, middlewareCtx) => {
|
|
18
18
|
let options: Partial<Options> = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// @ts-ignore entry point will get replaced
|
|
2
2
|
import worker from "__ENTRY_POINT__";
|
|
3
|
+
import { isRoutingRuleMatch } from "./pages-dev-util";
|
|
4
|
+
|
|
3
5
|
// @ts-ignore entry point will get replaced
|
|
4
6
|
export * from "__ENTRY_POINT__";
|
|
5
|
-
import { isRoutingRuleMatch } from "./pages-dev-util";
|
|
6
7
|
|
|
7
8
|
// @ts-ignore routes are injected
|
|
8
9
|
const routes = __ROUTES__;
|