@cloudflare/vite-plugin 1.51.1 → 1.51.3

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.mjs CHANGED
@@ -2,10 +2,10 @@ import { a as __toESM, c as __toESM$1, i as __require$1, n as __export, o as __c
2
2
  import * as nodeModule from "node:module";
3
3
  import { builtinModules, createRequire } from "node:module";
4
4
  import assert from "node:assert";
5
- import { CoreHeaders, CorePaths, DeferredPromise, Log, LogLevel, Miniflare, MiniflareCoreError, Mutex, Request as Request$1, Response as Response$1, buildPublicUrl, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, getWorkerRegistry, kUnsafeEphemeralUniqueKey, parseModuleFallbackRequest } from "miniflare";
5
+ import { CoreHeaders, CorePaths, DeferredPromise, Log, LogLevel, Miniflare, MiniflareCoreError, Mutex, Request as Request$1, Response as Response$1, buildPublicUrl, convertV4MiniflareOptions, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, getWorkerRegistry, kUnsafeEphemeralUniqueKey, parseModuleFallbackRequest } from "miniflare";
6
6
  import * as wrangler from "wrangler";
7
7
  import * as path2 from "node:path";
8
- import path2__default, { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
8
+ import path, { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
9
9
  import * as util$1 from "node:util";
10
10
  import util, { TextEncoder as TextEncoder$1, format, inspect, promisify, styleText } from "node:util";
11
11
  import * as vite from "vite";
@@ -1489,7 +1489,7 @@ async function assertWranglerVersion() {
1489
1489
  * The default compatibility date to use when the user omits one.
1490
1490
  * This value is injected at build time and remains fixed for each release.
1491
1491
  */
1492
- const DEFAULT_COMPAT_DATE = "2026-08-07";
1492
+ const DEFAULT_COMPAT_DATE = "2026-08-11";
1493
1493
 
1494
1494
  //#endregion
1495
1495
  //#region src/build-output-env.ts
@@ -1884,8 +1884,8 @@ __name$4(constructWranglerConfig, "constructWranglerConfig");
1884
1884
 
1885
1885
  //#endregion
1886
1886
  //#region ../workers-utils/dist/chunk-53IMCORZ.mjs
1887
- function isDirectory$1(path$1) {
1888
- return fs2.statSync(path$1, { throwIfNoEntry: false })?.isDirectory() ?? false;
1887
+ function isDirectory$1(path$2) {
1888
+ return fs2.statSync(path$2, { throwIfNoEntry: false })?.isDirectory() ?? false;
1889
1889
  }
1890
1890
  __name$4(isDirectory$1, "isDirectory");
1891
1891
  function removeDir$1(dirPath, { fireAndForget = false } = {}) {
@@ -1928,7 +1928,7 @@ function getEnv(name) {
1928
1928
  }
1929
1929
  __name$4(getEnv, "getEnv");
1930
1930
  function normalizePath$2(p$2) {
1931
- return p$2 ? path2__default.normalize(path2__default.join(p$2, ".")) : void 0;
1931
+ return p$2 ? path.normalize(path.join(p$2, ".")) : void 0;
1932
1932
  }
1933
1933
  __name$4(normalizePath$2, "normalizePath");
1934
1934
  function homeDir() {
@@ -1936,13 +1936,13 @@ function homeDir() {
1936
1936
  os.homedir(),
1937
1937
  getEnv("USERPROFILE"),
1938
1938
  getEnv("HOME"),
1939
- getEnv("HOMEDRIVE") || getEnv("HOMEPATH") ? path2__default.join(getEnv("HOMEDRIVE") ?? "", getEnv("HOMEPATH") ?? "") : void 0
1939
+ getEnv("HOMEDRIVE") || getEnv("HOMEPATH") ? path.join(getEnv("HOMEDRIVE") ?? "", getEnv("HOMEPATH") ?? "") : void 0
1940
1940
  ].find(isNonEmpty));
1941
1941
  return normalizePath$2(os.homedir() || getEnv("HOME"));
1942
1942
  }
1943
1943
  __name$4(homeDir, "homeDir");
1944
1944
  function joinToBase(base, segments) {
1945
- return base ? path2__default.join(base, ...segments) : void 0;
1945
+ return base ? path.join(base, ...segments) : void 0;
1946
1946
  }
1947
1947
  __name$4(joinToBase, "joinToBase");
1948
1948
  function tempDir() {
@@ -1978,7 +1978,7 @@ function baseDir() {
1978
1978
  }
1979
1979
  __name$4(baseDir, "baseDir");
1980
1980
  function valOrPath(value, segments) {
1981
- return value || path2__default.join(...segments);
1981
+ return value || path.join(...segments);
1982
1982
  }
1983
1983
  __name$4(valOrPath, "valOrPath");
1984
1984
  function windowsAppData() {
@@ -2018,10 +2018,10 @@ function xdgCache() {
2018
2018
  }
2019
2019
  __name$4(xdgCache, "xdgCache");
2020
2020
  function xdgAppPaths(name) {
2021
- const segment = path2__default.parse(name).name;
2021
+ const segment = path.parse(name).name;
2022
2022
  return {
2023
- config: /* @__PURE__ */ __name$4(() => path2__default.join(xdgConfig(), segment), "config"),
2024
- cache: /* @__PURE__ */ __name$4(() => path2__default.join(xdgCache(), segment), "cache")
2023
+ config: /* @__PURE__ */ __name$4(() => path.join(xdgConfig(), segment), "config"),
2024
+ cache: /* @__PURE__ */ __name$4(() => path.join(xdgCache(), segment), "cache")
2025
2025
  };
2026
2026
  }
2027
2027
  __name$4(xdgAppPaths, "xdgAppPaths");
@@ -2029,7 +2029,7 @@ function getGlobalConfigPath({ appName = "wrangler", leadingDot = true, useLegac
2029
2029
  const dirName = `${leadingDot ? "." : ""}${appName}`;
2030
2030
  const configDir = xdgAppPaths(dirName).config();
2031
2031
  if (useLegacyHomeDir) {
2032
- const legacyConfigDir = path2__default.join(os.homedir(), dirName);
2032
+ const legacyConfigDir = path.join(os.homedir(), dirName);
2033
2033
  if (isDirectory$1(legacyConfigDir)) return legacyConfigDir;
2034
2034
  }
2035
2035
  return configDir;
@@ -4406,7 +4406,7 @@ function resolveWranglerConfigPath$1({ config: config$2, script }, options) {
4406
4406
  deployConfigPath: void 0,
4407
4407
  redirected: false
4408
4408
  };
4409
- return findWranglerConfig$2(script !== void 0 ? path2__default.dirname(script) : process.cwd(), options);
4409
+ return findWranglerConfig$2(script !== void 0 ? path.dirname(script) : process.cwd(), options);
4410
4410
  }
4411
4411
  __name$4(resolveWranglerConfigPath$1, "resolveWranglerConfigPath");
4412
4412
  function findWranglerConfig$2(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
@@ -4437,15 +4437,15 @@ function findRedirectedWranglerConfig$1(cwd, userConfigPath) {
4437
4437
  const deployConfigFile = readFileSync$1(deployConfigPath);
4438
4438
  try {
4439
4439
  const deployConfig = parseJSONC$1(deployConfigFile, deployConfigPath);
4440
- redirectedConfigPath = deployConfig.configPath && path2__default.resolve(path2__default.dirname(deployConfigPath), deployConfig.configPath);
4440
+ redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);
4441
4441
  } catch (e) {
4442
- throw new UserError(`Failed to parse the deploy configuration file at ${path2__default.relative(".", deployConfigPath)}`, {
4442
+ throw new UserError(`Failed to parse the deploy configuration file at ${path.relative(".", deployConfigPath)}`, {
4443
4443
  cause: e,
4444
4444
  telemetryMessage: false
4445
4445
  });
4446
4446
  }
4447
4447
  if (!redirectedConfigPath) throw new UserError(esm_default$2`
4448
- A deploy configuration file was found at "${path2__default.relative(".", deployConfigPath)}".
4448
+ A deploy configuration file was found at "${path.relative(".", deployConfigPath)}".
4449
4449
  But this is not valid - the required "configPath" property was not found.
4450
4450
  Instead this file contains:
4451
4451
  \`\`\`
@@ -4453,13 +4453,13 @@ function findRedirectedWranglerConfig$1(cwd, userConfigPath) {
4453
4453
  \`\`\`
4454
4454
  `, { telemetryMessage: false });
4455
4455
  if (!existsSync(redirectedConfigPath)) throw new UserError(esm_default$2`
4456
- There is a deploy configuration at "${path2__default.relative(".", deployConfigPath)}".
4457
- But the redirected configuration path it points to, "${path2__default.relative(".", redirectedConfigPath)}", does not exist.
4456
+ There is a deploy configuration at "${path.relative(".", deployConfigPath)}".
4457
+ But the redirected configuration path it points to, "${path.relative(".", redirectedConfigPath)}", does not exist.
4458
4458
  `, { telemetryMessage: false });
4459
4459
  if (userConfigPath) {
4460
- if (path2__default.join(path2__default.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG$1) !== deployConfigPath) throw new UserError(esm_default$2`
4461
- Found both a user configuration file at "${path2__default.relative(".", userConfigPath)}"
4462
- and a deploy configuration file at "${path2__default.relative(".", deployConfigPath)}".
4460
+ if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG$1) !== deployConfigPath) throw new UserError(esm_default$2`
4461
+ Found both a user configuration file at "${path.relative(".", userConfigPath)}"
4462
+ and a deploy configuration file at "${path.relative(".", deployConfigPath)}".
4463
4463
  But these do not share the same base path so it is not clear which should be used.
4464
4464
  `, { telemetryMessage: false });
4465
4465
  }
@@ -5651,10 +5651,10 @@ var require_util$5 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/un
5651
5651
  if (!isHttpOrHttpsPrefixed(url$2.origin || url$2.protocol)) throw new InvalidArgumentError$37("Invalid URL protocol: the URL must start with `http:` or `https:`.");
5652
5652
  const port = url$2.port != null ? url$2.port : url$2.protocol === "https:" ? 443 : 80;
5653
5653
  let origin = url$2.origin != null ? url$2.origin : `${url$2.protocol || ""}//${url$2.hostname || ""}:${port}`;
5654
- let path$1 = url$2.path != null ? url$2.path : `${url$2.pathname || ""}${url$2.search || ""}`;
5654
+ let path$2 = url$2.path != null ? url$2.path : `${url$2.pathname || ""}${url$2.search || ""}`;
5655
5655
  if (origin[origin.length - 1] === "/") origin = origin.slice(0, origin.length - 1);
5656
- if (path$1 && path$1[0] !== "/") path$1 = `/${path$1}`;
5657
- return new URL(`${origin}${path$1}`);
5656
+ if (path$2 && path$2[0] !== "/") path$2 = `/${path$2}`;
5657
+ return new URL(`${origin}${path$2}`);
5658
5658
  }
5659
5659
  if (!isHttpOrHttpsPrefixed(url$2.origin || url$2.protocol)) throw new InvalidArgumentError$37("Invalid URL protocol: the URL must start with `http:` or `https:`.");
5660
5660
  return url$2;
@@ -6529,8 +6529,8 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
6529
6529
  debugLog("connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version$6, error$2.message);
6530
6530
  });
6531
6531
  diagnosticsChannel$1.subscribe("undici:client:sendHeaders", (evt) => {
6532
- const { request: { method, path: path$1, origin } } = evt;
6533
- debugLog("sending request to %s %s%s", method, origin, path$1);
6532
+ const { request: { method, path: path$2, origin } } = evt;
6533
+ debugLog("sending request to %s %s%s", method, origin, path$2);
6534
6534
  });
6535
6535
  }
6536
6536
  let isTrackingRequestEvents = false;
@@ -6542,16 +6542,16 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
6542
6542
  }
6543
6543
  isTrackingRequestEvents = true;
6544
6544
  diagnosticsChannel$1.subscribe("undici:request:headers", (evt) => {
6545
- const { request: { method, path: path$1, origin }, response: { statusCode } } = evt;
6546
- debugLog("received response to %s %s%s - HTTP %d", method, origin, path$1, statusCode);
6545
+ const { request: { method, path: path$2, origin }, response: { statusCode } } = evt;
6546
+ debugLog("received response to %s %s%s - HTTP %d", method, origin, path$2, statusCode);
6547
6547
  });
6548
6548
  diagnosticsChannel$1.subscribe("undici:request:trailers", (evt) => {
6549
- const { request: { method, path: path$1, origin } } = evt;
6550
- debugLog("trailers received from %s %s%s", method, origin, path$1);
6549
+ const { request: { method, path: path$2, origin } } = evt;
6550
+ debugLog("trailers received from %s %s%s", method, origin, path$2);
6551
6551
  });
6552
6552
  diagnosticsChannel$1.subscribe("undici:request:error", (evt) => {
6553
- const { request: { method, path: path$1, origin }, error: error$2 } = evt;
6554
- debugLog("request to %s %s%s errored - %s", method, origin, path$1, error$2.message);
6553
+ const { request: { method, path: path$2, origin }, error: error$2 } = evt;
6554
+ debugLog("request to %s %s%s errored - %s", method, origin, path$2, error$2.message);
6555
6555
  });
6556
6556
  }
6557
6557
  let isTrackingWebSocketEvents = false;
@@ -6612,10 +6612,10 @@ var require_request$1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
6612
6612
  }
6613
6613
  const kHandler = Symbol("handler");
6614
6614
  var Request$6 = class {
6615
- constructor(origin, { path: path$1, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
6616
- if (typeof path$1 !== "string") throw new InvalidArgumentError$36("path must be a string");
6617
- else if (path$1[0] !== "/" && !(path$1.startsWith("http://") || path$1.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$36("path must be an absolute URL or start with a slash");
6618
- else if (invalidPathRegex.test(path$1)) throw new InvalidArgumentError$36("invalid request path");
6615
+ constructor(origin, { path: path$2, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
6616
+ if (typeof path$2 !== "string") throw new InvalidArgumentError$36("path must be a string");
6617
+ else if (path$2[0] !== "/" && !(path$2.startsWith("http://") || path$2.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$36("path must be an absolute URL or start with a slash");
6618
+ else if (invalidPathRegex.test(path$2)) throw new InvalidArgumentError$36("invalid request path");
6619
6619
  if (typeof method !== "string") throw new InvalidArgumentError$36("method must be a string");
6620
6620
  else if (normalizedMethodRecords$1[method] === void 0 && !isValidHTTPToken$3(method)) throw new InvalidArgumentError$36("invalid request method");
6621
6621
  if (upgrade$1 && typeof upgrade$1 !== "string") throw new InvalidArgumentError$36("upgrade must be a string");
@@ -6656,7 +6656,7 @@ var require_request$1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
6656
6656
  this.completed = false;
6657
6657
  this.aborted = false;
6658
6658
  this.upgrade = upgrade$1 || null;
6659
- this.path = query ? serializePathWithQuery$3(path$1, query) : path$1;
6659
+ this.path = query ? serializePathWithQuery$3(path$2, query) : path$2;
6660
6660
  this.origin = origin;
6661
6661
  this.protocol = getProtocolFromUrlString(origin);
6662
6662
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
@@ -11262,7 +11262,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
11262
11262
  * @returns
11263
11263
  */
11264
11264
  function writeH1(client, request$2) {
11265
- const { method, path: path$1, host, upgrade: upgrade$1, blocking, reset } = request$2;
11265
+ const { method, path: path$2, host, upgrade: upgrade$1, blocking, reset } = request$2;
11266
11266
  let { body, headers, contentLength } = request$2;
11267
11267
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
11268
11268
  if (util$22.isFormDataLike(body)) {
@@ -11318,7 +11318,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
11318
11318
  if (client[kMaxRequests$1] && socket[kCounter$1]++ >= client[kMaxRequests$1]) socket[kReset$1] = true;
11319
11319
  if (blocking) socket[kBlocking] = true;
11320
11320
  if (socket.setTypeOfService) socket.setTypeOfService(request$2.typeOfService);
11321
- let header = `${method} ${path$1} HTTP/1.1\r\n`;
11321
+ let header = `${method} ${path$2} HTTP/1.1\r\n`;
11322
11322
  if (typeof host === "string") header += `host: ${host}\r\n`;
11323
11323
  else header += client[kHostHeader$1];
11324
11324
  if (upgrade$1) header += `connection: upgrade\r\nupgrade: ${upgrade$1}\r\n`;
@@ -11854,7 +11854,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
11854
11854
  function writeH2(client, request$2) {
11855
11855
  const requestTimeout = request$2.bodyTimeout ?? client[kBodyTimeout$1];
11856
11856
  const session = client[kHTTP2Session];
11857
- const { method, path: path$1, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
11857
+ const { method, path: path$2, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
11858
11858
  let { body } = request$2;
11859
11859
  if (upgrade$1 != null && upgrade$1 !== "websocket") {
11860
11860
  util$21.errorRequest(client, request$2, new InvalidArgumentError$30(`Custom upgrade "${upgrade$1}" not supported over HTTP/2`));
@@ -11907,7 +11907,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
11907
11907
  }
11908
11908
  headers[HTTP2_HEADER_METHOD] = "CONNECT";
11909
11909
  headers[HTTP2_HEADER_PROTOCOL] = "websocket";
11910
- headers[HTTP2_HEADER_PATH] = path$1;
11910
+ headers[HTTP2_HEADER_PATH] = path$2;
11911
11911
  if (protocol === "ws:" || protocol === "wss:") headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
11912
11912
  else headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
11913
11913
  stream$2 = session.request(headers, {
@@ -11949,7 +11949,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
11949
11949
  stream$2.setTimeout(requestTimeout);
11950
11950
  return true;
11951
11951
  }
11952
- headers[HTTP2_HEADER_PATH] = path$1;
11952
+ headers[HTTP2_HEADER_PATH] = path$2;
11953
11953
  headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
11954
11954
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
11955
11955
  if (body && typeof body.read === "function") body.read(0);
@@ -13814,8 +13814,8 @@ var require_proxy_agent = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
13814
13814
  }
13815
13815
  if (onHeaders) onHeaders.call(this, statusCode, data$1, resume$1);
13816
13816
  };
13817
- const { origin, path: path$1 = "/", headers = {} } = opts;
13818
- opts.path = origin + path$1;
13817
+ const { origin, path: path$2 = "/", headers = {} } = opts;
13818
+ opts.path = origin + path$2;
13819
13819
  if (!("host" in headers) && !("Host" in headers)) {
13820
13820
  const { host } = new URL(origin);
13821
13821
  headers.host = host;
@@ -15613,16 +15613,16 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnp
15613
15613
  }
15614
15614
  return normalizedQp;
15615
15615
  }
15616
- function safeUrl(path$1) {
15617
- if (typeof path$1 !== "string") return path$1;
15618
- const pathSegments = path$1.split("?", 3);
15619
- if (pathSegments.length !== 2) return path$1;
15616
+ function safeUrl(path$2) {
15617
+ if (typeof path$2 !== "string") return path$2;
15618
+ const pathSegments = path$2.split("?", 3);
15619
+ if (pathSegments.length !== 2) return path$2;
15620
15620
  const qp = new URLSearchParams(pathSegments.pop());
15621
15621
  qp.sort();
15622
15622
  return [...pathSegments, qp.toString()].join("?");
15623
15623
  }
15624
- function matchKey(mockDispatch$1, { path: path$1, method, body, headers }) {
15625
- const pathMatch = matchValue$1(mockDispatch$1.path, path$1);
15624
+ function matchKey(mockDispatch$1, { path: path$2, method, body, headers }) {
15625
+ const pathMatch = matchValue$1(mockDispatch$1.path, path$2);
15626
15626
  const methodMatch = matchValue$1(mockDispatch$1.method, method);
15627
15627
  const bodyMatch = typeof mockDispatch$1.body !== "undefined" ? matchValue$1(mockDispatch$1.body, body) : true;
15628
15628
  const headersMatch = matchHeaders(mockDispatch$1, headers);
@@ -15640,8 +15640,8 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnp
15640
15640
  const basePath = key.query ? serializePathWithQuery$2(key.path, key.query) : key.path;
15641
15641
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
15642
15642
  const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
15643
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$1, ignoreTrailingSlash }) => {
15644
- return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$1)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path$1), resolvedPath);
15643
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$2, ignoreTrailingSlash }) => {
15644
+ return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$2)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path$2), resolvedPath);
15645
15645
  });
15646
15646
  if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
15647
15647
  matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue$1(method, key.method));
@@ -15684,15 +15684,15 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnp
15684
15684
  /**
15685
15685
  * @param {string} path Path to remove trailing slash from
15686
15686
  */
15687
- function removeTrailingSlash(path$1) {
15688
- while (path$1.endsWith("/")) path$1 = path$1.slice(0, -1);
15689
- if (path$1.length === 0) path$1 = "/";
15690
- return path$1;
15687
+ function removeTrailingSlash(path$2) {
15688
+ while (path$2.endsWith("/")) path$2 = path$2.slice(0, -1);
15689
+ if (path$2.length === 0) path$2 = "/";
15690
+ return path$2;
15691
15691
  }
15692
15692
  function buildKey$1(opts) {
15693
- const { path: path$1, method, body, headers, query } = opts;
15693
+ const { path: path$2, method, body, headers, query } = opts;
15694
15694
  return {
15695
- path: path$1,
15695
+ path: path$2,
15696
15696
  method,
15697
15697
  body,
15698
15698
  headers,
@@ -16259,10 +16259,10 @@ var require_pending_interceptors_formatter = /* @__PURE__ */ __commonJS$2({ "../
16259
16259
  });
16260
16260
  }
16261
16261
  format(pendingInterceptors) {
16262
- const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$1, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
16262
+ const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
16263
16263
  Method: method,
16264
16264
  Origin: origin,
16265
- Path: path$1,
16265
+ Path: path$2,
16266
16266
  "Status code": statusCode,
16267
16267
  Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
16268
16268
  Invocations: timesInvoked,
@@ -16320,8 +16320,8 @@ var require_mock_agent = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnp
16320
16320
  const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
16321
16321
  const dispatchOpts = { ...opts };
16322
16322
  if (acceptNonStandardSearchParameters && dispatchOpts.path) {
16323
- const [path$1, searchParams] = dispatchOpts.path.split("?");
16324
- dispatchOpts.path = `${path$1}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
16323
+ const [path$2, searchParams] = dispatchOpts.path.split("?");
16324
+ dispatchOpts.path = `${path$2}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
16325
16325
  }
16326
16326
  return this[kAgent].dispatch(dispatchOpts, handler);
16327
16327
  }
@@ -16798,10 +16798,10 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$2({ "../../node_modul
16798
16798
  * @return {Promise<void>} - Resolves when snapshots are loaded
16799
16799
  */
16800
16800
  async loadSnapshots(filePath) {
16801
- const path$1 = filePath || this.#snapshotPath;
16802
- if (!path$1) throw new InvalidArgumentError$6("Snapshot path is required");
16801
+ const path$2 = filePath || this.#snapshotPath;
16802
+ if (!path$2) throw new InvalidArgumentError$6("Snapshot path is required");
16803
16803
  try {
16804
- const data$1 = await readFile(resolve$3(path$1), "utf8");
16804
+ const data$1 = await readFile(resolve$3(path$2), "utf8");
16805
16805
  const parsed = JSON.parse(data$1);
16806
16806
  if (Array.isArray(parsed)) {
16807
16807
  this.#snapshots.clear();
@@ -16809,7 +16809,7 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$2({ "../../node_modul
16809
16809
  } else this.#snapshots = new Map(Object.entries(parsed));
16810
16810
  } catch (error$2) {
16811
16811
  if (error$2.code === "ENOENT") this.#snapshots.clear();
16812
- else throw new UndiciError$1(`Failed to load snapshots from ${path$1}`, { cause: error$2 });
16812
+ else throw new UndiciError$1(`Failed to load snapshots from ${path$2}`, { cause: error$2 });
16813
16813
  }
16814
16814
  }
16815
16815
  /**
@@ -16819,9 +16819,9 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$2({ "../../node_modul
16819
16819
  * @returns {Promise<void>} - Resolves when snapshots are saved
16820
16820
  */
16821
16821
  async saveSnapshots(filePath) {
16822
- const path$1 = filePath || this.#snapshotPath;
16823
- if (!path$1) throw new InvalidArgumentError$6("Snapshot path is required");
16824
- const resolvedPath = resolve$3(path$1);
16822
+ const path$2 = filePath || this.#snapshotPath;
16823
+ if (!path$2) throw new InvalidArgumentError$6("Snapshot path is required");
16824
+ const resolvedPath = resolve$3(path$2);
16825
16825
  await mkdir(dirname$2(resolvedPath), { recursive: true });
16826
16826
  const data$1 = Array.from(this.#snapshots.entries()).map(([hash$1, snapshot]) => ({
16827
16827
  hash: hash$1,
@@ -17395,11 +17395,11 @@ var require_redirect_handler = /* @__PURE__ */ __commonJS$2({ "../../node_module
17395
17395
  return;
17396
17396
  }
17397
17397
  const { origin, pathname, search } = util$9.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
17398
- const path$1 = search ? `${pathname}${search}` : pathname;
17399
- const redirectUrlString = `${origin}${path$1}`;
17398
+ const path$2 = search ? `${pathname}${search}` : pathname;
17399
+ const redirectUrlString = `${origin}${path$2}`;
17400
17400
  for (const historyUrl of this.history) if (historyUrl.toString() === redirectUrlString) throw new InvalidArgumentError$3(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
17401
17401
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
17402
- this.opts.path = path$1;
17402
+ this.opts.path = path$2;
17403
17403
  this.opts.origin = origin;
17404
17404
  this.opts.query = null;
17405
17405
  }
@@ -18739,17 +18739,17 @@ var require_cache_handler = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.
18739
18739
  if (locationUrl.origin !== originUrl.origin) return;
18740
18740
  return locationUrl.pathname + locationUrl.search;
18741
18741
  }
18742
- function deleteCachedUri(store, cacheKey, path$1) {
18742
+ function deleteCachedUri(store, cacheKey, path$2) {
18743
18743
  deleteCachedValue$1(store, {
18744
18744
  ...cacheKey,
18745
- path: path$1
18745
+ path: path$2
18746
18746
  });
18747
18747
  for (let i$1 = 0; i$1 < util$8.safeHTTPMethods.length; i$1++) {
18748
18748
  const method = util$8.safeHTTPMethods[i$1];
18749
18749
  if (method !== cacheKey.method) deleteCachedValue$1(store, {
18750
18750
  ...cacheKey,
18751
18751
  method,
18752
- path: path$1
18752
+ path: path$2
18753
18753
  });
18754
18754
  }
18755
18755
  }
@@ -18757,8 +18757,8 @@ var require_cache_handler = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.
18757
18757
  if (headerValue === void 0) return;
18758
18758
  const values = Array.isArray(headerValue) ? headerValue : [headerValue];
18759
18759
  for (let i$1 = 0; i$1 < values.length; i$1++) {
18760
- const path$1 = getSameOriginPath(cacheKey, values[i$1]);
18761
- if (path$1 !== void 0) deleteCachedUri(store, cacheKey, path$1);
18760
+ const path$2 = getSameOriginPath(cacheKey, values[i$1]);
18761
+ if (path$2 !== void 0) deleteCachedUri(store, cacheKey, path$2);
18762
18762
  }
18763
18763
  }
18764
18764
  function invalidateUnsafeRequest(store, cacheKey, resHeaders) {
@@ -22763,10 +22763,10 @@ var require_fetch = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/und
22763
22763
  const url$2 = requestCurrentURL(request$2);
22764
22764
  /** @type {import('../../..').Agent} */
22765
22765
  const agent = fetchParams.controller.dispatcher;
22766
- const path$1 = url$2.pathname + url$2.search;
22766
+ const path$2 = url$2.pathname + url$2.search;
22767
22767
  const hasTrailingQuestionMark = url$2.search.length === 0 && url$2.href[url$2.href.length - url$2.hash.length - 1] === "?";
22768
22768
  return new Promise((resolve$4, reject) => agent.dispatch({
22769
- path: hasTrailingQuestionMark ? `${path$1}?` : path$1,
22769
+ path: hasTrailingQuestionMark ? `${path$2}?` : path$2,
22770
22770
  origin: url$2.origin,
22771
22771
  method: request$2.method,
22772
22772
  body: agent.isMockActive ? request$2.body && (request$2.body.source || request$2.body.stream) : body,
@@ -23548,9 +23548,9 @@ var require_util$2 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/un
23548
23548
  * path-value = <any CHAR except CTLs or ";">
23549
23549
  * @param {string} path
23550
23550
  */
23551
- function validateCookiePath(path$1) {
23552
- for (let i$1 = 0; i$1 < path$1.length; ++i$1) {
23553
- const code = path$1.charCodeAt(i$1);
23551
+ function validateCookiePath(path$2) {
23552
+ for (let i$1 = 0; i$1 < path$2.length; ++i$1) {
23553
+ const code = path$2.charCodeAt(i$1);
23554
23554
  if (code < 32 || code > 126 || code === 59) throw new Error("Invalid cookie path");
23555
23555
  }
23556
23556
  }
@@ -26720,9 +26720,9 @@ var require_undici = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/un
26720
26720
  if (opts != null && typeof opts !== "object") throw new InvalidArgumentError("invalid opts");
26721
26721
  if (opts && opts.path != null) {
26722
26722
  if (typeof opts.path !== "string") throw new InvalidArgumentError("invalid opts.path");
26723
- let path$1 = opts.path;
26724
- if (!opts.path.startsWith("/")) path$1 = `/${path$1}`;
26725
- url$2 = new URL(util$2.parseOrigin(url$2).origin + path$1);
26723
+ let path$2 = opts.path;
26724
+ if (!opts.path.startsWith("/")) path$2 = `/${path$2}`;
26725
+ url$2 = new URL(util$2.parseOrigin(url$2).origin + path$2);
26726
26726
  } else {
26727
26727
  if (!opts) opts = typeof url$2 === "object" ? url$2 : {};
26728
26728
  url$2 = util$2.parseURL(url$2);
@@ -42004,7 +42004,18 @@ var getC3CommandFromEnv = getEnvironmentVariableFactory({
42004
42004
  variableName: "WRANGLER_C3_COMMAND",
42005
42005
  defaultValue: /* @__PURE__ */ __name$4(() => "create cloudflare", "defaultValue")
42006
42006
  });
42007
- var getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({ variableName: "WRANGLER_SEND_METRICS" });
42007
+ var getDoNotTrackFromEnv = getEnvironmentVariableFactory({ variableName: "DO_NOT_TRACK" });
42008
+ function isDoNotTrackEnabled() {
42009
+ const value = getDoNotTrackFromEnv()?.toLowerCase();
42010
+ return value === "1" || value === "true";
42011
+ }
42012
+ __name$4(isDoNotTrackEnabled, "isDoNotTrackEnabled");
42013
+ var getWranglerSendMetricsVariableFromEnv = getBooleanEnvironmentVariableFactory({ variableName: "WRANGLER_SEND_METRICS" });
42014
+ function getWranglerSendMetricsFromEnv() {
42015
+ if (isDoNotTrackEnabled()) return false;
42016
+ return getWranglerSendMetricsVariableFromEnv();
42017
+ }
42018
+ __name$4(getWranglerSendMetricsFromEnv, "getWranglerSendMetricsFromEnv");
42008
42019
  var getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
42009
42020
  variableName: "WRANGLER_SEND_ERROR_REPORTS",
42010
42021
  defaultValue: false
@@ -42061,7 +42072,7 @@ var getBuildPlatformFromEnv = getEnvironmentVariableFactory({ variableName: "WRA
42061
42072
  var getRegistryPath = getEnvironmentVariableFactory({
42062
42073
  variableName: "WRANGLER_REGISTRY_PATH",
42063
42074
  defaultValue() {
42064
- return path2__default.join(getGlobalConfigPath(), "registry");
42075
+ return path.join(getGlobalConfigPath(), "registry");
42065
42076
  }
42066
42077
  });
42067
42078
  var getD1ExtraLocationChoices = getEnvironmentVariableFactory({ variableName: "WRANGLER_D1_EXTRA_LOCATION_CHOICES" });
@@ -42471,7 +42482,7 @@ function isPagesConfig(rawConfig) {
42471
42482
  }
42472
42483
  __name$4(isPagesConfig, "isPagesConfig");
42473
42484
  function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
42474
- const diagnostics = new Diagnostics(`Processing ${configPath ? path2__default.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
42485
+ const diagnostics = new Diagnostics(`Processing ${configPath ? path.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
42475
42486
  const isRedirectedConfig2 = isRedirectedRawConfig$1(rawConfig, configPath, userConfigPath);
42476
42487
  if ("legacy_env" in rawConfig) {
42477
42488
  if (!isRedirectedConfig2) diagnostics.errors.push(dedent$2`
@@ -42589,34 +42600,34 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
42589
42600
  else validateOptionalProperty(diagnostics, "build", "watch_dir", watch_dir, "string");
42590
42601
  return {
42591
42602
  command,
42592
- watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir2) => path2__default.relative(process.cwd(), path2__default.join(path2__default.dirname(configPath), `${dir2}`))) : path2__default.relative(process.cwd(), path2__default.join(path2__default.dirname(configPath), `${watch_dir}`)) : watch_dir,
42603
+ watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir2) => path.relative(process.cwd(), path.join(path.dirname(configPath), `${dir2}`))) : path.relative(process.cwd(), path.join(path.dirname(configPath), `${watch_dir}`)) : watch_dir,
42593
42604
  cwd
42594
42605
  };
42595
42606
  }
42596
42607
  __name$4(normalizeAndValidateBuild, "normalizeAndValidateBuild");
42597
42608
  function normalizeAndValidateMainField(configPath, rawMain) {
42598
- const configDir = path2__default.dirname(configPath ?? "wrangler.toml");
42609
+ const configDir = path.dirname(configPath ?? "wrangler.toml");
42599
42610
  if (rawMain !== void 0) if (typeof rawMain === "string") {
42600
- const directory = path2__default.resolve(configDir);
42601
- return path2__default.resolve(directory, rawMain);
42611
+ const directory = path.resolve(configDir);
42612
+ return path.resolve(directory, rawMain);
42602
42613
  } else return rawMain;
42603
42614
  else return;
42604
42615
  }
42605
42616
  __name$4(normalizeAndValidateMainField, "normalizeAndValidateMainField");
42606
42617
  function normalizeAndValidateBaseDirField(configPath, rawDir) {
42607
- const configDir = path2__default.dirname(configPath ?? "wrangler.toml");
42618
+ const configDir = path.dirname(configPath ?? "wrangler.toml");
42608
42619
  if (rawDir !== void 0) if (typeof rawDir === "string") {
42609
- const directory = path2__default.resolve(configDir);
42610
- return path2__default.resolve(directory, rawDir);
42620
+ const directory = path.resolve(configDir);
42621
+ return path.resolve(directory, rawDir);
42611
42622
  } else return rawDir;
42612
42623
  else return;
42613
42624
  }
42614
42625
  __name$4(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
42615
42626
  function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
42616
- const configDir = path2__default.dirname(configPath ?? "wrangler.toml");
42627
+ const configDir = path.dirname(configPath ?? "wrangler.toml");
42617
42628
  if (rawPagesDir !== void 0) if (typeof rawPagesDir === "string") {
42618
- const directory = path2__default.resolve(configDir);
42619
- return path2__default.resolve(directory, rawPagesDir);
42629
+ const directory = path.resolve(configDir);
42630
+ return path.resolve(directory, rawPagesDir);
42620
42631
  } else return rawPagesDir;
42621
42632
  else return;
42622
42633
  }
@@ -42670,7 +42681,7 @@ function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryP
42670
42681
  validateOptionalProperty(diagnostics, "site", "entry-point", legacySiteEntryPoint, "string");
42671
42682
  deprecated(diagnostics, rawConfig, `site.entry-point`, `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
42672
42683
  \`\`\`
42673
- main = "${path2__default.join(String(legacySiteEntryPoint) || "workers-site", path2__default.extname(String(legacySiteEntryPoint) || "workers-site") ? "" : "index.js")}"
42684
+ main = "${path.join(String(legacySiteEntryPoint) || "workers-site", path.extname(String(legacySiteEntryPoint) || "workers-site") ? "" : "index.js")}"
42674
42685
  \`\`\``, false, void 0, "warning");
42675
42686
  let siteEntryPoint = legacySiteEntryPoint;
42676
42687
  if (!mainEntryPoint && !siteEntryPoint) {
@@ -42683,7 +42694,7 @@ main = "workers-site/index.js"
42683
42694
  } else if (mainEntryPoint && siteEntryPoint) diagnostics.errors.push(`Don't define both the \`main\` and \`site.entry-point\` fields in your configuration.
42684
42695
  They serve the same purpose: to point to the entry-point of your worker.
42685
42696
  Delete the deprecated \`site.entry-point\` field from your config.`);
42686
- if (configPath && siteEntryPoint) siteEntryPoint = path2__default.relative(process.cwd(), path2__default.join(path2__default.dirname(configPath), siteEntryPoint));
42697
+ if (configPath && siteEntryPoint) siteEntryPoint = path.relative(process.cwd(), path.join(path.dirname(configPath), siteEntryPoint));
42687
42698
  return {
42688
42699
  bucket,
42689
42700
  "entry-point": siteEntryPoint,
@@ -42715,7 +42726,7 @@ function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapp
42715
42726
  if (rawMapping === void 0) return;
42716
42727
  const mapping = {};
42717
42728
  for (const [name, filePath] of Object.entries(rawMapping)) if (isString$2(diagnostics, `${field}['${name}']`, filePath, void 0)) {
42718
- if (configPath) mapping[name] = configPath ? path2__default.relative(process.cwd(), path2__default.join(path2__default.dirname(configPath), filePath)) : filePath;
42729
+ if (configPath) mapping[name] = configPath ? path.relative(process.cwd(), path.join(path.dirname(configPath), filePath)) : filePath;
42719
42730
  }
42720
42731
  return mapping;
42721
42732
  }
@@ -42975,7 +42986,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
42975
42986
  __name$4(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment");
42976
42987
  function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) {
42977
42988
  const tsconfig = inheritable(diagnostics, topLevelEnv, rawEnv, "tsconfig", isString$2, void 0);
42978
- return configPath && tsconfig ? path2__default.relative(process.cwd(), path2__default.join(path2__default.dirname(configPath), tsconfig)) : tsconfig;
42989
+ return configPath && tsconfig ? path.relative(process.cwd(), path.join(path.dirname(configPath), tsconfig)) : tsconfig;
42979
42990
  }
42980
42991
  __name$4(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
42981
42992
  var validateAndNormalizeRules = /* @__PURE__ */ __name$4((diagnostics, topLevelEnv, rawEnv, envName) => {
@@ -43518,9 +43529,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
43518
43529
  let resolvedBuildContextPath = void 0;
43519
43530
  try {
43520
43531
  if (isDockerfile(resolvedImage, configPath)) {
43521
- const baseDir$1 = configPath ? path2__default.dirname(configPath) : process.cwd();
43522
- resolvedImage = path2__default.resolve(baseDir$1, resolvedImage);
43523
- resolvedBuildContextPath = containerAppOptional.image_build_context ? path2__default.resolve(baseDir$1, containerAppOptional.image_build_context) : path2__default.dirname(resolvedImage);
43532
+ const baseDir$1 = configPath ? path.dirname(configPath) : process.cwd();
43533
+ resolvedImage = path.resolve(baseDir$1, resolvedImage);
43534
+ resolvedBuildContextPath = containerAppOptional.image_build_context ? path.resolve(baseDir$1, containerAppOptional.image_build_context) : path.dirname(resolvedImage);
43524
43535
  }
43525
43536
  } catch (err) {
43526
43537
  if (err instanceof Error && err.message) diagnostics.errors.push(err.message);
@@ -44897,8 +44908,8 @@ function isRemoteValid(targetObject, fieldPath, diagnostics) {
44897
44908
  }
44898
44909
  __name$4(isRemoteValid, "isRemoteValid");
44899
44910
  function isDockerfile(imagePath, configPath) {
44900
- const baseDir$1 = configPath ? path2__default.dirname(configPath) : process.cwd();
44901
- const maybeDockerfile = path2__default.resolve(baseDir$1, imagePath);
44911
+ const baseDir$1 = configPath ? path.dirname(configPath) : process.cwd();
44912
+ const maybeDockerfile = path.resolve(baseDir$1, imagePath);
44902
44913
  if (fs2.existsSync(maybeDockerfile)) {
44903
44914
  if (isDirectory$1(maybeDockerfile)) throw new UserError(`${imagePath} is a directory, you should specify a path to the Dockerfile`, { telemetryMessage: false });
44904
44915
  return true;
@@ -45049,10 +45060,10 @@ Pages requires Durable Object bindings to specify the name of the Worker where t
45049
45060
  __name$4(validateDurableObjectBinding2, "validateDurableObjectBinding");
45050
45061
  function getPackagePath(packageName, projectPath) {
45051
45062
  try {
45052
- return path2__default.dirname(__require$1.resolve(`${packageName}/package.json`, { paths: [projectPath] }));
45063
+ return path.dirname(__require$1.resolve(`${packageName}/package.json`, { paths: [projectPath] }));
45053
45064
  } catch {}
45054
45065
  try {
45055
- return path2__default.dirname(__require$1.resolve(packageName, { paths: [projectPath] }));
45066
+ return path.dirname(__require$1.resolve(packageName, { paths: [projectPath] }));
45056
45067
  } catch {}
45057
45068
  }
45058
45069
  __name$4(getPackagePath, "getPackagePath");
@@ -45077,14 +45088,14 @@ function getInstalledPackageVersion(packageName, projectPath, opts = {}) {
45077
45088
  __name$4(getInstalledPackageVersion, "getInstalledPackageVersion");
45078
45089
  function findFileUp(name, startDir, lastDir) {
45079
45090
  let dir2 = startDir;
45080
- const root = path2__default.parse(dir2).root;
45091
+ const root = path.parse(dir2).root;
45081
45092
  while (true) {
45082
- const candidate = path2__default.join(dir2, name);
45093
+ const candidate = path.join(dir2, name);
45083
45094
  try {
45084
45095
  if (statSync(candidate).isFile()) return candidate;
45085
45096
  } catch {}
45086
45097
  if (lastDir !== void 0 && dir2 === lastDir) break;
45087
- const parent = path2__default.dirname(dir2);
45098
+ const parent = path.dirname(dir2);
45088
45099
  if (parent === dir2 || dir2 === root) break;
45089
45100
  dir2 = parent;
45090
45101
  }
@@ -45350,7 +45361,7 @@ var process3 = globalThis.process;
45350
45361
  var { onExit, load: load$1, unload: unload$1 } = signalExitWrap(processOk$1(process3) ? new SignalExit(process3) : new SignalExitFallback());
45351
45362
  function getWranglerHiddenDirPath(projectRoot) {
45352
45363
  projectRoot ??= process.cwd();
45353
- return path2__default.join(projectRoot, ".wrangler");
45364
+ return path.join(projectRoot, ".wrangler");
45354
45365
  }
45355
45366
  __name$4(getWranglerHiddenDirPath, "getWranglerHiddenDirPath");
45356
45367
  var STALE_WRANGLER_TMP_DIR_MS = 1440 * 60 * 1e3;
@@ -45367,7 +45378,7 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
45367
45378
  const cutoff = Date.now() - STALE_WRANGLER_TMP_DIR_MS;
45368
45379
  for (const entry of entries) {
45369
45380
  if (!entry.isDirectory()) continue;
45370
- const entryPath = path2__default.join(tmpRoot, entry.name);
45381
+ const entryPath = path.join(tmpRoot, entry.name);
45371
45382
  try {
45372
45383
  if (fs2.statSync(entryPath).mtimeMs < cutoff) removeDirSync$1(entryPath);
45373
45384
  } catch {}
@@ -45375,10 +45386,10 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
45375
45386
  }
45376
45387
  __name$4(sweepStaleWranglerTmpDirs, "sweepStaleWranglerTmpDirs");
45377
45388
  function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
45378
- const tmpRoot = path2__default.join(getWranglerHiddenDirPath(projectRoot), "tmp");
45389
+ const tmpRoot = path.join(getWranglerHiddenDirPath(projectRoot), "tmp");
45379
45390
  fs2.mkdirSync(tmpRoot, { recursive: true });
45380
45391
  sweepStaleWranglerTmpDirs(tmpRoot);
45381
- const tmpPrefix = path2__default.join(tmpRoot, `${prefix}-`);
45392
+ const tmpPrefix = path.join(tmpRoot, `${prefix}-`);
45382
45393
  const tmpDir = fs2.realpathSync(fs2.mkdtempSync(tmpPrefix));
45383
45394
  const cleanupDir = /* @__PURE__ */ __name$4(() => {
45384
45395
  if (cleanup) try {
@@ -46254,7 +46265,7 @@ async function fetchLatestNpmVersion(name, version2) {
46254
46265
  __name$4(fetchLatestNpmVersion, "fetchLatestNpmVersion");
46255
46266
  async function openInBrowser(url2, logger$1) {
46256
46267
  try {
46257
- const { default: open$1 } = await import("./open-PBXRGS4R-7GUxLVbA.mjs");
46268
+ const { default: open$1 } = await import("./open-PBXRGS4R-MlJKk7qC.mjs");
46258
46269
  (await open$1(url2)).on("error", (err) => {
46259
46270
  handleBrowserOpenError(url2, err, logger$1);
46260
46271
  });
@@ -48810,8 +48821,8 @@ const postfixRE = /[?#].*$/;
48810
48821
  function cleanUrl(url$2) {
48811
48822
  return url$2.replace(postfixRE, "");
48812
48823
  }
48813
- function withTrailingSlash(path$1) {
48814
- return path$1.endsWith("/") ? path$1 : `${path$1}/`;
48824
+ function withTrailingSlash(path$2) {
48825
+ return path$2.endsWith("/") ? path$2 : `${path$2}/`;
48815
48826
  }
48816
48827
  function createRequestHandler(handler) {
48817
48828
  return async (req, res, next) => {
@@ -49450,11 +49461,11 @@ function explicitlyAborted(x, startIndex = 0) {
49450
49461
  for (let i$1 = startIndex; i$1 < x.issues.length; i$1++) if (x.issues[i$1]?.continue === false) return true;
49451
49462
  return false;
49452
49463
  }
49453
- function prefixIssues(path$1, issues) {
49464
+ function prefixIssues(path$2, issues) {
49454
49465
  return issues.map((iss) => {
49455
49466
  var _a$3;
49456
49467
  (_a$3 = iss).path ?? (_a$3.path = []);
49457
- iss.path.unshift(path$1);
49468
+ iss.path.unshift(path$2);
49458
49469
  return iss;
49459
49470
  });
49460
49471
  }
@@ -49519,12 +49530,12 @@ function flattenError(error$2, mapper = (issue$2) => issue$2.message) {
49519
49530
  }
49520
49531
  function formatError(error$2, mapper = (issue$2) => issue$2.message) {
49521
49532
  const fieldErrors = { _errors: [] };
49522
- const processError = (error$3, path$1 = []) => {
49523
- for (const issue$2 of error$3.issues) if (issue$2.code === "invalid_union" && issue$2.errors.length) issue$2.errors.map((issues) => processError({ issues }, [...path$1, ...issue$2.path]));
49524
- else if (issue$2.code === "invalid_key") processError({ issues: issue$2.issues }, [...path$1, ...issue$2.path]);
49525
- else if (issue$2.code === "invalid_element") processError({ issues: issue$2.issues }, [...path$1, ...issue$2.path]);
49533
+ const processError = (error$3, path$2 = []) => {
49534
+ for (const issue$2 of error$3.issues) if (issue$2.code === "invalid_union" && issue$2.errors.length) issue$2.errors.map((issues) => processError({ issues }, [...path$2, ...issue$2.path]));
49535
+ else if (issue$2.code === "invalid_key") processError({ issues: issue$2.issues }, [...path$2, ...issue$2.path]);
49536
+ else if (issue$2.code === "invalid_element") processError({ issues: issue$2.issues }, [...path$2, ...issue$2.path]);
49526
49537
  else {
49527
- const fullpath = [...path$1, ...issue$2.path];
49538
+ const fullpath = [...path$2, ...issue$2.path];
49528
49539
  if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue$2));
49529
49540
  else {
49530
49541
  let curr = fieldErrors;
@@ -53615,6 +53626,50 @@ const AssetsSchema = strictObject({
53615
53626
  ]).optional(),
53616
53627
  runWorkerFirst: union([array(string()), boolean()]).optional()
53617
53628
  });
53629
+ const BrowserBindingSchema = strictObject({
53630
+ type: literal$1("browser"),
53631
+ remote: boolean().optional()
53632
+ });
53633
+ const WorkerBindingSchema = strictObject({
53634
+ type: literal$1("worker"),
53635
+ workerName: string(),
53636
+ exportName: string().optional(),
53637
+ props: record(string(), unknown()).optional(),
53638
+ remote: boolean().optional()
53639
+ });
53640
+ const D1BindingSchema = strictObject({
53641
+ type: literal$1("d1"),
53642
+ name: string().optional(),
53643
+ id: string().optional(),
53644
+ remote: boolean().optional()
53645
+ });
53646
+ const KVBindingSchema = strictObject({
53647
+ type: literal$1("kv"),
53648
+ id: string().optional(),
53649
+ remote: boolean().optional()
53650
+ });
53651
+ const QueueBindingSchema = strictObject({
53652
+ type: literal$1("queue"),
53653
+ name: string().optional(),
53654
+ deliveryDelay: number().optional(),
53655
+ remote: boolean().optional()
53656
+ });
53657
+ const R2BindingSchema = strictObject({
53658
+ type: literal$1("r2"),
53659
+ name: string().optional(),
53660
+ jurisdiction: string().optional(),
53661
+ remote: boolean().optional()
53662
+ });
53663
+ const FlagshipBindingSchema = strictObject({
53664
+ type: literal$1("flagship"),
53665
+ id: string().optional(),
53666
+ remote: boolean().optional()
53667
+ });
53668
+ const HyperdriveBindingSchema = strictObject({
53669
+ type: literal$1("hyperdrive"),
53670
+ id: string(),
53671
+ localConnectionString: string().optional()
53672
+ });
53618
53673
  const KnownBindingSchema = discriminatedUnion("type", [
53619
53674
  strictObject({
53620
53675
  type: literal$1("agent-memory"),
@@ -53645,16 +53700,8 @@ const KnownBindingSchema = discriminatedUnion("type", [
53645
53700
  remote: boolean().optional()
53646
53701
  }),
53647
53702
  strictObject({ type: literal$1("assets") }),
53648
- strictObject({
53649
- type: literal$1("browser"),
53650
- remote: boolean().optional()
53651
- }),
53652
- strictObject({
53653
- type: literal$1("d1"),
53654
- name: string().optional(),
53655
- id: string().optional(),
53656
- remote: boolean().optional()
53657
- }),
53703
+ BrowserBindingSchema,
53704
+ D1BindingSchema,
53658
53705
  strictObject({
53659
53706
  type: literal$1("dispatch-namespace"),
53660
53707
  namespace: string().optional(),
@@ -53669,16 +53716,8 @@ const KnownBindingSchema = discriminatedUnion("type", [
53669
53716
  workerName: string(),
53670
53717
  exportName: string()
53671
53718
  }),
53672
- strictObject({
53673
- type: literal$1("flagship"),
53674
- id: string().optional(),
53675
- remote: boolean().optional()
53676
- }),
53677
- strictObject({
53678
- type: literal$1("hyperdrive"),
53679
- id: string(),
53680
- localConnectionString: string().optional()
53681
- }),
53719
+ FlagshipBindingSchema,
53720
+ HyperdriveBindingSchema,
53682
53721
  strictObject({
53683
53722
  type: literal$1("images"),
53684
53723
  remote: boolean().optional()
@@ -53687,11 +53726,7 @@ const KnownBindingSchema = discriminatedUnion("type", [
53687
53726
  type: literal$1("json"),
53688
53727
  value: json()
53689
53728
  }),
53690
- strictObject({
53691
- type: literal$1("kv"),
53692
- id: string().optional(),
53693
- remote: boolean().optional()
53694
- }),
53729
+ KVBindingSchema,
53695
53730
  strictObject({
53696
53731
  type: literal$1("logfwdr"),
53697
53732
  destination: string()
@@ -53710,12 +53745,7 @@ const KnownBindingSchema = discriminatedUnion("type", [
53710
53745
  name: string(),
53711
53746
  remote: boolean().optional()
53712
53747
  }),
53713
- strictObject({
53714
- type: literal$1("queue"),
53715
- name: string().optional(),
53716
- deliveryDelay: number().optional(),
53717
- remote: boolean().optional()
53718
- }),
53748
+ QueueBindingSchema,
53719
53749
  strictObject({
53720
53750
  type: literal$1("rate-limit"),
53721
53751
  namespace: string(),
@@ -53724,12 +53754,7 @@ const KnownBindingSchema = discriminatedUnion("type", [
53724
53754
  period: union([literal$1(10), literal$1(60)])
53725
53755
  })
53726
53756
  }),
53727
- strictObject({
53728
- type: literal$1("r2"),
53729
- name: string().optional(),
53730
- jurisdiction: string().optional(),
53731
- remote: boolean().optional()
53732
- }),
53757
+ R2BindingSchema,
53733
53758
  strictObject({ type: literal$1("secret") }),
53734
53759
  strictObject({
53735
53760
  type: literal$1("secrets-store-secret"),
@@ -53778,13 +53803,7 @@ const KnownBindingSchema = discriminatedUnion("type", [
53778
53803
  type: literal$1("web-search"),
53779
53804
  remote: boolean().optional()
53780
53805
  }),
53781
- strictObject({
53782
- type: literal$1("worker"),
53783
- workerName: string(),
53784
- exportName: string().optional(),
53785
- props: record(string(), unknown()).optional(),
53786
- remote: boolean().optional()
53787
- }),
53806
+ WorkerBindingSchema,
53788
53807
  strictObject({ type: literal$1("worker-loader") })
53789
53808
  ]);
53790
53809
  const UnsafeBindingSchema = looseObject({
@@ -53826,7 +53845,7 @@ const SINGLETON_BINDING_TYPES = new Set([
53826
53845
  "web-search"
53827
53846
  ]);
53828
53847
  const listFormatter = new Intl.ListFormat("en-US");
53829
- const EnvSchema = record(string(), BindingSchema).superRefine((env$3, ctx) => {
53848
+ function validateSingletonBindings(env$3, ctx) {
53830
53849
  const seen = /* @__PURE__ */ new Set();
53831
53850
  const duplicates = /* @__PURE__ */ new Set();
53832
53851
  for (const binding of Object.values(env$3)) {
@@ -53840,37 +53859,44 @@ const EnvSchema = record(string(), BindingSchema).superRefine((env$3, ctx) => {
53840
53859
  code: "custom",
53841
53860
  message: `${listFormatter.format([...duplicates].sort())} bindings can only be defined once`
53842
53861
  });
53843
- }).optional();
53862
+ }
53863
+ const EnvSchema = record(string(), BindingSchema).superRefine(validateSingletonBindings).optional();
53864
+ const DurableObjectCreatedExportSchema = strictObject({
53865
+ type: literal$1("durable-object"),
53866
+ state: literal$1("created").optional(),
53867
+ storage: _enum(["sqlite", "legacy-kv"])
53868
+ });
53869
+ const DurableObjectDeletedExportSchema = strictObject({
53870
+ type: literal$1("durable-object"),
53871
+ state: literal$1("deleted")
53872
+ });
53873
+ const DurableObjectRenamedExportSchema = strictObject({
53874
+ type: literal$1("durable-object"),
53875
+ state: literal$1("renamed"),
53876
+ renamedTo: string()
53877
+ });
53878
+ const DurableObjectTransferredExportSchema = strictObject({
53879
+ type: literal$1("durable-object"),
53880
+ state: literal$1("transferred"),
53881
+ transferredTo: string()
53882
+ });
53883
+ const DurableObjectExpectingTransferExportSchema = strictObject({
53884
+ type: literal$1("durable-object"),
53885
+ state: literal$1("expecting-transfer"),
53886
+ storage: _enum(["sqlite", "legacy-kv"]),
53887
+ transferFrom: string()
53888
+ });
53889
+ const WorkerEntrypointExportSchema = strictObject({
53890
+ type: literal$1("worker"),
53891
+ cache: strictObject({ enabled: boolean() }).optional()
53892
+ });
53844
53893
  const ExportSchema = union([
53845
- strictObject({
53846
- type: literal$1("durable-object"),
53847
- state: literal$1("created").optional(),
53848
- storage: _enum(["sqlite", "legacy-kv"])
53849
- }),
53850
- strictObject({
53851
- type: literal$1("durable-object"),
53852
- state: literal$1("deleted")
53853
- }),
53854
- strictObject({
53855
- type: literal$1("durable-object"),
53856
- state: literal$1("renamed"),
53857
- renamedTo: string()
53858
- }),
53859
- strictObject({
53860
- type: literal$1("durable-object"),
53861
- state: literal$1("transferred"),
53862
- transferredTo: string()
53863
- }),
53864
- strictObject({
53865
- type: literal$1("durable-object"),
53866
- state: literal$1("expecting-transfer"),
53867
- storage: _enum(["sqlite", "legacy-kv"]),
53868
- transferFrom: string()
53869
- }),
53870
- strictObject({
53871
- type: literal$1("worker"),
53872
- cache: strictObject({ enabled: boolean() }).optional()
53873
- })
53894
+ DurableObjectCreatedExportSchema,
53895
+ DurableObjectDeletedExportSchema,
53896
+ DurableObjectRenamedExportSchema,
53897
+ DurableObjectTransferredExportSchema,
53898
+ DurableObjectExpectingTransferExportSchema,
53899
+ WorkerEntrypointExportSchema
53874
53900
  ]);
53875
53901
  const LimitsSchema = strictObject({
53876
53902
  cpuMs: number().optional(),
@@ -56482,7 +56508,7 @@ function resolveWranglerConfigPath({ config: config$2, script }, options) {
56482
56508
  deployConfigPath: void 0,
56483
56509
  redirected: false
56484
56510
  };
56485
- return findWranglerConfig$1(script !== void 0 ? path2__default.dirname(script) : process.cwd(), options);
56511
+ return findWranglerConfig$1(script !== void 0 ? path.dirname(script) : process.cwd(), options);
56486
56512
  }
56487
56513
  __name$3(resolveWranglerConfigPath, "resolveWranglerConfigPath");
56488
56514
  function findWranglerConfig$1(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
@@ -56513,15 +56539,15 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
56513
56539
  const deployConfigFile = readFileSync$1$1(deployConfigPath);
56514
56540
  try {
56515
56541
  const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);
56516
- redirectedConfigPath = deployConfig.configPath && path2__default.resolve(path2__default.dirname(deployConfigPath), deployConfig.configPath);
56542
+ redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);
56517
56543
  } catch (e) {
56518
- throw new UserError$1(`Failed to parse the deploy configuration file at ${path2__default.relative(".", deployConfigPath)}`, {
56544
+ throw new UserError$1(`Failed to parse the deploy configuration file at ${path.relative(".", deployConfigPath)}`, {
56519
56545
  cause: e,
56520
56546
  telemetryMessage: false
56521
56547
  });
56522
56548
  }
56523
56549
  if (!redirectedConfigPath) throw new UserError$1(esm_default$1`
56524
- A deploy configuration file was found at "${path2__default.relative(".", deployConfigPath)}".
56550
+ A deploy configuration file was found at "${path.relative(".", deployConfigPath)}".
56525
56551
  But this is not valid - the required "configPath" property was not found.
56526
56552
  Instead this file contains:
56527
56553
  \`\`\`
@@ -56529,13 +56555,13 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
56529
56555
  \`\`\`
56530
56556
  `, { telemetryMessage: false });
56531
56557
  if (!existsSync(redirectedConfigPath)) throw new UserError$1(esm_default$1`
56532
- There is a deploy configuration at "${path2__default.relative(".", deployConfigPath)}".
56533
- But the redirected configuration path it points to, "${path2__default.relative(".", redirectedConfigPath)}", does not exist.
56558
+ There is a deploy configuration at "${path.relative(".", deployConfigPath)}".
56559
+ But the redirected configuration path it points to, "${path.relative(".", redirectedConfigPath)}", does not exist.
56534
56560
  `, { telemetryMessage: false });
56535
56561
  if (userConfigPath) {
56536
- if (path2__default.join(path2__default.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError$1(esm_default$1`
56537
- Found both a user configuration file at "${path2__default.relative(".", userConfigPath)}"
56538
- and a deploy configuration file at "${path2__default.relative(".", deployConfigPath)}".
56562
+ if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError$1(esm_default$1`
56563
+ Found both a user configuration file at "${path.relative(".", userConfigPath)}"
56564
+ and a deploy configuration file at "${path.relative(".", deployConfigPath)}".
56539
56565
  But these do not share the same base path so it is not clear which should be used.
56540
56566
  `, { telemetryMessage: false });
56541
56567
  }
@@ -57326,15 +57352,15 @@ async function generateRuntimeTypes({ compatibilityDate, compatibilityFlags = []
57326
57352
  * worker, and then making a request to that worker to fetch types.
57327
57353
  */
57328
57354
  async function generate({ compatibilityDate, compatibilityFlags = [] }) {
57329
- const mf = new Miniflare({
57355
+ const mf = new Miniflare(convertV4MiniflareOptions({
57330
57356
  compatibilityDate: "2024-01-01",
57331
57357
  compatibilityFlags: ["nodejs_compat", "rtti_api"],
57332
57358
  modules: true,
57333
57359
  script: (await fsp.readFile(require$1.resolve("workerd/worker.mjs"))).toString()
57334
- });
57335
- const path$1 = `http://dummy.com/${compatibilityDate}${compatibilityFlags.length ? `+${compatibilityFlags.join("+")}` : ""}`;
57360
+ }));
57361
+ const path$2 = `http://dummy.com/${compatibilityDate}${compatibilityFlags.length ? `+${compatibilityFlags.join("+")}` : ""}`;
57336
57362
  try {
57337
- const res = await mf.dispatchFetch(path$1);
57363
+ const res = await mf.dispatchFetch(path$2);
57338
57364
  const text = await res.text();
57339
57365
  if (!res.ok) throw new Error(text);
57340
57366
  return text;
@@ -57529,8 +57555,8 @@ var __name$2 = (target$1, value) => __defProp$2(target$1, "name", {
57529
57555
  value,
57530
57556
  configurable: true
57531
57557
  });
57532
- function isDirectory(path$1) {
57533
- return fs2.statSync(path$1, { throwIfNoEntry: false })?.isDirectory() ?? false;
57558
+ function isDirectory(path$1$1) {
57559
+ return fs2.statSync(path$1$1, { throwIfNoEntry: false })?.isDirectory() ?? false;
57534
57560
  }
57535
57561
  __name$2(isDirectory, "isDirectory");
57536
57562
  function removeDir(dirPath, { fireAndForget = false } = {}) {
@@ -62840,15 +62866,15 @@ function hasTrailingSlash(input = "", respectQueryAndFragment) {
62840
62866
  function withTrailingSlash$1(input = "", respectQueryAndFragment) {
62841
62867
  if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
62842
62868
  if (hasTrailingSlash(input, true)) return input || "/";
62843
- let path$1 = input;
62869
+ let path$2 = input;
62844
62870
  let fragment = "";
62845
62871
  const fragmentIndex = input.indexOf("#");
62846
62872
  if (fragmentIndex >= 0) {
62847
- path$1 = input.slice(0, fragmentIndex);
62873
+ path$2 = input.slice(0, fragmentIndex);
62848
62874
  fragment = input.slice(fragmentIndex);
62849
- if (!path$1) return fragment;
62875
+ if (!path$2) return fragment;
62850
62876
  }
62851
- const [s0, ...s] = path$1.split("?");
62877
+ const [s0, ...s] = path$2.split("?");
62852
62878
  return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
62853
62879
  }
62854
62880
  function isNonEmptyURL(url$2) {
@@ -62874,8 +62900,8 @@ const isAbsolute$2 = function(p$2) {
62874
62900
  //#endregion
62875
62901
  //#region ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
62876
62902
  const BUILTIN_MODULES = new Set(builtinModules);
62877
- function normalizeSlash(path$1) {
62878
- return path$1.replace(/\\/g, "/");
62903
+ function normalizeSlash(path$2) {
62904
+ return path$2.replace(/\\/g, "/");
62879
62905
  }
62880
62906
  /**
62881
62907
  * @typedef ErrnoExceptionFields
@@ -62995,8 +63021,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
62995
63021
  * @param {string} [base]
62996
63022
  * @param {string} [message]
62997
63023
  */
62998
- (path$1, base, message) => {
62999
- return `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
63024
+ (path$2, base, message) => {
63025
+ return `Invalid package config ${path$2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
63000
63026
  },
63001
63027
  Error
63002
63028
  );
@@ -63026,8 +63052,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
63026
63052
  * @param {string} base
63027
63053
  * @param {boolean} [exactUrl]
63028
63054
  */
63029
- (path$1, base, exactUrl = false) => {
63030
- return `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`;
63055
+ (path$2, base, exactUrl = false) => {
63056
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path$2}' imported from ${base}`;
63031
63057
  },
63032
63058
  Error
63033
63059
  );
@@ -63065,8 +63091,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
63065
63091
  * @param {string} extension
63066
63092
  * @param {string} path
63067
63093
  */
63068
- (extension, path$1) => {
63069
- return `Unknown file extension "${extension}" for ${path$1}`;
63094
+ (extension, path$2) => {
63095
+ return `Unknown file extension "${extension}" for ${path$2}`;
63070
63096
  },
63071
63097
  TypeError
63072
63098
  );
@@ -63223,7 +63249,7 @@ function read(jsonPath, { base, specifier }) {
63223
63249
  /** @type {string | undefined} */
63224
63250
  let string$3;
63225
63251
  try {
63226
- string$3 = fs2.readFileSync(path2__default.toNamespacedPath(jsonPath), "utf8");
63252
+ string$3 = fs2.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
63227
63253
  } catch (error$2) {
63228
63254
  const exception = error$2;
63229
63255
  if (exception.code !== "ENOENT") throw exception;
@@ -63429,15 +63455,15 @@ function emitLegacyIndexDeprecation(url$2, packageJsonUrl, base, main) {
63429
63455
  const packagePath = fileURLToPath(new URL$1(".", packageJsonUrl));
63430
63456
  const basePath = fileURLToPath(base);
63431
63457
  if (!main) process$1.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
63432
- else if (path2__default.resolve(packagePath, main) !== urlPath) process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
63458
+ else if (path.resolve(packagePath, main) !== urlPath) process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
63433
63459
  }
63434
63460
  /**
63435
63461
  * @param {string} path
63436
63462
  * @returns {Stats | undefined}
63437
63463
  */
63438
- function tryStatSync(path$1) {
63464
+ function tryStatSync(path$2) {
63439
63465
  try {
63440
- return statSync(path$1);
63466
+ return statSync(path$2);
63441
63467
  } catch {}
63442
63468
  }
63443
63469
  /**
@@ -63536,7 +63562,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
63536
63562
  {
63537
63563
  const real = realpathSync(filePath);
63538
63564
  const { search, hash: hash$1 } = resolved;
63539
- resolved = pathToFileURL(real + (filePath.endsWith(path2__default.sep) ? "/" : ""));
63565
+ resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : ""));
63540
63566
  resolved.search = search;
63541
63567
  resolved.hash = hash$1;
63542
63568
  }
@@ -66842,9 +66868,9 @@ function constructHeaders({ headers, headersFile, logger: logger$1 }) {
66842
66868
 
66843
66869
  //#endregion
66844
66870
  //#region ../workers-shared/utils/configuration/validateURL.ts
66845
- const extractPathname = (path$1 = "/", includeSearch, includeHash) => {
66846
- if (!path$1.startsWith("/")) path$1 = `/${path$1}`;
66847
- const url$2 = new URL(`//${path$1}`, "relative://");
66871
+ const extractPathname = (path$2 = "/", includeSearch, includeHash) => {
66872
+ if (!path$2.startsWith("/")) path$2 = `/${path$2}`;
66873
+ const url$2 = new URL(`//${path$2}`, "relative://");
66848
66874
  return `${url$2.pathname}${includeSearch ? url$2.search : ""}${includeHash ? url$2.hash : ""}`;
66849
66875
  };
66850
66876
  const URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
@@ -66903,7 +66929,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
66903
66929
  lineNumber: i$1 + 1,
66904
66930
  message: "No headers specified"
66905
66931
  });
66906
- const [path$1, pathError] = validateUrl(line, false, true);
66932
+ const [path$2, pathError] = validateUrl(line, false, true);
66907
66933
  if (pathError) {
66908
66934
  invalid.push({
66909
66935
  line,
@@ -66914,7 +66940,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
66914
66940
  skipUntilNextPath = true;
66915
66941
  continue;
66916
66942
  }
66917
- const wildcardError = validateNoMultipleWildcards(path$1);
66943
+ const wildcardError = validateNoMultipleWildcards(path$2);
66918
66944
  if (wildcardError) {
66919
66945
  invalid.push({
66920
66946
  line,
@@ -66926,7 +66952,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
66926
66952
  continue;
66927
66953
  }
66928
66954
  rule = {
66929
- path: path$1,
66955
+ path: path$2,
66930
66956
  line,
66931
66957
  headers: {},
66932
66958
  unsetHeaders: []
@@ -67009,11 +67035,11 @@ function isValidRule(rule) {
67009
67035
  * `:splat` placeholder, would result in duplicate `:splat` parameters which is
67010
67036
  * unsupported.
67011
67037
  */
67012
- function validateNoMultipleWildcards(path$1) {
67013
- const wildcardCount = (path$1.match(SPLAT_REGEX) ?? []).length;
67014
- const hasSplatPlaceholder = /:splat(?!\w)/.test(path$1);
67015
- if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$1}.`;
67016
- if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$1}.`;
67038
+ function validateNoMultipleWildcards(path$2) {
67039
+ const wildcardCount = (path$2.match(SPLAT_REGEX) ?? []).length;
67040
+ const hasSplatPlaceholder = /:splat(?!\w)/.test(path$2);
67041
+ if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$2}.`;
67042
+ if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$2}.`;
67017
67043
  }
67018
67044
 
67019
67045
  //#endregion
@@ -67230,13 +67256,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/ig
67230
67256
  const throwError = (message, Ctor) => {
67231
67257
  throw new Ctor(message);
67232
67258
  };
67233
- const checkPath = (path$1, originalPath, doThrow) => {
67234
- if (!isString$1(path$1)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
67235
- if (!path$1) return doThrow(`path must not be empty`, TypeError);
67236
- if (checkPath.isNotRelative(path$1)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
67259
+ const checkPath = (path$2, originalPath, doThrow) => {
67260
+ if (!isString$1(path$2)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
67261
+ if (!path$2) return doThrow(`path must not be empty`, TypeError);
67262
+ if (checkPath.isNotRelative(path$2)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
67237
67263
  return true;
67238
67264
  };
67239
- const isNotRelative = (path$1) => REGEX_TEST_INVALID_PATH.test(path$1);
67265
+ const isNotRelative = (path$2) => REGEX_TEST_INVALID_PATH.test(path$2);
67240
67266
  checkPath.isNotRelative = isNotRelative;
67241
67267
  checkPath.convert = (p$2) => p$2;
67242
67268
  var Ignore = class {
@@ -67272,13 +67298,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/ig
67272
67298
  addPattern(pattern) {
67273
67299
  return this.add(pattern);
67274
67300
  }
67275
- _testOne(path$1, checkUnignored) {
67301
+ _testOne(path$2, checkUnignored) {
67276
67302
  let ignored = false;
67277
67303
  let unignored = false;
67278
67304
  this._rules.forEach((rule) => {
67279
67305
  const { negative } = rule;
67280
67306
  if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) return;
67281
- if (rule.regex.test(path$1)) {
67307
+ if (rule.regex.test(path$2)) {
67282
67308
  ignored = !negative;
67283
67309
  unignored = negative;
67284
67310
  }
@@ -67289,33 +67315,33 @@ var require_ignore = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/ig
67289
67315
  };
67290
67316
  }
67291
67317
  _test(originalPath, cache$2, checkUnignored, slices) {
67292
- const path$1 = originalPath && checkPath.convert(originalPath);
67293
- checkPath(path$1, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
67294
- return this._t(path$1, cache$2, checkUnignored, slices);
67318
+ const path$2 = originalPath && checkPath.convert(originalPath);
67319
+ checkPath(path$2, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
67320
+ return this._t(path$2, cache$2, checkUnignored, slices);
67295
67321
  }
67296
- _t(path$1, cache$2, checkUnignored, slices) {
67297
- if (path$1 in cache$2) return cache$2[path$1];
67298
- if (!slices) slices = path$1.split(SLASH);
67322
+ _t(path$2, cache$2, checkUnignored, slices) {
67323
+ if (path$2 in cache$2) return cache$2[path$2];
67324
+ if (!slices) slices = path$2.split(SLASH);
67299
67325
  slices.pop();
67300
- if (!slices.length) return cache$2[path$1] = this._testOne(path$1, checkUnignored);
67326
+ if (!slices.length) return cache$2[path$2] = this._testOne(path$2, checkUnignored);
67301
67327
  const parent = this._t(slices.join(SLASH) + SLASH, cache$2, checkUnignored, slices);
67302
- return cache$2[path$1] = parent.ignored ? parent : this._testOne(path$1, checkUnignored);
67328
+ return cache$2[path$2] = parent.ignored ? parent : this._testOne(path$2, checkUnignored);
67303
67329
  }
67304
- ignores(path$1) {
67305
- return this._test(path$1, this._ignoreCache, false).ignored;
67330
+ ignores(path$2) {
67331
+ return this._test(path$2, this._ignoreCache, false).ignored;
67306
67332
  }
67307
67333
  createFilter() {
67308
- return (path$1) => !this.ignores(path$1);
67334
+ return (path$2) => !this.ignores(path$2);
67309
67335
  }
67310
67336
  filter(paths) {
67311
67337
  return makeArray(paths).filter(this.createFilter());
67312
67338
  }
67313
- test(path$1) {
67314
- return this._test(path$1, this._testCache, true);
67339
+ test(path$2) {
67340
+ return this._test(path$2, this._testCache, true);
67315
67341
  }
67316
67342
  };
67317
67343
  const factory = (options) => new Ignore(options);
67318
- const isPathValid = (path$1) => checkPath(path$1 && checkPath.convert(path$1), path$1, RETURN_FALSE);
67344
+ const isPathValid = (path$2) => checkPath(path$2 && checkPath.convert(path$2), path$2, RETURN_FALSE);
67319
67345
  factory.isPathValid = isPathValid;
67320
67346
  factory.default = factory;
67321
67347
  module.exports = factory;
@@ -67324,7 +67350,7 @@ var require_ignore = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/ig
67324
67350
  const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
67325
67351
  checkPath.convert = makePosix;
67326
67352
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
67327
- checkPath.isNotRelative = (path$1) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$1) || isNotRelative(path$1);
67353
+ checkPath.isNotRelative = (path$2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$2) || isNotRelative(path$2);
67328
67354
  }
67329
67355
  }) });
67330
67356
 
@@ -68679,11 +68705,11 @@ var Mime = class {
68679
68705
  }
68680
68706
  return this;
68681
68707
  }
68682
- getType(path$1) {
68683
- if (typeof path$1 !== "string") return null;
68684
- const last = path$1.replace(/^.*[/\\]/s, "").toLowerCase();
68708
+ getType(path$2) {
68709
+ if (typeof path$2 !== "string") return null;
68710
+ const last = path$2.replace(/^.*[/\\]/s, "").toLowerCase();
68685
68711
  const ext = last.replace(/^.*\./s, "").toLowerCase();
68686
- const hasPath = last.length < path$1.length;
68712
+ const hasPath = last.length < path$2.length;
68687
68713
  if (!(ext.length < last.length - 1) && hasPath) return null;
68688
68714
  return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
68689
68715
  }
@@ -69456,11 +69482,11 @@ const getQueryString = (params) => {
69456
69482
  };
69457
69483
  const getUrl = (config$2, options) => {
69458
69484
  const encoder$1 = config$2.ENCODE_PATH || encodeURI;
69459
- const path$1 = options.url.replace("{api-version}", config$2.VERSION).replace(/{(.*?)}/g, (substring, group) => {
69485
+ const path$2 = options.url.replace("{api-version}", config$2.VERSION).replace(/{(.*?)}/g, (substring, group) => {
69460
69486
  if (options.path?.hasOwnProperty(group)) return encoder$1(String(options.path[group]));
69461
69487
  return substring;
69462
69488
  });
69463
- const url$2 = `${config$2.BASE}${path$1}`;
69489
+ const url$2 = `${config$2.BASE}${path$2}`;
69464
69490
  if (options.query) return `${url$2}${getQueryString(options.query)}`;
69465
69491
  return url$2;
69466
69492
  };
@@ -70558,7 +70584,7 @@ function getContainerOptions(options) {
70558
70584
  return containersConfig.map((container) => {
70559
70585
  if (isDockerfile(container.image, configPath)) return {
70560
70586
  dockerfile: container.image,
70561
- image_build_context: container.image_build_context ?? path2__default.dirname(container.image),
70587
+ image_build_context: container.image_build_context ?? path.dirname(container.image),
70562
70588
  image_vars: container.image_vars,
70563
70589
  class_name: container.class_name,
70564
70590
  image_tag: getDevContainerImageName(container.class_name, containerBuildId)
@@ -74789,13 +74815,13 @@ function createProfileStore(args) {
74789
74815
  args.bindings.write(currentBindings);
74790
74816
  },
74791
74817
  activate(profile, dir$2) {
74792
- const normalizedDir = path2__default.resolve(dir$2);
74818
+ const normalizedDir = path.resolve(dir$2);
74793
74819
  const currentBindings = args.bindings.read();
74794
74820
  currentBindings[normalizedDir] = profile;
74795
74821
  args.bindings.write(currentBindings);
74796
74822
  },
74797
74823
  deactivate(dir$2) {
74798
- const normalizedDir = path2__default.resolve(dir$2);
74824
+ const normalizedDir = path.resolve(dir$2);
74799
74825
  const currentBindings = args.bindings.read();
74800
74826
  const boundProfile = currentBindings[normalizedDir];
74801
74827
  if (boundProfile === void 0) {
@@ -74867,18 +74893,18 @@ function validateProfileName(name) {
74867
74893
  }
74868
74894
  __name$1(validateProfileName, "validateProfileName");
74869
74895
  function formatDirectoryForUserError(dir$2) {
74870
- return path2__default.relative(process.cwd(), dir$2) || ".";
74896
+ return path.relative(process.cwd(), dir$2) || ".";
74871
74897
  }
74872
74898
  __name$1(formatDirectoryForUserError, "formatDirectoryForUserError");
74873
74899
  function getProfileForDirectoryFromBindings(startDir, bindings$1) {
74874
- const normalizedDir = path2__default.resolve(startDir);
74900
+ const normalizedDir = path.resolve(startDir);
74875
74901
  const sortedEntries = Object.entries(bindings$1).sort(([a], [b]) => b.length - a.length);
74876
74902
  for (const [boundDir, profile] of sortedEntries) {
74877
74903
  if (normalizedDir === boundDir) return {
74878
74904
  profile,
74879
74905
  dir: boundDir
74880
74906
  };
74881
- if (normalizedDir.startsWith(boundDir) && normalizedDir[boundDir.length] === path2__default.sep) return {
74907
+ if (normalizedDir.startsWith(boundDir) && normalizedDir[boundDir.length] === path.sep) return {
74882
74908
  profile,
74883
74909
  dir: boundDir
74884
74910
  };
@@ -75633,7 +75659,7 @@ function resolveAuthProfileBaseName(profile) {
75633
75659
  }
75634
75660
  __name$1(resolveAuthProfileBaseName, "resolveAuthProfileBaseName");
75635
75661
  function getAuthConfigFilePath$2(configPath, profile, extension = "toml") {
75636
- return path2__default.join(configPath, USER_AUTH_CONFIG_PATH, `${resolveAuthProfileBaseName(profile)}.${extension}`);
75662
+ return path.join(configPath, USER_AUTH_CONFIG_PATH, `${resolveAuthProfileBaseName(profile)}.${extension}`);
75637
75663
  }
75638
75664
  __name$1(getAuthConfigFilePath$2, "getAuthConfigFilePath");
75639
75665
  var FileCredentialStore = class {
@@ -75664,7 +75690,7 @@ var FileCredentialStore = class {
75664
75690
  }
75665
75691
  write(config$2) {
75666
75692
  const filePath = this.filePath();
75667
- mkdirSync(path2__default.dirname(filePath), { recursive: true });
75693
+ mkdirSync(path.dirname(filePath), { recursive: true });
75668
75694
  writeFileSync(filePath, stringifyFile(this.format, config$2), {
75669
75695
  encoding: "utf-8",
75670
75696
  mode: 384
@@ -75729,7 +75755,7 @@ function parseEncryptedEnvelope(raw) {
75729
75755
  }
75730
75756
  __name$1(parseEncryptedEnvelope, "parseEncryptedEnvelope");
75731
75757
  function getEncryptedAuthConfigFilePath$2(configPath, profile) {
75732
- return path2__default.join(configPath, "config", `${resolveAuthProfileBaseName(profile)}.enc`);
75758
+ return path.join(configPath, "config", `${resolveAuthProfileBaseName(profile)}.enc`);
75733
75759
  }
75734
75760
  __name$1(getEncryptedAuthConfigFilePath$2, "getEncryptedAuthConfigFilePath");
75735
75761
  var EncryptedFileCredentialStore = class {
@@ -75768,7 +75794,7 @@ var EncryptedFileCredentialStore = class {
75768
75794
  const key = this.ensureKey();
75769
75795
  const envelope = encryptString(stringifyFile(this.format, config$2), key);
75770
75796
  const encryptedPath = getEncryptedAuthConfigFilePath$2(this.configPath, this.profile);
75771
- mkdirSync(path2__default.dirname(encryptedPath), { recursive: true });
75797
+ mkdirSync(path.dirname(encryptedPath), { recursive: true });
75772
75798
  writeFileSync(encryptedPath, JSON.stringify(envelope, null, " "), {
75773
75799
  encoding: "utf-8",
75774
75800
  mode: 384
@@ -75873,26 +75899,26 @@ function setNpmRunner(fn) {
75873
75899
  }
75874
75900
  __name$1(setNpmRunner, "setNpmRunner");
75875
75901
  function getKeyringInstallDir(configPath) {
75876
- return path2__default.join(configPath, "native", "keyring");
75902
+ return path.join(configPath, "native", "keyring");
75877
75903
  }
75878
75904
  __name$1(getKeyringInstallDir, "getKeyringInstallDir");
75879
75905
  function getInstalledBindingPath(installDir) {
75880
- return path2__default.join(installDir, "node_modules", "@napi-rs", "keyring");
75906
+ return path.join(installDir, "node_modules", "@napi-rs", "keyring");
75881
75907
  }
75882
75908
  __name$1(getInstalledBindingPath, "getInstalledBindingPath");
75883
75909
  function findKeyringBinding(installDir) {
75884
75910
  const cached$2 = cachedBindingPathByDir.get(installDir);
75885
75911
  if (cached$2 !== void 0) return cached$2;
75886
75912
  const lazy$2 = getInstalledBindingPath(installDir);
75887
- if (existsSync(path2__default.join(lazy$2, "index.js"))) {
75913
+ if (existsSync(path.join(lazy$2, "index.js"))) {
75888
75914
  cachedBindingPathByDir.set(installDir, lazy$2);
75889
75915
  return lazy$2;
75890
75916
  }
75891
75917
  try {
75892
75918
  const r$1 = npmRunner(["root", "-g"]);
75893
75919
  if (r$1.status === 0) {
75894
- const global$2 = path2__default.join(r$1.stdout.trim(), "@napi-rs", "keyring");
75895
- if (existsSync(path2__default.join(global$2, "index.js"))) {
75920
+ const global$2 = path.join(r$1.stdout.trim(), "@napi-rs", "keyring");
75921
+ if (existsSync(path.join(global$2, "index.js"))) {
75896
75922
  cachedBindingPathByDir.set(installDir, global$2);
75897
75923
  return global$2;
75898
75924
  }
@@ -75905,7 +75931,7 @@ __name$1(findKeyringBinding, "findKeyringBinding");
75905
75931
  function installKeyringBindingSync(installDir) {
75906
75932
  const dir$2 = installDir;
75907
75933
  mkdirSync(dir$2, { recursive: true });
75908
- const hostPkgJson = path2__default.join(dir$2, "package.json");
75934
+ const hostPkgJson = path.join(dir$2, "package.json");
75909
75935
  if (!existsSync(hostPkgJson)) writeFileSync(hostPkgJson, JSON.stringify({
75910
75936
  private: true,
75911
75937
  name: "cloudflare-auth-keyring-host"
@@ -76337,7 +76363,7 @@ __name$1(scrubEncryptedCredentials, "scrubEncryptedCredentials");
76337
76363
  //#region ../workers-auth/dist/chunk-AEOSGWMT.mjs
76338
76364
  function createPreferences(getConfigPath) {
76339
76365
  function getUserPreferencesPath() {
76340
- return path2__default.resolve(getConfigPath(), "preferences.json");
76366
+ return path.resolve(getConfigPath(), "preferences.json");
76341
76367
  }
76342
76368
  __name$1(getUserPreferencesPath, "getUserPreferencesPath");
76343
76369
  function readUserPreferences$2() {
@@ -76357,7 +76383,7 @@ function createPreferences(getConfigPath) {
76357
76383
  ...update
76358
76384
  };
76359
76385
  const filePath = getUserPreferencesPath();
76360
- mkdirSync(path2__default.dirname(filePath), { recursive: true });
76386
+ mkdirSync(path.dirname(filePath), { recursive: true });
76361
76387
  writeFileSync(filePath, JSON.stringify(next, null, " "), { encoding: "utf-8" });
76362
76388
  }
76363
76389
  __name$1(updateUserPreferences$2, "updateUserPreferences");
@@ -76992,7 +77018,7 @@ function createFileStorage(format$4, getPath) {
76992
77018
  }, "read"),
76993
77019
  write(config$2) {
76994
77020
  const configPath = getPath();
76995
- mkdirSync(path2__default.dirname(configPath), { recursive: true });
77021
+ mkdirSync(path.dirname(configPath), { recursive: true });
76996
77022
  writeFileSync(configPath, stringifyFile(format$4, config$2), {
76997
77023
  encoding: "utf-8",
76998
77024
  mode: 384
@@ -77306,7 +77332,7 @@ function createCloudflareProfileStore(ctx) {
77306
77332
  }
77307
77333
  __name$1(encryptedPath, "encryptedPath");
77308
77334
  function getProfileConfigDirectory() {
77309
- return path2__default.dirname(plaintextPath("default"));
77335
+ return path.dirname(plaintextPath("default"));
77310
77336
  }
77311
77337
  __name$1(getProfileConfigDirectory, "getProfileConfigDirectory");
77312
77338
  const configs = {
@@ -77333,7 +77359,7 @@ function createCloudflareProfileStore(ctx) {
77333
77359
  }
77334
77360
  };
77335
77361
  function getDirectoryBindingsPath() {
77336
- return path2__default.join(getConfigPath(), DIRECTORY_BINDINGS_FILE);
77362
+ return path.join(getConfigPath(), DIRECTORY_BINDINGS_FILE);
77337
77363
  }
77338
77364
  __name$1(getDirectoryBindingsPath, "getDirectoryBindingsPath");
77339
77365
  return createProfileStore({
@@ -77349,7 +77375,7 @@ function createCloudflareProfileStore(ctx) {
77349
77375
  },
77350
77376
  write(dirBindings) {
77351
77377
  const bindingsPath = getDirectoryBindingsPath();
77352
- mkdirSync(path2__default.dirname(bindingsPath), { recursive: true });
77378
+ mkdirSync(path.dirname(bindingsPath), { recursive: true });
77353
77379
  writeFileSync(bindingsPath, JSON.stringify(dirBindings, null, " "), "utf-8");
77354
77380
  }
77355
77381
  }
@@ -77590,7 +77616,7 @@ function getTemporaryAccountConfigFile$1() {
77590
77616
  }
77591
77617
  __name$1(getTemporaryAccountConfigFile$1, "getTemporaryAccountConfigFile");
77592
77618
  function getCfTemporaryAccountConfigPath() {
77593
- return path2__default.join(getCfConfigPath(), getTemporaryAccountConfigFile$1());
77619
+ return path.join(getCfConfigPath(), getTemporaryAccountConfigFile$1());
77594
77620
  }
77595
77621
  __name$1(getCfTemporaryAccountConfigPath, "getCfTemporaryAccountConfigPath");
77596
77622
  function createJsonFileStorage(getPath) {
@@ -77713,7 +77739,7 @@ function getTemporaryAccountConfigFile() {
77713
77739
  }
77714
77740
  __name$1(getTemporaryAccountConfigFile, "getTemporaryAccountConfigFile");
77715
77741
  function getTemporaryPreviewAccountConfigPath() {
77716
- return path2__default.join(getGlobalConfigPath(), getTemporaryAccountConfigFile());
77742
+ return path.join(getGlobalConfigPath(), getTemporaryAccountConfigFile());
77717
77743
  }
77718
77744
  __name$1(getTemporaryPreviewAccountConfigPath, "getTemporaryPreviewAccountConfigPath");
77719
77745
  function createTomlFileStorage(getPath) {
@@ -77787,7 +77813,7 @@ var require_command_exists$1 = /* @__PURE__ */ __commonJS$2({ "../../node_module
77787
77813
  var exec = __require$2("child_process").exec;
77788
77814
  var execSync$1 = __require$2("child_process").execSync;
77789
77815
  var fs$2 = __require$2("fs");
77790
- var path = __require$2("path");
77816
+ var path$1 = __require$2("path");
77791
77817
  var access = fs$2.access;
77792
77818
  var accessSync$1 = fs$2.accessSync;
77793
77819
  var constants$4 = fs$2.constants || fs$2;
@@ -77864,8 +77890,8 @@ var require_command_exists$1 = /* @__PURE__ */ __commonJS$2({ "../../node_module
77864
77890
  };
77865
77891
  if (isUsingWindows) cleanInput = function(s) {
77866
77892
  if (/[\\]/.test(s)) {
77867
- var dirname$3 = "\"" + path.dirname(s) + "\"";
77868
- var basename$2 = "\"" + path.basename(s) + "\"";
77893
+ var dirname$3 = "\"" + path$1.dirname(s) + "\"";
77894
+ var basename$2 = "\"" + path$1.basename(s) + "\"";
77869
77895
  return dirname$3 + ":" + basename$2;
77870
77896
  }
77871
77897
  return "\"" + s + "\"";
@@ -78679,11 +78705,11 @@ function createWorkerUploadForm(worker, bindings$1, options) {
78679
78705
  const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
78680
78706
  if (modules?.some(({ name }) => name === manifestModuleName) && main.type === "esm") {
78681
78707
  assert(modules !== void 0);
78682
- const subDirs = new Set(modules.map((module$1) => path2__default.posix.dirname(module$1.name)));
78708
+ const subDirs = new Set(modules.map((module$1) => path.posix.dirname(module$1.name)));
78683
78709
  for (const subDir of subDirs) {
78684
78710
  if (subDir === ".") continue;
78685
- const relativePath = path2__default.posix.relative(subDir, manifestModuleName);
78686
- const filePath = path2__default.posix.join(subDir, manifestModuleName);
78711
+ const relativePath = path.posix.relative(subDir, manifestModuleName);
78712
+ const filePath = path.posix.join(subDir, manifestModuleName);
78687
78713
  modules.push({
78688
78714
  name: filePath,
78689
78715
  filePath,
@@ -78763,7 +78789,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
78763
78789
  //#endregion
78764
78790
  //#region ../remote-bindings/dist/index.mjs
78765
78791
  var import_undici = require_undici();
78766
- var version$2 = "0.0.8";
78792
+ var version$2 = "0.0.10";
78767
78793
  var NoDefaultValueProvided = class extends UserError {
78768
78794
  constructor() {
78769
78795
  super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
@@ -78883,7 +78909,7 @@ var ProxyController = class {
78883
78909
  createProxyWorker() {
78884
78910
  if (this._torndown || this.proxyWorker) return;
78885
78911
  assert(this.latestConfig !== void 0);
78886
- const proxyWorker = new Miniflare({
78912
+ const proxyWorker = new Miniflare(convertV4MiniflareOptions({
78887
78913
  host: this.latestConfig.server.hostname,
78888
78914
  port: this.latestConfig.server.port,
78889
78915
  https: this.latestConfig.server.secure,
@@ -78915,7 +78941,7 @@ var ProxyController = class {
78915
78941
  verbose: logger.loggerLevel === "debug",
78916
78942
  log: new ProxyControllerLogger(castLogLevel(logger.loggerLevel), { prefix: logger.loggerLevel === "debug" ? "remote-bindings-ProxyWorker" : "remote-bindings" }, this.localServerReady.promise),
78917
78943
  handleStructuredLogs
78918
- });
78944
+ }));
78919
78945
  this.proxyWorker = proxyWorker;
78920
78946
  proxyWorker.ready.then((url$2) => {
78921
78947
  assert(url$2);
@@ -79208,7 +79234,7 @@ function createRemoteWorkerInit(props) {
79208
79234
  return {
79209
79235
  name: props.name,
79210
79236
  main: {
79211
- name: path2__default.basename(props.bundle.path),
79237
+ name: path.basename(props.bundle.path),
79212
79238
  filePath: props.bundle.path,
79213
79239
  type: props.bundle.type,
79214
79240
  content: props.bundle.entrypointSource
@@ -79677,26 +79703,26 @@ function deepStrictEqual(source, target$1) {
79677
79703
  //#endregion
79678
79704
  //#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.4/node_modules/fdir/dist/index.mjs
79679
79705
  var __require = /* @__PURE__ */ createRequire$1(import.meta.url);
79680
- function cleanPath(path$1) {
79681
- let normalized = normalize(path$1);
79706
+ function cleanPath(path$2) {
79707
+ let normalized = normalize(path$2);
79682
79708
  if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
79683
79709
  return normalized;
79684
79710
  }
79685
79711
  const SLASHES_REGEX = /[\\/]/g;
79686
- function convertSlashes(path$1, separator) {
79687
- return path$1.replace(SLASHES_REGEX, separator);
79712
+ function convertSlashes(path$2, separator) {
79713
+ return path$2.replace(SLASHES_REGEX, separator);
79688
79714
  }
79689
79715
  const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
79690
- function isRootDirectory(path$1) {
79691
- return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
79716
+ function isRootDirectory(path$2) {
79717
+ return path$2 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$2);
79692
79718
  }
79693
- function normalizePath$1(path$1, options) {
79719
+ function normalizePath$1(path$2, options) {
79694
79720
  const { resolvePaths, normalizePath: normalizePath$1$1, pathSeparator } = options;
79695
- const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
79696
- if (resolvePaths) path$1 = resolve$1(path$1);
79697
- if (normalizePath$1$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
79698
- if (path$1 === ".") return "";
79699
- return convertSlashes(path$1[path$1.length - 1] !== pathSeparator ? path$1 + pathSeparator : path$1, pathSeparator);
79721
+ const pathNeedsCleaning = process.platform === "win32" && path$2.includes("/") || path$2.startsWith(".");
79722
+ if (resolvePaths) path$2 = resolve$1(path$2);
79723
+ if (normalizePath$1$1 || pathNeedsCleaning) path$2 = cleanPath(path$2);
79724
+ if (path$2 === ".") return "";
79725
+ return convertSlashes(path$2[path$2.length - 1] !== pathSeparator ? path$2 + pathSeparator : path$2, pathSeparator);
79700
79726
  }
79701
79727
  function joinPathWithBasePath(filename, directoryPath) {
79702
79728
  return directoryPath + filename;
@@ -79732,8 +79758,8 @@ const pushDirectory = (directoryPath, paths) => {
79732
79758
  paths.push(directoryPath || ".");
79733
79759
  };
79734
79760
  const pushDirectoryFilter = (directoryPath, paths, filters) => {
79735
- const path$1 = directoryPath || ".";
79736
- if (filters.every((filter) => filter(path$1, true))) paths.push(path$1);
79761
+ const path$2 = directoryPath || ".";
79762
+ if (filters.every((filter) => filter(path$2, true))) paths.push(path$2);
79737
79763
  };
79738
79764
  const empty$2 = () => {};
79739
79765
  function build$6(root, options) {
@@ -79782,26 +79808,26 @@ const empty = () => {};
79782
79808
  function build$3(options) {
79783
79809
  return options.group ? groupFiles : empty;
79784
79810
  }
79785
- const resolveSymlinksAsync = function(path$1, state, callback$1) {
79811
+ const resolveSymlinksAsync = function(path$2, state, callback$1) {
79786
79812
  const { queue, fs: fs$3, options: { suppressErrors } } = state;
79787
79813
  queue.enqueue();
79788
- fs$3.realpath(path$1, (error$2, resolvedPath) => {
79814
+ fs$3.realpath(path$2, (error$2, resolvedPath) => {
79789
79815
  if (error$2) return queue.dequeue(suppressErrors ? null : error$2, state);
79790
79816
  fs$3.stat(resolvedPath, (error$1$1, stat$1) => {
79791
79817
  if (error$1$1) return queue.dequeue(suppressErrors ? null : error$1$1, state);
79792
- if (stat$1.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
79818
+ if (stat$1.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
79793
79819
  callback$1(stat$1, resolvedPath);
79794
79820
  queue.dequeue(null, state);
79795
79821
  });
79796
79822
  });
79797
79823
  };
79798
- const resolveSymlinks = function(path$1, state, callback$1) {
79824
+ const resolveSymlinks = function(path$2, state, callback$1) {
79799
79825
  const { queue, fs: fs$3, options: { suppressErrors } } = state;
79800
79826
  queue.enqueue();
79801
79827
  try {
79802
- const resolvedPath = fs$3.realpathSync(path$1);
79828
+ const resolvedPath = fs$3.realpathSync(path$2);
79803
79829
  const stat$1 = fs$3.statSync(resolvedPath);
79804
- if (stat$1.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
79830
+ if (stat$1.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
79805
79831
  callback$1(stat$1, resolvedPath);
79806
79832
  } catch (e) {
79807
79833
  if (!suppressErrors) throw e;
@@ -79811,16 +79837,16 @@ function build$2(options, isSynchronous) {
79811
79837
  if (!options.resolveSymlinks || options.excludeSymlinks) return null;
79812
79838
  return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
79813
79839
  }
79814
- function isRecursive(path$1, resolved, state) {
79840
+ function isRecursive(path$2, resolved, state) {
79815
79841
  if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
79816
- let parent = dirname$1(path$1);
79842
+ let parent = dirname$1(path$2);
79817
79843
  let depth$1 = 1;
79818
79844
  while (parent !== state.root && depth$1 < 2) {
79819
79845
  const resolvedPath = state.symlinks.get(parent);
79820
79846
  if (!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath))) depth$1++;
79821
79847
  else parent = dirname$1(parent);
79822
79848
  }
79823
- state.symlinks.set(path$1, resolved);
79849
+ state.symlinks.set(path$2, resolved);
79824
79850
  return depth$1 > 1;
79825
79851
  }
79826
79852
  function isRecursiveUsingRealPaths(resolved, state) {
@@ -80001,19 +80027,19 @@ var Walker = class {
80001
80027
  const filename = this.joinPath(entry.name, directoryPath);
80002
80028
  this.pushFile(filename, files, this.state.counts, filters);
80003
80029
  } else if (entry.isDirectory()) {
80004
- let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
80005
- if (exclude && exclude(entry.name, path$1)) continue;
80006
- this.pushDirectory(path$1, paths, filters);
80007
- this.walkDirectory(this.state, path$1, path$1, depth$1 - 1, this.walk);
80030
+ let path$2 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
80031
+ if (exclude && exclude(entry.name, path$2)) continue;
80032
+ this.pushDirectory(path$2, paths, filters);
80033
+ this.walkDirectory(this.state, path$2, path$2, depth$1 - 1, this.walk);
80008
80034
  } else if (this.resolveSymlink && entry.isSymbolicLink()) {
80009
- let path$1 = joinPathWithBasePath(entry.name, directoryPath);
80010
- this.resolveSymlink(path$1, this.state, (stat$1, resolvedPath) => {
80035
+ let path$2 = joinPathWithBasePath(entry.name, directoryPath);
80036
+ this.resolveSymlink(path$2, this.state, (stat$1, resolvedPath) => {
80011
80037
  if (stat$1.isDirectory()) {
80012
80038
  resolvedPath = normalizePath$1(resolvedPath, this.state.options);
80013
- if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
80014
- this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth$1 - 1, this.walk);
80039
+ if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$2 + pathSeparator)) return;
80040
+ this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$2 + pathSeparator, depth$1 - 1, this.walk);
80015
80041
  } else {
80016
- resolvedPath = useRealPaths ? resolvedPath : path$1;
80042
+ resolvedPath = useRealPaths ? resolvedPath : path$2;
80017
80043
  const filename = basename$1(resolvedPath);
80018
80044
  const directoryPath$1 = normalizePath$1(dirname$1(resolvedPath), this.state.options);
80019
80045
  resolvedPath = this.joinPath(filename, directoryPath$1);
@@ -80178,7 +80204,7 @@ var Builder = class {
80178
80204
  isMatch = globFn(patterns, ...options);
80179
80205
  this.globCache[patterns.join("\0")] = isMatch;
80180
80206
  }
80181
- this.options.filters.push((path$1) => isMatch(path$1));
80207
+ this.options.filters.push((path$2) => isMatch(path$2));
80182
80208
  return this;
80183
80209
  }
80184
80210
  };
@@ -80392,8 +80418,8 @@ var require_utils = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/pic
80392
80418
  if (state.negated === true) output = `(?:^(?!${output}).*$)`;
80393
80419
  return output;
80394
80420
  };
80395
- exports.basename = (path$1, { windows } = {}) => {
80396
- const segs = path$1.split(windows ? /[\\/]/ : "/");
80421
+ exports.basename = (path$2, { windows } = {}) => {
80422
+ const segs = path$2.split(windows ? /[\\/]/ : "/");
80397
80423
  const last = segs[segs.length - 1];
80398
80424
  if (last === "") return segs[segs.length - 2];
80399
80425
  return last;
@@ -82133,15 +82159,15 @@ function buildRelative(cwd, root) {
82133
82159
  };
82134
82160
  }
82135
82161
  const splitPatternOptions = { parts: true };
82136
- function splitPattern(path$1) {
82162
+ function splitPattern(path$2) {
82137
82163
  var _result$parts;
82138
- const result = import_picomatch.default.scan(path$1, splitPatternOptions);
82139
- return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
82164
+ const result = import_picomatch.default.scan(path$2, splitPatternOptions);
82165
+ return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$2];
82140
82166
  }
82141
82167
  const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
82142
82168
  const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
82143
- const escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
82144
- const escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
82169
+ const escapePosixPath = (path$2) => path$2.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
82170
+ const escapeWin32Path = (path$2) => path$2.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
82145
82171
  /**
82146
82172
  * Escapes a path's special characters depending on the platform.
82147
82173
  * @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
@@ -82265,13 +82291,13 @@ function buildCrawler(options, patterns) {
82265
82291
  if (options.deep !== void 0) maxDepth = Math.round(options.deep - props.depthOffset);
82266
82292
  const crawler = new Builder({
82267
82293
  filters: [debug$7 ? (p$2, isDirectory$2) => {
82268
- const path$1 = format$4(p$2, isDirectory$2);
82269
- const matches = matcher(path$1) && !ignore$1(path$1);
82270
- if (matches) log(`matched ${path$1}`);
82294
+ const path$2 = format$4(p$2, isDirectory$2);
82295
+ const matches = matcher(path$2) && !ignore$1(path$2);
82296
+ if (matches) log(`matched ${path$2}`);
82271
82297
  return matches;
82272
82298
  } : (p$2, isDirectory$2) => {
82273
- const path$1 = format$4(p$2, isDirectory$2);
82274
- return matcher(path$1) && !ignore$1(path$1);
82299
+ const path$2 = format$4(p$2, isDirectory$2);
82300
+ return matcher(path$2) && !ignore$1(path$2);
82275
82301
  }],
82276
82302
  exclude: debug$7 ? (_, p$2) => {
82277
82303
  const skipped = excludePredicate(_, p$2);
@@ -82404,7 +82430,6 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
82404
82430
  const assetWorkers = [
82405
82431
  {
82406
82432
  name: ROUTER_WORKER_NAME,
82407
- unsafeExcludeFromObservability: true,
82408
82433
  unsafeRegisterWorker: false,
82409
82434
  compatibilityDate: INTERNAL_WORKERS_COMPATIBILITY_DATE,
82410
82435
  compatibilityFlags: ["enable_ctx_exports"],
@@ -82422,7 +82447,6 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
82422
82447
  },
82423
82448
  {
82424
82449
  name: ASSET_WORKER_NAME,
82425
- unsafeExcludeFromObservability: true,
82426
82450
  unsafeRegisterWorker: false,
82427
82451
  compatibilityDate: INTERNAL_WORKERS_COMPATIBILITY_DATE,
82428
82452
  modulesRoot: miniflareModulesRoot,
@@ -82484,7 +82508,6 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
82484
82508
  },
82485
82509
  {
82486
82510
  name: VITE_PROXY_WORKER_NAME,
82487
- unsafeExcludeFromObservability: true,
82488
82511
  unsafeRegisterWorker: false,
82489
82512
  compatibilityDate: INTERNAL_WORKERS_COMPATIBILITY_DATE,
82490
82513
  modulesRoot: miniflareModulesRoot,
@@ -82523,13 +82546,15 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
82523
82546
  });
82524
82547
  for (const option of options ?? []) containerTagToOptionsMap.set(option.image_tag, option);
82525
82548
  }
82526
- const { externalWorkers: externalWorkers$1, workerOptions } = wrangler.unstable_getMiniflareWorkerOptions({
82549
+ const miniflareWorkerOptions = wrangler.unstable_getMiniflareWorkerOptions({
82527
82550
  ...worker.config,
82528
82551
  assets: void 0
82529
82552
  }, resolvedPluginConfig.cloudflareEnv, {
82530
82553
  remoteProxyConnectionString: remoteProxySessionData?.session?.remoteProxyConnectionString,
82531
82554
  containerBuildId
82532
82555
  });
82556
+ const { externalWorkers: externalWorkers$1 } = miniflareWorkerOptions;
82557
+ const workerOptions = miniflareWorkerOptions.workerOptions;
82533
82558
  if (workerOptions.browserRendering && getBrowserRenderingHeadfulFromEnv()) workerOptions.browserRendering.headful = true;
82534
82559
  const wrappers = [
82535
82560
  `import { createWorkerEntrypointWrapper, createDurableObjectWrapper, createWorkflowEntrypointWrapper } from "${RUNNER_PATH}";`,
@@ -82596,7 +82621,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
82596
82621
  const logger$1 = new ViteMiniflareLogger(resolvedViteConfig);
82597
82622
  const serverConfig = viteDevServer.config.server;
82598
82623
  return {
82599
- miniflareOptions: {
82624
+ miniflareOptions: convertV4MiniflareOptions({
82600
82625
  log: logger$1,
82601
82626
  publicUrl: buildPublicUrl({
82602
82627
  hostname: typeof serverConfig.host === "string" ? serverConfig.host : void 0,
@@ -82647,7 +82672,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
82647
82672
  default: return Response$1.error();
82648
82673
  }
82649
82674
  }
82650
- },
82675
+ }),
82651
82676
  containerTagToOptionsMap
82652
82677
  };
82653
82678
  }
@@ -82744,10 +82769,11 @@ async function getPreviewMiniflareOptions(ctx, vitePreviewServer) {
82744
82769
  containerBuildId
82745
82770
  });
82746
82771
  const { externalWorkers } = miniflareWorkerOptions;
82747
- const { modulesRules,...workerOptions } = miniflareWorkerOptions.workerOptions;
82772
+ const { modulesRules,...sourcelessWorkerOptions } = miniflareWorkerOptions.workerOptions;
82773
+ const workerOptions = sourcelessWorkerOptions;
82748
82774
  return [{
82749
82775
  ...workerOptions,
82750
- name: workerOptions.name ?? workerConfig.name,
82776
+ name: typeof workerOptions.name === "string" ? workerOptions.name : workerConfig.name,
82751
82777
  unsafeInspectorProxy: inputInspectorPort !== false,
82752
82778
  ...previewWorker.source === "build-output" && previewWorker.bundle ? getModulesFromManifest(previewWorker.bundle) : miniflareWorkerOptions.main ? getPreviewModules(miniflareWorkerOptions.main, modulesRules) : {
82753
82779
  modules: true,
@@ -82758,7 +82784,7 @@ async function getPreviewMiniflareOptions(ctx, vitePreviewServer) {
82758
82784
  const logger$1 = new ViteMiniflareLogger(resolvedViteConfig);
82759
82785
  const serverConfig = vitePreviewServer.config.preview;
82760
82786
  return {
82761
- miniflareOptions: {
82787
+ miniflareOptions: convertV4MiniflareOptions({
82762
82788
  log: logger$1,
82763
82789
  publicUrl: buildPublicUrl({
82764
82790
  hostname: typeof serverConfig.host === "string" ? serverConfig.host : void 0,
@@ -82777,7 +82803,7 @@ async function getPreviewMiniflareOptions(ctx, vitePreviewServer) {
82777
82803
  resourceTmpPath: path2.resolve(resolvedViteConfig.root, ".wrangler/tmp"),
82778
82804
  containerEngine,
82779
82805
  workers
82780
- },
82806
+ }),
82781
82807
  containerTagToOptionsMap
82782
82808
  };
82783
82809
  }
@@ -83527,13 +83553,13 @@ const wslDefaultBrowser = async () => {
83527
83553
  const { stdout: stdout$2 } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
83528
83554
  return stdout$2.trim();
83529
83555
  };
83530
- const convertWslPathToWindows = async (path$1) => {
83531
- if (/^[a-z]+:\/\//i.test(path$1)) return path$1;
83556
+ const convertWslPathToWindows = async (path$2) => {
83557
+ if (/^[a-z]+:\/\//i.test(path$2)) return path$2;
83532
83558
  try {
83533
- const { stdout: stdout$2 } = await execFile$1("wslpath", ["-aw", path$1], { encoding: "utf8" });
83559
+ const { stdout: stdout$2 } = await execFile$1("wslpath", ["-aw", path$2], { encoding: "utf8" });
83534
83560
  return stdout$2.trim();
83535
83561
  } catch {
83536
- return path$1;
83562
+ return path$2;
83537
83563
  }
83538
83564
  };
83539
83565
 
@@ -83719,8 +83745,8 @@ var is_in_ssh_default = isInSsh;
83719
83745
  //#endregion
83720
83746
  //#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
83721
83747
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
83722
- const __dirname = import.meta.url ? path2__default.dirname(fileURLToPath(import.meta.url)) : "";
83723
- const localXdgOpenPath = path2__default.join(__dirname, "xdg-open");
83748
+ const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
83749
+ const localXdgOpenPath = path.join(__dirname, "xdg-open");
83724
83750
  const { platform, arch: arch$1 } = process$1;
83725
83751
  const tryEachApp = async (apps$1, opener) => {
83726
83752
  if (apps$1.length === 0) return;