@cloudflare/vite-plugin 1.70.1 → 1.70.2

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.
@@ -1,21 +1,20 @@
1
- import { r as __name } from "./chunk-U6NEESU5-BQnRVk7-.mjs";
1
+ import { r as __name } from "./chunk-U6NEESU5-Dv6AnbSJ.mjs";
2
2
  import { createRequire } from "node:module";
3
- import fs2 from "node:fs";
4
- import path__default from "node:path";
3
+ import path from "node:path";
4
+ import fs from "node:fs";
5
+ import { fileURLToPath } from "node:url";
5
6
  import os from "node:os";
6
7
  import { promisify } from "node:util";
7
8
  import process from "node:process";
8
- import { fileURLToPath } from "node:url";
9
9
  import { Buffer } from "node:buffer";
10
- import fs, { constants as constants$1 } from "node:fs/promises";
10
+ import fs$1, { constants as constants$1 } from "node:fs/promises";
11
11
  import childProcess, { execFile } from "node:child_process";
12
-
13
- //#region ../../node_modules/.pnpm/@cloudflare+workers-utils@0.53.0_vitest@5.0.4_@opentelemetry+api@1.9.1_@types+node@22.1_dccf70b6c9730ef30ad05bcacf8c8eff/node_modules/@cloudflare/workers-utils/dist/open-PCXX3ZDZ.mjs
12
+ //#region ../../node_modules/.pnpm/@cloudflare+workers-utils@0.53.0_vitest@5.0.4_@opentelemetry+api@1.9.1_@types+node@22.1_e76c60ce5bd3b54e163f4a5edf808c74/node_modules/@cloudflare/workers-utils/dist/open-PCXX3ZDZ.mjs
14
13
  createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
15
14
  var isDockerCached;
16
15
  function hasDockerEnv() {
17
16
  try {
18
- fs2.statSync("/.dockerenv");
17
+ fs.statSync("/.dockerenv");
19
18
  return true;
20
19
  } catch {
21
20
  return false;
@@ -24,7 +23,7 @@ function hasDockerEnv() {
24
23
  __name(hasDockerEnv, "hasDockerEnv");
25
24
  function hasDockerCGroup() {
26
25
  try {
27
- return fs2.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
26
+ return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
28
27
  } catch {
29
28
  return false;
30
29
  }
@@ -38,7 +37,7 @@ __name(isDocker, "isDocker");
38
37
  var cachedResult;
39
38
  var hasContainerEnv = /* @__PURE__ */ __name(() => {
40
39
  try {
41
- fs2.statSync("/run/.containerenv");
40
+ fs.statSync("/run/.containerenv");
42
41
  return true;
43
42
  } catch {
44
43
  return false;
@@ -56,18 +55,18 @@ var isWsl = /* @__PURE__ */ __name(() => {
56
55
  return true;
57
56
  }
58
57
  try {
59
- return fs2.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
58
+ return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
60
59
  } catch {
61
60
  return false;
62
61
  }
63
62
  }, "isWsl");
64
63
  var is_wsl_default = process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
65
- var execFile$1 = promisify(childProcess.execFile);
64
+ var execFile$2 = promisify(childProcess.execFile);
66
65
  var powerShellPath = /* @__PURE__ */ __name(() => `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, "powerShellPath");
67
66
  var executePowerShell = /* @__PURE__ */ __name(async (command, options = {}) => {
68
- const { powerShellPath: psPath,...execFileOptions } = options;
67
+ const { powerShellPath: psPath, ...execFileOptions } = options;
69
68
  const encodedCommand = executePowerShell.encodeCommand(command);
70
- return execFile$1(psPath ?? powerShellPath(), [...executePowerShell.argumentsPrefix, encodedCommand], {
69
+ return execFile$2(psPath ?? powerShellPath(), [...executePowerShell.argumentsPrefix, encodedCommand], {
71
70
  encoding: "utf8",
72
71
  ...execFileOptions
73
72
  });
@@ -99,11 +98,11 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
99
98
  const configFilePath = "/etc/wsl.conf";
100
99
  let isConfigFileExists = false;
101
100
  try {
102
- await fs.access(configFilePath, constants$1.F_OK);
101
+ await fs$1.access(configFilePath, constants$1.F_OK);
103
102
  isConfigFileExists = true;
104
103
  } catch {}
105
104
  if (!isConfigFileExists) return defaultMountPoint;
106
- const parsedMountPoint = parseMountPointFromConfig(await fs.readFile(configFilePath, { encoding: "utf8" }));
105
+ const parsedMountPoint = parseMountPointFromConfig(await fs$1.readFile(configFilePath, { encoding: "utf8" }));
107
106
  if (parsedMountPoint === void 0) return defaultMountPoint;
108
107
  mountPoint = parsedMountPoint;
109
108
  mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
@@ -118,7 +117,7 @@ var canAccessPowerShell = /* @__PURE__ */ __name(async () => {
118
117
  canAccessPowerShellPromise ??= (async () => {
119
118
  try {
120
119
  const psPath = await powerShellPath2();
121
- await fs.access(psPath, constants$1.X_OK);
120
+ await fs$1.access(psPath, constants$1.X_OK);
122
121
  return true;
123
122
  } catch {
124
123
  return false;
@@ -128,14 +127,14 @@ var canAccessPowerShell = /* @__PURE__ */ __name(async () => {
128
127
  }, "canAccessPowerShell");
129
128
  var wslDefaultBrowser = /* @__PURE__ */ __name(async () => {
130
129
  const psPath = await powerShellPath2();
131
- const { stdout: stdout$1 } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
132
- return stdout$1.trim();
130
+ const { stdout } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
131
+ return stdout.trim();
133
132
  }, "wslDefaultBrowser");
134
133
  var convertWslPathToWindows = /* @__PURE__ */ __name(async (path2) => {
135
134
  if (/^[a-z]+:\/\//i.test(path2)) return path2;
136
135
  try {
137
- const { stdout: stdout$1 } = await execFile2("wslpath", ["-aw", path2], { encoding: "utf8" });
138
- return stdout$1.trim();
136
+ const { stdout } = await execFile2("wslpath", ["-aw", path2], { encoding: "utf8" });
137
+ return stdout.trim();
139
138
  } catch {
140
139
  return path2;
141
140
  }
@@ -164,12 +163,12 @@ __name(defineLazyProperty, "defineLazyProperty");
164
163
  var execFileAsync = promisify(execFile);
165
164
  async function defaultBrowserId() {
166
165
  if (process.platform !== "darwin") throw new Error("macOS only");
167
- const { stdout: stdout$1 } = await execFileAsync("defaults", [
166
+ const { stdout } = await execFileAsync("defaults", [
168
167
  "read",
169
168
  "com.apple.LaunchServices/com.apple.launchservices.secure",
170
169
  "LSHandlers"
171
170
  ]);
172
- const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout$1)?.groups.id ?? "com.apple.Safari";
171
+ const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout)?.groups.id ?? "com.apple.Safari";
173
172
  if (browserId === "com.apple.safari") return "com.apple.Safari";
174
173
  return browserId;
175
174
  }
@@ -180,12 +179,12 @@ async function runAppleScript(script, { humanReadableOutput = true, signal } = {
180
179
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
181
180
  const execOptions = {};
182
181
  if (signal) execOptions.signal = signal;
183
- const { stdout: stdout$1 } = await execFileAsync2("osascript", [
182
+ const { stdout } = await execFileAsync2("osascript", [
184
183
  "-e",
185
184
  script,
186
185
  outputArguments
187
186
  ], execOptions);
188
- return stdout$1.trim();
187
+ return stdout.trim();
189
188
  }
190
189
  __name(runAppleScript, "runAppleScript");
191
190
  async function bundleName(bundleId) {
@@ -267,14 +266,14 @@ var UnknownBrowserError = class extends Error {
267
266
  }
268
267
  };
269
268
  async function defaultBrowser(_execFileAsync = execFileAsync3) {
270
- const { stdout: stdout$1 } = await _execFileAsync("reg", [
269
+ const { stdout } = await _execFileAsync("reg", [
271
270
  "QUERY",
272
271
  " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
273
272
  "/v",
274
273
  "ProgId"
275
274
  ]);
276
- const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout$1);
277
- if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout$1)}`);
275
+ const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
276
+ if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
278
277
  const { id } = match.groups;
279
278
  const browser = windowsBrowserProgIds[id];
280
279
  if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
@@ -292,12 +291,12 @@ async function defaultBrowser2() {
292
291
  };
293
292
  }
294
293
  if (process.platform === "linux") {
295
- const { stdout: stdout$1 } = await execFileAsync4("xdg-mime", [
294
+ const { stdout } = await execFileAsync4("xdg-mime", [
296
295
  "query",
297
296
  "default",
298
297
  "x-scheme-handler/http"
299
298
  ]);
300
- const id = stdout$1.trim();
299
+ const id = stdout.trim();
301
300
  return {
302
301
  name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
303
302
  id
@@ -309,8 +308,8 @@ async function defaultBrowser2() {
309
308
  __name(defaultBrowser2, "defaultBrowser");
310
309
  var is_in_ssh_default = Boolean(process.env.SSH_CONNECTION || process.env.SSH_CLIENT || process.env.SSH_TTY);
311
310
  var fallbackAttemptSymbol = Symbol("fallbackAttempt");
312
- var __dirname$1 = import.meta.url ? path__default.dirname(fileURLToPath(import.meta.url)) : "";
313
- var localXdgOpenPath = path__default.join(__dirname$1, "xdg-open");
311
+ var __dirname$1 = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
312
+ var localXdgOpenPath = path.join(__dirname$1, "xdg-open");
314
313
  var { platform, arch: arch$1 } = process;
315
314
  var tryEachApp = /* @__PURE__ */ __name(async (apps2, opener) => {
316
315
  if (apps2.length === 0) return;
@@ -421,7 +420,7 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
421
420
  const isBundled = !__dirname$1 || __dirname$1 === "/";
422
421
  let exeLocalXdgOpen = false;
423
422
  try {
424
- await fs.access(localXdgOpenPath, constants$1.X_OK);
423
+ await fs$1.access(localXdgOpenPath, constants$1.X_OK);
425
424
  exeLocalXdgOpen = true;
426
425
  } catch {}
427
426
  command = process.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
@@ -435,17 +434,17 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
435
434
  if (platform === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
436
435
  if (options.target) cliArguments.push(options.target);
437
436
  const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
438
- if (options.wait) return new Promise((resolve$1, reject) => {
437
+ if (options.wait) return new Promise((resolve, reject) => {
439
438
  subprocess.once("error", reject);
440
439
  subprocess.once("close", (exitCode) => {
441
440
  if (!options.allowNonzeroExitCode && exitCode !== 0) {
442
441
  reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
443
442
  return;
444
443
  }
445
- resolve$1(subprocess);
444
+ resolve(subprocess);
446
445
  });
447
446
  });
448
- if (isFallbackAttempt) return new Promise((resolve$1, reject) => {
447
+ if (isFallbackAttempt) return new Promise((resolve, reject) => {
449
448
  subprocess.once("error", reject);
450
449
  subprocess.once("spawn", () => {
451
450
  subprocess.once("close", (exitCode) => {
@@ -455,16 +454,16 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
455
454
  return;
456
455
  }
457
456
  subprocess.unref();
458
- resolve$1(subprocess);
457
+ resolve(subprocess);
459
458
  });
460
459
  });
461
460
  });
462
461
  subprocess.unref();
463
- return new Promise((resolve$1, reject) => {
462
+ return new Promise((resolve, reject) => {
464
463
  subprocess.once("error", reject);
465
464
  subprocess.once("spawn", () => {
466
465
  subprocess.off("error", reject);
467
- resolve$1(subprocess);
466
+ resolve(subprocess);
468
467
  });
469
468
  });
470
469
  }, "baseOpen");
@@ -525,6 +524,5 @@ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
525
524
  }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
526
525
  defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
527
526
  var open_default = open;
528
-
529
527
  //#endregion
530
- export { open_default as default };
528
+ export { open_default as default };
@@ -1,7 +1,7 @@
1
1
  //#region package.json
2
2
  var package_default = {
3
3
  name: "@cloudflare/vite-plugin",
4
- version: "1.70.1",
4
+ version: "1.70.2",
5
5
  description: "Cloudflare plugin for Vite",
6
6
  keywords: [
7
7
  "cloudflare",
@@ -39,9 +39,9 @@ var package_default = {
39
39
  },
40
40
  dependencies: {
41
41
  "@cloudflare/unenv-preset": "2.16.2",
42
- "miniflare": "5.20261117.0-beta",
42
+ "miniflare": "5.20261123.1-beta",
43
43
  "unenv": "2.0.0-rc.24",
44
- "wrangler": "4.164.0",
44
+ "wrangler": "4.168.0",
45
45
  "ws": "8.22.0"
46
46
  },
47
47
  devDependencies: {
@@ -50,8 +50,8 @@ var package_default = {
50
50
  "@cloudflare/remote-bindings": "workspace:*",
51
51
  "@cloudflare/workers-shared": "workspace:*",
52
52
  "@cloudflare/workers-tsconfig": "workspace:*",
53
- "@cloudflare/workers-types": "5.20261117.1",
54
- "@cloudflare/workers-utils": "0.54.2",
53
+ "@cloudflare/workers-types": "5.20261123.1",
54
+ "@cloudflare/workers-utils": "0.57.0",
55
55
  "@remix-run/node-fetch-server": "1.0.0",
56
56
  "@types/node": "22.15.17",
57
57
  "@types/semver": "7.8.0",
@@ -67,18 +67,17 @@ var package_default = {
67
67
  "semver": "7.8.5",
68
68
  "tinyglobby": "0.2.16",
69
69
  "tree-kill": "1.2.2",
70
- "tsdown": "0.16.3",
71
- "typescript": "5.8.3",
70
+ "tsdown": "catalog:default",
71
+ "typescript": "6.0.3",
72
72
  "vite": "catalog:default",
73
73
  "vite-legacy": "npm:vite@7.1.12",
74
74
  "vitest": "5.0.4"
75
75
  },
76
76
  peerDependencies: {
77
77
  "vite": "^6.1.0 || ^7.0.0 || ^8.0.0",
78
- "wrangler": "^4.164.0"
78
+ "wrangler": "^4.168.0"
79
79
  },
80
80
  "workers-sdk": { "prerelease": true }
81
81
  };
82
-
83
82
  //#endregion
84
- export { package_default as default };
83
+ export { package_default as default };
@@ -0,0 +1,30 @@
1
+ import { createRequire } from "node:module";
2
+ //#region ../../node_modules/.pnpm/@cloudflare+workers-utils@0.57.0_vitest@5.0.4_@opentelemetry+api@1.9.1_@types+node@22.1_6af2c628f7abaa9578b25d7353ff2100/node_modules/@cloudflare/workers-utils/dist/rolldown-runtime-BMUeFane.mjs
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __name = (target, value) => __defProp(target, "name", {
6
+ value,
7
+ configurable: true
8
+ });
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __getProtoOf = Object.getPrototypeOf;
12
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
16
+ key = keys[i];
17
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: ((k) => from[k]).bind(null, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
25
+ value: mod,
26
+ enumerable: true
27
+ }) : target, mod));
28
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
29
+ //#endregion
30
+ export { __toESM as i, __name as n, __require as r, __commonJSMin as t };