@cloudflare/vite-plugin 1.38.0 → 1.39.0

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
@@ -3,28 +3,28 @@ import assert from "node:assert";
3
3
  import { CoreHeaders, CorePaths, Log, LogLevel, Miniflare, Request as Request$1, Response as Response$1, buildPublicUrl, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, getWorkerRegistry, kUnsafeEphemeralUniqueKey, parseModuleFallbackRequest } from "miniflare";
4
4
  import * as wrangler from "wrangler";
5
5
  import * as nodePath from "node:path";
6
- import path, { dirname, isAbsolute, join, relative, resolve } from "node:path";
6
+ import path3, { dirname, isAbsolute, join, relative, resolve } from "node:path";
7
7
  import * as util$1 from "node:util";
8
8
  import { format, inspect, promisify } from "node:util";
9
9
  import * as vite from "vite";
10
10
  import { normalizePath, version } from "vite";
11
11
  import { createHash, randomUUID } from "node:crypto";
12
- import * as fs$2 from "node:fs";
13
- import fs, { accessSync, chmodSync, constants, existsSync, mkdirSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
12
+ import * as fs$1 from "node:fs";
13
+ import fs2, { accessSync, chmodSync, constants, existsSync, mkdirSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
14
14
  import os, { arch } from "node:os";
15
15
  import childProcess, { execFile, execFileSync, spawn } from "node:child_process";
16
16
  import net from "node:net";
17
17
  import { Buffer as Buffer$1 } from "node:buffer";
18
18
  import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
19
19
  import * as fsp from "node:fs/promises";
20
- import fs$1, { constants as constants$1 } from "node:fs/promises";
20
+ import fs, { constants as constants$1 } from "node:fs/promises";
21
21
  import { getCloudflarePreset, nonPrefixedNodeModules } from "@cloudflare/unenv-preset";
22
22
  import process$1 from "node:process";
23
23
  import v8 from "node:v8";
24
24
  import { defineEnv } from "unenv";
25
25
  import * as nativeFs$1 from "fs";
26
26
  import nativeFs from "fs";
27
- import path$1, { basename, dirname as dirname$1, normalize, posix, relative as relative$1, resolve as resolve$1, sep } from "path";
27
+ import path, { basename, dirname as dirname$1, normalize, posix, relative as relative$1, resolve as resolve$1, sep } from "path";
28
28
  import { fileURLToPath as fileURLToPath$1 } from "url";
29
29
  import { createRequire as createRequire$1 } from "module";
30
30
  import { WebSocketServer } from "ws";
@@ -1503,7 +1503,7 @@ async function assertWranglerVersion() {
1503
1503
  * The default compatibility date to use when the user omits one.
1504
1504
  * This value is injected at build time and remains fixed for each release.
1505
1505
  */
1506
- const DEFAULT_COMPAT_DATE = "2026-05-22";
1506
+ const DEFAULT_COMPAT_DATE = "2026-05-26";
1507
1507
 
1508
1508
  //#endregion
1509
1509
  //#region ../../node_modules/.pnpm/@remix-run+node-fetch-server@0.8.0/node_modules/@remix-run/node-fetch-server/dist/node-fetch-server.js
@@ -3958,7 +3958,7 @@ function resolveWranglerConfigPath({ config, script }, options) {
3958
3958
  deployConfigPath: void 0,
3959
3959
  redirected: false
3960
3960
  };
3961
- return findWranglerConfig$1(script !== void 0 ? path.dirname(script) : process.cwd(), options);
3961
+ return findWranglerConfig$1(script !== void 0 ? path3.dirname(script) : process.cwd(), options);
3962
3962
  }
3963
3963
  __name(resolveWranglerConfigPath, "resolveWranglerConfigPath");
3964
3964
  function findWranglerConfig$1(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
@@ -3989,15 +3989,15 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
3989
3989
  const deployConfigFile = readFileSync$1(deployConfigPath);
3990
3990
  try {
3991
3991
  const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);
3992
- redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);
3992
+ redirectedConfigPath = deployConfig.configPath && path3.resolve(path3.dirname(deployConfigPath), deployConfig.configPath);
3993
3993
  } catch (e) {
3994
- throw new UserError(`Failed to parse the deploy configuration file at ${path.relative(".", deployConfigPath)}`, {
3994
+ throw new UserError(`Failed to parse the deploy configuration file at ${path3.relative(".", deployConfigPath)}`, {
3995
3995
  cause: e,
3996
3996
  telemetryMessage: false
3997
3997
  });
3998
3998
  }
3999
3999
  if (!redirectedConfigPath) throw new UserError(esm_default`
4000
- A deploy configuration file was found at "${path.relative(".", deployConfigPath)}".
4000
+ A deploy configuration file was found at "${path3.relative(".", deployConfigPath)}".
4001
4001
  But this is not valid - the required "configPath" property was not found.
4002
4002
  Instead this file contains:
4003
4003
  \`\`\`
@@ -4005,13 +4005,13 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
4005
4005
  \`\`\`
4006
4006
  `, { telemetryMessage: false });
4007
4007
  if (!existsSync(redirectedConfigPath)) throw new UserError(esm_default`
4008
- There is a deploy configuration at "${path.relative(".", deployConfigPath)}".
4009
- But the redirected configuration path it points to, "${path.relative(".", redirectedConfigPath)}", does not exist.
4008
+ There is a deploy configuration at "${path3.relative(".", deployConfigPath)}".
4009
+ But the redirected configuration path it points to, "${path3.relative(".", redirectedConfigPath)}", does not exist.
4010
4010
  `, { telemetryMessage: false });
4011
4011
  if (userConfigPath) {
4012
- if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError(esm_default`
4013
- Found both a user configuration file at "${path.relative(".", userConfigPath)}"
4014
- and a deploy configuration file at "${path.relative(".", deployConfigPath)}".
4012
+ if (path3.join(path3.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError(esm_default`
4013
+ Found both a user configuration file at "${path3.relative(".", userConfigPath)}"
4014
+ and a deploy configuration file at "${path3.relative(".", deployConfigPath)}".
4015
4015
  But these do not share the same base path so it is not clear which should be used.
4016
4016
  `, { telemetryMessage: false });
4017
4017
  }
@@ -4055,11 +4055,11 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
4055
4055
  }
4056
4056
  __name(formatConfigSnippet, "formatConfigSnippet");
4057
4057
  function isDirectory(path2) {
4058
- return fs.statSync(path2, { throwIfNoEntry: false })?.isDirectory() ?? false;
4058
+ return fs2.statSync(path2, { throwIfNoEntry: false })?.isDirectory() ?? false;
4059
4059
  }
4060
4060
  __name(isDirectory, "isDirectory");
4061
4061
  function removeDir(dirPath, { fireAndForget = false } = {}) {
4062
- const result = fs.promises.rm(dirPath, {
4062
+ const result = fs2.promises.rm(dirPath, {
4063
4063
  recursive: true,
4064
4064
  force: true,
4065
4065
  maxRetries: 5,
@@ -4070,7 +4070,7 @@ function removeDir(dirPath, { fireAndForget = false } = {}) {
4070
4070
  }
4071
4071
  __name(removeDir, "removeDir");
4072
4072
  function removeDirSync(dirPath) {
4073
- fs.rmSync(dirPath, {
4073
+ fs2.rmSync(dirPath, {
4074
4074
  recursive: true,
4075
4075
  force: true,
4076
4076
  maxRetries: 5,
@@ -5227,10 +5227,10 @@ var require_util$5 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
5227
5227
  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
5228
5228
  const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
5229
5229
  let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
5230
- let path$2 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
5230
+ let path$1 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
5231
5231
  if (origin[origin.length - 1] === "/") origin = origin.slice(0, origin.length - 1);
5232
- if (path$2 && path$2[0] !== "/") path$2 = `/${path$2}`;
5233
- return new URL(`${origin}${path$2}`);
5232
+ if (path$1 && path$1[0] !== "/") path$1 = `/${path$1}`;
5233
+ return new URL(`${origin}${path$1}`);
5234
5234
  }
5235
5235
  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
5236
5236
  return url;
@@ -6105,8 +6105,8 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
6105
6105
  debugLog("connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version$2, error.message);
6106
6106
  });
6107
6107
  diagnosticsChannel$1.subscribe("undici:client:sendHeaders", (evt) => {
6108
- const { request: { method, path: path$2, origin } } = evt;
6109
- debugLog("sending request to %s %s%s", method, origin, path$2);
6108
+ const { request: { method, path: path$1, origin } } = evt;
6109
+ debugLog("sending request to %s %s%s", method, origin, path$1);
6110
6110
  });
6111
6111
  }
6112
6112
  let isTrackingRequestEvents = false;
@@ -6118,16 +6118,16 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
6118
6118
  }
6119
6119
  isTrackingRequestEvents = true;
6120
6120
  diagnosticsChannel$1.subscribe("undici:request:headers", (evt) => {
6121
- const { request: { method, path: path$2, origin }, response: { statusCode } } = evt;
6122
- debugLog("received response to %s %s%s - HTTP %d", method, origin, path$2, statusCode);
6121
+ const { request: { method, path: path$1, origin }, response: { statusCode } } = evt;
6122
+ debugLog("received response to %s %s%s - HTTP %d", method, origin, path$1, statusCode);
6123
6123
  });
6124
6124
  diagnosticsChannel$1.subscribe("undici:request:trailers", (evt) => {
6125
- const { request: { method, path: path$2, origin } } = evt;
6126
- debugLog("trailers received from %s %s%s", method, origin, path$2);
6125
+ const { request: { method, path: path$1, origin } } = evt;
6126
+ debugLog("trailers received from %s %s%s", method, origin, path$1);
6127
6127
  });
6128
6128
  diagnosticsChannel$1.subscribe("undici:request:error", (evt) => {
6129
- const { request: { method, path: path$2, origin }, error } = evt;
6130
- debugLog("request to %s %s%s errored - %s", method, origin, path$2, error.message);
6129
+ const { request: { method, path: path$1, origin }, error } = evt;
6130
+ debugLog("request to %s %s%s errored - %s", method, origin, path$1, error.message);
6131
6131
  });
6132
6132
  }
6133
6133
  let isTrackingWebSocketEvents = false;
@@ -6180,10 +6180,10 @@ var require_request$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
6180
6180
  const invalidPathRegex = /[^\u0021-\u00ff]/;
6181
6181
  const kHandler = Symbol("handler");
6182
6182
  var Request$6 = class {
6183
- constructor(origin, { path: path$2, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
6184
- if (typeof path$2 !== "string") throw new InvalidArgumentError$35("path must be a string");
6185
- else if (path$2[0] !== "/" && !(path$2.startsWith("http://") || path$2.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$35("path must be an absolute URL or start with a slash");
6186
- else if (invalidPathRegex.test(path$2)) throw new InvalidArgumentError$35("invalid request path");
6183
+ constructor(origin, { path: path$1, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
6184
+ if (typeof path$1 !== "string") throw new InvalidArgumentError$35("path must be a string");
6185
+ else if (path$1[0] !== "/" && !(path$1.startsWith("http://") || path$1.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$35("path must be an absolute URL or start with a slash");
6186
+ else if (invalidPathRegex.test(path$1)) throw new InvalidArgumentError$35("invalid request path");
6187
6187
  if (typeof method !== "string") throw new InvalidArgumentError$35("method must be a string");
6188
6188
  else if (normalizedMethodRecords$1[method] === void 0 && !isValidHTTPToken$2(method)) throw new InvalidArgumentError$35("invalid request method");
6189
6189
  if (upgrade$1 && typeof upgrade$1 !== "string") throw new InvalidArgumentError$35("upgrade must be a string");
@@ -6224,7 +6224,7 @@ var require_request$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
6224
6224
  this.completed = false;
6225
6225
  this.aborted = false;
6226
6226
  this.upgrade = upgrade$1 || null;
6227
- this.path = query ? serializePathWithQuery$3(path$2, query) : path$2;
6227
+ this.path = query ? serializePathWithQuery$3(path$1, query) : path$1;
6228
6228
  this.origin = origin;
6229
6229
  this.protocol = getProtocolFromUrlString(origin);
6230
6230
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
@@ -10707,7 +10707,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
10707
10707
  * @returns
10708
10708
  */
10709
10709
  function writeH1(client, request$2) {
10710
- const { method, path: path$2, host, upgrade: upgrade$1, blocking, reset } = request$2;
10710
+ const { method, path: path$1, host, upgrade: upgrade$1, blocking, reset } = request$2;
10711
10711
  let { body, headers, contentLength } = request$2;
10712
10712
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
10713
10713
  if (util$23.isFormDataLike(body)) {
@@ -10752,7 +10752,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
10752
10752
  if (client[kMaxRequests$1] && socket[kCounter$1]++ >= client[kMaxRequests$1]) socket[kReset$1] = true;
10753
10753
  if (blocking) socket[kBlocking] = true;
10754
10754
  if (socket.setTypeOfService) socket.setTypeOfService(request$2.typeOfService);
10755
- let header = `${method} ${path$2} HTTP/1.1\r\n`;
10755
+ let header = `${method} ${path$1} HTTP/1.1\r\n`;
10756
10756
  if (typeof host === "string") header += `host: ${host}\r\n`;
10757
10757
  else header += client[kHostHeader$1];
10758
10758
  if (upgrade$1) header += `connection: upgrade\r\nupgrade: ${upgrade$1}\r\n`;
@@ -11288,7 +11288,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
11288
11288
  function writeH2(client, request$2) {
11289
11289
  const requestTimeout = request$2.bodyTimeout ?? client[kBodyTimeout$1];
11290
11290
  const session = client[kHTTP2Session];
11291
- const { method, path: path$2, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
11291
+ const { method, path: path$1, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
11292
11292
  let { body } = request$2;
11293
11293
  if (upgrade$1 != null && upgrade$1 !== "websocket") {
11294
11294
  util$22.errorRequest(client, request$2, new InvalidArgumentError$30(`Custom upgrade "${upgrade$1}" not supported over HTTP/2`));
@@ -11341,7 +11341,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
11341
11341
  }
11342
11342
  headers[HTTP2_HEADER_METHOD] = "CONNECT";
11343
11343
  headers[HTTP2_HEADER_PROTOCOL] = "websocket";
11344
- headers[HTTP2_HEADER_PATH] = path$2;
11344
+ headers[HTTP2_HEADER_PATH] = path$1;
11345
11345
  if (protocol === "ws:" || protocol === "wss:") headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
11346
11346
  else headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
11347
11347
  stream$2 = session.request(headers, {
@@ -11383,7 +11383,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
11383
11383
  stream$2.setTimeout(requestTimeout);
11384
11384
  return true;
11385
11385
  }
11386
- headers[HTTP2_HEADER_PATH] = path$2;
11386
+ headers[HTTP2_HEADER_PATH] = path$1;
11387
11387
  headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
11388
11388
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
11389
11389
  if (body && typeof body.read === "function") body.read(0);
@@ -13209,8 +13209,8 @@ var require_proxy_agent = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
13209
13209
  }
13210
13210
  if (onHeaders) onHeaders.call(this, statusCode, data$1, resume$1);
13211
13211
  };
13212
- const { origin, path: path$2 = "/", headers = {} } = opts;
13213
- opts.path = origin + path$2;
13212
+ const { origin, path: path$1 = "/", headers = {} } = opts;
13213
+ opts.path = origin + path$1;
13214
13214
  if (!("host" in headers) && !("Host" in headers)) {
13215
13215
  const { host } = new URL(origin);
13216
13216
  headers.host = host;
@@ -14994,16 +14994,16 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
14994
14994
  }
14995
14995
  return normalizedQp;
14996
14996
  }
14997
- function safeUrl(path$2) {
14998
- if (typeof path$2 !== "string") return path$2;
14999
- const pathSegments = path$2.split("?", 3);
15000
- if (pathSegments.length !== 2) return path$2;
14997
+ function safeUrl(path$1) {
14998
+ if (typeof path$1 !== "string") return path$1;
14999
+ const pathSegments = path$1.split("?", 3);
15000
+ if (pathSegments.length !== 2) return path$1;
15001
15001
  const qp = new URLSearchParams(pathSegments.pop());
15002
15002
  qp.sort();
15003
15003
  return [...pathSegments, qp.toString()].join("?");
15004
15004
  }
15005
- function matchKey(mockDispatch$1, { path: path$2, method, body, headers }) {
15006
- const pathMatch = matchValue$1(mockDispatch$1.path, path$2);
15005
+ function matchKey(mockDispatch$1, { path: path$1, method, body, headers }) {
15006
+ const pathMatch = matchValue$1(mockDispatch$1.path, path$1);
15007
15007
  const methodMatch = matchValue$1(mockDispatch$1.method, method);
15008
15008
  const bodyMatch = typeof mockDispatch$1.body !== "undefined" ? matchValue$1(mockDispatch$1.body, body) : true;
15009
15009
  const headersMatch = matchHeaders(mockDispatch$1, headers);
@@ -15021,8 +15021,8 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
15021
15021
  const basePath = key.query ? serializePathWithQuery$2(key.path, key.query) : key.path;
15022
15022
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
15023
15023
  const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
15024
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$2, ignoreTrailingSlash }) => {
15025
- return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$2)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path$2), resolvedPath);
15024
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$1, ignoreTrailingSlash }) => {
15025
+ return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$1)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path$1), resolvedPath);
15026
15026
  });
15027
15027
  if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
15028
15028
  matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue$1(method, key.method));
@@ -15065,15 +15065,15 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
15065
15065
  /**
15066
15066
  * @param {string} path Path to remove trailing slash from
15067
15067
  */
15068
- function removeTrailingSlash(path$2) {
15069
- while (path$2.endsWith("/")) path$2 = path$2.slice(0, -1);
15070
- if (path$2.length === 0) path$2 = "/";
15071
- return path$2;
15068
+ function removeTrailingSlash(path$1) {
15069
+ while (path$1.endsWith("/")) path$1 = path$1.slice(0, -1);
15070
+ if (path$1.length === 0) path$1 = "/";
15071
+ return path$1;
15072
15072
  }
15073
15073
  function buildKey$1(opts) {
15074
- const { path: path$2, method, body, headers, query } = opts;
15074
+ const { path: path$1, method, body, headers, query } = opts;
15075
15075
  return {
15076
- path: path$2,
15076
+ path: path$1,
15077
15077
  method,
15078
15078
  body,
15079
15079
  headers,
@@ -15640,10 +15640,10 @@ var require_pending_interceptors_formatter = /* @__PURE__ */ __commonJS$1({ "../
15640
15640
  });
15641
15641
  }
15642
15642
  format(pendingInterceptors) {
15643
- const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
15643
+ const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$1, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
15644
15644
  Method: method,
15645
15645
  Origin: origin,
15646
- Path: path$2,
15646
+ Path: path$1,
15647
15647
  "Status code": statusCode,
15648
15648
  Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
15649
15649
  Invocations: timesInvoked,
@@ -15701,8 +15701,8 @@ var require_mock_agent = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
15701
15701
  const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
15702
15702
  const dispatchOpts = { ...opts };
15703
15703
  if (acceptNonStandardSearchParameters && dispatchOpts.path) {
15704
- const [path$2, searchParams] = dispatchOpts.path.split("?");
15705
- dispatchOpts.path = `${path$2}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
15704
+ const [path$1, searchParams] = dispatchOpts.path.split("?");
15705
+ dispatchOpts.path = `${path$1}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
15706
15706
  }
15707
15707
  return this[kAgent].dispatch(dispatchOpts, handler);
15708
15708
  }
@@ -16179,10 +16179,10 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
16179
16179
  * @return {Promise<void>} - Resolves when snapshots are loaded
16180
16180
  */
16181
16181
  async loadSnapshots(filePath) {
16182
- const path$2 = filePath || this.#snapshotPath;
16183
- if (!path$2) throw new InvalidArgumentError$6("Snapshot path is required");
16182
+ const path$1 = filePath || this.#snapshotPath;
16183
+ if (!path$1) throw new InvalidArgumentError$6("Snapshot path is required");
16184
16184
  try {
16185
- const data$1 = await readFile(resolve$3(path$2), "utf8");
16185
+ const data$1 = await readFile(resolve$3(path$1), "utf8");
16186
16186
  const parsed = JSON.parse(data$1);
16187
16187
  if (Array.isArray(parsed)) {
16188
16188
  this.#snapshots.clear();
@@ -16190,7 +16190,7 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
16190
16190
  } else this.#snapshots = new Map(Object.entries(parsed));
16191
16191
  } catch (error) {
16192
16192
  if (error.code === "ENOENT") this.#snapshots.clear();
16193
- else throw new UndiciError$1(`Failed to load snapshots from ${path$2}`, { cause: error });
16193
+ else throw new UndiciError$1(`Failed to load snapshots from ${path$1}`, { cause: error });
16194
16194
  }
16195
16195
  }
16196
16196
  /**
@@ -16200,9 +16200,9 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
16200
16200
  * @returns {Promise<void>} - Resolves when snapshots are saved
16201
16201
  */
16202
16202
  async saveSnapshots(filePath) {
16203
- const path$2 = filePath || this.#snapshotPath;
16204
- if (!path$2) throw new InvalidArgumentError$6("Snapshot path is required");
16205
- const resolvedPath = resolve$3(path$2);
16203
+ const path$1 = filePath || this.#snapshotPath;
16204
+ if (!path$1) throw new InvalidArgumentError$6("Snapshot path is required");
16205
+ const resolvedPath = resolve$3(path$1);
16206
16206
  await mkdir(dirname$2(resolvedPath), { recursive: true });
16207
16207
  const data$1 = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
16208
16208
  hash,
@@ -16769,11 +16769,11 @@ var require_redirect_handler = /* @__PURE__ */ __commonJS$1({ "../../node_module
16769
16769
  return;
16770
16770
  }
16771
16771
  const { origin, pathname, search } = util$10.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
16772
- const path$2 = search ? `${pathname}${search}` : pathname;
16773
- const redirectUrlString = `${origin}${path$2}`;
16772
+ const path$1 = search ? `${pathname}${search}` : pathname;
16773
+ const redirectUrlString = `${origin}${path$1}`;
16774
16774
  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.`);
16775
16775
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
16776
- this.opts.path = path$2;
16776
+ this.opts.path = path$1;
16777
16777
  this.opts.origin = origin;
16778
16778
  this.opts.query = null;
16779
16779
  }
@@ -21731,10 +21731,10 @@ var require_fetch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/und
21731
21731
  const url = requestCurrentURL(request$2);
21732
21732
  /** @type {import('../../..').Agent} */
21733
21733
  const agent = fetchParams.controller.dispatcher;
21734
- const path$2 = url.pathname + url.search;
21734
+ const path$1 = url.pathname + url.search;
21735
21735
  const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
21736
21736
  return new Promise((resolve$4, reject) => agent.dispatch({
21737
- path: hasTrailingQuestionMark ? `${path$2}?` : path$2,
21737
+ path: hasTrailingQuestionMark ? `${path$1}?` : path$1,
21738
21738
  origin: url.origin,
21739
21739
  method: request$2.method,
21740
21740
  body: agent.isMockActive ? request$2.body && (request$2.body.source || request$2.body.stream) : body,
@@ -22516,9 +22516,9 @@ var require_util$2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
22516
22516
  * path-value = <any CHAR except CTLs or ";">
22517
22517
  * @param {string} path
22518
22518
  */
22519
- function validateCookiePath(path$2) {
22520
- for (let i$1 = 0; i$1 < path$2.length; ++i$1) {
22521
- const code = path$2.charCodeAt(i$1);
22519
+ function validateCookiePath(path$1) {
22520
+ for (let i$1 = 0; i$1 < path$1.length; ++i$1) {
22521
+ const code = path$1.charCodeAt(i$1);
22522
22522
  if (code < 32 || code === 127 || code === 59) throw new Error("Invalid cookie path");
22523
22523
  }
22524
22524
  }
@@ -25626,9 +25626,9 @@ var require_undici = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
25626
25626
  if (opts != null && typeof opts !== "object") throw new InvalidArgumentError("invalid opts");
25627
25627
  if (opts && opts.path != null) {
25628
25628
  if (typeof opts.path !== "string") throw new InvalidArgumentError("invalid opts.path");
25629
- let path$2 = opts.path;
25630
- if (!opts.path.startsWith("/")) path$2 = `/${path$2}`;
25631
- url = new URL(util$3.parseOrigin(url).origin + path$2);
25629
+ let path$1 = opts.path;
25630
+ if (!opts.path.startsWith("/")) path$1 = `/${path$1}`;
25631
+ url = new URL(util$3.parseOrigin(url).origin + path$1);
25632
25632
  } else {
25633
25633
  if (!opts) opts = typeof url === "object" ? url : {};
25634
25634
  url = util$3.parseURL(url);
@@ -25745,7 +25745,7 @@ var require_XDGAppPaths = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8
25745
25745
  }
25746
25746
  __name(typeOf, "typeOf");
25747
25747
  function Adapt(adapter_) {
25748
- var meta = adapter_.meta, path4 = adapter_.path, xdg = adapter_.xdg;
25748
+ var meta = adapter_.meta, path5 = adapter_.path, xdg = adapter_.xdg;
25749
25749
  return { XDGAppPaths: new (/* @__PURE__ */ function() {
25750
25750
  function XDGAppPaths_2(options_) {
25751
25751
  if (options_ === void 0) options_ = {};
@@ -25763,7 +25763,7 @@ var require_XDGAppPaths = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8
25763
25763
  meta.pkgMainFilename(),
25764
25764
  meta.mainFilename()
25765
25765
  ];
25766
- var name = path4.parse(((_c = namePriorityList.find(function(e2) {
25766
+ var name = path5.parse(((_c = namePriorityList.find(function(e2) {
25767
25767
  return isString2(e2);
25768
25768
  })) !== null && _c !== void 0 ? _c : "$eval") + suffix).name;
25769
25769
  XDGAppPaths.$name = /* @__PURE__ */ __name(function $name() {
@@ -25783,28 +25783,28 @@ var require_XDGAppPaths = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8
25783
25783
  }
25784
25784
  __name(finalPathSegment, "finalPathSegment");
25785
25785
  XDGAppPaths.cache = /* @__PURE__ */ __name(function cache$2(dirOptions) {
25786
- return path4.join(xdg.cache(), finalPathSegment(dirOptions));
25786
+ return path5.join(xdg.cache(), finalPathSegment(dirOptions));
25787
25787
  }, "cache");
25788
25788
  XDGAppPaths.config = /* @__PURE__ */ __name(function config(dirOptions) {
25789
- return path4.join(xdg.config(), finalPathSegment(dirOptions));
25789
+ return path5.join(xdg.config(), finalPathSegment(dirOptions));
25790
25790
  }, "config");
25791
25791
  XDGAppPaths.data = /* @__PURE__ */ __name(function data$1(dirOptions) {
25792
- return path4.join(xdg.data(), finalPathSegment(dirOptions));
25792
+ return path5.join(xdg.data(), finalPathSegment(dirOptions));
25793
25793
  }, "data");
25794
25794
  XDGAppPaths.runtime = /* @__PURE__ */ __name(function runtime(dirOptions) {
25795
- return xdg.runtime() ? path4.join(xdg.runtime(), finalPathSegment(dirOptions)) : void 0;
25795
+ return xdg.runtime() ? path5.join(xdg.runtime(), finalPathSegment(dirOptions)) : void 0;
25796
25796
  }, "runtime");
25797
25797
  XDGAppPaths.state = /* @__PURE__ */ __name(function state(dirOptions) {
25798
- return path4.join(xdg.state(), finalPathSegment(dirOptions));
25798
+ return path5.join(xdg.state(), finalPathSegment(dirOptions));
25799
25799
  }, "state");
25800
25800
  XDGAppPaths.configDirs = /* @__PURE__ */ __name(function configDirs(dirOptions) {
25801
25801
  return xdg.configDirs().map(function(s) {
25802
- return path4.join(s, finalPathSegment(dirOptions));
25802
+ return path5.join(s, finalPathSegment(dirOptions));
25803
25803
  });
25804
25804
  }, "configDirs");
25805
25805
  XDGAppPaths.dataDirs = /* @__PURE__ */ __name(function dataDirs(dirOptions) {
25806
25806
  return xdg.dataDirs().map(function(s) {
25807
- return path4.join(s, finalPathSegment(dirOptions));
25807
+ return path5.join(s, finalPathSegment(dirOptions));
25808
25808
  });
25809
25809
  }, "dataDirs");
25810
25810
  return XDGAppPaths;
@@ -25824,7 +25824,7 @@ var require_XDG = __commonJS({ "../../node_modules/.pnpm/xdg-portable@10.6.0/nod
25824
25824
  exports$1.__esModule = true;
25825
25825
  exports$1.Adapt = void 0;
25826
25826
  function Adapt(adapter_) {
25827
- var env$1 = adapter_.env, osPaths = adapter_.osPaths, path4 = adapter_.path;
25827
+ var env$1 = adapter_.env, osPaths = adapter_.osPaths, path5 = adapter_.path;
25828
25828
  var isMacOS = /^darwin$/i.test(adapter_.process.platform);
25829
25829
  var isWinOS = /^win/i.test(adapter_.process.platform);
25830
25830
  function baseDir() {
@@ -25832,7 +25832,7 @@ var require_XDG = __commonJS({ "../../node_modules/.pnpm/xdg-portable@10.6.0/nod
25832
25832
  }
25833
25833
  __name(baseDir, "baseDir");
25834
25834
  function valOrPath(val, pathSegments) {
25835
- return val || path4.join.apply(path4, pathSegments);
25835
+ return val || path5.join.apply(path5, pathSegments);
25836
25836
  }
25837
25837
  __name(valOrPath, "valOrPath");
25838
25838
  var linux = /* @__PURE__ */ __name(function() {
@@ -25946,11 +25946,11 @@ var require_XDG = __commonJS({ "../../node_modules/.pnpm/xdg-portable@10.6.0/nod
25946
25946
  XDG.state = extension.state;
25947
25947
  XDG.configDirs = /* @__PURE__ */ __name(function configDirs() {
25948
25948
  var pathList = env$1.get("XDG_CONFIG_DIRS");
25949
- return __spreadArray([extension.config()], pathList ? pathList.split(path4.delimiter) : []);
25949
+ return __spreadArray([extension.config()], pathList ? pathList.split(path5.delimiter) : []);
25950
25950
  }, "configDirs");
25951
25951
  XDG.dataDirs = /* @__PURE__ */ __name(function dataDirs() {
25952
25952
  var pathList = env$1.get("XDG_DATA_DIRS");
25953
- return __spreadArray([extension.data()], pathList ? pathList.split(path4.delimiter) : []);
25953
+ return __spreadArray([extension.data()], pathList ? pathList.split(path5.delimiter) : []);
25954
25954
  }, "dataDirs");
25955
25955
  return XDG;
25956
25956
  }
@@ -25973,7 +25973,7 @@ var require_OSPaths = __commonJS({ "../../node_modules/.pnpm/os-paths@7.4.0/node
25973
25973
  }
25974
25974
  __name(isEmpty, "isEmpty");
25975
25975
  function Adapt(adapter_) {
25976
- var env$1 = adapter_.env, os2 = adapter_.os, path4 = adapter_.path;
25976
+ var env$1 = adapter_.env, os2 = adapter_.os, path5 = adapter_.path;
25977
25977
  var isWinOS = /^win/i.test(adapter_.process.platform);
25978
25978
  function normalizePath$2(path_) {
25979
25979
  return path_ ? adapter_.path.normalize(adapter_.path.join(path_, ".")) : void 0;
@@ -25985,7 +25985,7 @@ var require_OSPaths = __commonJS({ "../../node_modules/.pnpm/os-paths@7.4.0/node
25985
25985
  typeof os2.homedir === "function" ? os2.homedir() : void 0,
25986
25986
  env$1.get("USERPROFILE"),
25987
25987
  env$1.get("HOME"),
25988
- env$1.get("HOMEDRIVE") || env$1.get("HOMEPATH") ? path4.join(env$1.get("HOMEDRIVE") || "", env$1.get("HOMEPATH") || "") : void 0
25988
+ env$1.get("HOMEDRIVE") || env$1.get("HOMEPATH") ? path5.join(env$1.get("HOMEDRIVE") || "", env$1.get("HOMEPATH") || "") : void 0
25989
25989
  ].find(function(v) {
25990
25990
  return !isEmpty(v);
25991
25991
  }));
@@ -25996,7 +25996,7 @@ var require_OSPaths = __commonJS({ "../../node_modules/.pnpm/os-paths@7.4.0/node
25996
25996
  __name(home, "home");
25997
25997
  function temp() {
25998
25998
  function joinPathToBase(base, segments) {
25999
- return base ? path4.join.apply(path4, __spreadArray([base], segments)) : void 0;
25999
+ return base ? path5.join.apply(path5, __spreadArray([base], segments)) : void 0;
26000
26000
  }
26001
26001
  __name(joinPathToBase, "joinPathToBase");
26002
26002
  function posix$1() {
@@ -26101,14 +26101,14 @@ var require_node = __commonJS({ "../../node_modules/.pnpm/os-paths@7.4.0/node_mo
26101
26101
  exports$1.__esModule = true;
26102
26102
  exports$1.adapter = void 0;
26103
26103
  var os2 = __importStar(__require$1("os"));
26104
- var path4 = __importStar(__require$1("path"));
26104
+ var path5 = __importStar(__require$1("path"));
26105
26105
  exports$1.adapter = {
26106
26106
  atImportPermissions: { env: true },
26107
26107
  env: { get: /* @__PURE__ */ __name(function(s) {
26108
26108
  return process.env[s];
26109
26109
  }, "get") },
26110
26110
  os: os2,
26111
- path: path4,
26111
+ path: path5,
26112
26112
  process
26113
26113
  };
26114
26114
  } });
@@ -26152,7 +26152,7 @@ var require_node2 = __commonJS({ "../../node_modules/.pnpm/xdg-portable@10.6.0/n
26152
26152
  };
26153
26153
  exports$1.__esModule = true;
26154
26154
  exports$1.adapter = void 0;
26155
- var path4 = __importStar(__require$1("path"));
26155
+ var path5 = __importStar(__require$1("path"));
26156
26156
  var os_paths_1 = __importDefault(require_mod_cjs());
26157
26157
  exports$1.adapter = {
26158
26158
  atImportPermissions: { env: true },
@@ -26160,7 +26160,7 @@ var require_node2 = __commonJS({ "../../node_modules/.pnpm/xdg-portable@10.6.0/n
26160
26160
  return process.env[s];
26161
26161
  }, "get") },
26162
26162
  osPaths: os_paths_1["default"],
26163
- path: path4,
26163
+ path: path5,
26164
26164
  process
26165
26165
  };
26166
26166
  } });
@@ -26204,7 +26204,7 @@ var require_node3 = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8.3.0/n
26204
26204
  };
26205
26205
  exports$1.__esModule = true;
26206
26206
  exports$1.adapter = void 0;
26207
- var path4 = __importStar(__require$1("path"));
26207
+ var path5 = __importStar(__require$1("path"));
26208
26208
  var xdg_portable_1 = __importDefault(require_mod_cjs2());
26209
26209
  exports$1.adapter = {
26210
26210
  atImportPermissions: {
@@ -26220,7 +26220,7 @@ var require_node3 = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8.3.0/n
26220
26220
  return process.pkg ? process.execPath : void 0;
26221
26221
  }, "pkgMainFilename")
26222
26222
  },
26223
- path: path4,
26223
+ path: path5,
26224
26224
  process,
26225
26225
  xdg: xdg_portable_1["default"]
26226
26226
  };
@@ -26230,14 +26230,147 @@ var require_mod_cjs3 = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8.3.
26230
26230
  var node_js_1 = require_node3();
26231
26231
  module$1.exports = XDGAppPaths_js_1.Adapt(node_js_1.adapter).XDGAppPaths;
26232
26232
  } });
26233
+ var require_signals = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports$1, module$1) {
26234
+ module$1.exports = [
26235
+ "SIGABRT",
26236
+ "SIGALRM",
26237
+ "SIGHUP",
26238
+ "SIGINT",
26239
+ "SIGTERM"
26240
+ ];
26241
+ if (process.platform !== "win32") module$1.exports.push("SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
26242
+ if (process.platform === "linux") module$1.exports.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT", "SIGUNUSED");
26243
+ } });
26244
+ var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports$1, module$1) {
26245
+ var process2 = global.process;
26246
+ var processOk = /* @__PURE__ */ __name(function(process3) {
26247
+ return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
26248
+ }, "processOk");
26249
+ if (!processOk(process2)) module$1.exports = function() {
26250
+ return function() {};
26251
+ };
26252
+ else {
26253
+ assert2 = __require$1("assert");
26254
+ signals = require_signals();
26255
+ isWin$1 = /^win/i.test(process2.platform);
26256
+ EE$3 = __require$1("events");
26257
+ if (typeof EE$3 !== "function") EE$3 = EE$3.EventEmitter;
26258
+ if (process2.__signal_exit_emitter__) emitter = process2.__signal_exit_emitter__;
26259
+ else {
26260
+ emitter = process2.__signal_exit_emitter__ = new EE$3();
26261
+ emitter.count = 0;
26262
+ emitter.emitted = {};
26263
+ }
26264
+ if (!emitter.infinite) {
26265
+ emitter.setMaxListeners(Infinity);
26266
+ emitter.infinite = true;
26267
+ }
26268
+ module$1.exports = function(cb, opts) {
26269
+ if (!processOk(global.process)) return function() {};
26270
+ assert2.equal(typeof cb, "function", "a callback must be provided for exit handler");
26271
+ if (loaded === false) load();
26272
+ var ev = "exit";
26273
+ if (opts && opts.alwaysLast) ev = "afterexit";
26274
+ var remove = /* @__PURE__ */ __name(function() {
26275
+ emitter.removeListener(ev, cb);
26276
+ if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) unload();
26277
+ }, "remove");
26278
+ emitter.on(ev, cb);
26279
+ return remove;
26280
+ };
26281
+ unload = /* @__PURE__ */ __name(function unload2() {
26282
+ if (!loaded || !processOk(global.process)) return;
26283
+ loaded = false;
26284
+ signals.forEach(function(sig) {
26285
+ try {
26286
+ process2.removeListener(sig, sigListeners[sig]);
26287
+ } catch (er) {}
26288
+ });
26289
+ process2.emit = originalProcessEmit;
26290
+ process2.reallyExit = originalProcessReallyExit;
26291
+ emitter.count -= 1;
26292
+ }, "unload");
26293
+ module$1.exports.unload = unload;
26294
+ emit = /* @__PURE__ */ __name(function emit2(event, code, signal) {
26295
+ if (emitter.emitted[event]) return;
26296
+ emitter.emitted[event] = true;
26297
+ emitter.emit(event, code, signal);
26298
+ }, "emit");
26299
+ sigListeners = {};
26300
+ signals.forEach(function(sig) {
26301
+ sigListeners[sig] = /* @__PURE__ */ __name(function listener() {
26302
+ if (!processOk(global.process)) return;
26303
+ if (process2.listeners(sig).length === emitter.count) {
26304
+ unload();
26305
+ emit("exit", null, sig);
26306
+ emit("afterexit", null, sig);
26307
+ if (isWin$1 && sig === "SIGHUP") sig = "SIGINT";
26308
+ process2.kill(process2.pid, sig);
26309
+ }
26310
+ }, "listener");
26311
+ });
26312
+ module$1.exports.signals = function() {
26313
+ return signals;
26314
+ };
26315
+ loaded = false;
26316
+ load = /* @__PURE__ */ __name(function load2() {
26317
+ if (loaded || !processOk(global.process)) return;
26318
+ loaded = true;
26319
+ emitter.count += 1;
26320
+ signals = signals.filter(function(sig) {
26321
+ try {
26322
+ process2.on(sig, sigListeners[sig]);
26323
+ return true;
26324
+ } catch (er) {
26325
+ return false;
26326
+ }
26327
+ });
26328
+ process2.emit = processEmit;
26329
+ process2.reallyExit = processReallyExit;
26330
+ }, "load");
26331
+ module$1.exports.load = load;
26332
+ originalProcessReallyExit = process2.reallyExit;
26333
+ processReallyExit = /* @__PURE__ */ __name(function processReallyExit2(code) {
26334
+ if (!processOk(global.process)) return;
26335
+ process2.exitCode = code || 0;
26336
+ emit("exit", process2.exitCode, null);
26337
+ emit("afterexit", process2.exitCode, null);
26338
+ originalProcessReallyExit.call(process2, process2.exitCode);
26339
+ }, "processReallyExit");
26340
+ originalProcessEmit = process2.emit;
26341
+ processEmit = /* @__PURE__ */ __name(function processEmit2(ev, arg) {
26342
+ if (ev === "exit" && processOk(global.process)) {
26343
+ if (arg !== void 0) process2.exitCode = arg;
26344
+ var ret = originalProcessEmit.apply(this, arguments);
26345
+ emit("exit", process2.exitCode, null);
26346
+ emit("afterexit", process2.exitCode, null);
26347
+ return ret;
26348
+ } else return originalProcessEmit.apply(this, arguments);
26349
+ }, "processEmit");
26350
+ }
26351
+ var assert2;
26352
+ var signals;
26353
+ var isWin$1;
26354
+ var EE$3;
26355
+ var emitter;
26356
+ var unload;
26357
+ var emit;
26358
+ var sigListeners;
26359
+ var loaded;
26360
+ var load;
26361
+ var originalProcessReallyExit;
26362
+ var processReallyExit;
26363
+ var originalProcessEmit;
26364
+ var processEmit;
26365
+ } });
26233
26366
  var require_command_exists = __commonJS({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports$1, module$1) {
26234
26367
  var exec = __require$1("child_process").exec;
26235
26368
  var execSync = __require$1("child_process").execSync;
26236
- var fs2 = __require$1("fs");
26237
- var path4 = __require$1("path");
26238
- var access = fs2.access;
26239
- var accessSync2 = fs2.accessSync;
26240
- var constants2 = fs2.constants || fs2;
26369
+ var fs3 = __require$1("fs");
26370
+ var path5 = __require$1("path");
26371
+ var access = fs3.access;
26372
+ var accessSync2 = fs3.accessSync;
26373
+ var constants2 = fs3.constants || fs3;
26241
26374
  var isUsingWindows = process.platform == "win32";
26242
26375
  var fileNotExists = /* @__PURE__ */ __name(function(commandName, callback$1) {
26243
26376
  access(commandName, constants2.F_OK, function(err) {
@@ -26311,8 +26444,8 @@ var require_command_exists = __commonJS({ "../../node_modules/.pnpm/command-exis
26311
26444
  }, "cleanInput");
26312
26445
  if (isUsingWindows) cleanInput = /* @__PURE__ */ __name(function(s) {
26313
26446
  if (/[\\]/.test(s)) {
26314
- var dirname2 = "\"" + path4.dirname(s) + "\"";
26315
- var basename$1 = "\"" + path4.basename(s) + "\"";
26447
+ var dirname2 = "\"" + path5.dirname(s) + "\"";
26448
+ var basename$1 = "\"" + path5.basename(s) + "\"";
26316
26449
  return dirname2 + ":" + basename$1;
26317
26450
  }
26318
26451
  return "\"" + s + "\"";
@@ -26728,8 +26861,8 @@ function getErrorMap$1() {
26728
26861
  }
26729
26862
  __name(getErrorMap$1, "getErrorMap");
26730
26863
  var makeIssue$1 = /* @__PURE__ */ __name((params) => {
26731
- const { data: data$1, path: path4, errorMaps, issueData } = params;
26732
- const fullPath = [...path4, ...issueData.path || []];
26864
+ const { data: data$1, path: path5, errorMaps, issueData } = params;
26865
+ const fullPath = [...path5, ...issueData.path || []];
26733
26866
  const fullIssue = {
26734
26867
  ...issueData,
26735
26868
  path: fullPath
@@ -26833,11 +26966,11 @@ var ParseInputLazyPath$1 = class {
26833
26966
  static {
26834
26967
  __name(this, "ParseInputLazyPath");
26835
26968
  }
26836
- constructor(parent, value, path4, key) {
26969
+ constructor(parent, value, path5, key) {
26837
26970
  this._cachedPath = [];
26838
26971
  this.parent = parent;
26839
26972
  this.data = value;
26840
- this._path = path4;
26973
+ this._path = path5;
26841
26974
  this._key = key;
26842
26975
  }
26843
26976
  get path() {
@@ -30004,7 +30137,7 @@ __reExport(mod_esm_exports, __toESM(require_mod_cjs3(), 1));
30004
30137
  var mod_esm_default = import_mod_cjs.default;
30005
30138
  function getGlobalWranglerConfigPath() {
30006
30139
  const configDir = mod_esm_default(".wrangler").config();
30007
- const legacyConfigDir = path.join(os.homedir(), ".wrangler");
30140
+ const legacyConfigDir = path3.join(os.homedir(), ".wrangler");
30008
30141
  if (isDirectory(legacyConfigDir)) return legacyConfigDir;
30009
30142
  else return configDir;
30010
30143
  }
@@ -30100,7 +30233,7 @@ var getBuildPlatformFromEnv = getEnvironmentVariableFactory({ variableName: "WRA
30100
30233
  var getRegistryPath = getEnvironmentVariableFactory({
30101
30234
  variableName: "WRANGLER_REGISTRY_PATH",
30102
30235
  defaultValue() {
30103
- return path.join(getGlobalWranglerConfigPath(), "registry");
30236
+ return path3.join(getGlobalWranglerConfigPath(), "registry");
30104
30237
  }
30105
30238
  });
30106
30239
  var getD1ExtraLocationChoices = getEnvironmentVariableFactory({ variableName: "WRANGLER_D1_EXTRA_LOCATION_CHOICES" });
@@ -30242,9 +30375,9 @@ Please add "${field}" to "env.${envName}".`);
30242
30375
  return rawEnv[field] ?? defaultValue;
30243
30376
  }
30244
30377
  __name(notInheritable, "notInheritable");
30245
- function unwindPropertyPath(root, path4) {
30378
+ function unwindPropertyPath(root, path5) {
30246
30379
  let container = root;
30247
- const parts = path4.split(".");
30380
+ const parts = path5.split(".");
30248
30381
  for (let i$1 = 0; i$1 < parts.length - 1; i$1++) {
30249
30382
  if (!hasProperty(container, parts[i$1])) return;
30250
30383
  container = container[parts[i$1]];
@@ -30512,7 +30645,7 @@ function isPagesConfig(rawConfig) {
30512
30645
  }
30513
30646
  __name(isPagesConfig, "isPagesConfig");
30514
30647
  function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
30515
- const diagnostics = new Diagnostics(`Processing ${configPath ? path.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
30648
+ const diagnostics = new Diagnostics(`Processing ${configPath ? path3.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
30516
30649
  validateOptionalProperty(diagnostics, "", "legacy_env", rawConfig.legacy_env, "boolean");
30517
30650
  validateOptionalProperty(diagnostics, "", "send_metrics", rawConfig.send_metrics, "boolean");
30518
30651
  validateOptionalProperty(diagnostics, "", "keep_vars", rawConfig.keep_vars, "boolean");
@@ -30616,34 +30749,34 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
30616
30749
  else validateOptionalProperty(diagnostics, "build", "watch_dir", watch_dir, "string");
30617
30750
  return {
30618
30751
  command,
30619
- watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir) => path.relative(process.cwd(), path.join(path.dirname(configPath), `${dir}`))) : path.relative(process.cwd(), path.join(path.dirname(configPath), `${watch_dir}`)) : watch_dir,
30752
+ watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir) => path3.relative(process.cwd(), path3.join(path3.dirname(configPath), `${dir}`))) : path3.relative(process.cwd(), path3.join(path3.dirname(configPath), `${watch_dir}`)) : watch_dir,
30620
30753
  cwd
30621
30754
  };
30622
30755
  }
30623
30756
  __name(normalizeAndValidateBuild, "normalizeAndValidateBuild");
30624
30757
  function normalizeAndValidateMainField(configPath, rawMain) {
30625
- const configDir = path.dirname(configPath ?? "wrangler.toml");
30758
+ const configDir = path3.dirname(configPath ?? "wrangler.toml");
30626
30759
  if (rawMain !== void 0) if (typeof rawMain === "string") {
30627
- const directory = path.resolve(configDir);
30628
- return path.resolve(directory, rawMain);
30760
+ const directory = path3.resolve(configDir);
30761
+ return path3.resolve(directory, rawMain);
30629
30762
  } else return rawMain;
30630
30763
  else return;
30631
30764
  }
30632
30765
  __name(normalizeAndValidateMainField, "normalizeAndValidateMainField");
30633
30766
  function normalizeAndValidateBaseDirField(configPath, rawDir) {
30634
- const configDir = path.dirname(configPath ?? "wrangler.toml");
30767
+ const configDir = path3.dirname(configPath ?? "wrangler.toml");
30635
30768
  if (rawDir !== void 0) if (typeof rawDir === "string") {
30636
- const directory = path.resolve(configDir);
30637
- return path.resolve(directory, rawDir);
30769
+ const directory = path3.resolve(configDir);
30770
+ return path3.resolve(directory, rawDir);
30638
30771
  } else return rawDir;
30639
30772
  else return;
30640
30773
  }
30641
30774
  __name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
30642
30775
  function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
30643
- const configDir = path.dirname(configPath ?? "wrangler.toml");
30776
+ const configDir = path3.dirname(configPath ?? "wrangler.toml");
30644
30777
  if (rawPagesDir !== void 0) if (typeof rawPagesDir === "string") {
30645
- const directory = path.resolve(configDir);
30646
- return path.resolve(directory, rawPagesDir);
30778
+ const directory = path3.resolve(configDir);
30779
+ return path3.resolve(directory, rawPagesDir);
30647
30780
  } else return rawPagesDir;
30648
30781
  else return;
30649
30782
  }
@@ -30696,7 +30829,7 @@ function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryP
30696
30829
  validateOptionalProperty(diagnostics, "site", "entry-point", rawConfig.site["entry-point"], "string");
30697
30830
  deprecated(diagnostics, rawConfig, `site.entry-point`, `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
30698
30831
  \`\`\`
30699
- main = "${path.join(String(rawConfig.site["entry-point"]) || "workers-site", path.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js")}"
30832
+ main = "${path3.join(String(rawConfig.site["entry-point"]) || "workers-site", path3.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js")}"
30700
30833
  \`\`\``, false, void 0, "warning");
30701
30834
  let siteEntryPoint = rawConfig.site["entry-point"];
30702
30835
  if (!mainEntryPoint && !siteEntryPoint) {
@@ -30709,7 +30842,7 @@ main = "workers-site/index.js"
30709
30842
  } else if (mainEntryPoint && siteEntryPoint) diagnostics.errors.push(`Don't define both the \`main\` and \`site.entry-point\` fields in your configuration.
30710
30843
  They serve the same purpose: to point to the entry-point of your worker.
30711
30844
  Delete the deprecated \`site.entry-point\` field from your config.`);
30712
- if (configPath && siteEntryPoint) siteEntryPoint = path.relative(process.cwd(), path.join(path.dirname(configPath), siteEntryPoint));
30845
+ if (configPath && siteEntryPoint) siteEntryPoint = path3.relative(process.cwd(), path3.join(path3.dirname(configPath), siteEntryPoint));
30713
30846
  return {
30714
30847
  bucket,
30715
30848
  "entry-point": siteEntryPoint,
@@ -30741,7 +30874,7 @@ function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapp
30741
30874
  if (rawMapping === void 0) return;
30742
30875
  const mapping = {};
30743
30876
  for (const [name, filePath] of Object.entries(rawMapping)) if (isString$2(diagnostics, `${field}['${name}']`, filePath, void 0)) {
30744
- if (configPath) mapping[name] = configPath ? path.relative(process.cwd(), path.join(path.dirname(configPath), filePath)) : filePath;
30877
+ if (configPath) mapping[name] = configPath ? path3.relative(process.cwd(), path3.join(path3.dirname(configPath), filePath)) : filePath;
30745
30878
  }
30746
30879
  return mapping;
30747
30880
  }
@@ -30989,7 +31122,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
30989
31122
  __name(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment");
30990
31123
  function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) {
30991
31124
  const tsconfig = inheritable(diagnostics, topLevelEnv, rawEnv, "tsconfig", isString$2, void 0);
30992
- return configPath && tsconfig ? path.relative(process.cwd(), path.join(path.dirname(configPath), tsconfig)) : tsconfig;
31125
+ return configPath && tsconfig ? path3.relative(process.cwd(), path3.join(path3.dirname(configPath), tsconfig)) : tsconfig;
30993
31126
  }
30994
31127
  __name(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
30995
31128
  var validateAndNormalizeRules = /* @__PURE__ */ __name((diagnostics, topLevelEnv, rawEnv, envName) => {
@@ -31245,24 +31378,24 @@ var validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value)
31245
31378
  diagnostics.errors.push(`"${field}" bindings should, optionally, have a boolean "remote" field but got ${JSON.stringify(value)}.`);
31246
31379
  isValid2 = false;
31247
31380
  }
31248
- if (hasProperty(value, "schedule") && value.schedule !== void 0) if (typeof value.schedule === "string") {
31249
- if (value.schedule.length === 0) {
31250
- diagnostics.errors.push(`"${field}" bindings "schedule" field must not be an empty string.`);
31381
+ if (hasProperty(value, "schedules") && value.schedules !== void 0) if (typeof value.schedules === "string") {
31382
+ if (value.schedules.length === 0) {
31383
+ diagnostics.errors.push(`"${field}" bindings "schedules" field must not be an empty string.`);
31251
31384
  isValid2 = false;
31252
31385
  }
31253
- } else if (Array.isArray(value.schedule)) {
31254
- if (value.schedule.length === 0) {
31255
- diagnostics.errors.push(`"${field}" bindings "schedule" field must not be an empty array.`);
31386
+ } else if (Array.isArray(value.schedules)) {
31387
+ if (value.schedules.length === 0) {
31388
+ diagnostics.errors.push(`"${field}" bindings "schedules" field must not be an empty array.`);
31256
31389
  isValid2 = false;
31257
- } else if (!value.schedule.every((s) => typeof s === "string")) {
31258
- diagnostics.errors.push(`"${field}" bindings should, optionally, have a string or array of strings "schedule" field but got ${JSON.stringify(value)}.`);
31390
+ } else if (!value.schedules.every((s) => typeof s === "string")) {
31391
+ diagnostics.errors.push(`"${field}" bindings should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(value)}.`);
31259
31392
  isValid2 = false;
31260
- } else if (value.schedule.some((s) => s === "")) {
31261
- diagnostics.errors.push(`"${field}" bindings "schedule" field must not contain empty strings.`);
31393
+ } else if (value.schedules.some((s) => s === "")) {
31394
+ diagnostics.errors.push(`"${field}" bindings "schedules" field must not contain empty strings.`);
31262
31395
  isValid2 = false;
31263
31396
  }
31264
31397
  } else {
31265
- diagnostics.errors.push(`"${field}" bindings should, optionally, have a string or array of strings "schedule" field but got ${JSON.stringify(value)}.`);
31398
+ diagnostics.errors.push(`"${field}" bindings should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(value)}.`);
31266
31399
  isValid2 = false;
31267
31400
  }
31268
31401
  if (hasProperty(value, "limits") && value.limits !== void 0) if (typeof value.limits !== "object" || value.limits === null || Array.isArray(value.limits)) {
@@ -31285,7 +31418,7 @@ var validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value)
31285
31418
  "script_name",
31286
31419
  "remote",
31287
31420
  "limits",
31288
- "schedule"
31421
+ "schedules"
31289
31422
  ]);
31290
31423
  return isValid2;
31291
31424
  }, "validateWorkflowBinding");
@@ -31487,9 +31620,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
31487
31620
  let resolvedBuildContextPath = void 0;
31488
31621
  try {
31489
31622
  if (isDockerfile(resolvedImage, configPath)) {
31490
- const baseDir = configPath ? path.dirname(configPath) : process.cwd();
31491
- resolvedImage = path.resolve(baseDir, resolvedImage);
31492
- resolvedBuildContextPath = containerAppOptional.image_build_context ? path.resolve(baseDir, containerAppOptional.image_build_context) : path.dirname(resolvedImage);
31623
+ const baseDir = configPath ? path3.dirname(configPath) : process.cwd();
31624
+ resolvedImage = path3.resolve(baseDir, resolvedImage);
31625
+ resolvedBuildContextPath = containerAppOptional.image_build_context ? path3.resolve(baseDir, containerAppOptional.image_build_context) : path3.dirname(resolvedImage);
31493
31626
  }
31494
31627
  } catch (err) {
31495
31628
  if (err instanceof Error && err.message) diagnostics.errors.push(err.message);
@@ -32628,9 +32761,9 @@ function isRemoteValid(targetObject, fieldPath, diagnostics) {
32628
32761
  }
32629
32762
  __name(isRemoteValid, "isRemoteValid");
32630
32763
  function isDockerfile(imagePath, configPath) {
32631
- const baseDir = configPath ? path.dirname(configPath) : process.cwd();
32632
- const maybeDockerfile = path.resolve(baseDir, imagePath);
32633
- if (fs.existsSync(maybeDockerfile)) {
32764
+ const baseDir = configPath ? path3.dirname(configPath) : process.cwd();
32765
+ const maybeDockerfile = path3.resolve(baseDir, imagePath);
32766
+ if (fs2.existsSync(maybeDockerfile)) {
32634
32767
  if (isDirectory(maybeDockerfile)) throw new UserError(`${imagePath} is a directory, you should specify a path to the Dockerfile`, { telemetryMessage: false });
32635
32768
  return true;
32636
32769
  }
@@ -32648,6 +32781,53 @@ function isDockerfile(imagePath, configPath) {
32648
32781
  return false;
32649
32782
  }
32650
32783
  __name(isDockerfile, "isDockerfile");
32784
+ var BINDING_LOCAL_SUPPORT = {
32785
+ plain_text: "local-only",
32786
+ secret_text: "local-only",
32787
+ json: "local-only",
32788
+ wasm_module: "local-only",
32789
+ text_blob: "local-only",
32790
+ data_blob: "local-only",
32791
+ version_metadata: "local-only",
32792
+ inherit: "local-only",
32793
+ logfwdr: "local-only",
32794
+ assets: "local-only",
32795
+ unsafe_hello_world: "local-only",
32796
+ durable_object_namespace: "local-only",
32797
+ hyperdrive: "local-only",
32798
+ fetcher: "local-only",
32799
+ analytics_engine: "local-only",
32800
+ secrets_store_secret: "local-only",
32801
+ ratelimit: "local-only",
32802
+ worker_loader: "local-only",
32803
+ kv_namespace: "local-and-remote",
32804
+ r2_bucket: "local-and-remote",
32805
+ d1: "local-and-remote",
32806
+ workflow: "local-and-remote",
32807
+ browser: "local-and-remote",
32808
+ images: "local-and-remote",
32809
+ stream: "local-and-remote",
32810
+ send_email: "local-and-remote",
32811
+ pipeline: "local-and-remote",
32812
+ service: "local-and-remote",
32813
+ queue: "local-and-remote",
32814
+ vectorize: "remote",
32815
+ mtls_certificate: "remote",
32816
+ dispatch_namespace: "remote",
32817
+ ai: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32818
+ ai_search: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32819
+ ai_search_namespace: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32820
+ media: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32821
+ artifacts: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32822
+ flagship: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32823
+ vpc_service: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
32824
+ vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
32825
+ };
32826
+ function getBindingLocalSupport(type) {
32827
+ if (type in BINDING_LOCAL_SUPPORT) return BINDING_LOCAL_SUPPORT[type];
32828
+ return "local-only";
32829
+ }
32830
+ __name(getBindingLocalSupport, "getBindingLocalSupport");
32651
32831
  var supportedPagesConfigFields = [
32652
32832
  "pages_build_output_dir",
32653
32833
  "name",
@@ -32729,6 +32909,54 @@ Pages requires Durable Object bindings to specify the name of the Worker where t
32729
32909
  }
32730
32910
  }
32731
32911
  __name(validateDurableObjectBinding2, "validateDurableObjectBinding");
32912
+ var import_signal_exit = __toESM(require_signal_exit());
32913
+ function getWranglerHiddenDirPath(projectRoot) {
32914
+ projectRoot ??= process.cwd();
32915
+ return path3.join(projectRoot, ".wrangler");
32916
+ }
32917
+ __name(getWranglerHiddenDirPath, "getWranglerHiddenDirPath");
32918
+ var STALE_WRANGLER_TMP_DIR_MS = 1440 * 60 * 1e3;
32919
+ var sweptTmpRoots = /* @__PURE__ */ new Set();
32920
+ function sweepStaleWranglerTmpDirs(tmpRoot) {
32921
+ if (sweptTmpRoots.has(tmpRoot)) return;
32922
+ sweptTmpRoots.add(tmpRoot);
32923
+ let entries;
32924
+ try {
32925
+ entries = fs2.readdirSync(tmpRoot, { withFileTypes: true });
32926
+ } catch {
32927
+ return;
32928
+ }
32929
+ const cutoff = Date.now() - STALE_WRANGLER_TMP_DIR_MS;
32930
+ for (const entry of entries) {
32931
+ if (!entry.isDirectory()) continue;
32932
+ const entryPath = path3.join(tmpRoot, entry.name);
32933
+ try {
32934
+ if (fs2.statSync(entryPath).mtimeMs < cutoff) removeDirSync(entryPath);
32935
+ } catch {}
32936
+ }
32937
+ }
32938
+ __name(sweepStaleWranglerTmpDirs, "sweepStaleWranglerTmpDirs");
32939
+ function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
32940
+ const tmpRoot = path3.join(getWranglerHiddenDirPath(projectRoot), "tmp");
32941
+ fs2.mkdirSync(tmpRoot, { recursive: true });
32942
+ sweepStaleWranglerTmpDirs(tmpRoot);
32943
+ const tmpPrefix = path3.join(tmpRoot, `${prefix}-`);
32944
+ const tmpDir = fs2.realpathSync(fs2.mkdtempSync(tmpPrefix));
32945
+ const cleanupDir = /* @__PURE__ */ __name(() => {
32946
+ if (cleanup) try {
32947
+ removeDirSync(tmpDir);
32948
+ } catch {}
32949
+ }, "cleanupDir");
32950
+ const removeExitListener = (0, import_signal_exit.default)(cleanupDir);
32951
+ return {
32952
+ path: tmpDir,
32953
+ remove() {
32954
+ removeExitListener();
32955
+ cleanupDir();
32956
+ }
32957
+ };
32958
+ }
32959
+ __name(getWranglerTmpDir, "getWranglerTmpDir");
32732
32960
  var import_command_exists = __toESM(require_command_exists2());
32733
32961
  var UPDATE_SERVICE_URL = "https://update.argotunnel.com";
32734
32962
  var CLOUDFLARED_VERSION_PATTERN = /^\d{4}\.\d+\.\d+$/;
@@ -35533,8 +35761,8 @@ const postfixRE = /[?#].*$/;
35533
35761
  function cleanUrl(url) {
35534
35762
  return url.replace(postfixRE, "");
35535
35763
  }
35536
- function withTrailingSlash(path$2) {
35537
- return path$2.endsWith("/") ? path$2 : `${path$2}/`;
35764
+ function withTrailingSlash(path$1) {
35765
+ return path$1.endsWith("/") ? path$1 : `${path$1}/`;
35538
35766
  }
35539
35767
  function createRequestHandler(handler) {
35540
35768
  return async (req, res, next) => {
@@ -35910,53 +36138,34 @@ function getDeployConfigPath(root) {
35910
36138
  }
35911
36139
  function getWorkerConfigs(root, isPrerender) {
35912
36140
  const deployConfigPath = getDeployConfigPath(root);
35913
- const deployConfig = JSON.parse(fs$2.readFileSync(deployConfigPath, "utf-8"));
35914
- return [
35915
- ...isPrerender && deployConfig.prerenderWorkerConfigPath ? [{ configPath: deployConfig.prerenderWorkerConfigPath }] : [],
35916
- { configPath: deployConfig.configPath },
35917
- ...deployConfig.auxiliaryWorkers
35918
- ].map(({ configPath }) => {
36141
+ const deployConfig = JSON.parse(fs$1.readFileSync(deployConfigPath, "utf-8"));
36142
+ return [...isPrerender && deployConfig.prerenderWorkerConfigPath ? [{ configPath: deployConfig.prerenderWorkerConfigPath }] : [{ configPath: deployConfig.configPath }], ...deployConfig.auxiliaryWorkers].map(({ configPath }) => {
35919
36143
  const resolvedConfigPath = nodePath.resolve(nodePath.dirname(deployConfigPath), configPath);
35920
36144
  return wrangler.unstable_readConfig({ config: resolvedConfigPath });
35921
36145
  });
35922
36146
  }
35923
- function getRelativePathToWorkerConfig(deployConfigDirectory, root, outputDirectory) {
35924
- return nodePath.relative(deployConfigDirectory, nodePath.resolve(root, outputDirectory, "wrangler.json"));
35925
- }
35926
- function writeDeployConfig(resolvedPluginConfig, resolvedViteConfig) {
36147
+ function writeDeployConfig(resolvedPluginConfig, resolvedViteConfig, isAssetsOnly) {
35927
36148
  const deployConfigPath = getDeployConfigPath(resolvedViteConfig.root);
35928
36149
  const deployConfigDirectory = nodePath.dirname(deployConfigPath);
35929
- fs$2.mkdirSync(deployConfigDirectory, { recursive: true });
35930
- if (resolvedPluginConfig.type === "assets-only") {
35931
- const clientOutputDirectory = resolvedViteConfig.environments.client?.build.outDir;
35932
- assert(clientOutputDirectory, "Unexpected error: client environment output directory is undefined");
35933
- const prerenderOutputDirectory = resolvedPluginConfig.prerenderWorkerEnvironmentName ? resolvedViteConfig.environments[resolvedPluginConfig.prerenderWorkerEnvironmentName]?.build.outDir : void 0;
35934
- const deployConfig = {
35935
- configPath: getRelativePathToWorkerConfig(deployConfigDirectory, resolvedViteConfig.root, clientOutputDirectory),
35936
- auxiliaryWorkers: [],
35937
- prerenderWorkerConfigPath: prerenderOutputDirectory ? getRelativePathToWorkerConfig(deployConfigDirectory, resolvedViteConfig.root, prerenderOutputDirectory) : void 0
35938
- };
35939
- fs$2.writeFileSync(deployConfigPath, JSON.stringify(deployConfig));
35940
- } else {
35941
- let entryWorkerConfigPath;
35942
- let prerenderWorkerConfigPath;
35943
- const auxiliaryWorkers = [];
35944
- for (const environmentName of resolvedPluginConfig.environmentNameToWorkerMap.keys()) {
35945
- const outputDirectory = resolvedViteConfig.environments[environmentName]?.build.outDir;
35946
- assert(outputDirectory, `Unexpected error: ${environmentName} environment output directory is undefined`);
35947
- const configPath = getRelativePathToWorkerConfig(deployConfigDirectory, resolvedViteConfig.root, outputDirectory);
35948
- if (environmentName === resolvedPluginConfig.entryWorkerEnvironmentName) entryWorkerConfigPath = configPath;
35949
- else if (environmentName === resolvedPluginConfig.prerenderWorkerEnvironmentName) prerenderWorkerConfigPath = configPath;
35950
- else auxiliaryWorkers.push({ configPath });
35951
- }
35952
- assert(entryWorkerConfigPath, `Unexpected error: entryWorkerConfigPath is undefined`);
35953
- const deployConfig = {
35954
- configPath: entryWorkerConfigPath,
35955
- auxiliaryWorkers,
35956
- prerenderWorkerConfigPath
35957
- };
35958
- fs$2.writeFileSync(deployConfigPath, JSON.stringify(deployConfig));
36150
+ fs$1.mkdirSync(deployConfigDirectory, { recursive: true });
36151
+ const resolveConfigPath = (environmentName) => {
36152
+ const outputDirectory = resolvedViteConfig.environments[environmentName]?.build.outDir;
36153
+ assert(outputDirectory, `Unexpected error: ${environmentName} environment output directory is undefined`);
36154
+ return nodePath.relative(deployConfigDirectory, nodePath.resolve(resolvedViteConfig.root, outputDirectory, "wrangler.json"));
36155
+ };
36156
+ const auxiliaryWorkerEnvironmentNames = resolvedPluginConfig.type === "workers" ? [...resolvedPluginConfig.environmentNameToWorkerMap.entries()].filter(([name, worker]) => name !== resolvedPluginConfig.entryWorkerEnvironmentName && name !== resolvedPluginConfig.prerenderWorkerEnvironmentName && !resolveDevOnly(worker.devOnly)).map(([name]) => name) : [];
36157
+ let entryEnvironmentName;
36158
+ if (isAssetsOnly) entryEnvironmentName = "client";
36159
+ else {
36160
+ assert(resolvedPluginConfig.type === "workers", `Unexpected error: expected workers config but got ${resolvedPluginConfig.type}`);
36161
+ entryEnvironmentName = resolvedPluginConfig.entryWorkerEnvironmentName;
35959
36162
  }
36163
+ const deployConfig = {
36164
+ configPath: resolveConfigPath(entryEnvironmentName),
36165
+ auxiliaryWorkers: auxiliaryWorkerEnvironmentNames.map((name) => ({ configPath: resolveConfigPath(name) })),
36166
+ prerenderWorkerConfigPath: resolvedPluginConfig.prerenderWorkerEnvironmentName ? resolveConfigPath(resolvedPluginConfig.prerenderWorkerEnvironmentName) : void 0
36167
+ };
36168
+ fs$1.writeFileSync(deployConfigPath, JSON.stringify(deployConfig));
35960
36169
  }
35961
36170
 
35962
36171
  //#endregion
@@ -41055,15 +41264,15 @@ function hasTrailingSlash(input = "", respectQueryAndFragment) {
41055
41264
  function withTrailingSlash$1(input = "", respectQueryAndFragment) {
41056
41265
  if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
41057
41266
  if (hasTrailingSlash(input, true)) return input || "/";
41058
- let path$2 = input;
41267
+ let path$1 = input;
41059
41268
  let fragment = "";
41060
41269
  const fragmentIndex = input.indexOf("#");
41061
41270
  if (fragmentIndex >= 0) {
41062
- path$2 = input.slice(0, fragmentIndex);
41271
+ path$1 = input.slice(0, fragmentIndex);
41063
41272
  fragment = input.slice(fragmentIndex);
41064
- if (!path$2) return fragment;
41273
+ if (!path$1) return fragment;
41065
41274
  }
41066
- const [s0, ...s] = path$2.split("?");
41275
+ const [s0, ...s] = path$1.split("?");
41067
41276
  return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
41068
41277
  }
41069
41278
  function isNonEmptyURL(url) {
@@ -41089,8 +41298,8 @@ const isAbsolute$1 = function(p$1) {
41089
41298
  //#endregion
41090
41299
  //#region ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
41091
41300
  const BUILTIN_MODULES = new Set(builtinModules);
41092
- function normalizeSlash(path$2) {
41093
- return path$2.replace(/\\/g, "/");
41301
+ function normalizeSlash(path$1) {
41302
+ return path$1.replace(/\\/g, "/");
41094
41303
  }
41095
41304
  /**
41096
41305
  * @typedef ErrnoExceptionFields
@@ -41210,8 +41419,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
41210
41419
  * @param {string} [base]
41211
41420
  * @param {string} [message]
41212
41421
  */
41213
- (path$2, base, message) => {
41214
- return `Invalid package config ${path$2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
41422
+ (path$1, base, message) => {
41423
+ return `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
41215
41424
  },
41216
41425
  Error
41217
41426
  );
@@ -41241,8 +41450,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
41241
41450
  * @param {string} base
41242
41451
  * @param {boolean} [exactUrl]
41243
41452
  */
41244
- (path$2, base, exactUrl = false) => {
41245
- return `Cannot find ${exactUrl ? "module" : "package"} '${path$2}' imported from ${base}`;
41453
+ (path$1, base, exactUrl = false) => {
41454
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`;
41246
41455
  },
41247
41456
  Error
41248
41457
  );
@@ -41280,8 +41489,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
41280
41489
  * @param {string} extension
41281
41490
  * @param {string} path
41282
41491
  */
41283
- (extension, path$2) => {
41284
- return `Unknown file extension "${extension}" for ${path$2}`;
41492
+ (extension, path$1) => {
41493
+ return `Unknown file extension "${extension}" for ${path$1}`;
41285
41494
  },
41286
41495
  TypeError
41287
41496
  );
@@ -41438,7 +41647,7 @@ function read(jsonPath, { base, specifier }) {
41438
41647
  /** @type {string | undefined} */
41439
41648
  let string;
41440
41649
  try {
41441
- string = fs.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
41650
+ string = fs2.readFileSync(path3.toNamespacedPath(jsonPath), "utf8");
41442
41651
  } catch (error) {
41443
41652
  const exception = error;
41444
41653
  if (exception.code !== "ENOENT") throw exception;
@@ -41644,15 +41853,15 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
41644
41853
  const packagePath = fileURLToPath(new URL$1(".", packageJsonUrl));
41645
41854
  const basePath = fileURLToPath(base);
41646
41855
  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");
41647
- 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");
41856
+ else if (path3.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");
41648
41857
  }
41649
41858
  /**
41650
41859
  * @param {string} path
41651
41860
  * @returns {Stats | undefined}
41652
41861
  */
41653
- function tryStatSync(path$2) {
41862
+ function tryStatSync(path$1) {
41654
41863
  try {
41655
- return statSync(path$2);
41864
+ return statSync(path$1);
41656
41865
  } catch {}
41657
41866
  }
41658
41867
  /**
@@ -41751,7 +41960,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
41751
41960
  {
41752
41961
  const real = realpathSync(filePath);
41753
41962
  const { search, hash } = resolved;
41754
- resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : ""));
41963
+ resolved = pathToFileURL(real + (filePath.endsWith(path3.sep) ? "/" : ""));
41755
41964
  resolved.search = search;
41756
41965
  resolved.hash = hash;
41757
41966
  }
@@ -42745,7 +42954,7 @@ function maybeResolveMain(main, configPath, root) {
42745
42954
  const baseDir = configPath ? nodePath.dirname(configPath) : root;
42746
42955
  if (!baseDir) return main;
42747
42956
  const resolvedMain = nodePath.resolve(baseDir, main);
42748
- if (!fs$2.existsSync(resolvedMain)) throw new Error(`The provided Wrangler config main field (${resolvedMain}) doesn't point to an existing file`);
42957
+ if (!fs$1.existsSync(resolvedMain)) throw new Error(`The provided Wrangler config main field (${resolvedMain}) doesn't point to an existing file`);
42749
42958
  return resolvedMain;
42750
42959
  }
42751
42960
  /**
@@ -42766,7 +42975,7 @@ function getValidatedWranglerConfigPath(root, requestedConfigPath, isForAuxiliar
42766
42975
  const foundExtensionMessage = !fileExtension ? "no extension found" : `"${fileExtension}" found`;
42767
42976
  throw new Error(`${errorMessagePrefix} doesn't point to a file with the correct file extension. It should point to a jsonc, json or toml file (${foundExtensionMessage} instead)`);
42768
42977
  }
42769
- const mainStat = fs$2.statSync(configPath, { throwIfNoEntry: false });
42978
+ const mainStat = fs$1.statSync(configPath, { throwIfNoEntry: false });
42770
42979
  if (!mainStat) throw new Error(`${errorMessagePrefix} doesn't point to an existing file`);
42771
42980
  if (mainStat.isDirectory()) throw new Error(`${errorMessagePrefix} points to a directory. It should point to a file.`);
42772
42981
  return configPath;
@@ -42777,7 +42986,7 @@ function getValidatedWranglerConfigPath(root, requestedConfigPath, isForAuxiliar
42777
42986
  function findWranglerConfig(root) {
42778
42987
  for (const extension of allowedWranglerConfigExtensions) {
42779
42988
  const configPath = nodePath.join(root, `wrangler.${extension}`);
42780
- if (fs$2.existsSync(configPath)) return configPath;
42989
+ if (fs$1.existsSync(configPath)) return configPath;
42781
42990
  }
42782
42991
  }
42783
42992
  const allowedWranglerConfigExtensions = [
@@ -42877,7 +43086,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
42877
43086
  });
42878
43087
  prerenderWorkerEnvironmentName = prerenderWorkerConfig.viteEnvironment?.name ?? workerNameToEnvironmentName(workerResolvedConfig.config.topLevelName);
42879
43088
  validateAndAddEnvironmentName(prerenderWorkerEnvironmentName);
42880
- environmentNameToWorkerMap.set(prerenderWorkerEnvironmentName, resolveWorker(workerResolvedConfig.config));
43089
+ environmentNameToWorkerMap.set(prerenderWorkerEnvironmentName, resolveWorker(workerResolvedConfig.config, void 0));
42881
43090
  const prerenderWorkerChildEnvironments = prerenderWorkerConfig.viteEnvironment?.childEnvironments;
42882
43091
  if (prerenderWorkerChildEnvironments) {
42883
43092
  for (const childName of prerenderWorkerChildEnvironments) validateAndAddEnvironmentName(childName);
@@ -42900,7 +43109,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
42900
43109
  if (Array.isArray(entryWorkerResolvedConfig.config.assets?.run_worker_first)) staticRouting = parseStaticRouting(entryWorkerResolvedConfig.config.assets.run_worker_first);
42901
43110
  const entryWorkerEnvironmentName = pluginConfig.viteEnvironment?.name ?? workerNameToEnvironmentName(entryWorkerResolvedConfig.config.topLevelName);
42902
43111
  validateAndAddEnvironmentName(entryWorkerEnvironmentName);
42903
- environmentNameToWorkerMap.set(entryWorkerEnvironmentName, resolveWorker(entryWorkerResolvedConfig.config));
43112
+ environmentNameToWorkerMap.set(entryWorkerEnvironmentName, resolveWorker(entryWorkerResolvedConfig.config, pluginConfig.assetsOnly));
42904
43113
  const entryWorkerChildEnvironments = pluginConfig.viteEnvironment?.childEnvironments;
42905
43114
  if (entryWorkerChildEnvironments) {
42906
43115
  for (const childName of entryWorkerChildEnvironments) validateAndAddEnvironmentName(childName);
@@ -42920,7 +43129,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
42920
43129
  auxiliaryWorkersResolvedConfigs.push(workerResolvedConfig);
42921
43130
  const workerEnvironmentName = auxiliaryWorker.viteEnvironment?.name ?? workerNameToEnvironmentName(workerResolvedConfig.config.topLevelName);
42922
43131
  validateAndAddEnvironmentName(workerEnvironmentName);
42923
- environmentNameToWorkerMap.set(workerEnvironmentName, resolveWorker(workerResolvedConfig.config));
43132
+ environmentNameToWorkerMap.set(workerEnvironmentName, resolveWorker(workerResolvedConfig.config, auxiliaryWorker.devOnly));
42924
43133
  const auxiliaryWorkerChildEnvironments = auxiliaryWorker.viteEnvironment?.childEnvironments;
42925
43134
  if (auxiliaryWorkerChildEnvironments) {
42926
43135
  for (const childName of auxiliaryWorkerChildEnvironments) validateAndAddEnvironmentName(childName);
@@ -42955,10 +43164,19 @@ function createEnvironmentNameValidator() {
42955
43164
  usedNames.add(name);
42956
43165
  };
42957
43166
  }
42958
- function resolveWorker(workerConfig) {
43167
+ /**
43168
+ * Evaluates the `devOnly` value. Should be called lazily at build time
43169
+ * to allow frameworks to provide the value after initialization.
43170
+ */
43171
+ function resolveDevOnly(devOnly) {
43172
+ if (typeof devOnly === "function") return devOnly();
43173
+ return devOnly ?? false;
43174
+ }
43175
+ function resolveWorker(workerConfig, devOnly) {
42959
43176
  return {
42960
43177
  config: workerConfig,
42961
- nodeJsCompat: hasNodeJsCompat(workerConfig) ? new NodeJsCompat(workerConfig) : void 0
43178
+ nodeJsCompat: hasNodeJsCompat(workerConfig) ? new NodeJsCompat(workerConfig) : void 0,
43179
+ devOnly
42962
43180
  };
42963
43181
  }
42964
43182
 
@@ -44131,9 +44349,9 @@ function constructHeaders({ headers, headersFile, logger }) {
44131
44349
 
44132
44350
  //#endregion
44133
44351
  //#region ../workers-shared/utils/configuration/validateURL.ts
44134
- const extractPathname = (path$2 = "/", includeSearch, includeHash) => {
44135
- if (!path$2.startsWith("/")) path$2 = `/${path$2}`;
44136
- const url = new URL(`//${path$2}`, "relative://");
44352
+ const extractPathname = (path$1 = "/", includeSearch, includeHash) => {
44353
+ if (!path$1.startsWith("/")) path$1 = `/${path$1}`;
44354
+ const url = new URL(`//${path$1}`, "relative://");
44137
44355
  return `${url.pathname}${includeSearch ? url.search : ""}${includeHash ? url.hash : ""}`;
44138
44356
  };
44139
44357
  const URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
@@ -44192,7 +44410,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
44192
44410
  lineNumber: i$1 + 1,
44193
44411
  message: "No headers specified"
44194
44412
  });
44195
- const [path$2, pathError] = validateUrl(line, false, true);
44413
+ const [path$1, pathError] = validateUrl(line, false, true);
44196
44414
  if (pathError) {
44197
44415
  invalid.push({
44198
44416
  line,
@@ -44203,7 +44421,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
44203
44421
  skipUntilNextPath = true;
44204
44422
  continue;
44205
44423
  }
44206
- const wildcardError = validateNoMultipleWildcards(path$2);
44424
+ const wildcardError = validateNoMultipleWildcards(path$1);
44207
44425
  if (wildcardError) {
44208
44426
  invalid.push({
44209
44427
  line,
@@ -44215,7 +44433,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
44215
44433
  continue;
44216
44434
  }
44217
44435
  rule = {
44218
- path: path$2,
44436
+ path: path$1,
44219
44437
  line,
44220
44438
  headers: {},
44221
44439
  unsetHeaders: []
@@ -44298,11 +44516,11 @@ function isValidRule(rule) {
44298
44516
  * `:splat` placeholder, would result in duplicate `:splat` parameters which is
44299
44517
  * unsupported.
44300
44518
  */
44301
- function validateNoMultipleWildcards(path$2) {
44302
- const wildcardCount = (path$2.match(SPLAT_REGEX) ?? []).length;
44303
- const hasSplatPlaceholder = /:splat(?!\w)/.test(path$2);
44304
- if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$2}.`;
44305
- if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$2}.`;
44519
+ function validateNoMultipleWildcards(path$1) {
44520
+ const wildcardCount = (path$1.match(SPLAT_REGEX) ?? []).length;
44521
+ const hasSplatPlaceholder = /:splat(?!\w)/.test(path$1);
44522
+ if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$1}.`;
44523
+ if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$1}.`;
44306
44524
  }
44307
44525
 
44308
44526
  //#endregion
@@ -44519,13 +44737,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
44519
44737
  const throwError = (message, Ctor) => {
44520
44738
  throw new Ctor(message);
44521
44739
  };
44522
- const checkPath = (path$2, originalPath, doThrow) => {
44523
- if (!isString$1(path$2)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
44524
- if (!path$2) return doThrow(`path must not be empty`, TypeError);
44525
- if (checkPath.isNotRelative(path$2)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
44740
+ const checkPath = (path$1, originalPath, doThrow) => {
44741
+ if (!isString$1(path$1)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
44742
+ if (!path$1) return doThrow(`path must not be empty`, TypeError);
44743
+ if (checkPath.isNotRelative(path$1)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
44526
44744
  return true;
44527
44745
  };
44528
- const isNotRelative = (path$2) => REGEX_TEST_INVALID_PATH.test(path$2);
44746
+ const isNotRelative = (path$1) => REGEX_TEST_INVALID_PATH.test(path$1);
44529
44747
  checkPath.isNotRelative = isNotRelative;
44530
44748
  checkPath.convert = (p$1) => p$1;
44531
44749
  var Ignore = class {
@@ -44561,13 +44779,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
44561
44779
  addPattern(pattern) {
44562
44780
  return this.add(pattern);
44563
44781
  }
44564
- _testOne(path$2, checkUnignored) {
44782
+ _testOne(path$1, checkUnignored) {
44565
44783
  let ignored = false;
44566
44784
  let unignored = false;
44567
44785
  this._rules.forEach((rule) => {
44568
44786
  const { negative } = rule;
44569
44787
  if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) return;
44570
- if (rule.regex.test(path$2)) {
44788
+ if (rule.regex.test(path$1)) {
44571
44789
  ignored = !negative;
44572
44790
  unignored = negative;
44573
44791
  }
@@ -44578,33 +44796,33 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
44578
44796
  };
44579
44797
  }
44580
44798
  _test(originalPath, cache$2, checkUnignored, slices) {
44581
- const path$2 = originalPath && checkPath.convert(originalPath);
44582
- checkPath(path$2, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
44583
- return this._t(path$2, cache$2, checkUnignored, slices);
44799
+ const path$1 = originalPath && checkPath.convert(originalPath);
44800
+ checkPath(path$1, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
44801
+ return this._t(path$1, cache$2, checkUnignored, slices);
44584
44802
  }
44585
- _t(path$2, cache$2, checkUnignored, slices) {
44586
- if (path$2 in cache$2) return cache$2[path$2];
44587
- if (!slices) slices = path$2.split(SLASH);
44803
+ _t(path$1, cache$2, checkUnignored, slices) {
44804
+ if (path$1 in cache$2) return cache$2[path$1];
44805
+ if (!slices) slices = path$1.split(SLASH);
44588
44806
  slices.pop();
44589
- if (!slices.length) return cache$2[path$2] = this._testOne(path$2, checkUnignored);
44807
+ if (!slices.length) return cache$2[path$1] = this._testOne(path$1, checkUnignored);
44590
44808
  const parent = this._t(slices.join(SLASH) + SLASH, cache$2, checkUnignored, slices);
44591
- return cache$2[path$2] = parent.ignored ? parent : this._testOne(path$2, checkUnignored);
44809
+ return cache$2[path$1] = parent.ignored ? parent : this._testOne(path$1, checkUnignored);
44592
44810
  }
44593
- ignores(path$2) {
44594
- return this._test(path$2, this._ignoreCache, false).ignored;
44811
+ ignores(path$1) {
44812
+ return this._test(path$1, this._ignoreCache, false).ignored;
44595
44813
  }
44596
44814
  createFilter() {
44597
- return (path$2) => !this.ignores(path$2);
44815
+ return (path$1) => !this.ignores(path$1);
44598
44816
  }
44599
44817
  filter(paths) {
44600
44818
  return makeArray(paths).filter(this.createFilter());
44601
44819
  }
44602
- test(path$2) {
44603
- return this._test(path$2, this._testCache, true);
44820
+ test(path$1) {
44821
+ return this._test(path$1, this._testCache, true);
44604
44822
  }
44605
44823
  };
44606
44824
  const factory = (options) => new Ignore(options);
44607
- const isPathValid = (path$2) => checkPath(path$2 && checkPath.convert(path$2), path$2, RETURN_FALSE);
44825
+ const isPathValid = (path$1) => checkPath(path$1 && checkPath.convert(path$1), path$1, RETURN_FALSE);
44608
44826
  factory.isPathValid = isPathValid;
44609
44827
  factory.default = factory;
44610
44828
  module.exports = factory;
@@ -44613,7 +44831,7 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
44613
44831
  const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
44614
44832
  checkPath.convert = makePosix;
44615
44833
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
44616
- checkPath.isNotRelative = (path$2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$2) || isNotRelative(path$2);
44834
+ checkPath.isNotRelative = (path$1) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$1) || isNotRelative(path$1);
44617
44835
  }
44618
44836
  }) });
44619
44837
 
@@ -45968,11 +46186,11 @@ var Mime = class {
45968
46186
  }
45969
46187
  return this;
45970
46188
  }
45971
- getType(path$2) {
45972
- if (typeof path$2 !== "string") return null;
45973
- const last = path$2.replace(/^.*[/\\]/s, "").toLowerCase();
46189
+ getType(path$1) {
46190
+ if (typeof path$1 !== "string") return null;
46191
+ const last = path$1.replace(/^.*[/\\]/s, "").toLowerCase();
45974
46192
  const ext = last.replace(/^.*\./s, "").toLowerCase();
45975
- const hasPath = last.length < path$2.length;
46193
+ const hasPath = last.length < path$1.length;
45976
46194
  if (!(ext.length < last.length - 1) && hasPath) return null;
45977
46195
  return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
45978
46196
  }
@@ -46306,8 +46524,8 @@ function getErrorMap() {
46306
46524
  //#endregion
46307
46525
  //#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
46308
46526
  const makeIssue = (params) => {
46309
- const { data: data$1, path: path$2, errorMaps, issueData } = params;
46310
- const fullPath = [...path$2, ...issueData.path || []];
46527
+ const { data: data$1, path: path$1, errorMaps, issueData } = params;
46528
+ const fullPath = [...path$1, ...issueData.path || []];
46311
46529
  const fullIssue = {
46312
46530
  ...issueData,
46313
46531
  path: fullPath
@@ -46419,11 +46637,11 @@ var errorUtil;
46419
46637
  //#endregion
46420
46638
  //#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
46421
46639
  var ParseInputLazyPath = class {
46422
- constructor(parent, value, path$2, key) {
46640
+ constructor(parent, value, path$1, key) {
46423
46641
  this._cachedPath = [];
46424
46642
  this.parent = parent;
46425
46643
  this.data = value;
46426
- this._path = path$2;
46644
+ this._path = path$1;
46427
46645
  this._key = key;
46428
46646
  }
46429
46647
  get path() {
@@ -49709,14 +49927,14 @@ function createBuildApp(resolvedPluginConfig) {
49709
49927
  const clientEnvironment = builder.environments.client;
49710
49928
  assert(clientEnvironment, `No "client" environment`);
49711
49929
  const defaultHtmlPath = nodePath.resolve(builder.config.root, "index.html");
49712
- const hasClientEntry = clientEnvironment.config.build.rollupOptions.input || fs$2.existsSync(defaultHtmlPath);
49713
- const workerEnvironments = [...resolvedPluginConfig.environmentNameToWorkerMap.keys()].map((environmentName) => {
49930
+ const hasClientEntry = clientEnvironment.config.build.rollupOptions.input || fs$1.existsSync(defaultHtmlPath);
49931
+ const workerEnvironments = [...resolvedPluginConfig.environmentNameToWorkerMap.entries()].filter(([_, worker]) => !resolveDevOnly(worker.devOnly)).map(([environmentName]) => {
49714
49932
  const environment = builder.environments[environmentName];
49715
49933
  assert(environment, `"${environmentName}" environment not found`);
49716
49934
  return environment;
49717
49935
  });
49718
49936
  await Promise.all(workerEnvironments.map((environment) => builder.build(environment)));
49719
- if (resolvedPluginConfig.type === "assets-only") {
49937
+ if (resolvedPluginConfig.type === "assets-only" || !workerEnvironments.some((environment) => environment.name === resolvedPluginConfig.entryWorkerEnvironmentName)) {
49720
49938
  if (hasClientEntry) await builder.build(clientEnvironment);
49721
49939
  else if (getHasPublicAssets(builder.config) || resolvedPluginConfig.prerenderWorkerEnvironmentName) await fallbackBuild(builder, clientEnvironment);
49722
49940
  return;
@@ -49737,12 +49955,12 @@ function createBuildApp(resolvedPluginConfig) {
49737
49955
  for (const assetPath of importedAssetPaths) {
49738
49956
  const src$1 = nodePath.join(entryWorkerBuildDirectory, assetPath);
49739
49957
  const dest = nodePath.join(clientBuildDirectory, assetPath);
49740
- if (!fs$2.existsSync(src$1)) continue;
49741
- if (fs$2.existsSync(dest)) fs$2.unlinkSync(src$1);
49958
+ if (!fs$1.existsSync(src$1)) continue;
49959
+ if (fs$1.existsSync(dest)) fs$1.unlinkSync(src$1);
49742
49960
  else {
49743
49961
  const destDir = nodePath.dirname(dest);
49744
- fs$2.mkdirSync(destDir, { recursive: true });
49745
- fs$2.renameSync(src$1, dest);
49962
+ fs$1.mkdirSync(destDir, { recursive: true });
49963
+ fs$1.renameSync(src$1, dest);
49746
49964
  movedAssetPaths.push(dest);
49747
49965
  }
49748
49966
  }
@@ -49752,7 +49970,7 @@ function createBuildApp(resolvedPluginConfig) {
49752
49970
  function getHasPublicAssets({ publicDir }) {
49753
49971
  let hasPublicAssets = false;
49754
49972
  if (publicDir) try {
49755
- if (fs$2.readdirSync(publicDir).length) hasPublicAssets = true;
49973
+ if (fs$1.readdirSync(publicDir).length) hasPublicAssets = true;
49756
49974
  } catch {}
49757
49975
  return hasPublicAssets;
49758
49976
  }
@@ -49764,10 +49982,10 @@ async function fallbackBuild(builder, environment) {
49764
49982
  };
49765
49983
  await builder.build(environment);
49766
49984
  const fallbackEntryPath = nodePath.resolve(builder.config.root, environment.config.build.outDir, CLIENT_FALLBACK_ENTRY_NAME);
49767
- fs$2.unlinkSync(fallbackEntryPath);
49985
+ fs$1.unlinkSync(fallbackEntryPath);
49768
49986
  }
49769
49987
  function loadViteManifest(directory) {
49770
- const contents = fs$2.readFileSync(nodePath.resolve(directory, ".vite", "manifest.json"), "utf-8");
49988
+ const contents = fs$1.readFileSync(nodePath.resolve(directory, ".vite", "manifest.json"), "utf-8");
49771
49989
  return JSON.parse(contents);
49772
49990
  }
49773
49991
  function getImportedAssetPaths(viteManifest) {
@@ -49779,9 +49997,9 @@ function getImportedAssetPaths(viteManifest) {
49779
49997
  */
49780
49998
  function removeAssetsField(entryWorkerBuildDirectory) {
49781
49999
  const entryWorkerConfigPath = nodePath.join(entryWorkerBuildDirectory, "wrangler.json");
49782
- const workerConfig = JSON.parse(fs$2.readFileSync(entryWorkerConfigPath, "utf-8"));
50000
+ const workerConfig = JSON.parse(fs$1.readFileSync(entryWorkerConfigPath, "utf-8"));
49783
50001
  workerConfig.assets = void 0;
49784
- fs$2.writeFileSync(entryWorkerConfigPath, JSON.stringify(workerConfig));
50002
+ fs$1.writeFileSync(entryWorkerConfigPath, JSON.stringify(workerConfig));
49785
50003
  }
49786
50004
 
49787
50005
  //#endregion
@@ -50136,7 +50354,7 @@ const configPlugin = createPlugin("config", (ctx) => {
50136
50354
  order: "post",
50137
50355
  async handler(builder) {
50138
50356
  if (ctx.resolvedPluginConfig.type !== "workers") return;
50139
- const workerEnvironments = [...ctx.resolvedPluginConfig.environmentNameToWorkerMap.keys()].map((environmentName) => {
50357
+ const workerEnvironments = [...ctx.resolvedPluginConfig.environmentNameToWorkerMap.entries()].filter(([_, worker]) => !resolveDevOnly(worker.devOnly)).map(([environmentName]) => {
50140
50358
  const environment = builder.environments[environmentName];
50141
50359
  assert(environment, `"${environmentName}" environment not found`);
50142
50360
  return environment;
@@ -50145,8 +50363,27 @@ const configPlugin = createPlugin("config", (ctx) => {
50145
50363
  const { entryWorkerEnvironmentName } = ctx.resolvedPluginConfig;
50146
50364
  const entryWorkerEnvironment = builder.environments[entryWorkerEnvironmentName];
50147
50365
  assert(entryWorkerEnvironment, `No "${entryWorkerEnvironmentName}" environment`);
50148
- const entryWorkerBuildDirectory = nodePath.resolve(builder.config.root, entryWorkerEnvironment.config.build.outDir);
50149
- if (!builder.environments.client?.isBuilt) removeAssetsField(entryWorkerBuildDirectory);
50366
+ if (entryWorkerEnvironment.isBuilt) {
50367
+ if (!builder.environments.client?.isBuilt) removeAssetsField(nodePath.resolve(builder.config.root, entryWorkerEnvironment.config.build.outDir));
50368
+ } else {
50369
+ const clientEnvironment = builder.environments.client;
50370
+ assert(clientEnvironment, "No \"client\" environment");
50371
+ if (!clientEnvironment.isBuilt) throw new Error("If `assetsOnly` is set to `true`, the client environment must be built");
50372
+ const entryWorkerConfig = ctx.getWorkerConfig(entryWorkerEnvironmentName);
50373
+ assert(entryWorkerConfig, `No config found for "${entryWorkerEnvironmentName}" environment`);
50374
+ const outputConfig = {
50375
+ ...entryWorkerConfig,
50376
+ main: void 0,
50377
+ assets: {
50378
+ ...entryWorkerConfig.assets,
50379
+ directory: ".",
50380
+ binding: void 0
50381
+ }
50382
+ };
50383
+ if (outputConfig.unsafe && Object.keys(outputConfig.unsafe).length === 0) outputConfig.unsafe = void 0;
50384
+ fs$1.writeFileSync(nodePath.resolve(builder.config.root, clientEnvironment.config.build.outDir, "wrangler.json"), JSON.stringify(outputConfig));
50385
+ writeDeployConfig(ctx.resolvedPluginConfig, ctx.resolvedViteConfig, true);
50386
+ }
50150
50387
  }
50151
50388
  }
50152
50389
  };
@@ -50455,11 +50692,11 @@ const getQueryString = (params) => {
50455
50692
  };
50456
50693
  const getUrl = (config, options) => {
50457
50694
  const encoder$1 = config.ENCODE_PATH || encodeURI;
50458
- const path$2 = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
50695
+ const path$1 = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
50459
50696
  if (options.path?.hasOwnProperty(group)) return encoder$1(String(options.path[group]));
50460
50697
  return substring;
50461
50698
  });
50462
- const url = `${config.BASE}${path$2}`;
50699
+ const url = `${config.BASE}${path$1}`;
50463
50700
  if (options.query) return `${url}${getQueryString(options.query)}`;
50464
50701
  return url;
50465
50702
  };
@@ -51510,7 +51747,7 @@ function getContainerOptions(options) {
51510
51747
  return containersConfig.map((container) => {
51511
51748
  if (isDockerfile(container.image, configPath)) return {
51512
51749
  dockerfile: container.image,
51513
- image_build_context: container.image_build_context ?? path.dirname(container.image),
51750
+ image_build_context: container.image_build_context ?? path3.dirname(container.image),
51514
51751
  image_vars: container.image_vars,
51515
51752
  class_name: container.class_name,
51516
51753
  image_tag: getDevContainerImageName(container.class_name, containerBuildId)
@@ -51526,26 +51763,26 @@ function getContainerOptions(options) {
51526
51763
  //#endregion
51527
51764
  //#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.3/node_modules/fdir/dist/index.mjs
51528
51765
  var __require = /* @__PURE__ */ createRequire$1(import.meta.url);
51529
- function cleanPath(path$2) {
51530
- let normalized = normalize(path$2);
51766
+ function cleanPath(path$1) {
51767
+ let normalized = normalize(path$1);
51531
51768
  if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
51532
51769
  return normalized;
51533
51770
  }
51534
51771
  const SLASHES_REGEX = /[\\/]/g;
51535
- function convertSlashes(path$2, separator) {
51536
- return path$2.replace(SLASHES_REGEX, separator);
51772
+ function convertSlashes(path$1, separator) {
51773
+ return path$1.replace(SLASHES_REGEX, separator);
51537
51774
  }
51538
51775
  const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
51539
- function isRootDirectory(path$2) {
51540
- return path$2 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$2);
51776
+ function isRootDirectory(path$1) {
51777
+ return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
51541
51778
  }
51542
- function normalizePath$1(path$2, options) {
51779
+ function normalizePath$1(path$1, options) {
51543
51780
  const { resolvePaths, normalizePath: normalizePath$1$1, pathSeparator } = options;
51544
- const pathNeedsCleaning = process.platform === "win32" && path$2.includes("/") || path$2.startsWith(".");
51545
- if (resolvePaths) path$2 = resolve$1(path$2);
51546
- if (normalizePath$1$1 || pathNeedsCleaning) path$2 = cleanPath(path$2);
51547
- if (path$2 === ".") return "";
51548
- return convertSlashes(path$2[path$2.length - 1] !== pathSeparator ? path$2 + pathSeparator : path$2, pathSeparator);
51781
+ const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
51782
+ if (resolvePaths) path$1 = resolve$1(path$1);
51783
+ if (normalizePath$1$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
51784
+ if (path$1 === ".") return "";
51785
+ return convertSlashes(path$1[path$1.length - 1] !== pathSeparator ? path$1 + pathSeparator : path$1, pathSeparator);
51549
51786
  }
51550
51787
  function joinPathWithBasePath(filename, directoryPath) {
51551
51788
  return directoryPath + filename;
@@ -51581,8 +51818,8 @@ const pushDirectory = (directoryPath, paths) => {
51581
51818
  paths.push(directoryPath || ".");
51582
51819
  };
51583
51820
  const pushDirectoryFilter = (directoryPath, paths, filters) => {
51584
- const path$2 = directoryPath || ".";
51585
- if (filters.every((filter) => filter(path$2, true))) paths.push(path$2);
51821
+ const path$1 = directoryPath || ".";
51822
+ if (filters.every((filter) => filter(path$1, true))) paths.push(path$1);
51586
51823
  };
51587
51824
  const empty$2 = () => {};
51588
51825
  function build$6(root, options) {
@@ -51631,26 +51868,26 @@ const empty = () => {};
51631
51868
  function build$3(options) {
51632
51869
  return options.group ? groupFiles : empty;
51633
51870
  }
51634
- const resolveSymlinksAsync = function(path$2, state, callback$1) {
51635
- const { queue, fs: fs$3, options: { suppressErrors } } = state;
51871
+ const resolveSymlinksAsync = function(path$1, state, callback$1) {
51872
+ const { queue, fs: fs$2, options: { suppressErrors } } = state;
51636
51873
  queue.enqueue();
51637
- fs$3.realpath(path$2, (error, resolvedPath) => {
51874
+ fs$2.realpath(path$1, (error, resolvedPath) => {
51638
51875
  if (error) return queue.dequeue(suppressErrors ? null : error, state);
51639
- fs$3.stat(resolvedPath, (error$1, stat) => {
51876
+ fs$2.stat(resolvedPath, (error$1, stat) => {
51640
51877
  if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
51641
- if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
51878
+ if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
51642
51879
  callback$1(stat, resolvedPath);
51643
51880
  queue.dequeue(null, state);
51644
51881
  });
51645
51882
  });
51646
51883
  };
51647
- const resolveSymlinks = function(path$2, state, callback$1) {
51648
- const { queue, fs: fs$3, options: { suppressErrors } } = state;
51884
+ const resolveSymlinks = function(path$1, state, callback$1) {
51885
+ const { queue, fs: fs$2, options: { suppressErrors } } = state;
51649
51886
  queue.enqueue();
51650
51887
  try {
51651
- const resolvedPath = fs$3.realpathSync(path$2);
51652
- const stat = fs$3.statSync(resolvedPath);
51653
- if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
51888
+ const resolvedPath = fs$2.realpathSync(path$1);
51889
+ const stat = fs$2.statSync(resolvedPath);
51890
+ if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
51654
51891
  callback$1(stat, resolvedPath);
51655
51892
  } catch (e) {
51656
51893
  if (!suppressErrors) throw e;
@@ -51660,16 +51897,16 @@ function build$2(options, isSynchronous) {
51660
51897
  if (!options.resolveSymlinks || options.excludeSymlinks) return null;
51661
51898
  return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
51662
51899
  }
51663
- function isRecursive(path$2, resolved, state) {
51900
+ function isRecursive(path$1, resolved, state) {
51664
51901
  if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
51665
- let parent = dirname$1(path$2);
51902
+ let parent = dirname$1(path$1);
51666
51903
  let depth$1 = 1;
51667
51904
  while (parent !== state.root && depth$1 < 2) {
51668
51905
  const resolvedPath = state.symlinks.get(parent);
51669
51906
  if (!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath))) depth$1++;
51670
51907
  else parent = dirname$1(parent);
51671
51908
  }
51672
- state.symlinks.set(path$2, resolved);
51909
+ state.symlinks.set(path$1, resolved);
51673
51910
  return depth$1 > 1;
51674
51911
  }
51675
51912
  function isRecursiveUsingRealPaths(resolved, state) {
@@ -51718,22 +51955,22 @@ const readdirOpts = { withFileTypes: true };
51718
51955
  const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
51719
51956
  state.queue.enqueue();
51720
51957
  if (currentDepth < 0) return state.queue.dequeue(null, state);
51721
- const { fs: fs$3 } = state;
51958
+ const { fs: fs$2 } = state;
51722
51959
  state.visited.push(crawlPath);
51723
51960
  state.counts.directories++;
51724
- fs$3.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
51961
+ fs$2.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
51725
51962
  callback$1(entries, directoryPath, currentDepth);
51726
51963
  state.queue.dequeue(state.options.suppressErrors ? null : error, state);
51727
51964
  });
51728
51965
  };
51729
51966
  const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
51730
- const { fs: fs$3 } = state;
51967
+ const { fs: fs$2 } = state;
51731
51968
  if (currentDepth < 0) return;
51732
51969
  state.visited.push(crawlPath);
51733
51970
  state.counts.directories++;
51734
51971
  let entries = [];
51735
51972
  try {
51736
- entries = fs$3.readdirSync(crawlPath || ".", readdirOpts);
51973
+ entries = fs$2.readdirSync(crawlPath || ".", readdirOpts);
51737
51974
  } catch (e) {
51738
51975
  if (!state.options.suppressErrors) throw e;
51739
51976
  }
@@ -51850,19 +52087,19 @@ var Walker = class {
51850
52087
  const filename = this.joinPath(entry.name, directoryPath);
51851
52088
  this.pushFile(filename, files, this.state.counts, filters);
51852
52089
  } else if (entry.isDirectory()) {
51853
- let path$2 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
51854
- if (exclude && exclude(entry.name, path$2)) continue;
51855
- this.pushDirectory(path$2, paths, filters);
51856
- this.walkDirectory(this.state, path$2, path$2, depth$1 - 1, this.walk);
52090
+ let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
52091
+ if (exclude && exclude(entry.name, path$1)) continue;
52092
+ this.pushDirectory(path$1, paths, filters);
52093
+ this.walkDirectory(this.state, path$1, path$1, depth$1 - 1, this.walk);
51857
52094
  } else if (this.resolveSymlink && entry.isSymbolicLink()) {
51858
- let path$2 = joinPathWithBasePath(entry.name, directoryPath);
51859
- this.resolveSymlink(path$2, this.state, (stat, resolvedPath) => {
52095
+ let path$1 = joinPathWithBasePath(entry.name, directoryPath);
52096
+ this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => {
51860
52097
  if (stat.isDirectory()) {
51861
52098
  resolvedPath = normalizePath$1(resolvedPath, this.state.options);
51862
- if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$2 + pathSeparator)) return;
51863
- this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$2 + pathSeparator, depth$1 - 1, this.walk);
52099
+ if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
52100
+ this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth$1 - 1, this.walk);
51864
52101
  } else {
51865
- resolvedPath = useRealPaths ? resolvedPath : path$2;
52102
+ resolvedPath = useRealPaths ? resolvedPath : path$1;
51866
52103
  const filename = basename(resolvedPath);
51867
52104
  const directoryPath$1 = normalizePath$1(dirname$1(resolvedPath), this.state.options);
51868
52105
  resolvedPath = this.joinPath(filename, directoryPath$1);
@@ -52027,7 +52264,7 @@ var Builder = class {
52027
52264
  isMatch = globFn(patterns, ...options);
52028
52265
  this.globCache[patterns.join("\0")] = isMatch;
52029
52266
  }
52030
- this.options.filters.push((path$2) => isMatch(path$2));
52267
+ this.options.filters.push((path$1) => isMatch(path$1));
52031
52268
  return this;
52032
52269
  }
52033
52270
  };
@@ -52238,8 +52475,8 @@ var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
52238
52475
  if (state.negated === true) output = `(?:^(?!${output}).*$)`;
52239
52476
  return output;
52240
52477
  };
52241
- exports.basename = (path$2, { windows } = {}) => {
52242
- const segs = path$2.split(windows ? /[\\/]/ : "/");
52478
+ exports.basename = (path$1, { windows } = {}) => {
52479
+ const segs = path$1.split(windows ? /[\\/]/ : "/");
52243
52480
  const last = segs[segs.length - 1];
52244
52481
  if (last === "") return segs[segs.length - 2];
52245
52482
  return last;
@@ -53774,15 +54011,15 @@ function buildRelative(cwd, root) {
53774
54011
  };
53775
54012
  }
53776
54013
  const splitPatternOptions = { parts: true };
53777
- function splitPattern(path$1$1) {
54014
+ function splitPattern(path$1) {
53778
54015
  var _result$parts;
53779
- const result = import_picomatch.default.scan(path$1$1, splitPatternOptions);
53780
- return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1$1];
54016
+ const result = import_picomatch.default.scan(path$1, splitPatternOptions);
54017
+ return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
53781
54018
  }
53782
54019
  const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
53783
54020
  const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
53784
- const escapePosixPath = (path$1$1) => path$1$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
53785
- const escapeWin32Path = (path$1$1) => path$1$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
54021
+ const escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
54022
+ const escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
53786
54023
  /**
53787
54024
  * Escapes a path's special characters depending on the platform.
53788
54025
  * @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
@@ -53817,7 +54054,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
53817
54054
  if (pattern.endsWith("/")) result = pattern.slice(0, -1);
53818
54055
  if (!result.endsWith("*") && expandDirectories) result += "/**";
53819
54056
  const escapedCwd = escapePath(cwd);
53820
- if (path$1.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
54057
+ if (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
53821
54058
  else result = posix.normalize(result);
53822
54059
  const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
53823
54060
  const parts = splitPattern(result);
@@ -53876,15 +54113,15 @@ function processPatterns({ patterns = ["**/*"], ignore: ignore$1 = [], expandDir
53876
54113
  }
53877
54114
  function formatPaths(paths, relative$2) {
53878
54115
  for (let i$1 = paths.length - 1; i$1 >= 0; i$1--) {
53879
- const path$1$1 = paths[i$1];
53880
- paths[i$1] = relative$2(path$1$1);
54116
+ const path$1 = paths[i$1];
54117
+ paths[i$1] = relative$2(path$1);
53881
54118
  }
53882
54119
  return paths;
53883
54120
  }
53884
54121
  function normalizeCwd(cwd) {
53885
54122
  if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
53886
54123
  if (cwd instanceof URL) return fileURLToPath$1(cwd).replace(BACKSLASHES, "/");
53887
- return path$1.resolve(cwd).replace(BACKSLASHES, "/");
54124
+ return path.resolve(cwd).replace(BACKSLASHES, "/");
53888
54125
  }
53889
54126
  function getCrawler(patterns, inputOptions = {}) {
53890
54127
  const options = process.env.TINYGLOBBY_DEBUG ? {
@@ -53929,9 +54166,9 @@ function getCrawler(patterns, inputOptions = {}) {
53929
54166
  const formatExclude = options.absolute ? format$2 : buildFormat(cwd, props.root, true);
53930
54167
  const fdirOptions = {
53931
54168
  filters: [options.debug ? (p$1, isDirectory$1) => {
53932
- const path$1$1 = format$2(p$1, isDirectory$1);
53933
- const matches = matcher(path$1$1);
53934
- if (matches) log(`matched ${path$1$1}`);
54169
+ const path$1 = format$2(p$1, isDirectory$1);
54170
+ const matches = matcher(path$1);
54171
+ if (matches) log(`matched ${path$1}`);
53935
54172
  return matches;
53936
54173
  } : (p$1, isDirectory$1) => matcher(format$2(p$1, isDirectory$1))],
53937
54174
  exclude: options.debug ? (_, p$1) => {
@@ -54017,7 +54254,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
54017
54254
  modules: [{
54018
54255
  type: "ESModule",
54019
54256
  path: nodePath.join(miniflareModulesRoot, ROUTER_WORKER_PATH),
54020
- contents: fs$2.readFileSync(fileURLToPath(new URL(ROUTER_WORKER_PATH, import.meta.url)))
54257
+ contents: fs$1.readFileSync(fileURLToPath(new URL(ROUTER_WORKER_PATH, import.meta.url)))
54021
54258
  }],
54022
54259
  bindings: { CONFIG: { has_user_worker: resolvedPluginConfig.type === "workers" } },
54023
54260
  serviceBindings: {
@@ -54032,7 +54269,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
54032
54269
  modules: [{
54033
54270
  type: "ESModule",
54034
54271
  path: nodePath.join(miniflareModulesRoot, ASSET_WORKER_PATH),
54035
- contents: fs$2.readFileSync(fileURLToPath(new URL(ASSET_WORKER_PATH, import.meta.url)))
54272
+ contents: fs$1.readFileSync(fileURLToPath(new URL(ASSET_WORKER_PATH, import.meta.url)))
54036
54273
  }],
54037
54274
  bindings: {
54038
54275
  CONFIG: assetsConfig,
@@ -54076,7 +54313,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
54076
54313
  modules: [{
54077
54314
  type: "ESModule",
54078
54315
  path: nodePath.join(miniflareModulesRoot, VITE_PROXY_WORKER_PATH),
54079
- contents: fs$2.readFileSync(fileURLToPath(new URL(VITE_PROXY_WORKER_PATH, import.meta.url)))
54316
+ contents: fs$1.readFileSync(fileURLToPath(new URL(VITE_PROXY_WORKER_PATH, import.meta.url)))
54080
54317
  }],
54081
54318
  serviceBindings: {
54082
54319
  ...entryWorkerConfig ? { ENTRY_USER_WORKER: entryWorkerConfig.name } : {},
@@ -54137,12 +54374,12 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
54137
54374
  {
54138
54375
  type: "ESModule",
54139
54376
  path: nodePath.join(miniflareModulesRoot, RUNNER_PATH),
54140
- contents: fs$2.readFileSync(fileURLToPath(new URL(RUNNER_PATH, import.meta.url)))
54377
+ contents: fs$1.readFileSync(fileURLToPath(new URL(RUNNER_PATH, import.meta.url)))
54141
54378
  },
54142
54379
  {
54143
54380
  type: "ESModule",
54144
54381
  path: nodePath.join(miniflareModulesRoot, "workers/runner-worker/vite/module-runner"),
54145
- contents: fs$2.readFileSync(fileURLToPath(new URL(satisfiesMinimumViteVersion("7.2.0") ? MODULE_RUNNER_PATH : MODULE_RUNNER_LEGACY_PATH, import.meta.url)))
54382
+ contents: fs$1.readFileSync(fileURLToPath(new URL(satisfiesMinimumViteVersion("7.2.0") ? MODULE_RUNNER_PATH : MODULE_RUNNER_LEGACY_PATH, import.meta.url)))
54146
54383
  }
54147
54384
  ],
54148
54385
  unsafeUseModuleFallbackService: true,
@@ -54704,12 +54941,12 @@ const outputConfigPlugin = createPlugin("output-config", (ctx) => {
54704
54941
  },
54705
54942
  writeBundle() {
54706
54943
  assertIsNotPreview(ctx);
54707
- if (this.environment.name === (ctx.resolvedPluginConfig.type === "workers" ? ctx.resolvedPluginConfig.entryWorkerEnvironmentName : "client")) writeDeployConfig(ctx.resolvedPluginConfig, ctx.resolvedViteConfig);
54944
+ if (this.environment.name === (ctx.resolvedPluginConfig.type === "workers" ? ctx.resolvedPluginConfig.entryWorkerEnvironmentName : "client")) writeDeployConfig(ctx.resolvedPluginConfig, ctx.resolvedViteConfig, ctx.resolvedPluginConfig.type === "assets-only");
54708
54945
  }
54709
54946
  };
54710
54947
  });
54711
54948
  function readAssetsIgnoreFile(assetsIgnorePath) {
54712
- const content = existsSync(assetsIgnorePath) ? readFileSync(assetsIgnorePath, "utf-8") : "";
54949
+ const content = fs$1.existsSync(assetsIgnorePath) ? fs$1.readFileSync(assetsIgnorePath, "utf-8") : "";
54713
54950
  if (content.length === 0) return "";
54714
54951
  return content.at(-1) === "\n" ? content : `${content}\n`;
54715
54952
  }
@@ -54797,7 +55034,7 @@ const rscPlugin = createPlugin("rsc", () => {
54797
55034
  let isDockerCached;
54798
55035
  function hasDockerEnv() {
54799
55036
  try {
54800
- fs.statSync("/.dockerenv");
55037
+ fs2.statSync("/.dockerenv");
54801
55038
  return true;
54802
55039
  } catch {
54803
55040
  return false;
@@ -54805,7 +55042,7 @@ function hasDockerEnv() {
54805
55042
  }
54806
55043
  function hasDockerCGroup() {
54807
55044
  try {
54808
- return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
55045
+ return fs2.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
54809
55046
  } catch {
54810
55047
  return false;
54811
55048
  }
@@ -54820,7 +55057,7 @@ function isDocker() {
54820
55057
  let cachedResult;
54821
55058
  const hasContainerEnv = () => {
54822
55059
  try {
54823
- fs.statSync("/run/.containerenv");
55060
+ fs2.statSync("/run/.containerenv");
54824
55061
  return true;
54825
55062
  } catch {
54826
55063
  return false;
@@ -54840,7 +55077,7 @@ const isWsl = () => {
54840
55077
  return true;
54841
55078
  }
54842
55079
  try {
54843
- return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
55080
+ return fs2.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
54844
55081
  } catch {
54845
55082
  return false;
54846
55083
  }
@@ -54891,11 +55128,11 @@ const wslDrivesMountPoint = (() => {
54891
55128
  const configFilePath = "/etc/wsl.conf";
54892
55129
  let isConfigFileExists = false;
54893
55130
  try {
54894
- await fs$1.access(configFilePath, constants$1.F_OK);
55131
+ await fs.access(configFilePath, constants$1.F_OK);
54895
55132
  isConfigFileExists = true;
54896
55133
  } catch {}
54897
55134
  if (!isConfigFileExists) return defaultMountPoint;
54898
- const parsedMountPoint = parseMountPointFromConfig(await fs$1.readFile(configFilePath, { encoding: "utf8" }));
55135
+ const parsedMountPoint = parseMountPointFromConfig(await fs.readFile(configFilePath, { encoding: "utf8" }));
54899
55136
  if (parsedMountPoint === void 0) return defaultMountPoint;
54900
55137
  mountPoint = parsedMountPoint;
54901
55138
  mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
@@ -54911,7 +55148,7 @@ const canAccessPowerShell = async () => {
54911
55148
  canAccessPowerShellPromise ??= (async () => {
54912
55149
  try {
54913
55150
  const psPath = await powerShellPath();
54914
- await fs$1.access(psPath, constants$1.X_OK);
55151
+ await fs.access(psPath, constants$1.X_OK);
54915
55152
  return true;
54916
55153
  } catch {
54917
55154
  return false;
@@ -54924,13 +55161,13 @@ const wslDefaultBrowser = async () => {
54924
55161
  const { stdout } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
54925
55162
  return stdout.trim();
54926
55163
  };
54927
- const convertWslPathToWindows = async (path$2) => {
54928
- if (/^[a-z]+:\/\//i.test(path$2)) return path$2;
55164
+ const convertWslPathToWindows = async (path$1) => {
55165
+ if (/^[a-z]+:\/\//i.test(path$1)) return path$1;
54929
55166
  try {
54930
- const { stdout } = await execFile$1("wslpath", ["-aw", path$2], { encoding: "utf8" });
55167
+ const { stdout } = await execFile$1("wslpath", ["-aw", path$1], { encoding: "utf8" });
54931
55168
  return stdout.trim();
54932
55169
  } catch {
54933
- return path$2;
55170
+ return path$1;
54934
55171
  }
54935
55172
  };
54936
55173
 
@@ -55116,8 +55353,8 @@ var is_in_ssh_default = isInSsh;
55116
55353
  //#endregion
55117
55354
  //#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
55118
55355
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
55119
- const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
55120
- const localXdgOpenPath = path.join(__dirname, "xdg-open");
55356
+ const __dirname = import.meta.url ? path3.dirname(fileURLToPath(import.meta.url)) : "";
55357
+ const localXdgOpenPath = path3.join(__dirname, "xdg-open");
55121
55358
  const { platform, arch: arch$1 } = process$1;
55122
55359
  const tryEachApp = async (apps$1, opener) => {
55123
55360
  if (apps$1.length === 0) return;
@@ -55228,7 +55465,7 @@ const baseOpen = async (options) => {
55228
55465
  const isBundled = !__dirname || __dirname === "/";
55229
55466
  let exeLocalXdgOpen = false;
55230
55467
  try {
55231
- await fs$1.access(localXdgOpenPath, constants$1.X_OK);
55468
+ await fs.access(localXdgOpenPath, constants$1.X_OK);
55232
55469
  exeLocalXdgOpen = true;
55233
55470
  } catch {}
55234
55471
  command = process$1.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;