vite-plugin-vue-inspector
Advanced tools
Comparing version
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __spreadValues = (a, b) => { | ||
for (var prop in b || (b = {})) | ||
if (__hasOwnProp.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
if (__getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(b)) { | ||
if (__propIsEnum.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
} | ||
return a; | ||
}; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __export = (target, all) => { | ||
@@ -36,3 +19,6 @@ for (var name in all) | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -47,3 +33,3 @@ | ||
// node_modules/.pnpm/tsup@5.12.7_typescript@4.6.4/node_modules/tsup/assets/cjs_shims.js | ||
// node_modules/tsup/assets/cjs_shims.js | ||
var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href; | ||
@@ -123,3 +109,6 @@ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl(); | ||
const content = ` data-v-inspector-file="${id}" data-v-inspector-line=${line} data-v-inspector-column=${column} data-v-inspector-title="${base}"`; | ||
s.prependLeft(insertPosition, content); | ||
s.prependLeft( | ||
insertPosition, | ||
content | ||
); | ||
} | ||
@@ -148,3 +137,5 @@ } | ||
if (node.type === "JSXElement") { | ||
if (node.openingElement.attributes.some((attr) => attr.type !== "JSXSpreadAttribute" && attr.name.name === "data-v-inspector-file")) | ||
if (node.openingElement.attributes.some( | ||
(attr) => attr.type !== "JSXSpreadAttribute" && attr.name.name === "data-v-inspector-file" | ||
)) | ||
return; | ||
@@ -154,3 +145,6 @@ const insertPosition = node.start + parseJSXIdentifier(node.openingElement.name).length + 1; | ||
const content = ` data-v-inspector-file="${id}" data-v-inspector-line={${line}} data-v-inspector-column={${column}} data-v-inspector-title="${base}"`; | ||
s.prependLeft(insertPosition, content); | ||
s.prependLeft( | ||
insertPosition, | ||
content | ||
); | ||
} | ||
@@ -289,3 +283,6 @@ } | ||
case "VSCodium": | ||
return addWorkspaceToArgumentsIfExists(["-g", `${fileName}:${lineNumber}:${colNumber}`], workspace); | ||
return addWorkspaceToArgumentsIfExists( | ||
["-g", `${fileName}:${lineNumber}:${colNumber}`], | ||
workspace | ||
); | ||
case "appcode": | ||
@@ -308,3 +305,6 @@ case "clion": | ||
case "rider64": | ||
return addWorkspaceToArgumentsIfExists(["--line", lineNumber, fileName], workspace); | ||
return addWorkspaceToArgumentsIfExists( | ||
["--line", lineNumber, fileName], | ||
workspace | ||
); | ||
} | ||
@@ -341,3 +341,6 @@ return [fileName]; | ||
} else if (process.platform === "linux") { | ||
const output = import_child_process.default.execSync("ps x --no-heading -o comm --sort=comm", { stdio: ["pipe", "pipe", "ignore"] }).toString(); | ||
const output = import_child_process.default.execSync( | ||
"ps x --no-heading -o comm --sort=comm", | ||
{ stdio: ["pipe", "pipe", "ignore"] } | ||
).toString(); | ||
const processNames = Object.keys(COMMON_EDITORS_LINUX); | ||
@@ -360,10 +363,16 @@ for (let i = 0; i < processNames.length; i++) { | ||
console.log(); | ||
console.log(import_chalk.default.red(`Could not open ${import_path2.default.basename(fileName)} in the editor.`)); | ||
console.log( | ||
import_chalk.default.red(`Could not open ${import_path2.default.basename(fileName)} in the editor.`) | ||
); | ||
if (errorMessage) { | ||
if (errorMessage[errorMessage.length - 1] !== ".") | ||
errorMessage += "."; | ||
console.log(import_chalk.default.red(`The editor process exited with an error: ${errorMessage}`)); | ||
console.log( | ||
import_chalk.default.red(`The editor process exited with an error: ${errorMessage}`) | ||
); | ||
} | ||
console.log(); | ||
console.log(`To set up the editor integration, add something like ${import_chalk.default.cyan("VUE_EDITOR=atom")} to the ${import_chalk.default.green(".env.local")} file in your project folder and restart the development server. Learn more: ${import_chalk.default.green("https://goo.gl/MMTaZt")}`); | ||
console.log( | ||
`To set up the editor integration, add something like ${import_chalk.default.cyan("VUE_EDITOR=atom")} to the ${import_chalk.default.green(".env.local")} file in your project folder and restart the development server. Learn more: ${import_chalk.default.green("https://goo.gl/MMTaZt")}` | ||
); | ||
console.log(); | ||
@@ -391,5 +400,9 @@ } | ||
console.log(); | ||
console.log(import_chalk.default.red(`Could not open ${import_path2.default.basename(fileName)} in the editor.`)); | ||
console.log( | ||
import_chalk.default.red(`Could not open ${import_path2.default.basename(fileName)} in the editor.`) | ||
); | ||
console.log(); | ||
console.log("When running on Windows, file names are checked against a whitelist to protect against remote code execution attacks. File names may consist only of alphanumeric characters (all languages), periods, dashes, slashes, and underscores."); | ||
console.log( | ||
"When running on Windows, file names are checked against a whitelist to protect against remote code execution attacks. File names may consist only of alphanumeric characters (all languages), periods, dashes, slashes, and underscores." | ||
); | ||
console.log(); | ||
@@ -400,3 +413,11 @@ return; | ||
if (lineNumber) { | ||
args = args.concat(getArgumentsForLineNumber(editor, fileName, lineNumber, colNumber, workspace)); | ||
args = args.concat( | ||
getArgumentsForLineNumber( | ||
editor, | ||
fileName, | ||
lineNumber, | ||
colNumber, | ||
workspace | ||
) | ||
); | ||
} else { | ||
@@ -409,3 +430,7 @@ args.push(fileName); | ||
if (process.platform === "win32") { | ||
_childProcess = import_child_process.default.spawn("cmd.exe", ["/C", editor].concat(args), { stdio: "inherit" }); | ||
_childProcess = import_child_process.default.spawn( | ||
"cmd.exe", | ||
["/C", editor].concat(args), | ||
{ stdio: "inherit" } | ||
); | ||
} else { | ||
@@ -465,3 +490,3 @@ _childProcess = import_child_process.default.spawn(editor, args, { stdio: "inherit" }); | ||
const inspectorPath = getInspectorPath(); | ||
const normalizedOptions = __spreadValues(__spreadValues({}, DEFAULT_INSPECTOR_OPTIONS), options); | ||
const normalizedOptions = { ...DEFAULT_INSPECTOR_OPTIONS, ...options }; | ||
let serverOptions; | ||
@@ -484,3 +509,3 @@ return { | ||
if (id === "virtual:vue-inspector-options") { | ||
return `export default ${JSON.stringify(__spreadProps(__spreadValues({}, normalizedOptions), { serverOptions }))}`; | ||
return `export default ${JSON.stringify({ ...normalizedOptions, serverOptions })}`; | ||
} else if (id.startsWith(inspectorPath)) { | ||
@@ -528,3 +553,3 @@ const { query } = parseVueRequest(id); | ||
tag: "script", | ||
injectTo: "body", | ||
injectTo: "body-prepend", | ||
attrs: { | ||
@@ -531,0 +556,0 @@ type: "module", |
{ | ||
"name": "vite-plugin-vue-inspector", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "jump to local IDE source code while click the element of browser automatically.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
1186
3.94%76196
-1.37%