UEA-PRODEM
This commit is contained in:
+181
-92
@@ -2284,11 +2284,11 @@ function processSrcSetSync(srcs, replacer) {
|
||||
descriptor
|
||||
})));
|
||||
}
|
||||
const windowsDriveRE = /^[A-Z]:/;
|
||||
const windowsDriveRE$1 = /^[A-Z]:/;
|
||||
const replaceWindowsDriveRE = /^([A-Z]):\//;
|
||||
const linuxAbsolutePathRE = /^\/[^/]/;
|
||||
function escapeToLinuxLikePath(path$13) {
|
||||
if (windowsDriveRE.test(path$13)) return path$13.replace(replaceWindowsDriveRE, "/windows/$1/");
|
||||
if (windowsDriveRE$1.test(path$13)) return path$13.replace(replaceWindowsDriveRE, "/windows/$1/");
|
||||
if (linuxAbsolutePathRE.test(path$13)) return `/linux${path$13}`;
|
||||
return path$13;
|
||||
}
|
||||
@@ -6212,6 +6212,21 @@ const buildEsbuildPlugin = () => {
|
||||
}
|
||||
};
|
||||
};
|
||||
const destructuringBugRE = /^(safari|ios)(\d+)(?:\.(\d+))?$/;
|
||||
function needsDestructuringSupportedWorkaround(target) {
|
||||
if (!target) return false;
|
||||
const targets = Array.isArray(target) ? target : [target];
|
||||
for (const t$1 of targets) {
|
||||
const match = destructuringBugRE.exec(t$1);
|
||||
if (!match) continue;
|
||||
const major = Number(match[2]);
|
||||
if (major < 10) continue;
|
||||
if (major < 14) return true;
|
||||
if (major > 14) continue;
|
||||
if ((match[3] ? Number(match[3]) : 0) < (match[1] === "safari" ? 1 : 5)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function resolveEsbuildTranspileOptions(config$2, format$3) {
|
||||
const target = config$2.build.target;
|
||||
const minify = config$2.build.minify === "esbuild";
|
||||
@@ -6225,6 +6240,7 @@ function resolveEsbuildTranspileOptions(config$2, format$3) {
|
||||
format: rollupToEsbuildFormatMap[format$3],
|
||||
supported: {
|
||||
...defaultEsbuildSupported,
|
||||
...needsDestructuringSupportedWorkaround(target) ? { destructuring: true } : null,
|
||||
...esbuildOptions.supported
|
||||
}
|
||||
};
|
||||
@@ -8918,7 +8934,8 @@ function optimizedDepsPlugin() {
|
||||
if (this.environment.depsOptimizer?.isOptimizedDepFile(id)) return id;
|
||||
},
|
||||
async load(id) {
|
||||
const depsOptimizer = this.environment.depsOptimizer;
|
||||
const environment = this.environment;
|
||||
const depsOptimizer = environment.depsOptimizer;
|
||||
if (depsOptimizer?.isOptimizedDepFile(id)) {
|
||||
const metadata = depsOptimizer.metadata;
|
||||
const file = cleanUrl(id);
|
||||
@@ -8926,7 +8943,7 @@ function optimizedDepsPlugin() {
|
||||
const browserHash = versionMatch ? versionMatch[1].split("=")[1] : void 0;
|
||||
const info = optimizedDepInfoFromFile(metadata, file);
|
||||
if (info) {
|
||||
if (browserHash && info.browserHash !== browserHash) throwOutdatedRequest(id);
|
||||
if (browserHash && info.browserHash !== browserHash && !environment.config.optimizeDeps.ignoreOutdatedRequests) throwOutdatedRequest(id);
|
||||
try {
|
||||
await info.processing;
|
||||
} catch {
|
||||
@@ -8935,14 +8952,14 @@ function optimizedDepsPlugin() {
|
||||
const newMetadata = depsOptimizer.metadata;
|
||||
if (metadata !== newMetadata) {
|
||||
const currentInfo = optimizedDepInfoFromFile(newMetadata, file);
|
||||
if (info.browserHash !== currentInfo?.browserHash) throwOutdatedRequest(id);
|
||||
if (info.browserHash !== currentInfo?.browserHash && !environment.config.optimizeDeps.ignoreOutdatedRequests) throwOutdatedRequest(id);
|
||||
}
|
||||
}
|
||||
debug$15?.(`load ${import_picocolors$29.default.cyan(file)}`);
|
||||
try {
|
||||
return await fsp.readFile(file, "utf-8");
|
||||
} catch {
|
||||
if (browserHash) throwOutdatedRequest(id);
|
||||
if (browserHash && !environment.config.optimizeDeps.ignoreOutdatedRequests) throwOutdatedRequest(id);
|
||||
throwFileNotFoundInOptimizedDep(id);
|
||||
}
|
||||
}
|
||||
@@ -14349,12 +14366,47 @@ var require_chokidar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js
|
||||
//#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/quote.js
|
||||
var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
var OPS = [
|
||||
"||",
|
||||
"&&",
|
||||
";;",
|
||||
"|&",
|
||||
"<(",
|
||||
"<<<",
|
||||
">>",
|
||||
">&",
|
||||
"<&",
|
||||
"&",
|
||||
";",
|
||||
"(",
|
||||
")",
|
||||
"|",
|
||||
"<",
|
||||
">"
|
||||
];
|
||||
var LINE_TERMINATORS = /[\n\r\u2028\u2029]/;
|
||||
var GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|]/g;
|
||||
module.exports = function quote(xs) {
|
||||
return xs.map(function(s) {
|
||||
if (s === "") return "''";
|
||||
if (s && typeof s === "object") return s.op.replace(/(.)/g, "\\$1");
|
||||
if (s && typeof s === "object") {
|
||||
if (s.op === "glob") {
|
||||
if (typeof s.pattern !== "string") throw new TypeError("glob token requires a string `pattern`");
|
||||
if (LINE_TERMINATORS.test(s.pattern)) throw new TypeError("glob `pattern` must not contain line terminators");
|
||||
return s.pattern.replace(GLOB_SHELL_SPECIAL, "\\$&");
|
||||
}
|
||||
if (typeof s.op === "string") {
|
||||
if (OPS.indexOf(s.op) < 0) throw new TypeError("invalid `op` value: " + JSON.stringify(s.op));
|
||||
return s.op.replace(/[\s\S]/g, "\\$&");
|
||||
}
|
||||
if (typeof s.comment === "string") {
|
||||
if (LINE_TERMINATORS.test(s.comment)) throw new TypeError("`comment` must not contain line terminators");
|
||||
return "#" + s.comment;
|
||||
}
|
||||
throw new TypeError("unrecognized object token shape");
|
||||
}
|
||||
if (/["\s\\]/.test(s) && !/'/.test(s)) return "'" + s.replace(/(['])/g, "\\$1") + "'";
|
||||
if (/["'\s]/.test(s)) return "\"" + s.replace(/(["\\$`!])/g, "\\$1") + "\"";
|
||||
return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2");
|
||||
@@ -14363,7 +14415,7 @@ var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js
|
||||
//#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/parse.js
|
||||
var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
var CONTROL = "(?:" + [
|
||||
"\\|\\|",
|
||||
@@ -14503,14 +14555,14 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js
|
||||
//#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/index.js
|
||||
var require_shell_quote = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
exports.quote = require_quote();
|
||||
exports.parse = require_parse$1();
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.12.0/node_modules/launch-editor/editor-info/macos.js
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js
|
||||
var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = {
|
||||
"/Applications/Atom.app/Contents/MacOS/Atom": "atom",
|
||||
@@ -14520,11 +14572,14 @@ var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
"/Applications/Sublime Text.app/Contents/MacOS/sublime_text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
|
||||
"/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2": "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl",
|
||||
"/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl",
|
||||
"/Applications/Visual Studio Code.app/Contents/MacOS/Code": "code",
|
||||
"/Applications/Visual Studio Code.app/Contents/MacOS/Electron": "code",
|
||||
"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders": "code-insiders",
|
||||
"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron": "code-insiders",
|
||||
"/Applications/VSCodium.app/Contents/MacOS/Electron": "codium",
|
||||
"/Applications/Cursor.app/Contents/MacOS/Cursor": "cursor",
|
||||
"/Applications/Trae.app/Contents/MacOS/Electron": "trae",
|
||||
"/Applications/Antigravity.app/Contents/MacOS/Electron": "antigravity",
|
||||
"/Applications/AppCode.app/Contents/MacOS/appcode": "/Applications/AppCode.app/Contents/MacOS/appcode",
|
||||
"/Applications/CLion.app/Contents/MacOS/clion": "/Applications/CLion.app/Contents/MacOS/clion",
|
||||
"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea",
|
||||
@@ -14543,7 +14598,7 @@ var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.12.0/node_modules/launch-editor/editor-info/linux.js
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js
|
||||
var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = {
|
||||
atom: "atom",
|
||||
@@ -14554,6 +14609,7 @@ var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
codium: "codium",
|
||||
cursor: "cursor",
|
||||
trae: "trae",
|
||||
antigravity: "antigravity",
|
||||
emacs: "emacs",
|
||||
gvim: "gvim",
|
||||
idea: "idea",
|
||||
@@ -14577,7 +14633,7 @@ var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.12.0/node_modules/launch-editor/editor-info/windows.js
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js
|
||||
var require_windows$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = [
|
||||
"Brackets.exe",
|
||||
@@ -14604,12 +14660,14 @@ var require_windows$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
"goland64.exe",
|
||||
"rider.exe",
|
||||
"rider64.exe",
|
||||
"trae.exe"
|
||||
"Trae.exe",
|
||||
"zed.exe",
|
||||
"Antigravity.exe"
|
||||
];
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.12.0/node_modules/launch-editor/guess.js
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js
|
||||
var require_guess = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const path$8 = __require("path");
|
||||
const shellQuote = require_shell_quote();
|
||||
@@ -14617,61 +14675,75 @@ var require_guess = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const COMMON_EDITORS_MACOS = require_macos();
|
||||
const COMMON_EDITORS_LINUX = require_linux();
|
||||
const COMMON_EDITORS_WIN = require_windows$1();
|
||||
module.exports = function guessEditor$1(specifiedEditor) {
|
||||
function getEditorFromMacProcesses(output) {
|
||||
const processNames = Object.keys(COMMON_EDITORS_MACOS);
|
||||
const processList = output.split("\n");
|
||||
for (let i$1 = 0; i$1 < processNames.length; i$1++) {
|
||||
const processName = processNames[i$1];
|
||||
if (processList.includes(processName)) return COMMON_EDITORS_MACOS[processName];
|
||||
const processNameWithoutApplications = processName.replace("/Applications", "");
|
||||
if (output.indexOf(processNameWithoutApplications) !== -1) {
|
||||
if (processName !== COMMON_EDITORS_MACOS[processName]) return COMMON_EDITORS_MACOS[processName];
|
||||
const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications));
|
||||
if (runningProcess !== void 0) return runningProcess;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getEditorFromWindowsProcesses(output) {
|
||||
const runningProcesses = output.split("\r\n");
|
||||
for (let i$1 = 0; i$1 < runningProcesses.length; i$1++) {
|
||||
const fullProcessPath = runningProcesses[i$1].trim();
|
||||
const shortProcessName = path$8.win32.basename(fullProcessPath);
|
||||
if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) return fullProcessPath;
|
||||
}
|
||||
}
|
||||
function getEditorFromLinuxProcesses(output) {
|
||||
const processNames = Object.keys(COMMON_EDITORS_LINUX);
|
||||
for (let i$1 = 0; i$1 < processNames.length; i$1++) {
|
||||
const processName = processNames[i$1];
|
||||
if (output.indexOf(processName) !== -1) return COMMON_EDITORS_LINUX[processName];
|
||||
}
|
||||
}
|
||||
function guessEditor$1(specifiedEditor) {
|
||||
if (specifiedEditor) return shellQuote.parse(specifiedEditor);
|
||||
if (process.env.LAUNCH_EDITOR) return [process.env.LAUNCH_EDITOR];
|
||||
if (process.versions.webcontainer) return [process.env.EDITOR || "code"];
|
||||
try {
|
||||
if (process.platform === "darwin") {
|
||||
const output = childProcess$2.execSync("ps x -o comm=", { stdio: [
|
||||
const editor = getEditorFromMacProcesses(childProcess$2.execSync("ps x -o comm=", { stdio: [
|
||||
"pipe",
|
||||
"pipe",
|
||||
"ignore"
|
||||
] }).toString();
|
||||
const processNames = Object.keys(COMMON_EDITORS_MACOS);
|
||||
const processList = output.split("\n");
|
||||
for (let i$1 = 0; i$1 < processNames.length; i$1++) {
|
||||
const processName = processNames[i$1];
|
||||
if (processList.includes(processName)) return [COMMON_EDITORS_MACOS[processName]];
|
||||
const processNameWithoutApplications = processName.replace("/Applications", "");
|
||||
if (output.indexOf(processNameWithoutApplications) !== -1) {
|
||||
if (processName !== COMMON_EDITORS_MACOS[processName]) return [COMMON_EDITORS_MACOS[processName]];
|
||||
const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications));
|
||||
if (runningProcess !== void 0) return [runningProcess];
|
||||
}
|
||||
}
|
||||
] }).toString());
|
||||
if (editor !== void 0) return [editor];
|
||||
} else if (process.platform === "win32") {
|
||||
const runningProcesses = childProcess$2.execSync("powershell -NoProfile -Command \"[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\\"select executablepath from win32_process where executablepath is not null\\\" | % { $_.ExecutablePath }\"", { stdio: [
|
||||
const editor = getEditorFromWindowsProcesses(childProcess$2.execSync("powershell -NoProfile -Command \"[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\\"select executablepath from win32_process where executablepath is not null\\\" | % { $_.ExecutablePath }\"", { stdio: [
|
||||
"pipe",
|
||||
"pipe",
|
||||
"ignore"
|
||||
] }).toString().split("\r\n");
|
||||
for (let i$1 = 0; i$1 < runningProcesses.length; i$1++) {
|
||||
const fullProcessPath = runningProcesses[i$1].trim();
|
||||
const shortProcessName = path$8.basename(fullProcessPath);
|
||||
if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) return [fullProcessPath];
|
||||
}
|
||||
] }).toString());
|
||||
if (editor !== void 0) return [editor];
|
||||
} else if (process.platform === "linux") {
|
||||
const output = childProcess$2.execSync("ps x --no-heading -o comm --sort=comm", { stdio: [
|
||||
const editor = getEditorFromLinuxProcesses(childProcess$2.execSync("ps x --no-heading -o comm --sort=comm", { stdio: [
|
||||
"pipe",
|
||||
"pipe",
|
||||
"ignore"
|
||||
] }).toString();
|
||||
const processNames = Object.keys(COMMON_EDITORS_LINUX);
|
||||
for (let i$1 = 0; i$1 < processNames.length; i$1++) {
|
||||
const processName = processNames[i$1];
|
||||
if (output.indexOf(processName) !== -1) return [COMMON_EDITORS_LINUX[processName]];
|
||||
}
|
||||
] }).toString());
|
||||
if (editor !== void 0) return [editor];
|
||||
}
|
||||
} catch (ignoreError) {}
|
||||
if (process.env.VISUAL) return [process.env.VISUAL];
|
||||
else if (process.env.EDITOR) return [process.env.EDITOR];
|
||||
return [null];
|
||||
};
|
||||
}
|
||||
module.exports = guessEditor$1;
|
||||
module.exports.getEditorFromMacProcesses = getEditorFromMacProcesses;
|
||||
module.exports.getEditorFromWindowsProcesses = getEditorFromWindowsProcesses;
|
||||
module.exports.getEditorFromLinuxProcesses = getEditorFromLinuxProcesses;
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.12.0/node_modules/launch-editor/get-args.js
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js
|
||||
var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const path$7 = __require("path");
|
||||
module.exports = function getArgumentsForPosition$1(editor, fileName, lineNumber, columnNumber = 1) {
|
||||
@@ -14709,6 +14781,7 @@ var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
case "Code - Insiders":
|
||||
case "codium":
|
||||
case "trae":
|
||||
case "antigravity":
|
||||
case "cursor":
|
||||
case "vscodium":
|
||||
case "VSCodium": return [
|
||||
@@ -14750,7 +14823,7 @@ var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.12.0/node_modules/launch-editor/index.js
|
||||
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/index.js
|
||||
var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
@@ -14799,11 +14872,12 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
||||
columnNumber: match && match[3]
|
||||
};
|
||||
}
|
||||
let _childProcess = null;
|
||||
let currentChildProcess = null;
|
||||
function launchEditor(file, specifiedEditor, onErrorCallback) {
|
||||
const parsed = parseFile(file);
|
||||
let { fileName } = parsed;
|
||||
const { lineNumber, columnNumber } = parsed;
|
||||
if (process.platform === "win32" && path$6.resolve(fileName).startsWith("\\\\")) return onErrorCallback(fileName, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
|
||||
if (!fs$5.existsSync(fileName)) return;
|
||||
if (typeof specifiedEditor === "function") {
|
||||
onErrorCallback = specifiedEditor;
|
||||
@@ -14820,7 +14894,7 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
||||
const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
|
||||
args.push.apply(args, extraArgs);
|
||||
} else args.push(fileName);
|
||||
if (_childProcess && isTerminalEditor(editor)) _childProcess.kill("SIGKILL");
|
||||
if (currentChildProcess && isTerminalEditor(editor)) currentChildProcess.kill("SIGKILL");
|
||||
if (process.platform === "win32") {
|
||||
function escapeCmdArgs(cmdArgs) {
|
||||
return cmdArgs.replace(/([&|<>,;=^])/g, "^$1");
|
||||
@@ -14831,16 +14905,16 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
||||
return str;
|
||||
}
|
||||
const launchCommand = [editor, ...args.map(escapeCmdArgs)].map(doubleQuoteIfNeeded).join(" ");
|
||||
_childProcess = childProcess$1.exec(launchCommand, {
|
||||
currentChildProcess = childProcess$1.exec(launchCommand, {
|
||||
stdio: "inherit",
|
||||
shell: true
|
||||
});
|
||||
} else _childProcess = childProcess$1.spawn(editor, args, { stdio: "inherit" });
|
||||
_childProcess.on("exit", function(errorCode) {
|
||||
_childProcess = null;
|
||||
} else currentChildProcess = childProcess$1.spawn(editor, args, { stdio: "inherit" });
|
||||
currentChildProcess.on("exit", function(errorCode) {
|
||||
currentChildProcess = null;
|
||||
if (errorCode) onErrorCallback(fileName, "(code " + errorCode + ")");
|
||||
});
|
||||
_childProcess.on("error", function(error$1) {
|
||||
currentChildProcess.on("error", function(error$1) {
|
||||
let { code, message } = error$1;
|
||||
if ("ENOENT" === code) message = `${message} ('${editor}' command does not exist in 'PATH')`;
|
||||
onErrorCallback(fileName, message);
|
||||
@@ -14850,7 +14924,7 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
||||
}));
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/launch-editor-middleware@2.12.0/node_modules/launch-editor-middleware/index.js
|
||||
//#region ../../node_modules/.pnpm/launch-editor-middleware@2.14.1/node_modules/launch-editor-middleware/index.js
|
||||
var require_launch_editor_middleware = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const path$5 = __require("path");
|
||||
const launch = require_launch_editor();
|
||||
@@ -22498,12 +22572,15 @@ function isFileServingAllowed(configOrUrl, urlOrServer) {
|
||||
function isFileInTargetPath(targetPath, filePath) {
|
||||
return isSameFilePath(targetPath, filePath) || isParentDirectory(targetPath, filePath);
|
||||
}
|
||||
const windowsDriveRE = /^[A-Z]:/i;
|
||||
/**
|
||||
* Warning: parameters are not validated, only works with normalized absolute paths
|
||||
*/
|
||||
function isFileLoadingAllowed(config$2, filePath) {
|
||||
const { fs: fs$12 } = config$2.server;
|
||||
if (!fs$12.strict) return true;
|
||||
if (isWindows && filePath.includes("~")) return false;
|
||||
if ((isWindows && windowsDriveRE.test(filePath) ? filePath.slice(2) : filePath).includes(":")) return false;
|
||||
const filePathWithoutTrailingSlash = filePath.endsWith("/") ? filePath.slice(0, -1) : filePath;
|
||||
if (config$2.fsDenyGlob(filePathWithoutTrailingSlash)) return false;
|
||||
if (config$2.safeModulePaths.has(filePath)) return true;
|
||||
@@ -22551,7 +22628,7 @@ const ERR_DENIED_ID = "ERR_DENIED_ID";
|
||||
const debugLoad = createDebugger("vite:load");
|
||||
const debugTransform = createDebugger("vite:transform");
|
||||
const debugCache$1 = createDebugger("vite:cache");
|
||||
function transformRequest(environment, url$3, options$1 = {}) {
|
||||
function transformRequest(environment, url$3, options$1) {
|
||||
if (environment._closing && environment.config.dev.recoverable) throwClosedServerError();
|
||||
const timestamp = monotonicDateNow();
|
||||
url$3 = removeTimestampQuery(url$3);
|
||||
@@ -22615,7 +22692,7 @@ async function loadAndTransform(environment, id, url$3, options$1, timestamp, mo
|
||||
const { config: config$2, pluginContainer, logger } = environment;
|
||||
const prettyUrl = debugLoad || debugTransform ? prettifyUrl(url$3, config$2.root) : "";
|
||||
const moduleGraph = environment.moduleGraph;
|
||||
if (options$1.allowId && !options$1.allowId(id)) {
|
||||
if (!options$1.skipFsCheck && id[0] !== "\0" && isServerAccessDeniedForTransform(config$2, id)) {
|
||||
const err$2 = /* @__PURE__ */ new Error(`Denied ID ${id}`);
|
||||
err$2.code = ERR_DENIED_ID;
|
||||
err$2.id = id;
|
||||
@@ -22627,7 +22704,7 @@ async function loadAndTransform(environment, id, url$3, options$1, timestamp, mo
|
||||
const loadResult = await pluginContainer.load(id);
|
||||
if (loadResult == null) {
|
||||
const file = cleanUrl(id);
|
||||
if (environment.config.consumer === "server" || isFileLoadingAllowed(environment.getTopLevelConfig(), slash(file))) {
|
||||
if (options$1.skipFsCheck || isFileLoadingAllowed(environment.getTopLevelConfig(), slash(file))) {
|
||||
try {
|
||||
code = await fsp.readFile(file, "utf-8");
|
||||
debugLoad?.(`${timeFrom(loadStart)} [fs] ${prettyUrl}`);
|
||||
@@ -24453,7 +24530,7 @@ const rawRE$1 = /[?&]raw\b/;
|
||||
const inlineRE$2 = /[?&]inline\b/;
|
||||
const svgRE = /\.svg\b/;
|
||||
function isServerAccessDeniedForTransform(config$2, id) {
|
||||
if (rawRE$1.test(id) || urlRE$1.test(id) || inlineRE$2.test(id) || svgRE.test(id)) return checkLoadingAccess(config$2, id) !== "allowed";
|
||||
if (rawRE$1.test(id) || urlRE$1.test(id) || inlineRE$2.test(id) || svgRE.test(id)) return checkLoadingAccess(config$2, cleanUrl(id)) !== "allowed" || checkLoadingAccess(config$2, id) !== "allowed";
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
@@ -24499,31 +24576,35 @@ function transformMiddleware(server) {
|
||||
}
|
||||
const withoutQuery = cleanUrl(url$3);
|
||||
try {
|
||||
if (withoutQuery.endsWith(".map")) if (environment.depsOptimizer?.isOptimizedDepUrl(url$3)) {
|
||||
const sourcemapPath = url$3.startsWith(FS_PREFIX) ? fsPathFromId(url$3) : normalizePath(path.resolve(server.config.root, url$3.slice(1)));
|
||||
try {
|
||||
const map$1 = JSON.parse(await fsp.readFile(sourcemapPath, "utf-8"));
|
||||
applySourcemapIgnoreList(map$1, sourcemapPath, server.config.server.sourcemapIgnoreList, server.config.logger);
|
||||
return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
|
||||
} catch {
|
||||
const dummySourceMap = {
|
||||
version: 3,
|
||||
file: sourcemapPath.replace(/\.map$/, ""),
|
||||
sources: [],
|
||||
sourcesContent: [],
|
||||
names: [],
|
||||
mappings: ";;;;;;;;;"
|
||||
};
|
||||
return send(req$4, res, JSON.stringify(dummySourceMap), "json", {
|
||||
cacheControl: "no-cache",
|
||||
headers: server.config.server.headers
|
||||
});
|
||||
if (withoutQuery.endsWith(".map")) {
|
||||
const depsOptimizer = environment.depsOptimizer;
|
||||
if (depsOptimizer?.isOptimizedDepUrl(url$3)) {
|
||||
const sourcemapPath = url$3.startsWith(FS_PREFIX) ? fsPathFromId(url$3) : normalizePath(path.resolve(server.config.root, url$3.slice(1)));
|
||||
if (!depsOptimizer.isOptimizedDepFile(sourcemapPath)) return next();
|
||||
try {
|
||||
const map$1 = JSON.parse(await fsp.readFile(sourcemapPath, "utf-8"));
|
||||
applySourcemapIgnoreList(map$1, sourcemapPath, server.config.server.sourcemapIgnoreList, server.config.logger);
|
||||
return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
|
||||
} catch {
|
||||
const dummySourceMap = {
|
||||
version: 3,
|
||||
file: sourcemapPath.replace(/\.map$/, ""),
|
||||
sources: [],
|
||||
sourcesContent: [],
|
||||
names: [],
|
||||
mappings: ";;;;;;;;;"
|
||||
};
|
||||
return send(req$4, res, JSON.stringify(dummySourceMap), "json", {
|
||||
cacheControl: "no-cache",
|
||||
headers: server.config.server.headers
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const originalUrl = url$3.replace(/\.map($|\?)/, "$1");
|
||||
const map$1 = (await environment.moduleGraph.getModuleByUrl(originalUrl))?.transformResult?.map;
|
||||
if (map$1) return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
|
||||
else return next();
|
||||
}
|
||||
} else {
|
||||
const originalUrl = url$3.replace(/\.map($|\?)/, "$1");
|
||||
const map$1 = (await environment.moduleGraph.getModuleByUrl(originalUrl))?.transformResult?.map;
|
||||
if (map$1) return send(req$4, res, JSON.stringify(map$1), "json", { headers: server.config.server.headers });
|
||||
else return next();
|
||||
}
|
||||
if (publicDirInRoot && url$3.startsWith(publicPath)) warnAboutExplicitPublicPathInUrl(url$3);
|
||||
if (req$4.headers["sec-fetch-dest"] === "script" || isJSRequest(url$3) || isImportRequest(url$3) || isCSSRequest(url$3) || isHTMLProxy(url$3)) {
|
||||
@@ -24538,9 +24619,7 @@ function transformMiddleware(server) {
|
||||
return res.end();
|
||||
}
|
||||
}
|
||||
const result = await environment.transformRequest(url$3, { allowId(id) {
|
||||
return id[0] === "\0" || !isServerAccessDeniedForTransform(server.config, id);
|
||||
} });
|
||||
const result = await environment.transformRequest(url$3);
|
||||
if (result) {
|
||||
const depsOptimizer = environment.depsOptimizer;
|
||||
const type = isDirectCSSRequest(url$3) ? "css" : "js";
|
||||
@@ -24590,7 +24669,8 @@ function transformMiddleware(server) {
|
||||
if (e$1?.code === ERR_LOAD_URL) return next();
|
||||
if (e$1?.code === ERR_DENIED_ID) {
|
||||
const id = e$1.id;
|
||||
const servingAccessResult = checkLoadingAccess(server.config, id);
|
||||
let servingAccessResult = checkLoadingAccess(server.config, cleanUrl(id));
|
||||
if (servingAccessResult === "allowed") servingAccessResult = checkLoadingAccess(server.config, id);
|
||||
if (servingAccessResult === "denied") {
|
||||
respondWithAccessDenied(id, server, res);
|
||||
return true;
|
||||
@@ -26325,6 +26405,7 @@ function createServerHotChannel() {
|
||||
const innerEmitter = new EventEmitter();
|
||||
const outsideEmitter = new EventEmitter();
|
||||
return {
|
||||
skipFsCheck: true,
|
||||
send(payload) {
|
||||
outsideEmitter.emit("send", payload);
|
||||
},
|
||||
@@ -34740,6 +34821,10 @@ var DevEnvironment = class extends BaseEnvironment {
|
||||
* @internal
|
||||
*/
|
||||
_remoteRunnerOptions;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
_skipFsCheck;
|
||||
get pluginContainer() {
|
||||
if (!this._pluginContainer) throw new Error(`${this.name} environment.pluginContainer called before initialized`);
|
||||
return this._pluginContainer;
|
||||
@@ -34777,9 +34862,11 @@ var DevEnvironment = class extends BaseEnvironment {
|
||||
this.moduleGraph = new EnvironmentModuleGraph(name, (url$3) => this.pluginContainer.resolveId(url$3, void 0));
|
||||
this._crawlEndFinder = setupOnCrawlEnd();
|
||||
this._remoteRunnerOptions = context.remoteRunner ?? {};
|
||||
this._skipFsCheck = !!(context.transport && !(isWebSocketServer in context.transport) && context.transport.skipFsCheck);
|
||||
this.hot = context.transport ? isWebSocketServer in context.transport ? context.transport : normalizeHotChannel(context.transport, context.hot) : normalizeHotChannel({}, context.hot);
|
||||
this.hot.setInvokeHandler({
|
||||
fetchModule: (id, importer, options$2) => {
|
||||
if (context.disableFetchModule) throw new Error("fetchModule is disabled in this environment");
|
||||
return this.fetchModule(id, importer, options$2);
|
||||
},
|
||||
getBuiltins: async () => {
|
||||
@@ -34830,12 +34917,12 @@ var DevEnvironment = class extends BaseEnvironment {
|
||||
async reloadModule(module$1) {
|
||||
if (this.config.server.hmr !== false && module$1.file) updateModules(this, module$1.file, [module$1], monotonicDateNow());
|
||||
}
|
||||
transformRequest(url$3, options$1) {
|
||||
return transformRequest(this, url$3, options$1);
|
||||
transformRequest(url$3) {
|
||||
return transformRequest(this, url$3, { skipFsCheck: this._skipFsCheck });
|
||||
}
|
||||
async warmupRequest(url$3) {
|
||||
try {
|
||||
await this.transformRequest(url$3);
|
||||
await transformRequest(this, url$3, { skipFsCheck: true });
|
||||
} catch (e$1) {
|
||||
if (e$1?.code === ERR_OUTDATED_OPTIMIZED_DEP || e$1?.code === ERR_CLOSED_SERVER) return;
|
||||
this.logger.error(buildErrorMessage(e$1, [`Pre-transform error: ${e$1.message}`], false), {
|
||||
@@ -35217,7 +35304,8 @@ function defineConfig(config$2) {
|
||||
function defaultCreateClientDevEnvironment(name, config$2, context) {
|
||||
return new DevEnvironment(name, config$2, {
|
||||
hot: true,
|
||||
transport: context.ws
|
||||
transport: context.ws,
|
||||
disableFetchModule: true
|
||||
});
|
||||
}
|
||||
function defaultCreateDevEnvironment(name, config$2) {
|
||||
@@ -35284,7 +35372,8 @@ const configDefaults = Object.freeze({
|
||||
extensions: [],
|
||||
disabled: "build",
|
||||
holdUntilCrawlEnd: true,
|
||||
force: false
|
||||
force: false,
|
||||
ignoreOutdatedRequests: false
|
||||
},
|
||||
ssr: ssrConfigDefaults,
|
||||
environments: {},
|
||||
|
||||
+14
-2
@@ -847,6 +847,14 @@ interface DepOptimizationConfig {
|
||||
* @experimental
|
||||
*/
|
||||
holdUntilCrawlEnd?: boolean;
|
||||
/**
|
||||
* When enabled, Vite will not throw an error when an outdated optimized
|
||||
* dependency is requested. Enabling this option may cause a single module
|
||||
* to have a multiple reference.
|
||||
* @default false
|
||||
* @experimental
|
||||
*/
|
||||
ignoreOutdatedRequests?: boolean;
|
||||
}
|
||||
type DepOptimizationOptions = DepOptimizationConfig & {
|
||||
/**
|
||||
@@ -948,7 +956,6 @@ interface TransformOptions {
|
||||
*/
|
||||
ssr?: boolean;
|
||||
}
|
||||
interface TransformOptionsInternal {}
|
||||
//#endregion
|
||||
//#region src/node/server/moduleGraph.d.ts
|
||||
declare class EnvironmentModuleNode {
|
||||
@@ -1113,6 +1120,11 @@ interface HotChannelClient {
|
||||
}
|
||||
type HotChannelListener<T$1 extends string = string> = (data: InferCustomEventPayload<T$1>, client: HotChannelClient) => void;
|
||||
interface HotChannel<Api = any> {
|
||||
/**
|
||||
* When true, the fs access check is skipped in fetchModule.
|
||||
* Set this for transports that is not exposed over the network.
|
||||
*/
|
||||
skipFsCheck?: boolean;
|
||||
/**
|
||||
* Broadcast events to all clients
|
||||
*/
|
||||
@@ -1557,7 +1569,7 @@ declare class DevEnvironment extends BaseEnvironment {
|
||||
listen(server: ViteDevServer): Promise<void>;
|
||||
fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<moduleRunner_FetchResult>;
|
||||
reloadModule(module: EnvironmentModuleNode): Promise<void>;
|
||||
transformRequest(url: string, options?: TransformOptionsInternal): Promise<TransformResult | null>;
|
||||
transformRequest(url: string): Promise<TransformResult | null>;
|
||||
warmupRequest(url: string): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user