@cloudflare/vite-plugin 1.69.0 → 1.69.1
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as __toESM$1, i as __require$2, n as __export, r as __name$4, t as __commonJS$1 } from "./chunk-U6NEESU5-BwoIZAaT.mjs";
|
|
2
2
|
import { builtinModules, createRequire } from "node:module";
|
|
3
3
|
import assert from "node:assert";
|
|
4
|
-
import * as fs
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import fs2, { accessSync, appendFileSync, chmodSync, constants, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
import path__default, { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
@@ -9,7 +9,7 @@ import os, { arch, release, tmpdir } from "node:os";
|
|
|
9
9
|
import http, { validateHeaderName, validateHeaderValue } from "node:http";
|
|
10
10
|
import * as util from "node:util";
|
|
11
11
|
import { TextDecoder as TextDecoder$1, TextEncoder as TextEncoder$1, format, inspect, isDeepStrictEqual, promisify, stripVTControlCharacters, styleText } from "node:util";
|
|
12
|
-
import
|
|
12
|
+
import process5, { exit, stdin, stdout } from "node:process";
|
|
13
13
|
import tty from "node:tty";
|
|
14
14
|
import url, { URL as URL$1, URLSearchParams as URLSearchParams$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
15
15
|
import net, { createServer } from "node:net";
|
|
@@ -17,7 +17,7 @@ import events, { EventEmitter, once } from "node:events";
|
|
|
17
17
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
18
18
|
import crypto2, { createCipheriv, createDecipheriv, createHash, randomBytes, randomUUID, webcrypto } from "node:crypto";
|
|
19
19
|
import * as fsp from "node:fs/promises";
|
|
20
|
-
import
|
|
20
|
+
import fs4, { constants as constants$1, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
21
21
|
import childProcess, { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
22
22
|
import * as timersPromises from "node:timers/promises";
|
|
23
23
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
@@ -22378,13 +22378,13 @@ var ansi_styles_default$1 = ansiStyles$1;
|
|
|
22378
22378
|
|
|
22379
22379
|
//#endregion
|
|
22380
22380
|
//#region ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
22381
|
-
function hasFlag(flag, argv$1 = globalThis.Deno ? globalThis.Deno.args :
|
|
22381
|
+
function hasFlag(flag, argv$1 = globalThis.Deno ? globalThis.Deno.args : process5.argv) {
|
|
22382
22382
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
22383
22383
|
const position = argv$1.indexOf(prefix + flag);
|
|
22384
22384
|
const terminatorPosition = argv$1.indexOf("--");
|
|
22385
22385
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
22386
22386
|
}
|
|
22387
|
-
const { env: env$2 } =
|
|
22387
|
+
const { env: env$2 } = process5;
|
|
22388
22388
|
let flagForceColor;
|
|
22389
22389
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
22390
22390
|
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
@@ -22417,7 +22417,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
22417
22417
|
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
22418
22418
|
const min = forceColor || 0;
|
|
22419
22419
|
if (env$2.TERM === "dumb") return min;
|
|
22420
|
-
if (
|
|
22420
|
+
if (process5.platform === "win32") {
|
|
22421
22421
|
const osRelease = os.release().split(".");
|
|
22422
22422
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
22423
22423
|
return 1;
|
|
@@ -45931,11 +45931,11 @@ var require_ci_info$1 = __commonJS$1({ "../../node_modules/.pnpm/ci-info@4.4.0/n
|
|
|
45931
45931
|
var require_command_exists$2 = __commonJS$1({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports$1, module$1) {
|
|
45932
45932
|
var exec$3 = __require$2("child_process").exec;
|
|
45933
45933
|
var execSync$2 = __require$2("child_process").execSync;
|
|
45934
|
-
var fs4 = __require$2("fs");
|
|
45934
|
+
var fs4$1 = __require$2("fs");
|
|
45935
45935
|
var path7 = __require$2("path");
|
|
45936
|
-
var access$1 = fs4.access;
|
|
45937
|
-
var accessSync2 = fs4.accessSync;
|
|
45938
|
-
var constants2 = fs4.constants || fs4;
|
|
45936
|
+
var access$1 = fs4$1.access;
|
|
45937
|
+
var accessSync2 = fs4$1.accessSync;
|
|
45938
|
+
var constants2 = fs4$1.constants || fs4$1;
|
|
45939
45939
|
var isUsingWindows$1 = process.platform == "win32";
|
|
45940
45940
|
var fileNotExists$1 = /* @__PURE__ */ __name$4(function(commandName, callback$1) {
|
|
45941
45941
|
access$1(commandName, constants2.F_OK, function(err) {
|
|
@@ -53084,7 +53084,7 @@ function compareVersions(a, b) {
|
|
|
53084
53084
|
__name$4(compareVersions, "compareVersions");
|
|
53085
53085
|
async function openInBrowser(url$2, logger$2) {
|
|
53086
53086
|
try {
|
|
53087
|
-
const { default: open$3 } = await import("./open-PCXX3ZDZ-
|
|
53087
|
+
const { default: open$3 } = await import("./open-PCXX3ZDZ-D_I6kTEq.mjs");
|
|
53088
53088
|
(await open$3(url$2)).on("error", (err) => {
|
|
53089
53089
|
handleBrowserOpenError(url$2, err, logger$2);
|
|
53090
53090
|
});
|
|
@@ -57942,7 +57942,7 @@ function getDeployConfigPath(root) {
|
|
|
57942
57942
|
}
|
|
57943
57943
|
function getWorkerConfigs(root, isPrerender) {
|
|
57944
57944
|
const deployConfigPath = getDeployConfigPath(root);
|
|
57945
|
-
const deployConfig = JSON.parse(fs
|
|
57945
|
+
const deployConfig = JSON.parse(fs.readFileSync(deployConfigPath, "utf-8"));
|
|
57946
57946
|
return [...isPrerender && deployConfig.prerenderWorkerConfigPath ? [{ configPath: deployConfig.prerenderWorkerConfigPath }] : [{ configPath: deployConfig.configPath }], ...deployConfig.auxiliaryWorkers].map(({ configPath }) => {
|
|
57947
57947
|
const resolvedConfigPath = path.resolve(path.dirname(deployConfigPath), configPath);
|
|
57948
57948
|
return wrangler.unstable_readConfig({ config: resolvedConfigPath });
|
|
@@ -57951,7 +57951,7 @@ function getWorkerConfigs(root, isPrerender) {
|
|
|
57951
57951
|
function writeDeployConfig(resolvedPluginConfig, resolvedViteConfig, isAssetsOnly) {
|
|
57952
57952
|
const deployConfigPath = getDeployConfigPath(resolvedViteConfig.root);
|
|
57953
57953
|
const deployConfigDirectory = path.dirname(deployConfigPath);
|
|
57954
|
-
fs
|
|
57954
|
+
fs.mkdirSync(deployConfigDirectory, { recursive: true });
|
|
57955
57955
|
const resolveConfigPath = (environmentName) => {
|
|
57956
57956
|
const outputDirectory = resolvedViteConfig.environments[environmentName]?.build.outDir;
|
|
57957
57957
|
assert(outputDirectory, `Unexpected error: ${environmentName} environment output directory is undefined`);
|
|
@@ -57969,7 +57969,7 @@ function writeDeployConfig(resolvedPluginConfig, resolvedViteConfig, isAssetsOnl
|
|
|
57969
57969
|
auxiliaryWorkers: auxiliaryWorkerEnvironmentNames.map((name) => ({ configPath: resolveConfigPath(name) })),
|
|
57970
57970
|
prerenderWorkerConfigPath: resolvedPluginConfig.prerenderWorkerEnvironmentName ? resolveConfigPath(resolvedPluginConfig.prerenderWorkerEnvironmentName) : void 0
|
|
57971
57971
|
};
|
|
57972
|
-
fs
|
|
57972
|
+
fs.writeFileSync(deployConfigPath, JSON.stringify(deployConfig));
|
|
57973
57973
|
}
|
|
57974
57974
|
|
|
57975
57975
|
//#endregion
|
|
@@ -63653,10 +63653,10 @@ const doubleSlashRegEx = /[/\\]{2}/;
|
|
|
63653
63653
|
* @param {boolean} isTarget
|
|
63654
63654
|
*/
|
|
63655
63655
|
function emitInvalidSegmentDeprecation(target$1, request$2, match, packageJsonUrl, internal, base, isTarget) {
|
|
63656
|
-
if (
|
|
63656
|
+
if (process5.noDeprecation) return;
|
|
63657
63657
|
const pjsonPath = fileURLToPath(packageJsonUrl);
|
|
63658
63658
|
const double = doubleSlashRegEx.exec(isTarget ? target$1 : request$2) !== null;
|
|
63659
|
-
|
|
63659
|
+
process5.emitWarning(`Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target$1}" for module request "${request$2}" ${request$2 === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ""}.`, "DeprecationWarning", "DEP0166");
|
|
63660
63660
|
}
|
|
63661
63661
|
/**
|
|
63662
63662
|
* @param {URL} url
|
|
@@ -63666,13 +63666,13 @@ function emitInvalidSegmentDeprecation(target$1, request$2, match, packageJsonUr
|
|
|
63666
63666
|
* @returns {void}
|
|
63667
63667
|
*/
|
|
63668
63668
|
function emitLegacyIndexDeprecation(url$2, packageJsonUrl, base, main) {
|
|
63669
|
-
if (
|
|
63669
|
+
if (process5.noDeprecation) return;
|
|
63670
63670
|
if (defaultGetFormatWithoutErrors(url$2, { parentURL: base.href }) !== "module") return;
|
|
63671
63671
|
const urlPath = fileURLToPath(url$2.href);
|
|
63672
63672
|
const packagePath = fileURLToPath(new URL(".", packageJsonUrl));
|
|
63673
63673
|
const basePath = fileURLToPath(base);
|
|
63674
|
-
if (!main)
|
|
63675
|
-
else if (path__default.resolve(packagePath, main) !== urlPath)
|
|
63674
|
+
if (!main) process5.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");
|
|
63675
|
+
else if (path__default.resolve(packagePath, main) !== urlPath) process5.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");
|
|
63676
63676
|
}
|
|
63677
63677
|
/**
|
|
63678
63678
|
* @param {string} path
|
|
@@ -63972,11 +63972,11 @@ function isConditionalExportsMainSugar(exports$1, packageJsonUrl, base) {
|
|
|
63972
63972
|
* @param {URL} base
|
|
63973
63973
|
*/
|
|
63974
63974
|
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
|
|
63975
|
-
if (
|
|
63975
|
+
if (process5.noDeprecation) return;
|
|
63976
63976
|
const pjsonPath = fileURLToPath(pjsonUrl);
|
|
63977
63977
|
if (emittedPackageWarnings.has(pjsonPath + "|" + match)) return;
|
|
63978
63978
|
emittedPackageWarnings.add(pjsonPath + "|" + match);
|
|
63979
|
-
|
|
63979
|
+
process5.emitWarning(`Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155");
|
|
63980
63980
|
}
|
|
63981
63981
|
/**
|
|
63982
63982
|
* @param {URL} packageJsonUrl
|
|
@@ -64781,7 +64781,7 @@ function maybeResolveMain(main, configPath, root) {
|
|
|
64781
64781
|
const baseDir$1 = configPath ? path.dirname(configPath) : root;
|
|
64782
64782
|
if (!baseDir$1) return main;
|
|
64783
64783
|
const resolvedMain = path.resolve(baseDir$1, main);
|
|
64784
|
-
if (!fs
|
|
64784
|
+
if (!fs.existsSync(resolvedMain)) throw new Error(`The provided Wrangler config main field (${resolvedMain}) doesn't point to an existing file`);
|
|
64785
64785
|
return resolvedMain;
|
|
64786
64786
|
}
|
|
64787
64787
|
/**
|
|
@@ -64802,7 +64802,7 @@ function getValidatedWranglerConfigPath(root, requestedConfigPath, isForAuxiliar
|
|
|
64802
64802
|
const foundExtensionMessage = !fileExtension ? "no extension found" : `"${fileExtension}" found`;
|
|
64803
64803
|
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)`);
|
|
64804
64804
|
}
|
|
64805
|
-
const mainStat = fs
|
|
64805
|
+
const mainStat = fs.statSync(configPath, { throwIfNoEntry: false });
|
|
64806
64806
|
if (!mainStat) throw new Error(`${errorMessagePrefix} doesn't point to an existing file`);
|
|
64807
64807
|
if (mainStat.isDirectory()) throw new Error(`${errorMessagePrefix} points to a directory. It should point to a file.`);
|
|
64808
64808
|
return configPath;
|
|
@@ -64813,7 +64813,7 @@ function getValidatedWranglerConfigPath(root, requestedConfigPath, isForAuxiliar
|
|
|
64813
64813
|
function findWranglerConfig(root) {
|
|
64814
64814
|
for (const extension of allowedWranglerConfigExtensions) {
|
|
64815
64815
|
const configPath = path.join(root, `wrangler.${extension}`);
|
|
64816
|
-
if (fs
|
|
64816
|
+
if (fs.existsSync(configPath)) return configPath;
|
|
64817
64817
|
}
|
|
64818
64818
|
}
|
|
64819
64819
|
const allowedWranglerConfigExtensions = [
|
|
@@ -74331,7 +74331,7 @@ async function buildApp(builder, resolvedPluginConfig, environmentNameToImported
|
|
|
74331
74331
|
const clientEnvironment = builder.environments.client;
|
|
74332
74332
|
assert(clientEnvironment, `No "client" environment`);
|
|
74333
74333
|
const defaultHtmlPath = path.resolve(builder.config.root, "index.html");
|
|
74334
|
-
const hasClientEntry = clientEnvironment.config.build.rollupOptions.input || fs
|
|
74334
|
+
const hasClientEntry = clientEnvironment.config.build.rollupOptions.input || fs.existsSync(defaultHtmlPath);
|
|
74335
74335
|
const workerEnvironments = [...resolvedPluginConfig.environmentNameToWorkerMap.entries()].filter(([_, worker]) => !resolveDevOnly(worker.devOnly)).map(([environmentName]) => {
|
|
74336
74336
|
const environment = builder.environments[environmentName];
|
|
74337
74337
|
assert(environment, `"${environmentName}" environment not found`);
|
|
@@ -74375,14 +74375,14 @@ async function buildApp(builder, resolvedPluginConfig, environmentNameToImported
|
|
|
74375
74375
|
for (const assetPath of importedAssetPaths) {
|
|
74376
74376
|
const src$2 = path.join(workerBuildDirectory, assetPath);
|
|
74377
74377
|
const dest = path.join(clientBuildDirectory, assetPath);
|
|
74378
|
-
if (!fs
|
|
74379
|
-
if (fs
|
|
74380
|
-
if (!preserveOriginalAssets) fs
|
|
74378
|
+
if (!fs.existsSync(src$2)) continue;
|
|
74379
|
+
if (fs.existsSync(dest)) {
|
|
74380
|
+
if (!preserveOriginalAssets) fs.unlinkSync(src$2);
|
|
74381
74381
|
} else {
|
|
74382
74382
|
const destDir = path.dirname(dest);
|
|
74383
|
-
fs
|
|
74384
|
-
if (preserveOriginalAssets) fs
|
|
74385
|
-
else fs
|
|
74383
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
74384
|
+
if (preserveOriginalAssets) fs.copyFileSync(src$2, dest);
|
|
74385
|
+
else fs.renameSync(src$2, dest);
|
|
74386
74386
|
transferredAssetPaths.push(dest);
|
|
74387
74387
|
}
|
|
74388
74388
|
}
|
|
@@ -74392,7 +74392,7 @@ async function buildApp(builder, resolvedPluginConfig, environmentNameToImported
|
|
|
74392
74392
|
function getHasPublicAssets({ publicDir }) {
|
|
74393
74393
|
let hasPublicAssets = false;
|
|
74394
74394
|
if (publicDir) try {
|
|
74395
|
-
if (fs
|
|
74395
|
+
if (fs.readdirSync(publicDir).length) hasPublicAssets = true;
|
|
74396
74396
|
} catch {}
|
|
74397
74397
|
return hasPublicAssets;
|
|
74398
74398
|
}
|
|
@@ -74404,16 +74404,16 @@ async function fallbackBuild(builder, environment) {
|
|
|
74404
74404
|
};
|
|
74405
74405
|
await builder.build(environment);
|
|
74406
74406
|
const fallbackEntryPath = path.resolve(builder.config.root, environment.config.build.outDir, CLIENT_FALLBACK_ENTRY_NAME);
|
|
74407
|
-
fs
|
|
74407
|
+
fs.unlinkSync(fallbackEntryPath);
|
|
74408
74408
|
}
|
|
74409
74409
|
/**
|
|
74410
74410
|
* Used to remove the `assets` field from the entry Worker config if there are no assets
|
|
74411
74411
|
*/
|
|
74412
74412
|
function removeAssetsField(entryWorkerBuildDirectory) {
|
|
74413
74413
|
const entryWorkerConfigPath = path.join(entryWorkerBuildDirectory, "wrangler.json");
|
|
74414
|
-
const workerConfig = JSON.parse(fs
|
|
74414
|
+
const workerConfig = JSON.parse(fs.readFileSync(entryWorkerConfigPath, "utf-8"));
|
|
74415
74415
|
workerConfig.assets = void 0;
|
|
74416
|
-
fs
|
|
74416
|
+
fs.writeFileSync(entryWorkerConfigPath, JSON.stringify(workerConfig));
|
|
74417
74417
|
}
|
|
74418
74418
|
|
|
74419
74419
|
//#endregion
|
|
@@ -74877,7 +74877,7 @@ const configPlugin = createPlugin("config", (ctx) => {
|
|
|
74877
74877
|
buildApp: {
|
|
74878
74878
|
order: "post",
|
|
74879
74879
|
async handler(builder) {
|
|
74880
|
-
|
|
74880
|
+
if (ctx.resolvedPluginConfig.type === "preview") return;
|
|
74881
74881
|
await buildApp(builder, ctx.resolvedPluginConfig, environmentNameToImportedAssetPaths);
|
|
74882
74882
|
if (ctx.resolvedPluginConfig.type !== "workers") return;
|
|
74883
74883
|
const workerEnvironments = [...ctx.resolvedPluginConfig.environmentNameToWorkerMap.entries()].filter(([_, worker]) => !resolveDevOnly(worker.devOnly)).map(([environmentName]) => {
|
|
@@ -74907,7 +74907,7 @@ const configPlugin = createPlugin("config", (ctx) => {
|
|
|
74907
74907
|
}
|
|
74908
74908
|
};
|
|
74909
74909
|
if (outputConfig.unsafe && Object.keys(outputConfig.unsafe).length === 0) outputConfig.unsafe = void 0;
|
|
74910
|
-
fs
|
|
74910
|
+
fs.writeFileSync(path.resolve(builder.config.root, clientEnvironment.config.build.outDir, "wrangler.json"), JSON.stringify(outputConfig));
|
|
74911
74911
|
writeDeployConfig(ctx.resolvedPluginConfig, ctx.resolvedViteConfig, true);
|
|
74912
74912
|
}
|
|
74913
74913
|
}
|
|
@@ -75602,7 +75602,7 @@ var import_ci_info$1 = /* @__PURE__ */ __toESM$2(require_ci_info(), 1);
|
|
|
75602
75602
|
|
|
75603
75603
|
//#endregion
|
|
75604
75604
|
//#region ../../node_modules/.pnpm/@cloudflare+cli-shared-helpers@0.3.6_vitest@5.0.4_@opentelemetry+api@1.9.1_@types+node@_8ad19c2891441732cf973a4bd95ecdfb/node_modules/@cloudflare/cli-shared-helpers/dist/cursor.mjs
|
|
75605
|
-
function showCursor(show, stream$2 =
|
|
75605
|
+
function showCursor(show, stream$2 = process5.stderr) {
|
|
75606
75606
|
if (!stream$2.isTTY) return;
|
|
75607
75607
|
if (show) stream$2.write("\x1B[?25h");
|
|
75608
75608
|
else stream$2.write("\x1B[?25l");
|
|
@@ -76568,25 +76568,25 @@ var require_signals = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/s
|
|
|
76568
76568
|
//#endregion
|
|
76569
76569
|
//#region ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
|
|
76570
76570
|
var require_signal_exit = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js": ((exports, module) => {
|
|
76571
|
-
var process$
|
|
76572
|
-
const processOk = function(process$
|
|
76573
|
-
return process$
|
|
76571
|
+
var process$1 = global.process;
|
|
76572
|
+
const processOk = function(process$2) {
|
|
76573
|
+
return process$2 && typeof process$2 === "object" && typeof process$2.removeListener === "function" && typeof process$2.emit === "function" && typeof process$2.reallyExit === "function" && typeof process$2.listeners === "function" && typeof process$2.kill === "function" && typeof process$2.pid === "number" && typeof process$2.on === "function";
|
|
76574
76574
|
};
|
|
76575
76575
|
/* istanbul ignore if */
|
|
76576
|
-
if (!processOk(process$
|
|
76576
|
+
if (!processOk(process$1)) module.exports = function() {
|
|
76577
76577
|
return function() {};
|
|
76578
76578
|
};
|
|
76579
76579
|
else {
|
|
76580
76580
|
var assert$1 = __require$3("assert");
|
|
76581
76581
|
var signals = require_signals();
|
|
76582
|
-
var isWin$1 = /^win/i.test(process$
|
|
76582
|
+
var isWin$1 = /^win/i.test(process$1.platform);
|
|
76583
76583
|
var EE = __require$3("events");
|
|
76584
76584
|
/* istanbul ignore if */
|
|
76585
76585
|
if (typeof EE !== "function") EE = EE.EventEmitter;
|
|
76586
76586
|
var emitter;
|
|
76587
|
-
if (process$
|
|
76587
|
+
if (process$1.__signal_exit_emitter__) emitter = process$1.__signal_exit_emitter__;
|
|
76588
76588
|
else {
|
|
76589
|
-
emitter = process$
|
|
76589
|
+
emitter = process$1.__signal_exit_emitter__ = new EE();
|
|
76590
76590
|
emitter.count = 0;
|
|
76591
76591
|
emitter.emitted = {};
|
|
76592
76592
|
}
|
|
@@ -76613,11 +76613,11 @@ var require_signal_exit = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
|
|
|
76613
76613
|
loaded = false;
|
|
76614
76614
|
signals.forEach(function(sig) {
|
|
76615
76615
|
try {
|
|
76616
|
-
process$
|
|
76616
|
+
process$1.removeListener(sig, sigListeners[sig]);
|
|
76617
76617
|
} catch (er) {}
|
|
76618
76618
|
});
|
|
76619
|
-
process$
|
|
76620
|
-
process$
|
|
76619
|
+
process$1.emit = originalProcessEmit;
|
|
76620
|
+
process$1.reallyExit = originalProcessReallyExit;
|
|
76621
76621
|
emitter.count -= 1;
|
|
76622
76622
|
};
|
|
76623
76623
|
module.exports.unload = unload;
|
|
@@ -76632,7 +76632,7 @@ var require_signal_exit = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
|
|
|
76632
76632
|
sigListeners[sig] = function listener() {
|
|
76633
76633
|
/* istanbul ignore if */
|
|
76634
76634
|
if (!processOk(global.process)) return;
|
|
76635
|
-
if (process$
|
|
76635
|
+
if (process$1.listeners(sig).length === emitter.count) {
|
|
76636
76636
|
unload();
|
|
76637
76637
|
emit("exit", null, sig);
|
|
76638
76638
|
/* istanbul ignore next */
|
|
@@ -76640,7 +76640,7 @@ var require_signal_exit = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
|
|
|
76640
76640
|
/* istanbul ignore next */
|
|
76641
76641
|
if (isWin$1 && sig === "SIGHUP") sig = "SIGINT";
|
|
76642
76642
|
/* istanbul ignore next */
|
|
76643
|
-
process$
|
|
76643
|
+
process$1.kill(process$1.pid, sig);
|
|
76644
76644
|
}
|
|
76645
76645
|
};
|
|
76646
76646
|
});
|
|
@@ -76654,37 +76654,37 @@ var require_signal_exit = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
|
|
|
76654
76654
|
emitter.count += 1;
|
|
76655
76655
|
signals = signals.filter(function(sig) {
|
|
76656
76656
|
try {
|
|
76657
|
-
process$
|
|
76657
|
+
process$1.on(sig, sigListeners[sig]);
|
|
76658
76658
|
return true;
|
|
76659
76659
|
} catch (er) {
|
|
76660
76660
|
return false;
|
|
76661
76661
|
}
|
|
76662
76662
|
});
|
|
76663
|
-
process$
|
|
76664
|
-
process$
|
|
76663
|
+
process$1.emit = processEmit;
|
|
76664
|
+
process$1.reallyExit = processReallyExit;
|
|
76665
76665
|
};
|
|
76666
76666
|
module.exports.load = load;
|
|
76667
|
-
var originalProcessReallyExit = process$
|
|
76667
|
+
var originalProcessReallyExit = process$1.reallyExit;
|
|
76668
76668
|
var processReallyExit = function processReallyExit$1(code) {
|
|
76669
76669
|
/* istanbul ignore if */
|
|
76670
76670
|
if (!processOk(global.process)) return;
|
|
76671
|
-
process$
|
|
76672
|
-
emit("exit", process$
|
|
76671
|
+
process$1.exitCode = code || 0;
|
|
76672
|
+
emit("exit", process$1.exitCode, null);
|
|
76673
76673
|
/* istanbul ignore next */
|
|
76674
|
-
emit("afterexit", process$
|
|
76674
|
+
emit("afterexit", process$1.exitCode, null);
|
|
76675
76675
|
/* istanbul ignore next */
|
|
76676
|
-
originalProcessReallyExit.call(process$
|
|
76676
|
+
originalProcessReallyExit.call(process$1, process$1.exitCode);
|
|
76677
76677
|
};
|
|
76678
|
-
var originalProcessEmit = process$
|
|
76678
|
+
var originalProcessEmit = process$1.emit;
|
|
76679
76679
|
var processEmit = function processEmit$1(ev, arg) {
|
|
76680
76680
|
if (ev === "exit" && processOk(global.process)) {
|
|
76681
76681
|
/* istanbul ignore else */
|
|
76682
|
-
if (arg !== void 0) process$
|
|
76682
|
+
if (arg !== void 0) process$1.exitCode = arg;
|
|
76683
76683
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
76684
76684
|
/* istanbul ignore next */
|
|
76685
|
-
emit("exit", process$
|
|
76685
|
+
emit("exit", process$1.exitCode, null);
|
|
76686
76686
|
/* istanbul ignore next */
|
|
76687
|
-
emit("afterexit", process$
|
|
76687
|
+
emit("afterexit", process$1.exitCode, null);
|
|
76688
76688
|
/* istanbul ignore next */
|
|
76689
76689
|
return ret;
|
|
76690
76690
|
} else return originalProcessEmit.apply(this, arguments);
|
|
@@ -76698,7 +76698,7 @@ var import_onetime = /* @__PURE__ */ __toESM$2(require_onetime(), 1);
|
|
|
76698
76698
|
var import_signal_exit = /* @__PURE__ */ __toESM$2(require_signal_exit(), 1);
|
|
76699
76699
|
const restoreCursor = (0, import_onetime.default)(() => {
|
|
76700
76700
|
(0, import_signal_exit.default)(() => {
|
|
76701
|
-
|
|
76701
|
+
process5.stderr.write("\x1B[?25h");
|
|
76702
76702
|
}, { alwaysLast: true });
|
|
76703
76703
|
});
|
|
76704
76704
|
var restore_cursor_default = restoreCursor;
|
|
@@ -76707,12 +76707,12 @@ var restore_cursor_default = restoreCursor;
|
|
|
76707
76707
|
//#region ../../node_modules/.pnpm/cli-cursor@4.0.0/node_modules/cli-cursor/index.js
|
|
76708
76708
|
let isHidden = false;
|
|
76709
76709
|
const cliCursor = {};
|
|
76710
|
-
cliCursor.show = (writableStream =
|
|
76710
|
+
cliCursor.show = (writableStream = process5.stderr) => {
|
|
76711
76711
|
if (!writableStream.isTTY) return;
|
|
76712
76712
|
isHidden = false;
|
|
76713
76713
|
writableStream.write("\x1B[?25h");
|
|
76714
76714
|
};
|
|
76715
|
-
cliCursor.hide = (writableStream =
|
|
76715
|
+
cliCursor.hide = (writableStream = process5.stderr) => {
|
|
76716
76716
|
if (!writableStream.isTTY) return;
|
|
76717
76717
|
restore_cursor_default();
|
|
76718
76718
|
isHidden = true;
|
|
@@ -77247,8 +77247,8 @@ function createLogUpdate(stream$2, { showCursor: showCursor$1 = false } = {}) {
|
|
|
77247
77247
|
};
|
|
77248
77248
|
return render;
|
|
77249
77249
|
}
|
|
77250
|
-
const logUpdate$2 = createLogUpdate(
|
|
77251
|
-
const logUpdateStderr = createLogUpdate(
|
|
77250
|
+
const logUpdate$2 = createLogUpdate(process5.stdout);
|
|
77251
|
+
const logUpdateStderr = createLogUpdate(process5.stderr);
|
|
77252
77252
|
|
|
77253
77253
|
//#endregion
|
|
77254
77254
|
//#region ../../node_modules/.pnpm/@cloudflare+cli-shared-helpers@0.3.6_vitest@5.0.4_@opentelemetry+api@1.9.1_@types+node@_8ad19c2891441732cf973a4bd95ecdfb/node_modules/@cloudflare/cli-shared-helpers/dist/interactive.mjs
|
|
@@ -89775,11 +89775,11 @@ var __name = (target$1, value) => __defProp(target$1, "name", {
|
|
|
89775
89775
|
var require_command_exists$1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js": ((exports, module) => {
|
|
89776
89776
|
var exec = __require$3("child_process").exec;
|
|
89777
89777
|
var execSync$1 = __require$3("child_process").execSync;
|
|
89778
|
-
var fs$
|
|
89778
|
+
var fs$1 = __require$3("fs");
|
|
89779
89779
|
var path$1 = __require$3("path");
|
|
89780
|
-
var access = fs$
|
|
89781
|
-
var accessSync$1 = fs$
|
|
89782
|
-
var constants$4 = fs$
|
|
89780
|
+
var access = fs$1.access;
|
|
89781
|
+
var accessSync$1 = fs$1.accessSync;
|
|
89782
|
+
var constants$4 = fs$1.constants || fs$1;
|
|
89783
89783
|
var isUsingWindows = process.platform == "win32";
|
|
89784
89784
|
var fileNotExists = function(commandName, callback$1) {
|
|
89785
89785
|
access(commandName, constants$4.F_OK, function(err) {
|
|
@@ -91513,11 +91513,11 @@ function build$3(options) {
|
|
|
91513
91513
|
return options.group ? groupFiles : empty;
|
|
91514
91514
|
}
|
|
91515
91515
|
const resolveSymlinksAsync = function(path$2, state, callback$1) {
|
|
91516
|
-
const { queue, fs: fs$
|
|
91516
|
+
const { queue, fs: fs$2, options: { suppressErrors } } = state;
|
|
91517
91517
|
queue.enqueue();
|
|
91518
|
-
fs$
|
|
91518
|
+
fs$2.realpath(path$2, (error$3, resolvedPath) => {
|
|
91519
91519
|
if (error$3) return queue.dequeue(suppressErrors ? null : error$3, state);
|
|
91520
|
-
fs$
|
|
91520
|
+
fs$2.stat(resolvedPath, (error$1$1, stat$1) => {
|
|
91521
91521
|
if (error$1$1) return queue.dequeue(suppressErrors ? null : error$1$1, state);
|
|
91522
91522
|
if (stat$1.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
|
|
91523
91523
|
callback$1(stat$1, resolvedPath);
|
|
@@ -91526,11 +91526,11 @@ const resolveSymlinksAsync = function(path$2, state, callback$1) {
|
|
|
91526
91526
|
});
|
|
91527
91527
|
};
|
|
91528
91528
|
const resolveSymlinks = function(path$2, state, callback$1) {
|
|
91529
|
-
const { queue, fs: fs$
|
|
91529
|
+
const { queue, fs: fs$2, options: { suppressErrors } } = state;
|
|
91530
91530
|
queue.enqueue();
|
|
91531
91531
|
try {
|
|
91532
|
-
const resolvedPath = fs$
|
|
91533
|
-
const stat$1 = fs$
|
|
91532
|
+
const resolvedPath = fs$2.realpathSync(path$2);
|
|
91533
|
+
const stat$1 = fs$2.statSync(resolvedPath);
|
|
91534
91534
|
if (stat$1.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
|
|
91535
91535
|
callback$1(stat$1, resolvedPath);
|
|
91536
91536
|
} catch (e) {
|
|
@@ -91599,22 +91599,22 @@ const readdirOpts = { withFileTypes: true };
|
|
|
91599
91599
|
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
91600
91600
|
state.queue.enqueue();
|
|
91601
91601
|
if (currentDepth < 0) return state.queue.dequeue(null, state);
|
|
91602
|
-
const { fs: fs$
|
|
91602
|
+
const { fs: fs$2 } = state;
|
|
91603
91603
|
state.visited.push(crawlPath);
|
|
91604
91604
|
state.counts.directories++;
|
|
91605
|
-
fs$
|
|
91605
|
+
fs$2.readdir(crawlPath || ".", readdirOpts, (error$3, entries = []) => {
|
|
91606
91606
|
callback$1(entries, directoryPath, currentDepth);
|
|
91607
91607
|
state.queue.dequeue(state.options.suppressErrors ? null : error$3, state);
|
|
91608
91608
|
});
|
|
91609
91609
|
};
|
|
91610
91610
|
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
91611
|
-
const { fs: fs$
|
|
91611
|
+
const { fs: fs$2 } = state;
|
|
91612
91612
|
if (currentDepth < 0) return;
|
|
91613
91613
|
state.visited.push(crawlPath);
|
|
91614
91614
|
state.counts.directories++;
|
|
91615
91615
|
let entries = [];
|
|
91616
91616
|
try {
|
|
91617
|
-
entries = fs$
|
|
91617
|
+
entries = fs$2.readdirSync(crawlPath || ".", readdirOpts);
|
|
91618
91618
|
} catch (e) {
|
|
91619
91619
|
if (!state.options.suppressErrors) throw e;
|
|
91620
91620
|
}
|
|
@@ -94182,7 +94182,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
|
|
|
94182
94182
|
modules: [{
|
|
94183
94183
|
type: "ESModule",
|
|
94184
94184
|
path: path.join(miniflareModulesRoot, ROUTER_WORKER_PATH),
|
|
94185
|
-
contents: fs
|
|
94185
|
+
contents: fs.readFileSync(fileURLToPath(new URL(ROUTER_WORKER_PATH, import.meta.url)))
|
|
94186
94186
|
}],
|
|
94187
94187
|
bindings: { CONFIG: { has_user_worker: resolvedPluginConfig.type === "workers" } },
|
|
94188
94188
|
serviceBindings: {
|
|
@@ -94198,7 +94198,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
|
|
|
94198
94198
|
modules: [{
|
|
94199
94199
|
type: "ESModule",
|
|
94200
94200
|
path: path.join(miniflareModulesRoot, ASSET_WORKER_PATH),
|
|
94201
|
-
contents: fs
|
|
94201
|
+
contents: fs.readFileSync(fileURLToPath(new URL(ASSET_WORKER_PATH, import.meta.url)))
|
|
94202
94202
|
}],
|
|
94203
94203
|
bindings: {
|
|
94204
94204
|
CONFIG: assetsConfig,
|
|
@@ -94259,7 +94259,7 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
|
|
|
94259
94259
|
modules: [{
|
|
94260
94260
|
type: "ESModule",
|
|
94261
94261
|
path: path.join(miniflareModulesRoot, VITE_PROXY_WORKER_PATH),
|
|
94262
|
-
contents: fs
|
|
94262
|
+
contents: fs.readFileSync(fileURLToPath(new URL(VITE_PROXY_WORKER_PATH, import.meta.url)))
|
|
94263
94263
|
}],
|
|
94264
94264
|
serviceBindings: {
|
|
94265
94265
|
...entryWorkerConfig ? { ENTRY_USER_WORKER: entryWorkerConfig.name } : {},
|
|
@@ -94327,12 +94327,12 @@ async function getDevMiniflareOptions(ctx, viteDevServer) {
|
|
|
94327
94327
|
{
|
|
94328
94328
|
type: "ESModule",
|
|
94329
94329
|
path: path.join(miniflareModulesRoot, RUNNER_PATH),
|
|
94330
|
-
contents: fs
|
|
94330
|
+
contents: fs.readFileSync(fileURLToPath(new URL(RUNNER_PATH, import.meta.url)))
|
|
94331
94331
|
},
|
|
94332
94332
|
{
|
|
94333
94333
|
type: "ESModule",
|
|
94334
94334
|
path: path.join(miniflareModulesRoot, "workers/runner-worker/vite/module-runner"),
|
|
94335
|
-
contents: fs
|
|
94335
|
+
contents: fs.readFileSync(fileURLToPath(new URL(satisfiesMinimumViteVersion("7.2.0") ? MODULE_RUNNER_PATH : MODULE_RUNNER_LEGACY_PATH, import.meta.url)))
|
|
94336
94336
|
}
|
|
94337
94337
|
],
|
|
94338
94338
|
unsafeUseModuleFallbackService: true,
|
|
@@ -95151,7 +95151,7 @@ function isInsideContainer() {
|
|
|
95151
95151
|
//#endregion
|
|
95152
95152
|
//#region ../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
|
|
95153
95153
|
const isWsl = () => {
|
|
95154
|
-
if (
|
|
95154
|
+
if (process5.platform !== "linux") return false;
|
|
95155
95155
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
95156
95156
|
if (isInsideContainer()) return false;
|
|
95157
95157
|
return true;
|
|
@@ -95162,12 +95162,12 @@ const isWsl = () => {
|
|
|
95162
95162
|
return false;
|
|
95163
95163
|
}
|
|
95164
95164
|
};
|
|
95165
|
-
var is_wsl_default =
|
|
95165
|
+
var is_wsl_default = process5.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
95166
95166
|
|
|
95167
95167
|
//#endregion
|
|
95168
95168
|
//#region ../../node_modules/.pnpm/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
|
|
95169
95169
|
const execFile$2 = promisify(childProcess.execFile);
|
|
95170
|
-
const powerShellPath$1 = () => `${
|
|
95170
|
+
const powerShellPath$1 = () => `${process5.env.SYSTEMROOT || process5.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
95171
95171
|
const executePowerShell = async (command, options = {}) => {
|
|
95172
95172
|
const { powerShellPath: psPath,...execFileOptions } = options;
|
|
95173
95173
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
@@ -95208,11 +95208,11 @@ const wslDrivesMountPoint = (() => {
|
|
|
95208
95208
|
const configFilePath = "/etc/wsl.conf";
|
|
95209
95209
|
let isConfigFileExists = false;
|
|
95210
95210
|
try {
|
|
95211
|
-
await
|
|
95211
|
+
await fs4.access(configFilePath, constants$1.F_OK);
|
|
95212
95212
|
isConfigFileExists = true;
|
|
95213
95213
|
} catch {}
|
|
95214
95214
|
if (!isConfigFileExists) return defaultMountPoint;
|
|
95215
|
-
const parsedMountPoint = parseMountPointFromConfig(await
|
|
95215
|
+
const parsedMountPoint = parseMountPointFromConfig(await fs4.readFile(configFilePath, { encoding: "utf8" }));
|
|
95216
95216
|
if (parsedMountPoint === void 0) return defaultMountPoint;
|
|
95217
95217
|
mountPoint = parsedMountPoint;
|
|
95218
95218
|
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
@@ -95228,7 +95228,7 @@ const canAccessPowerShell = async () => {
|
|
|
95228
95228
|
canAccessPowerShellPromise ??= (async () => {
|
|
95229
95229
|
try {
|
|
95230
95230
|
const psPath = await powerShellPath();
|
|
95231
|
-
await
|
|
95231
|
+
await fs4.access(psPath, constants$1.X_OK);
|
|
95232
95232
|
return true;
|
|
95233
95233
|
} catch {
|
|
95234
95234
|
return false;
|
|
@@ -95278,7 +95278,7 @@ function defineLazyProperty(object$2, propertyName, valueGetter) {
|
|
|
95278
95278
|
//#region ../../node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
95279
95279
|
const execFileAsync$3 = promisify(execFile);
|
|
95280
95280
|
async function defaultBrowserId() {
|
|
95281
|
-
if (
|
|
95281
|
+
if (process5.platform !== "darwin") throw new Error("macOS only");
|
|
95282
95282
|
const { stdout: stdout$3 } = await execFileAsync$3("defaults", [
|
|
95283
95283
|
"read",
|
|
95284
95284
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
@@ -95293,7 +95293,7 @@ async function defaultBrowserId() {
|
|
|
95293
95293
|
//#region ../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
95294
95294
|
const execFileAsync$2 = promisify(execFile);
|
|
95295
95295
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
95296
|
-
if (
|
|
95296
|
+
if (process5.platform !== "darwin") throw new Error("macOS only");
|
|
95297
95297
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
95298
95298
|
const execOptions = {};
|
|
95299
95299
|
if (signal) execOptions.signal = signal;
|
|
@@ -95402,14 +95402,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
|
95402
95402
|
const execFileAsync = promisify(execFile);
|
|
95403
95403
|
const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
95404
95404
|
async function defaultBrowser() {
|
|
95405
|
-
if (
|
|
95405
|
+
if (process5.platform === "darwin") {
|
|
95406
95406
|
const id = await defaultBrowserId();
|
|
95407
95407
|
return {
|
|
95408
95408
|
name: await bundleName(id),
|
|
95409
95409
|
id
|
|
95410
95410
|
};
|
|
95411
95411
|
}
|
|
95412
|
-
if (
|
|
95412
|
+
if (process5.platform === "linux") {
|
|
95413
95413
|
const { stdout: stdout$3 } = await execFileAsync("xdg-mime", [
|
|
95414
95414
|
"query",
|
|
95415
95415
|
"default",
|
|
@@ -95421,13 +95421,13 @@ async function defaultBrowser() {
|
|
|
95421
95421
|
id
|
|
95422
95422
|
};
|
|
95423
95423
|
}
|
|
95424
|
-
if (
|
|
95424
|
+
if (process5.platform === "win32") return defaultBrowser$1();
|
|
95425
95425
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
95426
95426
|
}
|
|
95427
95427
|
|
|
95428
95428
|
//#endregion
|
|
95429
95429
|
//#region ../../node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
95430
|
-
const isInSsh = Boolean(
|
|
95430
|
+
const isInSsh = Boolean(process5.env.SSH_CONNECTION || process5.env.SSH_CLIENT || process5.env.SSH_TTY);
|
|
95431
95431
|
var is_in_ssh_default = isInSsh;
|
|
95432
95432
|
|
|
95433
95433
|
//#endregion
|
|
@@ -95435,7 +95435,7 @@ var is_in_ssh_default = isInSsh;
|
|
|
95435
95435
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
95436
95436
|
const __dirname = import.meta.url ? path__default.dirname(fileURLToPath(import.meta.url)) : "";
|
|
95437
95437
|
const localXdgOpenPath = path__default.join(__dirname, "xdg-open");
|
|
95438
|
-
const { platform, arch: arch$1 } =
|
|
95438
|
+
const { platform, arch: arch$1 } = process5;
|
|
95439
95439
|
const tryEachApp = async (apps$1, opener) => {
|
|
95440
95440
|
if (apps$1.length === 0) return;
|
|
95441
95441
|
const errors$1 = [];
|
|
@@ -95545,10 +95545,10 @@ const baseOpen = async (options) => {
|
|
|
95545
95545
|
const isBundled = !__dirname || __dirname === "/";
|
|
95546
95546
|
let exeLocalXdgOpen = false;
|
|
95547
95547
|
try {
|
|
95548
|
-
await
|
|
95548
|
+
await fs4.access(localXdgOpenPath, constants$1.X_OK);
|
|
95549
95549
|
exeLocalXdgOpen = true;
|
|
95550
95550
|
} catch {}
|
|
95551
|
-
command =
|
|
95551
|
+
command = process5.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
95552
95552
|
}
|
|
95553
95553
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
95554
95554
|
if (!options.wait) {
|
|
@@ -4,10 +4,10 @@ import fs2 from "node:fs";
|
|
|
4
4
|
import path__default from "node:path";
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
|
-
import
|
|
7
|
+
import process5 from "node:process";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { Buffer } from "node:buffer";
|
|
10
|
-
import
|
|
10
|
+
import fs4, { constants as constants$1 } from "node:fs/promises";
|
|
11
11
|
import childProcess, { execFile } from "node:child_process";
|
|
12
12
|
|
|
13
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
|
|
@@ -50,7 +50,7 @@ function isInsideContainer() {
|
|
|
50
50
|
}
|
|
51
51
|
__name(isInsideContainer, "isInsideContainer");
|
|
52
52
|
var isWsl = /* @__PURE__ */ __name(() => {
|
|
53
|
-
if (
|
|
53
|
+
if (process5.platform !== "linux") return false;
|
|
54
54
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
55
55
|
if (isInsideContainer()) return false;
|
|
56
56
|
return true;
|
|
@@ -61,9 +61,9 @@ var isWsl = /* @__PURE__ */ __name(() => {
|
|
|
61
61
|
return false;
|
|
62
62
|
}
|
|
63
63
|
}, "isWsl");
|
|
64
|
-
var is_wsl_default =
|
|
64
|
+
var is_wsl_default = process5.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
65
65
|
var execFile$1 = promisify(childProcess.execFile);
|
|
66
|
-
var powerShellPath = /* @__PURE__ */ __name(() => `${
|
|
66
|
+
var powerShellPath = /* @__PURE__ */ __name(() => `${process5.env.SYSTEMROOT || process5.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, "powerShellPath");
|
|
67
67
|
var executePowerShell = /* @__PURE__ */ __name(async (command, options = {}) => {
|
|
68
68
|
const { powerShellPath: psPath,...execFileOptions } = options;
|
|
69
69
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
@@ -99,11 +99,11 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
|
99
99
|
const configFilePath = "/etc/wsl.conf";
|
|
100
100
|
let isConfigFileExists = false;
|
|
101
101
|
try {
|
|
102
|
-
await
|
|
102
|
+
await fs4.access(configFilePath, constants$1.F_OK);
|
|
103
103
|
isConfigFileExists = true;
|
|
104
104
|
} catch {}
|
|
105
105
|
if (!isConfigFileExists) return defaultMountPoint;
|
|
106
|
-
const parsedMountPoint = parseMountPointFromConfig(await
|
|
106
|
+
const parsedMountPoint = parseMountPointFromConfig(await fs4.readFile(configFilePath, { encoding: "utf8" }));
|
|
107
107
|
if (parsedMountPoint === void 0) return defaultMountPoint;
|
|
108
108
|
mountPoint = parsedMountPoint;
|
|
109
109
|
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
@@ -118,7 +118,7 @@ var canAccessPowerShell = /* @__PURE__ */ __name(async () => {
|
|
|
118
118
|
canAccessPowerShellPromise ??= (async () => {
|
|
119
119
|
try {
|
|
120
120
|
const psPath = await powerShellPath2();
|
|
121
|
-
await
|
|
121
|
+
await fs4.access(psPath, constants$1.X_OK);
|
|
122
122
|
return true;
|
|
123
123
|
} catch {
|
|
124
124
|
return false;
|
|
@@ -163,7 +163,7 @@ function defineLazyProperty(object, propertyName, valueGetter) {
|
|
|
163
163
|
__name(defineLazyProperty, "defineLazyProperty");
|
|
164
164
|
var execFileAsync = promisify(execFile);
|
|
165
165
|
async function defaultBrowserId() {
|
|
166
|
-
if (
|
|
166
|
+
if (process5.platform !== "darwin") throw new Error("macOS only");
|
|
167
167
|
const { stdout: stdout$1 } = await execFileAsync("defaults", [
|
|
168
168
|
"read",
|
|
169
169
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
@@ -176,7 +176,7 @@ async function defaultBrowserId() {
|
|
|
176
176
|
__name(defaultBrowserId, "defaultBrowserId");
|
|
177
177
|
var execFileAsync2 = promisify(execFile);
|
|
178
178
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
179
|
-
if (
|
|
179
|
+
if (process5.platform !== "darwin") throw new Error("macOS only");
|
|
180
180
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
181
181
|
const execOptions = {};
|
|
182
182
|
if (signal) execOptions.signal = signal;
|
|
@@ -284,14 +284,14 @@ __name(defaultBrowser, "defaultBrowser");
|
|
|
284
284
|
var execFileAsync4 = promisify(execFile);
|
|
285
285
|
var titleize = /* @__PURE__ */ __name((string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase()), "titleize");
|
|
286
286
|
async function defaultBrowser2() {
|
|
287
|
-
if (
|
|
287
|
+
if (process5.platform === "darwin") {
|
|
288
288
|
const id = await defaultBrowserId();
|
|
289
289
|
return {
|
|
290
290
|
name: await bundleName(id),
|
|
291
291
|
id
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
if (
|
|
294
|
+
if (process5.platform === "linux") {
|
|
295
295
|
const { stdout: stdout$1 } = await execFileAsync4("xdg-mime", [
|
|
296
296
|
"query",
|
|
297
297
|
"default",
|
|
@@ -303,15 +303,15 @@ async function defaultBrowser2() {
|
|
|
303
303
|
id
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
|
-
if (
|
|
306
|
+
if (process5.platform === "win32") return defaultBrowser();
|
|
307
307
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
308
308
|
}
|
|
309
309
|
__name(defaultBrowser2, "defaultBrowser");
|
|
310
|
-
var is_in_ssh_default = Boolean(
|
|
310
|
+
var is_in_ssh_default = Boolean(process5.env.SSH_CONNECTION || process5.env.SSH_CLIENT || process5.env.SSH_TTY);
|
|
311
311
|
var fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
312
312
|
var __dirname$1 = import.meta.url ? path__default.dirname(fileURLToPath(import.meta.url)) : "";
|
|
313
313
|
var localXdgOpenPath = path__default.join(__dirname$1, "xdg-open");
|
|
314
|
-
var { platform, arch: arch$1 } =
|
|
314
|
+
var { platform, arch: arch$1 } = process5;
|
|
315
315
|
var tryEachApp = /* @__PURE__ */ __name(async (apps2, opener) => {
|
|
316
316
|
if (apps2.length === 0) return;
|
|
317
317
|
const errors = [];
|
|
@@ -421,10 +421,10 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
421
421
|
const isBundled = !__dirname$1 || __dirname$1 === "/";
|
|
422
422
|
let exeLocalXdgOpen = false;
|
|
423
423
|
try {
|
|
424
|
-
await
|
|
424
|
+
await fs4.access(localXdgOpenPath, constants$1.X_OK);
|
|
425
425
|
exeLocalXdgOpen = true;
|
|
426
426
|
} catch {}
|
|
427
|
-
command =
|
|
427
|
+
command = process5.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
428
428
|
}
|
|
429
429
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
430
430
|
if (!options.wait) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "1.69.
|
|
3
|
+
"version": "1.69.1",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"vitest": "5.0.4",
|
|
69
69
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
70
70
|
"@cloudflare/workers-shared": "0.20.1",
|
|
71
|
-
"@cloudflare/
|
|
72
|
-
"@cloudflare/
|
|
71
|
+
"@cloudflare/remote-bindings": "0.0.47",
|
|
72
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"vite": "^6.1.0 || ^7.0.0 || ^8.0.0",
|