@cloudflare/vite-plugin 1.54.3 → 1.54.5
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/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -2548,8 +2548,8 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
|
|
|
2548
2548
|
__name$5(formatConfigSnippet, "formatConfigSnippet");
|
|
2549
2549
|
|
|
2550
2550
|
//#endregion
|
|
2551
|
-
//#region ../workers-utils/dist/chunk-
|
|
2552
|
-
var DEFAULT_COMPAT_DATE = "2026-
|
|
2551
|
+
//#region ../workers-utils/dist/chunk-XADL62NU.mjs
|
|
2552
|
+
var DEFAULT_COMPAT_DATE = "2026-09-07";
|
|
2553
2553
|
function assertNever(_value) {}
|
|
2554
2554
|
__name$5(assertNever, "assertNever");
|
|
2555
2555
|
function mapWorkerMetadataBindings(bindings$1) {
|
|
@@ -50135,8 +50135,9 @@ function createRequestForIncomingMessage(req, res, options) {
|
|
|
50135
50135
|
});
|
|
50136
50136
|
const method = req.method ?? "GET";
|
|
50137
50137
|
const headers = createHeaders(req);
|
|
50138
|
-
const protocol = options?.protocol ?? ("encrypted" in req.socket && req.socket.encrypted ? "https:" : "http:");
|
|
50139
|
-
const host = options?.host ?? headers.get("Host") ?? "localhost";
|
|
50138
|
+
const protocol = options?.protocol ?? getScheme(req) ?? ("encrypted" in req.socket && req.socket.encrypted ? "https:" : "http:");
|
|
50139
|
+
const host = options?.host ?? getAuthority(req) ?? headers.get("Host") ?? "localhost";
|
|
50140
|
+
if (headers.get("Host") !== host) headers.set("Host", host);
|
|
50140
50141
|
const url$2 = new URL(req.url ?? "/", `${protocol}//${host}`);
|
|
50141
50142
|
const init = {
|
|
50142
50143
|
method,
|
|
@@ -50190,7 +50191,7 @@ function createCancellableRequestBody(req) {
|
|
|
50190
50191
|
});
|
|
50191
50192
|
}
|
|
50192
50193
|
function toMiniflareRequest(request$2) {
|
|
50193
|
-
const host = request$2.headers.get("Host");
|
|
50194
|
+
const host = request$2.headers.get("Host") ?? new URL(request$2.url).host;
|
|
50194
50195
|
const xForwardedHost = request$2.headers.get("X-Forwarded-Host");
|
|
50195
50196
|
if (host && !xForwardedHost) request$2.headers.set("X-Forwarded-Host", host);
|
|
50196
50197
|
request$2.headers.set(CoreHeaders.PROXY_SHARED_SECRET, PROXY_SHARED_SECRET);
|
|
@@ -50219,6 +50220,44 @@ function getForwardedProto(req) {
|
|
|
50219
50220
|
const first = value.split(",")[0]?.trim().toLowerCase();
|
|
50220
50221
|
if (first === "http" || first === "https") return `${first}:`;
|
|
50221
50222
|
}
|
|
50223
|
+
/**
|
|
50224
|
+
* Extracts the authority (host and port) from an incoming Node.js request.
|
|
50225
|
+
*
|
|
50226
|
+
* In HTTP/2, browsers pass the host and port in the `:authority` pseudo-header
|
|
50227
|
+
* rather than the HTTP/1.1 `Host` header. This helper inspects `:authority`
|
|
50228
|
+
* (or the `authority` property on `http2.Http2ServerRequest`) so that ports
|
|
50229
|
+
* are preserved when converting Node requests to standard Fetch requests.
|
|
50230
|
+
*
|
|
50231
|
+
* @param req Incoming request containing HTTP headers and optional authority property
|
|
50232
|
+
* @returns The authority string (e.g. "localhost:5173"), or undefined if not present
|
|
50233
|
+
*/
|
|
50234
|
+
function getAuthority(req) {
|
|
50235
|
+
const raw = req.headers[":authority"];
|
|
50236
|
+
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
50237
|
+
if (value) return value;
|
|
50238
|
+
if (typeof req.authority === "string" && req.authority) return req.authority;
|
|
50239
|
+
}
|
|
50240
|
+
/**
|
|
50241
|
+
* Extracts the scheme from an incoming Node.js request.
|
|
50242
|
+
*
|
|
50243
|
+
* Checks the `:scheme` pseudo-header in HTTP/2 requests or the `scheme`
|
|
50244
|
+
* property on `http2.Http2ServerRequest`.
|
|
50245
|
+
*
|
|
50246
|
+
* @param req Incoming request containing HTTP headers and optional scheme property
|
|
50247
|
+
* @returns The normalized scheme ("http:" or "https:"), or undefined if not present or unsupported
|
|
50248
|
+
*/
|
|
50249
|
+
function getScheme(req) {
|
|
50250
|
+
const raw = req.headers[":scheme"];
|
|
50251
|
+
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
50252
|
+
if (value) {
|
|
50253
|
+
const lower = value.toLowerCase();
|
|
50254
|
+
if (lower === "http" || lower === "https") return `${lower}:`;
|
|
50255
|
+
}
|
|
50256
|
+
if (typeof req.scheme === "string" && req.scheme) {
|
|
50257
|
+
const lower = req.scheme.toLowerCase();
|
|
50258
|
+
if (lower === "http" || lower === "https") return `${lower}:`;
|
|
50259
|
+
}
|
|
50260
|
+
}
|
|
50222
50261
|
|
|
50223
50262
|
//#endregion
|
|
50224
50263
|
//#region src/export-types.ts
|
|
@@ -65707,7 +65746,12 @@ var CloudflareDevEnvironment = class extends vite.DevEnvironment {
|
|
|
65707
65746
|
}
|
|
65708
65747
|
async fetchWorkerExportTypes(miniflare, workerConfig) {
|
|
65709
65748
|
await this.depsOptimizer?.init();
|
|
65710
|
-
|
|
65749
|
+
const response = await miniflare.dispatchFetch(new URL(GET_EXPORT_TYPES_PATH, UNKNOWN_HOST), { headers: { [CoreHeaders.ROUTE_OVERRIDE]: workerConfig.name } });
|
|
65750
|
+
if (!response.ok) {
|
|
65751
|
+
const status$1 = [response.status, response.statusText].filter(Boolean).join(" ");
|
|
65752
|
+
throw new Error(`Failed to fetch export types for Worker "${workerConfig.name}" (${status$1}): ${await response.text()}`);
|
|
65753
|
+
}
|
|
65754
|
+
return await response.json();
|
|
65711
65755
|
}
|
|
65712
65756
|
async fetchModule(id, importer, options) {
|
|
65713
65757
|
if (additionalModuleRE.test(id)) return {
|
|
@@ -76353,6 +76397,8 @@ var CF_SCOPES = [
|
|
|
76353
76397
|
"dns_records:edit",
|
|
76354
76398
|
"dns_records:read",
|
|
76355
76399
|
"dns_settings:read",
|
|
76400
|
+
"email_routing:write",
|
|
76401
|
+
"email_sending:write",
|
|
76356
76402
|
"firstpartytags:write",
|
|
76357
76403
|
"images:read",
|
|
76358
76404
|
"images:write",
|
|
@@ -77284,7 +77330,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
77284
77330
|
//#endregion
|
|
77285
77331
|
//#region ../remote-bindings/dist/index.mjs
|
|
77286
77332
|
var import_undici = require_undici();
|
|
77287
|
-
var version$2 = "0.0.
|
|
77333
|
+
var version$2 = "0.0.20";
|
|
77288
77334
|
var NoDefaultValueProvided = class extends UserError {
|
|
77289
77335
|
constructor() {
|
|
77290
77336
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|