feat: init
This commit is contained in:
21
node_modules/@vue/devtools-core/LICENSE
generated
vendored
Normal file
21
node_modules/@vue/devtools-core/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 webfansplz
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
3
node_modules/@vue/devtools-core/README.md
generated
vendored
Normal file
3
node_modules/@vue/devtools-core/README.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# @vue/devtools-core
|
||||
|
||||
> Internal core functions shared across @vue/devtools packages.
|
||||
24
node_modules/@vue/devtools-core/dist/chunk.js
generated
vendored
Normal file
24
node_modules/@vue/devtools-core/dist/chunk.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
//#region rolldown:runtime
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
||||
key = keys[i];
|
||||
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
||||
get: ((k) => from[k]).bind(null, key),
|
||||
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
||||
});
|
||||
}
|
||||
return to;
|
||||
};
|
||||
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));
|
||||
|
||||
//#endregion
|
||||
export { };
|
||||
549
node_modules/@vue/devtools-core/dist/index.cjs
generated
vendored
Normal file
549
node_modules/@vue/devtools-core/dist/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,549 @@
|
||||
let __vue_devtools_shared = require("@vue/devtools-shared");
|
||||
let __vue_devtools_kit = require("@vue/devtools-kit");
|
||||
let vue = require("vue");
|
||||
|
||||
//#region src/client.ts
|
||||
function setDevToolsClientUrl(url) {
|
||||
__vue_devtools_shared.target.__VUE_DEVTOOLS_CLIENT_URL__ = url;
|
||||
}
|
||||
function getDevToolsClientUrl() {
|
||||
return __vue_devtools_shared.target.__VUE_DEVTOOLS_CLIENT_URL__ ?? (() => {
|
||||
if (__vue_devtools_shared.isBrowser) {
|
||||
const devtoolsMeta = document.querySelector("meta[name=__VUE_DEVTOOLS_CLIENT_URL__]");
|
||||
if (devtoolsMeta) return devtoolsMeta.getAttribute("content");
|
||||
}
|
||||
return "";
|
||||
})();
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs
|
||||
function flatHooks(configHooks, hooks$2 = {}, parentName) {
|
||||
for (const key in configHooks) {
|
||||
const subHook = configHooks[key];
|
||||
const name = parentName ? `${parentName}:${key}` : key;
|
||||
if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks$2, name);
|
||||
else if (typeof subHook === "function") hooks$2[name] = subHook;
|
||||
}
|
||||
return hooks$2;
|
||||
}
|
||||
const defaultTask = { run: (function_) => function_() };
|
||||
const _createTask = () => defaultTask;
|
||||
const createTask = typeof console.createTask !== "undefined" ? console.createTask : _createTask;
|
||||
function serialTaskCaller(hooks$2, args) {
|
||||
const task = createTask(args.shift());
|
||||
return hooks$2.reduce((promise, hookFunction) => promise.then(() => task.run(() => hookFunction(...args))), Promise.resolve());
|
||||
}
|
||||
function parallelTaskCaller(hooks$2, args) {
|
||||
const task = createTask(args.shift());
|
||||
return Promise.all(hooks$2.map((hook) => task.run(() => hook(...args))));
|
||||
}
|
||||
function callEachWith(callbacks, arg0) {
|
||||
for (const callback of [...callbacks]) callback(arg0);
|
||||
}
|
||||
var Hookable = class {
|
||||
constructor() {
|
||||
this._hooks = {};
|
||||
this._before = void 0;
|
||||
this._after = void 0;
|
||||
this._deprecatedMessages = void 0;
|
||||
this._deprecatedHooks = {};
|
||||
this.hook = this.hook.bind(this);
|
||||
this.callHook = this.callHook.bind(this);
|
||||
this.callHookWith = this.callHookWith.bind(this);
|
||||
}
|
||||
hook(name, function_, options = {}) {
|
||||
if (!name || typeof function_ !== "function") return () => {};
|
||||
const originalName = name;
|
||||
let dep;
|
||||
while (this._deprecatedHooks[name]) {
|
||||
dep = this._deprecatedHooks[name];
|
||||
name = dep.to;
|
||||
}
|
||||
if (dep && !options.allowDeprecated) {
|
||||
let message = dep.message;
|
||||
if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
|
||||
if (!this._deprecatedMessages) this._deprecatedMessages = /* @__PURE__ */ new Set();
|
||||
if (!this._deprecatedMessages.has(message)) {
|
||||
console.warn(message);
|
||||
this._deprecatedMessages.add(message);
|
||||
}
|
||||
}
|
||||
if (!function_.name) try {
|
||||
Object.defineProperty(function_, "name", {
|
||||
get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
|
||||
configurable: true
|
||||
});
|
||||
} catch {}
|
||||
this._hooks[name] = this._hooks[name] || [];
|
||||
this._hooks[name].push(function_);
|
||||
return () => {
|
||||
if (function_) {
|
||||
this.removeHook(name, function_);
|
||||
function_ = void 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
hookOnce(name, function_) {
|
||||
let _unreg;
|
||||
let _function = (...arguments_) => {
|
||||
if (typeof _unreg === "function") _unreg();
|
||||
_unreg = void 0;
|
||||
_function = void 0;
|
||||
return function_(...arguments_);
|
||||
};
|
||||
_unreg = this.hook(name, _function);
|
||||
return _unreg;
|
||||
}
|
||||
removeHook(name, function_) {
|
||||
if (this._hooks[name]) {
|
||||
const index = this._hooks[name].indexOf(function_);
|
||||
if (index !== -1) this._hooks[name].splice(index, 1);
|
||||
if (this._hooks[name].length === 0) delete this._hooks[name];
|
||||
}
|
||||
}
|
||||
deprecateHook(name, deprecated) {
|
||||
this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
|
||||
const _hooks = this._hooks[name] || [];
|
||||
delete this._hooks[name];
|
||||
for (const hook of _hooks) this.hook(name, hook);
|
||||
}
|
||||
deprecateHooks(deprecatedHooks) {
|
||||
Object.assign(this._deprecatedHooks, deprecatedHooks);
|
||||
for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]);
|
||||
}
|
||||
addHooks(configHooks) {
|
||||
const hooks$2 = flatHooks(configHooks);
|
||||
const removeFns = Object.keys(hooks$2).map((key) => this.hook(key, hooks$2[key]));
|
||||
return () => {
|
||||
for (const unreg of removeFns.splice(0, removeFns.length)) unreg();
|
||||
};
|
||||
}
|
||||
removeHooks(configHooks) {
|
||||
const hooks$2 = flatHooks(configHooks);
|
||||
for (const key in hooks$2) this.removeHook(key, hooks$2[key]);
|
||||
}
|
||||
removeAllHooks() {
|
||||
for (const key in this._hooks) delete this._hooks[key];
|
||||
}
|
||||
callHook(name, ...arguments_) {
|
||||
arguments_.unshift(name);
|
||||
return this.callHookWith(serialTaskCaller, name, ...arguments_);
|
||||
}
|
||||
callHookParallel(name, ...arguments_) {
|
||||
arguments_.unshift(name);
|
||||
return this.callHookWith(parallelTaskCaller, name, ...arguments_);
|
||||
}
|
||||
callHookWith(caller, name, ...arguments_) {
|
||||
const event = this._before || this._after ? {
|
||||
name,
|
||||
args: arguments_,
|
||||
context: {}
|
||||
} : void 0;
|
||||
if (this._before) callEachWith(this._before, event);
|
||||
const result = caller(name in this._hooks ? [...this._hooks[name]] : [], arguments_);
|
||||
if (result instanceof Promise) return result.finally(() => {
|
||||
if (this._after && event) callEachWith(this._after, event);
|
||||
});
|
||||
if (this._after && event) callEachWith(this._after, event);
|
||||
return result;
|
||||
}
|
||||
beforeEach(function_) {
|
||||
this._before = this._before || [];
|
||||
this._before.push(function_);
|
||||
return () => {
|
||||
if (this._before !== void 0) {
|
||||
const index = this._before.indexOf(function_);
|
||||
if (index !== -1) this._before.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
afterEach(function_) {
|
||||
this._after = this._after || [];
|
||||
this._after.push(function_);
|
||||
return () => {
|
||||
if (this._after !== void 0) {
|
||||
const index = this._after.indexOf(function_);
|
||||
if (index !== -1) this._after.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
function createHooks() {
|
||||
return new Hookable();
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/rpc/global.ts
|
||||
const hooks$1 = createHooks();
|
||||
let DevToolsMessagingEvents = /* @__PURE__ */ function(DevToolsMessagingEvents$1) {
|
||||
DevToolsMessagingEvents$1["INSPECTOR_TREE_UPDATED"] = "inspector-tree-updated";
|
||||
DevToolsMessagingEvents$1["INSPECTOR_STATE_UPDATED"] = "inspector-state-updated";
|
||||
DevToolsMessagingEvents$1["DEVTOOLS_STATE_UPDATED"] = "devtools-state-updated";
|
||||
DevToolsMessagingEvents$1["ROUTER_INFO_UPDATED"] = "router-info-updated";
|
||||
DevToolsMessagingEvents$1["TIMELINE_EVENT_UPDATED"] = "timeline-event-updated";
|
||||
DevToolsMessagingEvents$1["INSPECTOR_UPDATED"] = "inspector-updated";
|
||||
DevToolsMessagingEvents$1["ACTIVE_APP_UNMOUNTED"] = "active-app-updated";
|
||||
DevToolsMessagingEvents$1["DESTROY_DEVTOOLS_CLIENT"] = "destroy-devtools-client";
|
||||
DevToolsMessagingEvents$1["RELOAD_DEVTOOLS_CLIENT"] = "reload-devtools-client";
|
||||
return DevToolsMessagingEvents$1;
|
||||
}({});
|
||||
function getDevToolsState() {
|
||||
const state = __vue_devtools_kit.devtools.ctx.state;
|
||||
return {
|
||||
connected: state.connected,
|
||||
clientConnected: true,
|
||||
vueVersion: state?.activeAppRecord?.version || "",
|
||||
tabs: state.tabs,
|
||||
commands: state.commands,
|
||||
vitePluginDetected: state.vitePluginDetected,
|
||||
appRecords: state.appRecords.map((item) => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
version: item.version,
|
||||
routerId: item.routerId,
|
||||
iframe: item.iframe
|
||||
})),
|
||||
activeAppRecordId: state.activeAppRecordId,
|
||||
timelineLayersState: state.timelineLayersState
|
||||
};
|
||||
}
|
||||
const functions = {
|
||||
on: (event, handler) => {
|
||||
hooks$1.hook(event, handler);
|
||||
},
|
||||
off: (event, handler) => {
|
||||
hooks$1.removeHook(event, handler);
|
||||
},
|
||||
once: (event, handler) => {
|
||||
hooks$1.hookOnce(event, handler);
|
||||
},
|
||||
emit: (event, ...args) => {
|
||||
hooks$1.callHook(event, ...args);
|
||||
},
|
||||
heartbeat: () => {
|
||||
return true;
|
||||
},
|
||||
devtoolsState: () => {
|
||||
return getDevToolsState();
|
||||
},
|
||||
async getInspectorTree(payload) {
|
||||
return (0, __vue_devtools_kit.stringify)(await __vue_devtools_kit.devtools.ctx.api.getInspectorTree(payload));
|
||||
},
|
||||
async getInspectorState(payload) {
|
||||
const inspector = (0, __vue_devtools_kit.getInspector)(payload.inspectorId);
|
||||
if (inspector) inspector.selectedNodeId = payload.nodeId;
|
||||
return (0, __vue_devtools_kit.stringify)(await __vue_devtools_kit.devtools.ctx.api.getInspectorState(payload));
|
||||
},
|
||||
async editInspectorState(payload) {
|
||||
return await __vue_devtools_kit.devtools.ctx.api.editInspectorState(payload);
|
||||
},
|
||||
sendInspectorState(id) {
|
||||
return __vue_devtools_kit.devtools.ctx.api.sendInspectorState(id);
|
||||
},
|
||||
inspectComponentInspector() {
|
||||
return __vue_devtools_kit.devtools.ctx.api.inspectComponentInspector();
|
||||
},
|
||||
cancelInspectComponentInspector() {
|
||||
return __vue_devtools_kit.devtools.ctx.api.cancelInspectComponentInspector();
|
||||
},
|
||||
getComponentRenderCode(id) {
|
||||
return __vue_devtools_kit.devtools.ctx.api.getComponentRenderCode(id);
|
||||
},
|
||||
scrollToComponent(id) {
|
||||
return __vue_devtools_kit.devtools.ctx.api.scrollToComponent(id);
|
||||
},
|
||||
inspectDOM(id) {
|
||||
return __vue_devtools_kit.devtools.ctx.api.inspectDOM(id);
|
||||
},
|
||||
getInspectorNodeActions(id) {
|
||||
return (0, __vue_devtools_kit.getInspectorNodeActions)(id);
|
||||
},
|
||||
getInspectorActions(id) {
|
||||
return (0, __vue_devtools_kit.getInspectorActions)(id);
|
||||
},
|
||||
updateTimelineLayersState(state) {
|
||||
return (0, __vue_devtools_kit.updateTimelineLayersState)(state);
|
||||
},
|
||||
callInspectorNodeAction(inspectorId, actionIndex, nodeId) {
|
||||
const nodeActions = (0, __vue_devtools_kit.getInspectorNodeActions)(inspectorId);
|
||||
if (nodeActions?.length) nodeActions[actionIndex].action?.(nodeId);
|
||||
},
|
||||
callInspectorAction(inspectorId, actionIndex) {
|
||||
const actions = (0, __vue_devtools_kit.getInspectorActions)(inspectorId);
|
||||
if (actions?.length) actions[actionIndex].action?.();
|
||||
},
|
||||
openInEditor(options) {
|
||||
return __vue_devtools_kit.devtools.ctx.api.openInEditor(options);
|
||||
},
|
||||
async checkVueInspectorDetected() {
|
||||
return !!await __vue_devtools_kit.devtools.ctx.api.getVueInspector();
|
||||
},
|
||||
async enableVueInspector() {
|
||||
const inspector = await __vue_devtools_kit.devtools?.api?.getVueInspector?.();
|
||||
if (inspector) await inspector.enable();
|
||||
},
|
||||
async toggleApp(id, options) {
|
||||
return __vue_devtools_kit.devtools.ctx.api.toggleApp(id, options);
|
||||
},
|
||||
updatePluginSettings(pluginId, key, value) {
|
||||
return __vue_devtools_kit.devtools.ctx.api.updatePluginSettings(pluginId, key, value);
|
||||
},
|
||||
getPluginSettings(pluginId) {
|
||||
return __vue_devtools_kit.devtools.ctx.api.getPluginSettings(pluginId);
|
||||
},
|
||||
getRouterInfo() {
|
||||
return __vue_devtools_kit.devtoolsRouterInfo;
|
||||
},
|
||||
navigate(path) {
|
||||
return __vue_devtools_kit.devtoolsRouter.value?.push(path).catch(() => ({}));
|
||||
},
|
||||
getMatchedRoutes(path) {
|
||||
const c = console.warn;
|
||||
console.warn = () => {};
|
||||
const matched = __vue_devtools_kit.devtoolsRouter.value?.resolve?.({ path: path || "/" }).matched ?? [];
|
||||
console.warn = c;
|
||||
return matched;
|
||||
},
|
||||
toggleClientConnected(state) {
|
||||
(0, __vue_devtools_kit.toggleClientConnected)(state);
|
||||
},
|
||||
getCustomInspector() {
|
||||
return (0, __vue_devtools_kit.getActiveInspectors)();
|
||||
},
|
||||
getInspectorInfo(id) {
|
||||
return (0, __vue_devtools_kit.getInspectorInfo)(id);
|
||||
},
|
||||
highlighComponent(uid) {
|
||||
return __vue_devtools_kit.devtools.ctx.hooks.callHook(__vue_devtools_kit.DevToolsContextHookKeys.COMPONENT_HIGHLIGHT, { uid });
|
||||
},
|
||||
unhighlight() {
|
||||
return __vue_devtools_kit.devtools.ctx.hooks.callHook(__vue_devtools_kit.DevToolsContextHookKeys.COMPONENT_UNHIGHLIGHT);
|
||||
},
|
||||
updateDevToolsClientDetected(params) {
|
||||
(0, __vue_devtools_kit.updateDevToolsClientDetected)(params);
|
||||
},
|
||||
initDevToolsServerListener() {
|
||||
const broadcast = (0, __vue_devtools_kit.getRpcServer)().broadcast;
|
||||
__vue_devtools_kit.devtools.ctx.hooks.hook(__vue_devtools_kit.DevToolsMessagingHookKeys.SEND_INSPECTOR_TREE_TO_CLIENT, (payload) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.INSPECTOR_TREE_UPDATED, (0, __vue_devtools_kit.stringify)(payload));
|
||||
});
|
||||
__vue_devtools_kit.devtools.ctx.hooks.hook(__vue_devtools_kit.DevToolsMessagingHookKeys.SEND_INSPECTOR_STATE_TO_CLIENT, (payload) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.INSPECTOR_STATE_UPDATED, (0, __vue_devtools_kit.stringify)(payload));
|
||||
});
|
||||
__vue_devtools_kit.devtools.ctx.hooks.hook(__vue_devtools_kit.DevToolsMessagingHookKeys.DEVTOOLS_STATE_UPDATED, () => {
|
||||
broadcast.emit(DevToolsMessagingEvents.DEVTOOLS_STATE_UPDATED, getDevToolsState());
|
||||
});
|
||||
__vue_devtools_kit.devtools.ctx.hooks.hook(__vue_devtools_kit.DevToolsMessagingHookKeys.ROUTER_INFO_UPDATED, ({ state }) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.ROUTER_INFO_UPDATED, state);
|
||||
});
|
||||
__vue_devtools_kit.devtools.ctx.hooks.hook(__vue_devtools_kit.DevToolsMessagingHookKeys.SEND_TIMELINE_EVENT_TO_CLIENT, (payload) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.TIMELINE_EVENT_UPDATED, (0, __vue_devtools_kit.stringify)(payload));
|
||||
});
|
||||
__vue_devtools_kit.devtools.ctx.hooks.hook(__vue_devtools_kit.DevToolsMessagingHookKeys.SEND_INSPECTOR_TO_CLIENT, (payload) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.INSPECTOR_UPDATED, payload);
|
||||
});
|
||||
__vue_devtools_kit.devtools.ctx.hooks.hook(__vue_devtools_kit.DevToolsMessagingHookKeys.SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT, () => {
|
||||
broadcast.emit(DevToolsMessagingEvents.ACTIVE_APP_UNMOUNTED);
|
||||
});
|
||||
}
|
||||
};
|
||||
const rpc = new Proxy({
|
||||
value: {},
|
||||
functions: {}
|
||||
}, { get(target$1, property) {
|
||||
const _rpc = (0, __vue_devtools_kit.getRpcClient)();
|
||||
if (property === "value") return _rpc;
|
||||
else if (property === "functions") return _rpc.$functions;
|
||||
} });
|
||||
const rpcServer = new Proxy({
|
||||
value: {},
|
||||
functions: {}
|
||||
}, { get(target$1, property) {
|
||||
const _rpc = (0, __vue_devtools_kit.getRpcServer)();
|
||||
if (property === "value") return _rpc;
|
||||
else if (property === "functions") return _rpc.functions;
|
||||
} });
|
||||
function onRpcConnected(callback) {
|
||||
let timer = null;
|
||||
let retryCount = 0;
|
||||
function heartbeat() {
|
||||
rpc.value?.heartbeat?.().then(() => {
|
||||
callback();
|
||||
clearTimeout(timer);
|
||||
}).catch(() => {});
|
||||
}
|
||||
timer = setInterval(() => {
|
||||
if (retryCount >= 30) clearTimeout(timer);
|
||||
retryCount++;
|
||||
heartbeat();
|
||||
}, retryCount * 200 + 200);
|
||||
heartbeat();
|
||||
}
|
||||
function onRpcSeverReady(callback) {
|
||||
let timer = null;
|
||||
const timeout = 120;
|
||||
function heartbeat() {
|
||||
if (rpcServer.value.clients.length > 0) {
|
||||
callback();
|
||||
clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
timer = setInterval(() => {
|
||||
heartbeat();
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/rpc/vite.ts
|
||||
const hooks = createHooks();
|
||||
const viteRpcFunctions = {
|
||||
on: (event, handler) => {
|
||||
hooks.hook(event, handler);
|
||||
},
|
||||
off: (event, handler) => {
|
||||
hooks.removeHook(event, handler);
|
||||
},
|
||||
once: (event, handler) => {
|
||||
hooks.hookOnce(event, handler);
|
||||
},
|
||||
emit: (event, ...args) => {
|
||||
hooks.callHook(event, ...args);
|
||||
},
|
||||
heartbeat: () => {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
const viteRpc = new Proxy({
|
||||
value: {},
|
||||
functions: {}
|
||||
}, { get(target$1, property) {
|
||||
const _rpc = (0, __vue_devtools_kit.getViteRpcClient)();
|
||||
if (property === "value") return _rpc;
|
||||
else if (property === "functions") return _rpc?.$functions;
|
||||
} });
|
||||
function onViteRpcConnected(callback) {
|
||||
let timer = null;
|
||||
function heartbeat() {
|
||||
viteRpc.value?.heartbeat?.().then(() => {
|
||||
clearTimeout(timer);
|
||||
callback();
|
||||
}).catch(() => ({}));
|
||||
timer = setTimeout(() => {
|
||||
heartbeat();
|
||||
}, 80);
|
||||
}
|
||||
heartbeat();
|
||||
}
|
||||
function createViteClientRpc() {
|
||||
(0, __vue_devtools_kit.createRpcClient)(viteRpcFunctions, { preset: "vite" });
|
||||
}
|
||||
function createViteServerRpc(functions$1) {
|
||||
(0, __vue_devtools_kit.createRpcServer)(functions$1, { preset: "vite" });
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/vue-plugin/devtools-state.ts
|
||||
const VueDevToolsStateSymbol = Symbol.for("__VueDevToolsStateSymbol__");
|
||||
function VueDevToolsVuePlugin() {
|
||||
return { install(app) {
|
||||
const state = createDevToolsStateContext();
|
||||
state.getDevToolsState();
|
||||
app.provide(VueDevToolsStateSymbol, state);
|
||||
app.config.globalProperties.$getDevToolsState = state.getDevToolsState;
|
||||
app.config.globalProperties.$disconnectDevToolsClient = () => {
|
||||
state.clientConnected.value = false;
|
||||
state.connected.value = false;
|
||||
};
|
||||
} };
|
||||
}
|
||||
function createDevToolsStateContext() {
|
||||
const connected = (0, vue.ref)(false);
|
||||
const clientConnected = (0, vue.ref)(false);
|
||||
const vueVersion = (0, vue.ref)("");
|
||||
const tabs = (0, vue.ref)([]);
|
||||
const commands = (0, vue.ref)([]);
|
||||
const vitePluginDetected = (0, vue.ref)(false);
|
||||
const appRecords = (0, vue.ref)([]);
|
||||
const activeAppRecordId = (0, vue.ref)("");
|
||||
const timelineLayersState = (0, vue.ref)({});
|
||||
function updateState(data) {
|
||||
connected.value = data.connected;
|
||||
clientConnected.value = data.clientConnected;
|
||||
vueVersion.value = data.vueVersion || "";
|
||||
tabs.value = data.tabs;
|
||||
commands.value = data.commands;
|
||||
vitePluginDetected.value = data.vitePluginDetected;
|
||||
appRecords.value = data.appRecords;
|
||||
activeAppRecordId.value = data.activeAppRecordId;
|
||||
timelineLayersState.value = data.timelineLayersState;
|
||||
}
|
||||
function getDevToolsState$1() {
|
||||
onRpcConnected(() => {
|
||||
rpc.value.devtoolsState().then((data) => {
|
||||
updateState(data);
|
||||
});
|
||||
rpc.functions.off(DevToolsMessagingEvents.DEVTOOLS_STATE_UPDATED, updateState);
|
||||
rpc.functions.on(DevToolsMessagingEvents.DEVTOOLS_STATE_UPDATED, updateState);
|
||||
});
|
||||
}
|
||||
return {
|
||||
getDevToolsState: getDevToolsState$1,
|
||||
connected,
|
||||
clientConnected,
|
||||
vueVersion,
|
||||
tabs,
|
||||
commands,
|
||||
vitePluginDetected,
|
||||
appRecords,
|
||||
activeAppRecordId,
|
||||
timelineLayersState
|
||||
};
|
||||
}
|
||||
function useDevToolsState() {
|
||||
return (0, vue.inject)(VueDevToolsStateSymbol);
|
||||
}
|
||||
const fns = [];
|
||||
function onDevToolsConnected(fn) {
|
||||
const { connected, clientConnected } = useDevToolsState();
|
||||
fns.push(fn);
|
||||
(0, vue.onUnmounted)(() => {
|
||||
fns.splice(fns.indexOf(fn), 1);
|
||||
});
|
||||
const devtoolsReady = (0, vue.computed)(() => clientConnected.value && connected.value);
|
||||
if (devtoolsReady.value) fn();
|
||||
else {
|
||||
const stop = (0, vue.watch)(devtoolsReady, (v) => {
|
||||
if (v) {
|
||||
fn();
|
||||
stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
return () => {
|
||||
fns.splice(fns.indexOf(fn), 1);
|
||||
};
|
||||
}
|
||||
function refreshCurrentPageData() {
|
||||
fns.forEach((fn) => fn());
|
||||
}
|
||||
|
||||
//#endregion
|
||||
exports.DevToolsMessagingEvents = DevToolsMessagingEvents;
|
||||
exports.VueDevToolsVuePlugin = VueDevToolsVuePlugin;
|
||||
exports.createDevToolsStateContext = createDevToolsStateContext;
|
||||
exports.createViteClientRpc = createViteClientRpc;
|
||||
exports.createViteServerRpc = createViteServerRpc;
|
||||
exports.functions = functions;
|
||||
exports.getDevToolsClientUrl = getDevToolsClientUrl;
|
||||
exports.onDevToolsConnected = onDevToolsConnected;
|
||||
exports.onRpcConnected = onRpcConnected;
|
||||
exports.onRpcSeverReady = onRpcSeverReady;
|
||||
exports.onViteRpcConnected = onViteRpcConnected;
|
||||
exports.refreshCurrentPageData = refreshCurrentPageData;
|
||||
exports.rpc = rpc;
|
||||
exports.rpcServer = rpcServer;
|
||||
exports.setDevToolsClientUrl = setDevToolsClientUrl;
|
||||
exports.useDevToolsState = useDevToolsState;
|
||||
exports.viteRpc = viteRpc;
|
||||
exports.viteRpcFunctions = viteRpcFunctions;
|
||||
712
node_modules/@vue/devtools-core/dist/index.d.cts
generated
vendored
Normal file
712
node_modules/@vue/devtools-core/dist/index.d.cts
generated
vendored
Normal file
@@ -0,0 +1,712 @@
|
||||
import * as vue0 from "vue";
|
||||
import { App, ComponentInternalInstance, ComponentOptions, Ref, SuspenseBoundary, VNode } from "vue";
|
||||
import * as vue_router0 from "vue-router";
|
||||
import { RouteLocationNormalizedLoaded, RouteRecordNormalized } from "vue-router";
|
||||
import { BirpcGroup, BirpcReturn } from "birpc";
|
||||
import { ModuleNode } from "vite";
|
||||
|
||||
//#region src/client.d.ts
|
||||
declare function setDevToolsClientUrl(url: string): void;
|
||||
declare function getDevToolsClientUrl(): any;
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/app.d.ts
|
||||
type App$1 = any;
|
||||
type VueAppInstance = ComponentInternalInstance & {
|
||||
type: {
|
||||
_componentTag: string | undefined;
|
||||
components: Record<string, ComponentInternalInstance['type']>;
|
||||
__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string;
|
||||
__isKeepAlive: boolean;
|
||||
devtools: {
|
||||
hide: boolean;
|
||||
};
|
||||
mixins: ComponentOptions[];
|
||||
extends: ComponentOptions;
|
||||
vuex: {
|
||||
getters: Record<string, unknown>;
|
||||
};
|
||||
computed: Record<string, unknown>;
|
||||
};
|
||||
__v_cache: Cache;
|
||||
__VUE_DEVTOOLS_NEXT_UID__: string;
|
||||
_isBeingDestroyed: boolean;
|
||||
_instance: VueAppInstance;
|
||||
_container: {
|
||||
_vnode: {
|
||||
component: VueAppInstance;
|
||||
};
|
||||
};
|
||||
isUnmounted: boolean;
|
||||
parent: VueAppInstance;
|
||||
appContext: {
|
||||
app: VueAppInstance & App$1 & {
|
||||
__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__: string;
|
||||
__VUE_DEVTOOLS_NEXT_APP_RECORD__: AppRecord;
|
||||
};
|
||||
};
|
||||
__VUE_DEVTOOLS_NEXT_APP_RECORD__: AppRecord;
|
||||
suspense: SuspenseBoundary & {
|
||||
suspenseKey: string;
|
||||
};
|
||||
renderContext: Record<string, unknown>;
|
||||
devtoolsRawSetupState: Record<string, unknown>;
|
||||
setupState: Record<string, unknown>;
|
||||
provides: Record<string | symbol, unknown>;
|
||||
ctx: Record<string, unknown>;
|
||||
} & App$1;
|
||||
interface AppRecord {
|
||||
id: string;
|
||||
name: string;
|
||||
app?: App$1;
|
||||
version?: string;
|
||||
types?: Record<string, string | symbol>;
|
||||
instanceMap: Map<string, VueAppInstance>;
|
||||
perfGroupIds: Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}>;
|
||||
rootInstance: VueAppInstance;
|
||||
routerId?: string;
|
||||
iframe?: string;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/command.d.ts
|
||||
interface CustomCommandAction {
|
||||
type: 'url';
|
||||
/**
|
||||
* Url of the action, if set, execute the action will open the url
|
||||
*/
|
||||
src: string;
|
||||
}
|
||||
interface CustomCommand {
|
||||
/**
|
||||
* The id of the command, should be unique
|
||||
*/
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
/**
|
||||
* Order of the command, bigger number will be shown first
|
||||
* @default 0
|
||||
*/
|
||||
order?: number;
|
||||
/**
|
||||
* Icon of the tab, support any Iconify icons, or a url to an image
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* - action of the command
|
||||
* - __NOTE__: This will be ignored if `children` is set
|
||||
*/
|
||||
action?: CustomCommandAction;
|
||||
/**
|
||||
* - children of action, if set, execute the action will show the children
|
||||
*/
|
||||
children?: Omit<CustomCommand, 'children'>[];
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/inspector.d.ts
|
||||
interface InspectorNodeTag {
|
||||
label: string;
|
||||
textColor: number;
|
||||
backgroundColor: number;
|
||||
tooltip?: string;
|
||||
}
|
||||
type EditStatePayload = {
|
||||
value: any;
|
||||
newKey?: string | null;
|
||||
remove?: undefined | false;
|
||||
} | {
|
||||
value?: undefined;
|
||||
newKey?: undefined;
|
||||
remove: true;
|
||||
};
|
||||
interface CustomInspectorNode {
|
||||
id: string;
|
||||
label: string;
|
||||
children?: CustomInspectorNode[];
|
||||
tags?: InspectorNodeTag[];
|
||||
name?: string;
|
||||
file?: string;
|
||||
}
|
||||
interface CustomInspectorState {
|
||||
[key: string]: (StateBase | Omit<ComponentState, 'type'>)[];
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/component.d.ts
|
||||
type ComponentInstance = any;
|
||||
interface ComponentTreeNode {
|
||||
uid: string | number;
|
||||
id: string;
|
||||
name: string;
|
||||
renderKey: string | number;
|
||||
inactive: boolean;
|
||||
isFragment: boolean;
|
||||
hasChildren: boolean;
|
||||
children: ComponentTreeNode[];
|
||||
domOrder?: number[];
|
||||
consoleId?: string;
|
||||
isRouterView?: boolean;
|
||||
macthedRouteSegment?: string;
|
||||
tags: InspectorNodeTag[];
|
||||
autoOpen: boolean;
|
||||
meta?: any;
|
||||
}
|
||||
type ComponentBuiltinCustomStateTypes = 'function' | 'map' | 'set' | 'reference' | 'component' | 'component-definition' | 'router' | 'store';
|
||||
interface ComponentCustomState extends ComponentStateBase {
|
||||
value: CustomState;
|
||||
}
|
||||
interface StateBase {
|
||||
key: string;
|
||||
value: any;
|
||||
editable?: boolean;
|
||||
objectType?: 'ref' | 'reactive' | 'computed' | 'other';
|
||||
raw?: string;
|
||||
}
|
||||
interface ComponentStateBase extends StateBase {
|
||||
type: string;
|
||||
}
|
||||
interface ComponentPropState extends ComponentStateBase {
|
||||
meta?: {
|
||||
type: string;
|
||||
required: boolean;
|
||||
/** Vue 1 only */
|
||||
mode?: 'default' | 'sync' | 'once';
|
||||
};
|
||||
}
|
||||
interface CustomState {
|
||||
_custom: {
|
||||
type: ComponentBuiltinCustomStateTypes | string;
|
||||
objectType?: string;
|
||||
display?: string;
|
||||
tooltip?: string;
|
||||
value?: any;
|
||||
abstract?: boolean;
|
||||
file?: string;
|
||||
uid?: number;
|
||||
readOnly?: boolean;
|
||||
/** Configure immediate child fields */
|
||||
fields?: {
|
||||
abstract?: boolean;
|
||||
};
|
||||
id?: any;
|
||||
actions?: {
|
||||
icon: string;
|
||||
tooltip?: string;
|
||||
action: () => void | Promise<void>;
|
||||
}[];
|
||||
/** internal */
|
||||
_reviveId?: number;
|
||||
};
|
||||
}
|
||||
type ComponentState = ComponentStateBase | ComponentPropState | ComponentCustomState;
|
||||
interface InspectedComponentData {
|
||||
id: string;
|
||||
name: string;
|
||||
file: string;
|
||||
state: ComponentState[];
|
||||
functional?: boolean;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/ctx/hook.d.ts
|
||||
declare enum DevToolsV6PluginAPIHookKeys {
|
||||
VISIT_COMPONENT_TREE = "visitComponentTree",
|
||||
INSPECT_COMPONENT = "inspectComponent",
|
||||
EDIT_COMPONENT_STATE = "editComponentState",
|
||||
GET_INSPECTOR_TREE = "getInspectorTree",
|
||||
GET_INSPECTOR_STATE = "getInspectorState",
|
||||
EDIT_INSPECTOR_STATE = "editInspectorState",
|
||||
INSPECT_TIMELINE_EVENT = "inspectTimelineEvent",
|
||||
TIMELINE_CLEARED = "timelineCleared",
|
||||
SET_PLUGIN_SETTINGS = "setPluginSettings",
|
||||
}
|
||||
interface DevToolsV6PluginAPIHookPayloads {
|
||||
[DevToolsV6PluginAPIHookKeys.VISIT_COMPONENT_TREE]: {
|
||||
app: App$1;
|
||||
componentInstance: ComponentInstance;
|
||||
treeNode: ComponentTreeNode;
|
||||
filter: string;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.INSPECT_COMPONENT]: {
|
||||
app: App$1;
|
||||
componentInstance: ComponentInstance;
|
||||
instanceData: InspectedComponentData;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.EDIT_COMPONENT_STATE]: {
|
||||
app: App$1;
|
||||
inspectorId: string;
|
||||
nodeId: string;
|
||||
path: string[];
|
||||
type: string;
|
||||
state: EditStatePayload;
|
||||
set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE]: {
|
||||
app: App$1;
|
||||
inspectorId: string;
|
||||
filter: string;
|
||||
rootNodes: CustomInspectorNode[];
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE]: {
|
||||
app: App$1;
|
||||
inspectorId: string;
|
||||
nodeId: string;
|
||||
state: CustomInspectorState;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE]: {
|
||||
app: App$1;
|
||||
inspectorId: string;
|
||||
nodeId: string;
|
||||
path: string[];
|
||||
type: string;
|
||||
state: EditStatePayload;
|
||||
set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.INSPECT_TIMELINE_EVENT]: {
|
||||
app: App$1;
|
||||
layerId: string;
|
||||
event: TimelineEvent;
|
||||
all?: boolean;
|
||||
data: any;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.TIMELINE_CLEARED]: Record<string, never>;
|
||||
[DevToolsV6PluginAPIHookKeys.SET_PLUGIN_SETTINGS]: {
|
||||
app: App$1;
|
||||
pluginId: string;
|
||||
key: string;
|
||||
newValue: any;
|
||||
oldValue: any;
|
||||
settings: any;
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/core/open-in-editor/index.d.ts
|
||||
interface OpenInEditorOptions {
|
||||
baseUrl?: string;
|
||||
file?: string;
|
||||
line?: number;
|
||||
column?: number;
|
||||
host?: string;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/router.d.ts
|
||||
interface RouterInfo {
|
||||
currentRoute: RouteLocationNormalizedLoaded | null | Record<string, any>;
|
||||
routes: RouteRecordNormalized[];
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/tab.d.ts
|
||||
type TabCategory = 'pinned' | 'app' | 'modules' | 'advanced';
|
||||
type ModuleView = ModuleIframeView | ModuleVNodeView | ModuleSFCView;
|
||||
interface ModuleIframeView {
|
||||
/**
|
||||
* Iframe view
|
||||
*/
|
||||
type: 'iframe';
|
||||
/**
|
||||
* Url of the iframe
|
||||
*/
|
||||
src: string;
|
||||
/**
|
||||
* Persist the iframe instance even if the tab is not active
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
persistent?: boolean;
|
||||
}
|
||||
interface ModuleVNodeView {
|
||||
/**
|
||||
* Vue's VNode view
|
||||
*/
|
||||
type: 'vnode';
|
||||
/**
|
||||
* Send vnode to the client, they must be static and serializable
|
||||
*/
|
||||
vnode: VNode;
|
||||
}
|
||||
interface ModuleSFCView {
|
||||
/**
|
||||
* SFC view
|
||||
*/
|
||||
type: 'sfc';
|
||||
/**
|
||||
* SFC component
|
||||
*/
|
||||
sfc: string;
|
||||
}
|
||||
interface CustomTab {
|
||||
/**
|
||||
* The name of the tab, must be unique
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Icon of the tab, support any Iconify icons, or a url to an image
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* Title of the tab
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Main view of the tab
|
||||
*/
|
||||
view: ModuleView;
|
||||
/**
|
||||
* Category of the tab
|
||||
* @default 'app'
|
||||
*/
|
||||
category?: TabCategory;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/timeline.d.ts
|
||||
interface TimelineEvent<TData = any, TMeta = any> {
|
||||
time: number;
|
||||
data: TData;
|
||||
logType?: 'default' | 'warning' | 'error';
|
||||
meta?: TMeta;
|
||||
groupId?: number | string;
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/messaging/index.d.ts
|
||||
declare function getRpcClient<R, L extends object = Record<string, never>>(): BirpcReturn<R, L>;
|
||||
declare function getRpcServer<R, L extends object = Record<string, never>>(): BirpcGroup<R, L>;
|
||||
declare function getViteRpcClient<R, L extends object = Record<string, never>>(): BirpcReturn<R, L>;
|
||||
//#endregion
|
||||
//#region src/rpc/global.d.ts
|
||||
declare enum DevToolsMessagingEvents {
|
||||
INSPECTOR_TREE_UPDATED = "inspector-tree-updated",
|
||||
INSPECTOR_STATE_UPDATED = "inspector-state-updated",
|
||||
DEVTOOLS_STATE_UPDATED = "devtools-state-updated",
|
||||
ROUTER_INFO_UPDATED = "router-info-updated",
|
||||
TIMELINE_EVENT_UPDATED = "timeline-event-updated",
|
||||
INSPECTOR_UPDATED = "inspector-updated",
|
||||
ACTIVE_APP_UNMOUNTED = "active-app-updated",
|
||||
DESTROY_DEVTOOLS_CLIENT = "destroy-devtools-client",
|
||||
RELOAD_DEVTOOLS_CLIENT = "reload-devtools-client",
|
||||
}
|
||||
declare const functions: {
|
||||
on: (event: string, handler: Function) => void;
|
||||
off: (event: string, handler: Function) => void;
|
||||
once: (event: string, handler: Function) => void;
|
||||
emit: (event: string, ...args: any[]) => void;
|
||||
heartbeat: () => boolean;
|
||||
devtoolsState: () => {
|
||||
connected: boolean;
|
||||
clientConnected: boolean;
|
||||
vueVersion: string;
|
||||
tabs: CustomTab[];
|
||||
commands: CustomCommand[];
|
||||
vitePluginDetected: boolean;
|
||||
appRecords: {
|
||||
id: string;
|
||||
name: string;
|
||||
version: string | undefined;
|
||||
routerId: string | undefined;
|
||||
iframe: string | undefined;
|
||||
}[];
|
||||
activeAppRecordId: string;
|
||||
timelineLayersState: Record<string, boolean>;
|
||||
};
|
||||
getInspectorTree(payload: Pick<DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE], "inspectorId" | "filter">): Promise<string>;
|
||||
getInspectorState(payload: Pick<DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE], "inspectorId" | "nodeId">): Promise<string>;
|
||||
editInspectorState(payload: DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE]): Promise<void>;
|
||||
sendInspectorState(id: string): void;
|
||||
inspectComponentInspector(): Promise<string>;
|
||||
cancelInspectComponentInspector(): void;
|
||||
getComponentRenderCode(id: string): any;
|
||||
scrollToComponent(id: string): void;
|
||||
inspectDOM(id: string): void;
|
||||
getInspectorNodeActions(id: string): {
|
||||
icon: string;
|
||||
tooltip?: string;
|
||||
action: (nodeId: string) => void | Promise<void>;
|
||||
}[] | undefined;
|
||||
getInspectorActions(id: string): {
|
||||
icon: string;
|
||||
tooltip?: string;
|
||||
action: () => void | Promise<void>;
|
||||
}[] | undefined;
|
||||
updateTimelineLayersState(state: Record<string, boolean>): void;
|
||||
callInspectorNodeAction(inspectorId: string, actionIndex: number, nodeId: string): void;
|
||||
callInspectorAction(inspectorId: string, actionIndex: number): void;
|
||||
openInEditor(options: OpenInEditorOptions): void;
|
||||
checkVueInspectorDetected(): Promise<boolean>;
|
||||
enableVueInspector(): Promise<void>;
|
||||
toggleApp(id: string, options?: {
|
||||
inspectingComponent?: boolean;
|
||||
}): Promise<void>;
|
||||
updatePluginSettings(pluginId: string, key: string, value: string): void;
|
||||
getPluginSettings(pluginId: string): {
|
||||
options: Record<string, {
|
||||
label: string;
|
||||
description?: string;
|
||||
} & ({
|
||||
type: "boolean";
|
||||
defaultValue: boolean;
|
||||
} | {
|
||||
type: "choice";
|
||||
defaultValue: string | number;
|
||||
options: {
|
||||
value: string | number;
|
||||
label: string;
|
||||
}[];
|
||||
component?: "select" | "button-group";
|
||||
} | {
|
||||
type: "text";
|
||||
defaultValue: string;
|
||||
})> | null;
|
||||
values: any;
|
||||
};
|
||||
getRouterInfo(): RouterInfo;
|
||||
navigate(path: string): Promise<void | vue_router0.NavigationFailure | {} | undefined>;
|
||||
getMatchedRoutes(path: string): vue_router0.RouteRecordNormalized[];
|
||||
toggleClientConnected(state: boolean): void;
|
||||
getCustomInspector(): {
|
||||
id: string;
|
||||
label: string;
|
||||
logo: string;
|
||||
icon: string;
|
||||
packageName: string | undefined;
|
||||
homepage: string | undefined;
|
||||
pluginId: string;
|
||||
}[];
|
||||
getInspectorInfo(id: string): {
|
||||
id: string;
|
||||
label: string;
|
||||
logo: string | undefined;
|
||||
packageName: string | undefined;
|
||||
homepage: string | undefined;
|
||||
timelineLayers: {
|
||||
id: string;
|
||||
label: string;
|
||||
color: number;
|
||||
}[];
|
||||
treeFilterPlaceholder: string;
|
||||
stateFilterPlaceholder: string;
|
||||
} | undefined;
|
||||
highlighComponent(uid: string): Promise<any>;
|
||||
unhighlight(): Promise<any>;
|
||||
updateDevToolsClientDetected(params: Record<string, boolean>): void;
|
||||
initDevToolsServerListener(): void;
|
||||
};
|
||||
type RPCFunctions = typeof functions;
|
||||
declare const rpc: {
|
||||
value: ReturnType<typeof getRpcClient<RPCFunctions>>;
|
||||
functions: ReturnType<typeof getRpcClient<RPCFunctions>>;
|
||||
};
|
||||
declare const rpcServer: {
|
||||
value: ReturnType<typeof getRpcServer<RPCFunctions>>;
|
||||
functions: ReturnType<typeof getRpcServer<RPCFunctions>>;
|
||||
};
|
||||
declare function onRpcConnected(callback: () => void): void;
|
||||
declare function onRpcSeverReady(callback: () => void): void;
|
||||
//#endregion
|
||||
//#region src/rpc/types.d.ts
|
||||
type AssetType = 'image' | 'font' | 'video' | 'audio' | 'text' | 'json' | 'wasm' | 'other';
|
||||
interface AssetInfo {
|
||||
path: string;
|
||||
type: AssetType;
|
||||
publicPath: string;
|
||||
relativePath: string;
|
||||
filePath: string;
|
||||
size: number;
|
||||
mtime: number;
|
||||
}
|
||||
interface ImageMeta {
|
||||
width: number;
|
||||
height: number;
|
||||
orientation?: number;
|
||||
type?: string;
|
||||
mimeType?: string;
|
||||
}
|
||||
type AssetImporter = Pick<ModuleNode, 'url' | 'id'>;
|
||||
interface AssetEntry {
|
||||
path: string;
|
||||
content: string;
|
||||
encoding?: BufferEncoding;
|
||||
override?: boolean;
|
||||
}
|
||||
interface CodeSnippet {
|
||||
code: string;
|
||||
lang: string;
|
||||
name: string;
|
||||
docs?: string;
|
||||
}
|
||||
interface ModuleInfo {
|
||||
id: string;
|
||||
plugins: {
|
||||
name: string;
|
||||
transform?: number;
|
||||
resolveId?: number;
|
||||
}[];
|
||||
deps: string[];
|
||||
virtual: boolean;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/rpc/vite.d.ts
|
||||
declare const viteRpcFunctions: {
|
||||
on: (event: string, handler: Function) => void;
|
||||
off: (event: string, handler: Function) => void;
|
||||
once: (event: string, handler: Function) => void;
|
||||
emit: (event: string, ...args: any[]) => void;
|
||||
heartbeat: () => boolean;
|
||||
};
|
||||
type ViteRPCFunctions = typeof viteRpcFunctions & {
|
||||
getStaticAssets: () => Promise<AssetInfo[]>;
|
||||
getAssetImporters: (url: string) => Promise<AssetImporter[]>;
|
||||
getImageMeta: (filepath: string) => Promise<ImageMeta>;
|
||||
getTextAssetContent: (filepath: string, limit?: number) => Promise<string>;
|
||||
getRoot: () => Promise<string>;
|
||||
getGraphModules: () => Promise<ModuleInfo[]>;
|
||||
};
|
||||
declare const viteRpc: {
|
||||
value: ReturnType<typeof getViteRpcClient<ViteRPCFunctions>>;
|
||||
functions: ReturnType<typeof getViteRpcClient<ViteRPCFunctions>>;
|
||||
};
|
||||
declare function onViteRpcConnected(callback: () => void): void;
|
||||
declare function createViteClientRpc(): void;
|
||||
declare function createViteServerRpc(functions: Record<string, any>): void;
|
||||
//#endregion
|
||||
//#region src/vue-plugin/devtools-state.d.ts
|
||||
interface DevToolsState {
|
||||
connected: boolean;
|
||||
clientConnected: boolean;
|
||||
vueVersion: string;
|
||||
tabs: CustomTab[];
|
||||
commands: CustomCommand[];
|
||||
vitePluginDetected: boolean;
|
||||
appRecords: AppRecord[];
|
||||
activeAppRecordId: string;
|
||||
timelineLayersState: Record<string, boolean>;
|
||||
}
|
||||
type DevToolsRefState = { [P in keyof DevToolsState]: Ref<DevToolsState[P]> };
|
||||
declare function VueDevToolsVuePlugin(): {
|
||||
install(app: App): void;
|
||||
};
|
||||
declare function createDevToolsStateContext(): {
|
||||
getDevToolsState: () => void;
|
||||
connected: Ref<boolean, boolean>;
|
||||
clientConnected: Ref<boolean, boolean>;
|
||||
vueVersion: Ref<string, string>;
|
||||
tabs: Ref<{
|
||||
name: string;
|
||||
icon?: string | undefined;
|
||||
title: string;
|
||||
view: {
|
||||
type: "iframe";
|
||||
src: string;
|
||||
persistent?: boolean | undefined;
|
||||
} | {
|
||||
type: "vnode";
|
||||
vnode: vue0.VNode;
|
||||
} | {
|
||||
type: "sfc";
|
||||
sfc: string;
|
||||
};
|
||||
category?: ("app" | "pinned" | "modules" | "advanced") | undefined;
|
||||
}[], CustomTab[] | {
|
||||
name: string;
|
||||
icon?: string | undefined;
|
||||
title: string;
|
||||
view: {
|
||||
type: "iframe";
|
||||
src: string;
|
||||
persistent?: boolean | undefined;
|
||||
} | {
|
||||
type: "vnode";
|
||||
vnode: vue0.VNode;
|
||||
} | {
|
||||
type: "sfc";
|
||||
sfc: string;
|
||||
};
|
||||
category?: ("app" | "pinned" | "modules" | "advanced") | undefined;
|
||||
}[]>;
|
||||
commands: Ref<{
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string | undefined;
|
||||
order?: number | undefined;
|
||||
icon?: string | undefined;
|
||||
action?: {
|
||||
type: "url";
|
||||
src: string;
|
||||
} | undefined;
|
||||
children?: {
|
||||
icon?: string | undefined;
|
||||
title: string;
|
||||
id: string;
|
||||
description?: string | undefined;
|
||||
order?: number | undefined;
|
||||
action?: {
|
||||
type: "url";
|
||||
src: string;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
}[], CustomCommand[] | {
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string | undefined;
|
||||
order?: number | undefined;
|
||||
icon?: string | undefined;
|
||||
action?: {
|
||||
type: "url";
|
||||
src: string;
|
||||
} | undefined;
|
||||
children?: {
|
||||
icon?: string | undefined;
|
||||
title: string;
|
||||
id: string;
|
||||
description?: string | undefined;
|
||||
order?: number | undefined;
|
||||
action?: {
|
||||
type: "url";
|
||||
src: string;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
}[]>;
|
||||
vitePluginDetected: Ref<boolean, boolean>;
|
||||
appRecords: Ref<{
|
||||
id: string;
|
||||
name: string;
|
||||
app?: App$1;
|
||||
version?: string | undefined;
|
||||
types?: Record<string, string | symbol> | undefined;
|
||||
instanceMap: Map<string, any> & Omit<Map<string, any>, keyof Map<any, any>>;
|
||||
perfGroupIds: Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}> & Omit<Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}>, keyof Map<any, any>>;
|
||||
rootInstance: VueAppInstance;
|
||||
routerId?: string | undefined;
|
||||
iframe?: string | undefined;
|
||||
}[], AppRecord[] | {
|
||||
id: string;
|
||||
name: string;
|
||||
app?: App$1;
|
||||
version?: string | undefined;
|
||||
types?: Record<string, string | symbol> | undefined;
|
||||
instanceMap: Map<string, any> & Omit<Map<string, any>, keyof Map<any, any>>;
|
||||
perfGroupIds: Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}> & Omit<Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}>, keyof Map<any, any>>;
|
||||
rootInstance: VueAppInstance;
|
||||
routerId?: string | undefined;
|
||||
iframe?: string | undefined;
|
||||
}[]>;
|
||||
activeAppRecordId: Ref<string, string>;
|
||||
timelineLayersState: Ref<Record<string, boolean>, Record<string, boolean>>;
|
||||
};
|
||||
declare function useDevToolsState(): DevToolsRefState;
|
||||
declare function onDevToolsConnected(fn: () => void): () => void;
|
||||
declare function refreshCurrentPageData(): void;
|
||||
//#endregion
|
||||
export { AssetEntry, AssetImporter, AssetInfo, AssetType, CodeSnippet, DevToolsMessagingEvents, ImageMeta, ModuleInfo, RPCFunctions, ViteRPCFunctions, VueDevToolsVuePlugin, createDevToolsStateContext, createViteClientRpc, createViteServerRpc, functions, getDevToolsClientUrl, onDevToolsConnected, onRpcConnected, onRpcSeverReady, onViteRpcConnected, refreshCurrentPageData, rpc, rpcServer, setDevToolsClientUrl, useDevToolsState, viteRpc, viteRpcFunctions };
|
||||
712
node_modules/@vue/devtools-core/dist/index.d.ts
generated
vendored
Normal file
712
node_modules/@vue/devtools-core/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,712 @@
|
||||
import * as vue0 from "vue";
|
||||
import { App, ComponentInternalInstance, ComponentOptions, Ref, SuspenseBoundary, VNode } from "vue";
|
||||
import * as vue_router0 from "vue-router";
|
||||
import { RouteLocationNormalizedLoaded, RouteRecordNormalized } from "vue-router";
|
||||
import { BirpcGroup, BirpcReturn } from "birpc";
|
||||
import { ModuleNode } from "vite";
|
||||
|
||||
//#region src/client.d.ts
|
||||
declare function setDevToolsClientUrl(url: string): void;
|
||||
declare function getDevToolsClientUrl(): any;
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/app.d.ts
|
||||
type App$1 = any;
|
||||
type VueAppInstance = ComponentInternalInstance & {
|
||||
type: {
|
||||
_componentTag: string | undefined;
|
||||
components: Record<string, ComponentInternalInstance['type']>;
|
||||
__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string;
|
||||
__isKeepAlive: boolean;
|
||||
devtools: {
|
||||
hide: boolean;
|
||||
};
|
||||
mixins: ComponentOptions[];
|
||||
extends: ComponentOptions;
|
||||
vuex: {
|
||||
getters: Record<string, unknown>;
|
||||
};
|
||||
computed: Record<string, unknown>;
|
||||
};
|
||||
__v_cache: Cache;
|
||||
__VUE_DEVTOOLS_NEXT_UID__: string;
|
||||
_isBeingDestroyed: boolean;
|
||||
_instance: VueAppInstance;
|
||||
_container: {
|
||||
_vnode: {
|
||||
component: VueAppInstance;
|
||||
};
|
||||
};
|
||||
isUnmounted: boolean;
|
||||
parent: VueAppInstance;
|
||||
appContext: {
|
||||
app: VueAppInstance & App$1 & {
|
||||
__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__: string;
|
||||
__VUE_DEVTOOLS_NEXT_APP_RECORD__: AppRecord;
|
||||
};
|
||||
};
|
||||
__VUE_DEVTOOLS_NEXT_APP_RECORD__: AppRecord;
|
||||
suspense: SuspenseBoundary & {
|
||||
suspenseKey: string;
|
||||
};
|
||||
renderContext: Record<string, unknown>;
|
||||
devtoolsRawSetupState: Record<string, unknown>;
|
||||
setupState: Record<string, unknown>;
|
||||
provides: Record<string | symbol, unknown>;
|
||||
ctx: Record<string, unknown>;
|
||||
} & App$1;
|
||||
interface AppRecord {
|
||||
id: string;
|
||||
name: string;
|
||||
app?: App$1;
|
||||
version?: string;
|
||||
types?: Record<string, string | symbol>;
|
||||
instanceMap: Map<string, VueAppInstance>;
|
||||
perfGroupIds: Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}>;
|
||||
rootInstance: VueAppInstance;
|
||||
routerId?: string;
|
||||
iframe?: string;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/command.d.ts
|
||||
interface CustomCommandAction {
|
||||
type: 'url';
|
||||
/**
|
||||
* Url of the action, if set, execute the action will open the url
|
||||
*/
|
||||
src: string;
|
||||
}
|
||||
interface CustomCommand {
|
||||
/**
|
||||
* The id of the command, should be unique
|
||||
*/
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
/**
|
||||
* Order of the command, bigger number will be shown first
|
||||
* @default 0
|
||||
*/
|
||||
order?: number;
|
||||
/**
|
||||
* Icon of the tab, support any Iconify icons, or a url to an image
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* - action of the command
|
||||
* - __NOTE__: This will be ignored if `children` is set
|
||||
*/
|
||||
action?: CustomCommandAction;
|
||||
/**
|
||||
* - children of action, if set, execute the action will show the children
|
||||
*/
|
||||
children?: Omit<CustomCommand, 'children'>[];
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/inspector.d.ts
|
||||
interface InspectorNodeTag {
|
||||
label: string;
|
||||
textColor: number;
|
||||
backgroundColor: number;
|
||||
tooltip?: string;
|
||||
}
|
||||
type EditStatePayload = {
|
||||
value: any;
|
||||
newKey?: string | null;
|
||||
remove?: undefined | false;
|
||||
} | {
|
||||
value?: undefined;
|
||||
newKey?: undefined;
|
||||
remove: true;
|
||||
};
|
||||
interface CustomInspectorNode {
|
||||
id: string;
|
||||
label: string;
|
||||
children?: CustomInspectorNode[];
|
||||
tags?: InspectorNodeTag[];
|
||||
name?: string;
|
||||
file?: string;
|
||||
}
|
||||
interface CustomInspectorState {
|
||||
[key: string]: (StateBase | Omit<ComponentState, 'type'>)[];
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/component.d.ts
|
||||
type ComponentInstance = any;
|
||||
interface ComponentTreeNode {
|
||||
uid: string | number;
|
||||
id: string;
|
||||
name: string;
|
||||
renderKey: string | number;
|
||||
inactive: boolean;
|
||||
isFragment: boolean;
|
||||
hasChildren: boolean;
|
||||
children: ComponentTreeNode[];
|
||||
domOrder?: number[];
|
||||
consoleId?: string;
|
||||
isRouterView?: boolean;
|
||||
macthedRouteSegment?: string;
|
||||
tags: InspectorNodeTag[];
|
||||
autoOpen: boolean;
|
||||
meta?: any;
|
||||
}
|
||||
type ComponentBuiltinCustomStateTypes = 'function' | 'map' | 'set' | 'reference' | 'component' | 'component-definition' | 'router' | 'store';
|
||||
interface ComponentCustomState extends ComponentStateBase {
|
||||
value: CustomState;
|
||||
}
|
||||
interface StateBase {
|
||||
key: string;
|
||||
value: any;
|
||||
editable?: boolean;
|
||||
objectType?: 'ref' | 'reactive' | 'computed' | 'other';
|
||||
raw?: string;
|
||||
}
|
||||
interface ComponentStateBase extends StateBase {
|
||||
type: string;
|
||||
}
|
||||
interface ComponentPropState extends ComponentStateBase {
|
||||
meta?: {
|
||||
type: string;
|
||||
required: boolean;
|
||||
/** Vue 1 only */
|
||||
mode?: 'default' | 'sync' | 'once';
|
||||
};
|
||||
}
|
||||
interface CustomState {
|
||||
_custom: {
|
||||
type: ComponentBuiltinCustomStateTypes | string;
|
||||
objectType?: string;
|
||||
display?: string;
|
||||
tooltip?: string;
|
||||
value?: any;
|
||||
abstract?: boolean;
|
||||
file?: string;
|
||||
uid?: number;
|
||||
readOnly?: boolean;
|
||||
/** Configure immediate child fields */
|
||||
fields?: {
|
||||
abstract?: boolean;
|
||||
};
|
||||
id?: any;
|
||||
actions?: {
|
||||
icon: string;
|
||||
tooltip?: string;
|
||||
action: () => void | Promise<void>;
|
||||
}[];
|
||||
/** internal */
|
||||
_reviveId?: number;
|
||||
};
|
||||
}
|
||||
type ComponentState = ComponentStateBase | ComponentPropState | ComponentCustomState;
|
||||
interface InspectedComponentData {
|
||||
id: string;
|
||||
name: string;
|
||||
file: string;
|
||||
state: ComponentState[];
|
||||
functional?: boolean;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/ctx/hook.d.ts
|
||||
declare enum DevToolsV6PluginAPIHookKeys {
|
||||
VISIT_COMPONENT_TREE = "visitComponentTree",
|
||||
INSPECT_COMPONENT = "inspectComponent",
|
||||
EDIT_COMPONENT_STATE = "editComponentState",
|
||||
GET_INSPECTOR_TREE = "getInspectorTree",
|
||||
GET_INSPECTOR_STATE = "getInspectorState",
|
||||
EDIT_INSPECTOR_STATE = "editInspectorState",
|
||||
INSPECT_TIMELINE_EVENT = "inspectTimelineEvent",
|
||||
TIMELINE_CLEARED = "timelineCleared",
|
||||
SET_PLUGIN_SETTINGS = "setPluginSettings",
|
||||
}
|
||||
interface DevToolsV6PluginAPIHookPayloads {
|
||||
[DevToolsV6PluginAPIHookKeys.VISIT_COMPONENT_TREE]: {
|
||||
app: App$1;
|
||||
componentInstance: ComponentInstance;
|
||||
treeNode: ComponentTreeNode;
|
||||
filter: string;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.INSPECT_COMPONENT]: {
|
||||
app: App$1;
|
||||
componentInstance: ComponentInstance;
|
||||
instanceData: InspectedComponentData;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.EDIT_COMPONENT_STATE]: {
|
||||
app: App$1;
|
||||
inspectorId: string;
|
||||
nodeId: string;
|
||||
path: string[];
|
||||
type: string;
|
||||
state: EditStatePayload;
|
||||
set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE]: {
|
||||
app: App$1;
|
||||
inspectorId: string;
|
||||
filter: string;
|
||||
rootNodes: CustomInspectorNode[];
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE]: {
|
||||
app: App$1;
|
||||
inspectorId: string;
|
||||
nodeId: string;
|
||||
state: CustomInspectorState;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE]: {
|
||||
app: App$1;
|
||||
inspectorId: string;
|
||||
nodeId: string;
|
||||
path: string[];
|
||||
type: string;
|
||||
state: EditStatePayload;
|
||||
set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.INSPECT_TIMELINE_EVENT]: {
|
||||
app: App$1;
|
||||
layerId: string;
|
||||
event: TimelineEvent;
|
||||
all?: boolean;
|
||||
data: any;
|
||||
};
|
||||
[DevToolsV6PluginAPIHookKeys.TIMELINE_CLEARED]: Record<string, never>;
|
||||
[DevToolsV6PluginAPIHookKeys.SET_PLUGIN_SETTINGS]: {
|
||||
app: App$1;
|
||||
pluginId: string;
|
||||
key: string;
|
||||
newValue: any;
|
||||
oldValue: any;
|
||||
settings: any;
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/core/open-in-editor/index.d.ts
|
||||
interface OpenInEditorOptions {
|
||||
baseUrl?: string;
|
||||
file?: string;
|
||||
line?: number;
|
||||
column?: number;
|
||||
host?: string;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/router.d.ts
|
||||
interface RouterInfo {
|
||||
currentRoute: RouteLocationNormalizedLoaded | null | Record<string, any>;
|
||||
routes: RouteRecordNormalized[];
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/tab.d.ts
|
||||
type TabCategory = 'pinned' | 'app' | 'modules' | 'advanced';
|
||||
type ModuleView = ModuleIframeView | ModuleVNodeView | ModuleSFCView;
|
||||
interface ModuleIframeView {
|
||||
/**
|
||||
* Iframe view
|
||||
*/
|
||||
type: 'iframe';
|
||||
/**
|
||||
* Url of the iframe
|
||||
*/
|
||||
src: string;
|
||||
/**
|
||||
* Persist the iframe instance even if the tab is not active
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
persistent?: boolean;
|
||||
}
|
||||
interface ModuleVNodeView {
|
||||
/**
|
||||
* Vue's VNode view
|
||||
*/
|
||||
type: 'vnode';
|
||||
/**
|
||||
* Send vnode to the client, they must be static and serializable
|
||||
*/
|
||||
vnode: VNode;
|
||||
}
|
||||
interface ModuleSFCView {
|
||||
/**
|
||||
* SFC view
|
||||
*/
|
||||
type: 'sfc';
|
||||
/**
|
||||
* SFC component
|
||||
*/
|
||||
sfc: string;
|
||||
}
|
||||
interface CustomTab {
|
||||
/**
|
||||
* The name of the tab, must be unique
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Icon of the tab, support any Iconify icons, or a url to an image
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* Title of the tab
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Main view of the tab
|
||||
*/
|
||||
view: ModuleView;
|
||||
/**
|
||||
* Category of the tab
|
||||
* @default 'app'
|
||||
*/
|
||||
category?: TabCategory;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/types/timeline.d.ts
|
||||
interface TimelineEvent<TData = any, TMeta = any> {
|
||||
time: number;
|
||||
data: TData;
|
||||
logType?: 'default' | 'warning' | 'error';
|
||||
meta?: TMeta;
|
||||
groupId?: number | string;
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../devtools-kit/src/messaging/index.d.ts
|
||||
declare function getRpcClient<R, L extends object = Record<string, never>>(): BirpcReturn<R, L>;
|
||||
declare function getRpcServer<R, L extends object = Record<string, never>>(): BirpcGroup<R, L>;
|
||||
declare function getViteRpcClient<R, L extends object = Record<string, never>>(): BirpcReturn<R, L>;
|
||||
//#endregion
|
||||
//#region src/rpc/global.d.ts
|
||||
declare enum DevToolsMessagingEvents {
|
||||
INSPECTOR_TREE_UPDATED = "inspector-tree-updated",
|
||||
INSPECTOR_STATE_UPDATED = "inspector-state-updated",
|
||||
DEVTOOLS_STATE_UPDATED = "devtools-state-updated",
|
||||
ROUTER_INFO_UPDATED = "router-info-updated",
|
||||
TIMELINE_EVENT_UPDATED = "timeline-event-updated",
|
||||
INSPECTOR_UPDATED = "inspector-updated",
|
||||
ACTIVE_APP_UNMOUNTED = "active-app-updated",
|
||||
DESTROY_DEVTOOLS_CLIENT = "destroy-devtools-client",
|
||||
RELOAD_DEVTOOLS_CLIENT = "reload-devtools-client",
|
||||
}
|
||||
declare const functions: {
|
||||
on: (event: string, handler: Function) => void;
|
||||
off: (event: string, handler: Function) => void;
|
||||
once: (event: string, handler: Function) => void;
|
||||
emit: (event: string, ...args: any[]) => void;
|
||||
heartbeat: () => boolean;
|
||||
devtoolsState: () => {
|
||||
connected: boolean;
|
||||
clientConnected: boolean;
|
||||
vueVersion: string;
|
||||
tabs: CustomTab[];
|
||||
commands: CustomCommand[];
|
||||
vitePluginDetected: boolean;
|
||||
appRecords: {
|
||||
id: string;
|
||||
name: string;
|
||||
version: string | undefined;
|
||||
routerId: string | undefined;
|
||||
iframe: string | undefined;
|
||||
}[];
|
||||
activeAppRecordId: string;
|
||||
timelineLayersState: Record<string, boolean>;
|
||||
};
|
||||
getInspectorTree(payload: Pick<DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE], "inspectorId" | "filter">): Promise<string>;
|
||||
getInspectorState(payload: Pick<DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE], "inspectorId" | "nodeId">): Promise<string>;
|
||||
editInspectorState(payload: DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE]): Promise<void>;
|
||||
sendInspectorState(id: string): void;
|
||||
inspectComponentInspector(): Promise<string>;
|
||||
cancelInspectComponentInspector(): void;
|
||||
getComponentRenderCode(id: string): any;
|
||||
scrollToComponent(id: string): void;
|
||||
inspectDOM(id: string): void;
|
||||
getInspectorNodeActions(id: string): {
|
||||
icon: string;
|
||||
tooltip?: string;
|
||||
action: (nodeId: string) => void | Promise<void>;
|
||||
}[] | undefined;
|
||||
getInspectorActions(id: string): {
|
||||
icon: string;
|
||||
tooltip?: string;
|
||||
action: () => void | Promise<void>;
|
||||
}[] | undefined;
|
||||
updateTimelineLayersState(state: Record<string, boolean>): void;
|
||||
callInspectorNodeAction(inspectorId: string, actionIndex: number, nodeId: string): void;
|
||||
callInspectorAction(inspectorId: string, actionIndex: number): void;
|
||||
openInEditor(options: OpenInEditorOptions): void;
|
||||
checkVueInspectorDetected(): Promise<boolean>;
|
||||
enableVueInspector(): Promise<void>;
|
||||
toggleApp(id: string, options?: {
|
||||
inspectingComponent?: boolean;
|
||||
}): Promise<void>;
|
||||
updatePluginSettings(pluginId: string, key: string, value: string): void;
|
||||
getPluginSettings(pluginId: string): {
|
||||
options: Record<string, {
|
||||
label: string;
|
||||
description?: string;
|
||||
} & ({
|
||||
type: "boolean";
|
||||
defaultValue: boolean;
|
||||
} | {
|
||||
type: "choice";
|
||||
defaultValue: string | number;
|
||||
options: {
|
||||
value: string | number;
|
||||
label: string;
|
||||
}[];
|
||||
component?: "select" | "button-group";
|
||||
} | {
|
||||
type: "text";
|
||||
defaultValue: string;
|
||||
})> | null;
|
||||
values: any;
|
||||
};
|
||||
getRouterInfo(): RouterInfo;
|
||||
navigate(path: string): Promise<void | vue_router0.NavigationFailure | {} | undefined>;
|
||||
getMatchedRoutes(path: string): vue_router0.RouteRecordNormalized[];
|
||||
toggleClientConnected(state: boolean): void;
|
||||
getCustomInspector(): {
|
||||
id: string;
|
||||
label: string;
|
||||
logo: string;
|
||||
icon: string;
|
||||
packageName: string | undefined;
|
||||
homepage: string | undefined;
|
||||
pluginId: string;
|
||||
}[];
|
||||
getInspectorInfo(id: string): {
|
||||
id: string;
|
||||
label: string;
|
||||
logo: string | undefined;
|
||||
packageName: string | undefined;
|
||||
homepage: string | undefined;
|
||||
timelineLayers: {
|
||||
id: string;
|
||||
label: string;
|
||||
color: number;
|
||||
}[];
|
||||
treeFilterPlaceholder: string;
|
||||
stateFilterPlaceholder: string;
|
||||
} | undefined;
|
||||
highlighComponent(uid: string): Promise<any>;
|
||||
unhighlight(): Promise<any>;
|
||||
updateDevToolsClientDetected(params: Record<string, boolean>): void;
|
||||
initDevToolsServerListener(): void;
|
||||
};
|
||||
type RPCFunctions = typeof functions;
|
||||
declare const rpc: {
|
||||
value: ReturnType<typeof getRpcClient<RPCFunctions>>;
|
||||
functions: ReturnType<typeof getRpcClient<RPCFunctions>>;
|
||||
};
|
||||
declare const rpcServer: {
|
||||
value: ReturnType<typeof getRpcServer<RPCFunctions>>;
|
||||
functions: ReturnType<typeof getRpcServer<RPCFunctions>>;
|
||||
};
|
||||
declare function onRpcConnected(callback: () => void): void;
|
||||
declare function onRpcSeverReady(callback: () => void): void;
|
||||
//#endregion
|
||||
//#region src/rpc/types.d.ts
|
||||
type AssetType = 'image' | 'font' | 'video' | 'audio' | 'text' | 'json' | 'wasm' | 'other';
|
||||
interface AssetInfo {
|
||||
path: string;
|
||||
type: AssetType;
|
||||
publicPath: string;
|
||||
relativePath: string;
|
||||
filePath: string;
|
||||
size: number;
|
||||
mtime: number;
|
||||
}
|
||||
interface ImageMeta {
|
||||
width: number;
|
||||
height: number;
|
||||
orientation?: number;
|
||||
type?: string;
|
||||
mimeType?: string;
|
||||
}
|
||||
type AssetImporter = Pick<ModuleNode, 'url' | 'id'>;
|
||||
interface AssetEntry {
|
||||
path: string;
|
||||
content: string;
|
||||
encoding?: BufferEncoding;
|
||||
override?: boolean;
|
||||
}
|
||||
interface CodeSnippet {
|
||||
code: string;
|
||||
lang: string;
|
||||
name: string;
|
||||
docs?: string;
|
||||
}
|
||||
interface ModuleInfo {
|
||||
id: string;
|
||||
plugins: {
|
||||
name: string;
|
||||
transform?: number;
|
||||
resolveId?: number;
|
||||
}[];
|
||||
deps: string[];
|
||||
virtual: boolean;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/rpc/vite.d.ts
|
||||
declare const viteRpcFunctions: {
|
||||
on: (event: string, handler: Function) => void;
|
||||
off: (event: string, handler: Function) => void;
|
||||
once: (event: string, handler: Function) => void;
|
||||
emit: (event: string, ...args: any[]) => void;
|
||||
heartbeat: () => boolean;
|
||||
};
|
||||
type ViteRPCFunctions = typeof viteRpcFunctions & {
|
||||
getStaticAssets: () => Promise<AssetInfo[]>;
|
||||
getAssetImporters: (url: string) => Promise<AssetImporter[]>;
|
||||
getImageMeta: (filepath: string) => Promise<ImageMeta>;
|
||||
getTextAssetContent: (filepath: string, limit?: number) => Promise<string>;
|
||||
getRoot: () => Promise<string>;
|
||||
getGraphModules: () => Promise<ModuleInfo[]>;
|
||||
};
|
||||
declare const viteRpc: {
|
||||
value: ReturnType<typeof getViteRpcClient<ViteRPCFunctions>>;
|
||||
functions: ReturnType<typeof getViteRpcClient<ViteRPCFunctions>>;
|
||||
};
|
||||
declare function onViteRpcConnected(callback: () => void): void;
|
||||
declare function createViteClientRpc(): void;
|
||||
declare function createViteServerRpc(functions: Record<string, any>): void;
|
||||
//#endregion
|
||||
//#region src/vue-plugin/devtools-state.d.ts
|
||||
interface DevToolsState {
|
||||
connected: boolean;
|
||||
clientConnected: boolean;
|
||||
vueVersion: string;
|
||||
tabs: CustomTab[];
|
||||
commands: CustomCommand[];
|
||||
vitePluginDetected: boolean;
|
||||
appRecords: AppRecord[];
|
||||
activeAppRecordId: string;
|
||||
timelineLayersState: Record<string, boolean>;
|
||||
}
|
||||
type DevToolsRefState = { [P in keyof DevToolsState]: Ref<DevToolsState[P]> };
|
||||
declare function VueDevToolsVuePlugin(): {
|
||||
install(app: App): void;
|
||||
};
|
||||
declare function createDevToolsStateContext(): {
|
||||
getDevToolsState: () => void;
|
||||
connected: Ref<boolean, boolean>;
|
||||
clientConnected: Ref<boolean, boolean>;
|
||||
vueVersion: Ref<string, string>;
|
||||
tabs: Ref<{
|
||||
name: string;
|
||||
icon?: string | undefined;
|
||||
title: string;
|
||||
view: {
|
||||
type: "iframe";
|
||||
src: string;
|
||||
persistent?: boolean | undefined;
|
||||
} | {
|
||||
type: "vnode";
|
||||
vnode: vue0.VNode;
|
||||
} | {
|
||||
type: "sfc";
|
||||
sfc: string;
|
||||
};
|
||||
category?: ("app" | "pinned" | "modules" | "advanced") | undefined;
|
||||
}[], CustomTab[] | {
|
||||
name: string;
|
||||
icon?: string | undefined;
|
||||
title: string;
|
||||
view: {
|
||||
type: "iframe";
|
||||
src: string;
|
||||
persistent?: boolean | undefined;
|
||||
} | {
|
||||
type: "vnode";
|
||||
vnode: vue0.VNode;
|
||||
} | {
|
||||
type: "sfc";
|
||||
sfc: string;
|
||||
};
|
||||
category?: ("app" | "pinned" | "modules" | "advanced") | undefined;
|
||||
}[]>;
|
||||
commands: Ref<{
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string | undefined;
|
||||
order?: number | undefined;
|
||||
icon?: string | undefined;
|
||||
action?: {
|
||||
type: "url";
|
||||
src: string;
|
||||
} | undefined;
|
||||
children?: {
|
||||
icon?: string | undefined;
|
||||
title: string;
|
||||
id: string;
|
||||
description?: string | undefined;
|
||||
order?: number | undefined;
|
||||
action?: {
|
||||
type: "url";
|
||||
src: string;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
}[], CustomCommand[] | {
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string | undefined;
|
||||
order?: number | undefined;
|
||||
icon?: string | undefined;
|
||||
action?: {
|
||||
type: "url";
|
||||
src: string;
|
||||
} | undefined;
|
||||
children?: {
|
||||
icon?: string | undefined;
|
||||
title: string;
|
||||
id: string;
|
||||
description?: string | undefined;
|
||||
order?: number | undefined;
|
||||
action?: {
|
||||
type: "url";
|
||||
src: string;
|
||||
} | undefined;
|
||||
}[] | undefined;
|
||||
}[]>;
|
||||
vitePluginDetected: Ref<boolean, boolean>;
|
||||
appRecords: Ref<{
|
||||
id: string;
|
||||
name: string;
|
||||
app?: App$1;
|
||||
version?: string | undefined;
|
||||
types?: Record<string, string | symbol> | undefined;
|
||||
instanceMap: Map<string, any> & Omit<Map<string, any>, keyof Map<any, any>>;
|
||||
perfGroupIds: Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}> & Omit<Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}>, keyof Map<any, any>>;
|
||||
rootInstance: VueAppInstance;
|
||||
routerId?: string | undefined;
|
||||
iframe?: string | undefined;
|
||||
}[], AppRecord[] | {
|
||||
id: string;
|
||||
name: string;
|
||||
app?: App$1;
|
||||
version?: string | undefined;
|
||||
types?: Record<string, string | symbol> | undefined;
|
||||
instanceMap: Map<string, any> & Omit<Map<string, any>, keyof Map<any, any>>;
|
||||
perfGroupIds: Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}> & Omit<Map<string, {
|
||||
groupId: number;
|
||||
time: number;
|
||||
}>, keyof Map<any, any>>;
|
||||
rootInstance: VueAppInstance;
|
||||
routerId?: string | undefined;
|
||||
iframe?: string | undefined;
|
||||
}[]>;
|
||||
activeAppRecordId: Ref<string, string>;
|
||||
timelineLayersState: Ref<Record<string, boolean>, Record<string, boolean>>;
|
||||
};
|
||||
declare function useDevToolsState(): DevToolsRefState;
|
||||
declare function onDevToolsConnected(fn: () => void): () => void;
|
||||
declare function refreshCurrentPageData(): void;
|
||||
//#endregion
|
||||
export { AssetEntry, AssetImporter, AssetInfo, AssetType, CodeSnippet, DevToolsMessagingEvents, ImageMeta, ModuleInfo, RPCFunctions, ViteRPCFunctions, VueDevToolsVuePlugin, createDevToolsStateContext, createViteClientRpc, createViteServerRpc, functions, getDevToolsClientUrl, onDevToolsConnected, onRpcConnected, onRpcSeverReady, onViteRpcConnected, refreshCurrentPageData, rpc, rpcServer, setDevToolsClientUrl, useDevToolsState, viteRpc, viteRpcFunctions };
|
||||
532
node_modules/@vue/devtools-core/dist/index.js
generated
vendored
Normal file
532
node_modules/@vue/devtools-core/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,532 @@
|
||||
import { isBrowser, target } from "@vue/devtools-shared";
|
||||
import { DevToolsContextHookKeys, DevToolsMessagingHookKeys, createRpcClient, createRpcServer, devtools, devtoolsRouter, devtoolsRouterInfo, getActiveInspectors, getInspector, getInspectorActions, getInspectorInfo, getInspectorNodeActions, getRpcClient, getRpcServer, getViteRpcClient, stringify, toggleClientConnected, updateDevToolsClientDetected, updateTimelineLayersState } from "@vue/devtools-kit";
|
||||
import { computed, inject, onUnmounted, ref, watch } from "vue";
|
||||
|
||||
//#region src/client.ts
|
||||
function setDevToolsClientUrl(url) {
|
||||
target.__VUE_DEVTOOLS_CLIENT_URL__ = url;
|
||||
}
|
||||
function getDevToolsClientUrl() {
|
||||
return target.__VUE_DEVTOOLS_CLIENT_URL__ ?? (() => {
|
||||
if (isBrowser) {
|
||||
const devtoolsMeta = document.querySelector("meta[name=__VUE_DEVTOOLS_CLIENT_URL__]");
|
||||
if (devtoolsMeta) return devtoolsMeta.getAttribute("content");
|
||||
}
|
||||
return "";
|
||||
})();
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs
|
||||
function flatHooks(configHooks, hooks$2 = {}, parentName) {
|
||||
for (const key in configHooks) {
|
||||
const subHook = configHooks[key];
|
||||
const name = parentName ? `${parentName}:${key}` : key;
|
||||
if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks$2, name);
|
||||
else if (typeof subHook === "function") hooks$2[name] = subHook;
|
||||
}
|
||||
return hooks$2;
|
||||
}
|
||||
const defaultTask = { run: (function_) => function_() };
|
||||
const _createTask = () => defaultTask;
|
||||
const createTask = typeof console.createTask !== "undefined" ? console.createTask : _createTask;
|
||||
function serialTaskCaller(hooks$2, args) {
|
||||
const task = createTask(args.shift());
|
||||
return hooks$2.reduce((promise, hookFunction) => promise.then(() => task.run(() => hookFunction(...args))), Promise.resolve());
|
||||
}
|
||||
function parallelTaskCaller(hooks$2, args) {
|
||||
const task = createTask(args.shift());
|
||||
return Promise.all(hooks$2.map((hook) => task.run(() => hook(...args))));
|
||||
}
|
||||
function callEachWith(callbacks, arg0) {
|
||||
for (const callback of [...callbacks]) callback(arg0);
|
||||
}
|
||||
var Hookable = class {
|
||||
constructor() {
|
||||
this._hooks = {};
|
||||
this._before = void 0;
|
||||
this._after = void 0;
|
||||
this._deprecatedMessages = void 0;
|
||||
this._deprecatedHooks = {};
|
||||
this.hook = this.hook.bind(this);
|
||||
this.callHook = this.callHook.bind(this);
|
||||
this.callHookWith = this.callHookWith.bind(this);
|
||||
}
|
||||
hook(name, function_, options = {}) {
|
||||
if (!name || typeof function_ !== "function") return () => {};
|
||||
const originalName = name;
|
||||
let dep;
|
||||
while (this._deprecatedHooks[name]) {
|
||||
dep = this._deprecatedHooks[name];
|
||||
name = dep.to;
|
||||
}
|
||||
if (dep && !options.allowDeprecated) {
|
||||
let message = dep.message;
|
||||
if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
|
||||
if (!this._deprecatedMessages) this._deprecatedMessages = /* @__PURE__ */ new Set();
|
||||
if (!this._deprecatedMessages.has(message)) {
|
||||
console.warn(message);
|
||||
this._deprecatedMessages.add(message);
|
||||
}
|
||||
}
|
||||
if (!function_.name) try {
|
||||
Object.defineProperty(function_, "name", {
|
||||
get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
|
||||
configurable: true
|
||||
});
|
||||
} catch {}
|
||||
this._hooks[name] = this._hooks[name] || [];
|
||||
this._hooks[name].push(function_);
|
||||
return () => {
|
||||
if (function_) {
|
||||
this.removeHook(name, function_);
|
||||
function_ = void 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
hookOnce(name, function_) {
|
||||
let _unreg;
|
||||
let _function = (...arguments_) => {
|
||||
if (typeof _unreg === "function") _unreg();
|
||||
_unreg = void 0;
|
||||
_function = void 0;
|
||||
return function_(...arguments_);
|
||||
};
|
||||
_unreg = this.hook(name, _function);
|
||||
return _unreg;
|
||||
}
|
||||
removeHook(name, function_) {
|
||||
if (this._hooks[name]) {
|
||||
const index = this._hooks[name].indexOf(function_);
|
||||
if (index !== -1) this._hooks[name].splice(index, 1);
|
||||
if (this._hooks[name].length === 0) delete this._hooks[name];
|
||||
}
|
||||
}
|
||||
deprecateHook(name, deprecated) {
|
||||
this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
|
||||
const _hooks = this._hooks[name] || [];
|
||||
delete this._hooks[name];
|
||||
for (const hook of _hooks) this.hook(name, hook);
|
||||
}
|
||||
deprecateHooks(deprecatedHooks) {
|
||||
Object.assign(this._deprecatedHooks, deprecatedHooks);
|
||||
for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]);
|
||||
}
|
||||
addHooks(configHooks) {
|
||||
const hooks$2 = flatHooks(configHooks);
|
||||
const removeFns = Object.keys(hooks$2).map((key) => this.hook(key, hooks$2[key]));
|
||||
return () => {
|
||||
for (const unreg of removeFns.splice(0, removeFns.length)) unreg();
|
||||
};
|
||||
}
|
||||
removeHooks(configHooks) {
|
||||
const hooks$2 = flatHooks(configHooks);
|
||||
for (const key in hooks$2) this.removeHook(key, hooks$2[key]);
|
||||
}
|
||||
removeAllHooks() {
|
||||
for (const key in this._hooks) delete this._hooks[key];
|
||||
}
|
||||
callHook(name, ...arguments_) {
|
||||
arguments_.unshift(name);
|
||||
return this.callHookWith(serialTaskCaller, name, ...arguments_);
|
||||
}
|
||||
callHookParallel(name, ...arguments_) {
|
||||
arguments_.unshift(name);
|
||||
return this.callHookWith(parallelTaskCaller, name, ...arguments_);
|
||||
}
|
||||
callHookWith(caller, name, ...arguments_) {
|
||||
const event = this._before || this._after ? {
|
||||
name,
|
||||
args: arguments_,
|
||||
context: {}
|
||||
} : void 0;
|
||||
if (this._before) callEachWith(this._before, event);
|
||||
const result = caller(name in this._hooks ? [...this._hooks[name]] : [], arguments_);
|
||||
if (result instanceof Promise) return result.finally(() => {
|
||||
if (this._after && event) callEachWith(this._after, event);
|
||||
});
|
||||
if (this._after && event) callEachWith(this._after, event);
|
||||
return result;
|
||||
}
|
||||
beforeEach(function_) {
|
||||
this._before = this._before || [];
|
||||
this._before.push(function_);
|
||||
return () => {
|
||||
if (this._before !== void 0) {
|
||||
const index = this._before.indexOf(function_);
|
||||
if (index !== -1) this._before.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
afterEach(function_) {
|
||||
this._after = this._after || [];
|
||||
this._after.push(function_);
|
||||
return () => {
|
||||
if (this._after !== void 0) {
|
||||
const index = this._after.indexOf(function_);
|
||||
if (index !== -1) this._after.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
function createHooks() {
|
||||
return new Hookable();
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/rpc/global.ts
|
||||
const hooks$1 = createHooks();
|
||||
let DevToolsMessagingEvents = /* @__PURE__ */ function(DevToolsMessagingEvents$1) {
|
||||
DevToolsMessagingEvents$1["INSPECTOR_TREE_UPDATED"] = "inspector-tree-updated";
|
||||
DevToolsMessagingEvents$1["INSPECTOR_STATE_UPDATED"] = "inspector-state-updated";
|
||||
DevToolsMessagingEvents$1["DEVTOOLS_STATE_UPDATED"] = "devtools-state-updated";
|
||||
DevToolsMessagingEvents$1["ROUTER_INFO_UPDATED"] = "router-info-updated";
|
||||
DevToolsMessagingEvents$1["TIMELINE_EVENT_UPDATED"] = "timeline-event-updated";
|
||||
DevToolsMessagingEvents$1["INSPECTOR_UPDATED"] = "inspector-updated";
|
||||
DevToolsMessagingEvents$1["ACTIVE_APP_UNMOUNTED"] = "active-app-updated";
|
||||
DevToolsMessagingEvents$1["DESTROY_DEVTOOLS_CLIENT"] = "destroy-devtools-client";
|
||||
DevToolsMessagingEvents$1["RELOAD_DEVTOOLS_CLIENT"] = "reload-devtools-client";
|
||||
return DevToolsMessagingEvents$1;
|
||||
}({});
|
||||
function getDevToolsState() {
|
||||
const state = devtools.ctx.state;
|
||||
return {
|
||||
connected: state.connected,
|
||||
clientConnected: true,
|
||||
vueVersion: state?.activeAppRecord?.version || "",
|
||||
tabs: state.tabs,
|
||||
commands: state.commands,
|
||||
vitePluginDetected: state.vitePluginDetected,
|
||||
appRecords: state.appRecords.map((item) => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
version: item.version,
|
||||
routerId: item.routerId,
|
||||
iframe: item.iframe
|
||||
})),
|
||||
activeAppRecordId: state.activeAppRecordId,
|
||||
timelineLayersState: state.timelineLayersState
|
||||
};
|
||||
}
|
||||
const functions = {
|
||||
on: (event, handler) => {
|
||||
hooks$1.hook(event, handler);
|
||||
},
|
||||
off: (event, handler) => {
|
||||
hooks$1.removeHook(event, handler);
|
||||
},
|
||||
once: (event, handler) => {
|
||||
hooks$1.hookOnce(event, handler);
|
||||
},
|
||||
emit: (event, ...args) => {
|
||||
hooks$1.callHook(event, ...args);
|
||||
},
|
||||
heartbeat: () => {
|
||||
return true;
|
||||
},
|
||||
devtoolsState: () => {
|
||||
return getDevToolsState();
|
||||
},
|
||||
async getInspectorTree(payload) {
|
||||
return stringify(await devtools.ctx.api.getInspectorTree(payload));
|
||||
},
|
||||
async getInspectorState(payload) {
|
||||
const inspector = getInspector(payload.inspectorId);
|
||||
if (inspector) inspector.selectedNodeId = payload.nodeId;
|
||||
return stringify(await devtools.ctx.api.getInspectorState(payload));
|
||||
},
|
||||
async editInspectorState(payload) {
|
||||
return await devtools.ctx.api.editInspectorState(payload);
|
||||
},
|
||||
sendInspectorState(id) {
|
||||
return devtools.ctx.api.sendInspectorState(id);
|
||||
},
|
||||
inspectComponentInspector() {
|
||||
return devtools.ctx.api.inspectComponentInspector();
|
||||
},
|
||||
cancelInspectComponentInspector() {
|
||||
return devtools.ctx.api.cancelInspectComponentInspector();
|
||||
},
|
||||
getComponentRenderCode(id) {
|
||||
return devtools.ctx.api.getComponentRenderCode(id);
|
||||
},
|
||||
scrollToComponent(id) {
|
||||
return devtools.ctx.api.scrollToComponent(id);
|
||||
},
|
||||
inspectDOM(id) {
|
||||
return devtools.ctx.api.inspectDOM(id);
|
||||
},
|
||||
getInspectorNodeActions(id) {
|
||||
return getInspectorNodeActions(id);
|
||||
},
|
||||
getInspectorActions(id) {
|
||||
return getInspectorActions(id);
|
||||
},
|
||||
updateTimelineLayersState(state) {
|
||||
return updateTimelineLayersState(state);
|
||||
},
|
||||
callInspectorNodeAction(inspectorId, actionIndex, nodeId) {
|
||||
const nodeActions = getInspectorNodeActions(inspectorId);
|
||||
if (nodeActions?.length) nodeActions[actionIndex].action?.(nodeId);
|
||||
},
|
||||
callInspectorAction(inspectorId, actionIndex) {
|
||||
const actions = getInspectorActions(inspectorId);
|
||||
if (actions?.length) actions[actionIndex].action?.();
|
||||
},
|
||||
openInEditor(options) {
|
||||
return devtools.ctx.api.openInEditor(options);
|
||||
},
|
||||
async checkVueInspectorDetected() {
|
||||
return !!await devtools.ctx.api.getVueInspector();
|
||||
},
|
||||
async enableVueInspector() {
|
||||
const inspector = await devtools?.api?.getVueInspector?.();
|
||||
if (inspector) await inspector.enable();
|
||||
},
|
||||
async toggleApp(id, options) {
|
||||
return devtools.ctx.api.toggleApp(id, options);
|
||||
},
|
||||
updatePluginSettings(pluginId, key, value) {
|
||||
return devtools.ctx.api.updatePluginSettings(pluginId, key, value);
|
||||
},
|
||||
getPluginSettings(pluginId) {
|
||||
return devtools.ctx.api.getPluginSettings(pluginId);
|
||||
},
|
||||
getRouterInfo() {
|
||||
return devtoolsRouterInfo;
|
||||
},
|
||||
navigate(path) {
|
||||
return devtoolsRouter.value?.push(path).catch(() => ({}));
|
||||
},
|
||||
getMatchedRoutes(path) {
|
||||
const c = console.warn;
|
||||
console.warn = () => {};
|
||||
const matched = devtoolsRouter.value?.resolve?.({ path: path || "/" }).matched ?? [];
|
||||
console.warn = c;
|
||||
return matched;
|
||||
},
|
||||
toggleClientConnected(state) {
|
||||
toggleClientConnected(state);
|
||||
},
|
||||
getCustomInspector() {
|
||||
return getActiveInspectors();
|
||||
},
|
||||
getInspectorInfo(id) {
|
||||
return getInspectorInfo(id);
|
||||
},
|
||||
highlighComponent(uid) {
|
||||
return devtools.ctx.hooks.callHook(DevToolsContextHookKeys.COMPONENT_HIGHLIGHT, { uid });
|
||||
},
|
||||
unhighlight() {
|
||||
return devtools.ctx.hooks.callHook(DevToolsContextHookKeys.COMPONENT_UNHIGHLIGHT);
|
||||
},
|
||||
updateDevToolsClientDetected(params) {
|
||||
updateDevToolsClientDetected(params);
|
||||
},
|
||||
initDevToolsServerListener() {
|
||||
const broadcast = getRpcServer().broadcast;
|
||||
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.SEND_INSPECTOR_TREE_TO_CLIENT, (payload) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.INSPECTOR_TREE_UPDATED, stringify(payload));
|
||||
});
|
||||
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.SEND_INSPECTOR_STATE_TO_CLIENT, (payload) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.INSPECTOR_STATE_UPDATED, stringify(payload));
|
||||
});
|
||||
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.DEVTOOLS_STATE_UPDATED, () => {
|
||||
broadcast.emit(DevToolsMessagingEvents.DEVTOOLS_STATE_UPDATED, getDevToolsState());
|
||||
});
|
||||
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.ROUTER_INFO_UPDATED, ({ state }) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.ROUTER_INFO_UPDATED, state);
|
||||
});
|
||||
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.SEND_TIMELINE_EVENT_TO_CLIENT, (payload) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.TIMELINE_EVENT_UPDATED, stringify(payload));
|
||||
});
|
||||
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.SEND_INSPECTOR_TO_CLIENT, (payload) => {
|
||||
broadcast.emit(DevToolsMessagingEvents.INSPECTOR_UPDATED, payload);
|
||||
});
|
||||
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT, () => {
|
||||
broadcast.emit(DevToolsMessagingEvents.ACTIVE_APP_UNMOUNTED);
|
||||
});
|
||||
}
|
||||
};
|
||||
const rpc = new Proxy({
|
||||
value: {},
|
||||
functions: {}
|
||||
}, { get(target$1, property) {
|
||||
const _rpc = getRpcClient();
|
||||
if (property === "value") return _rpc;
|
||||
else if (property === "functions") return _rpc.$functions;
|
||||
} });
|
||||
const rpcServer = new Proxy({
|
||||
value: {},
|
||||
functions: {}
|
||||
}, { get(target$1, property) {
|
||||
const _rpc = getRpcServer();
|
||||
if (property === "value") return _rpc;
|
||||
else if (property === "functions") return _rpc.functions;
|
||||
} });
|
||||
function onRpcConnected(callback) {
|
||||
let timer = null;
|
||||
let retryCount = 0;
|
||||
function heartbeat() {
|
||||
rpc.value?.heartbeat?.().then(() => {
|
||||
callback();
|
||||
clearTimeout(timer);
|
||||
}).catch(() => {});
|
||||
}
|
||||
timer = setInterval(() => {
|
||||
if (retryCount >= 30) clearTimeout(timer);
|
||||
retryCount++;
|
||||
heartbeat();
|
||||
}, retryCount * 200 + 200);
|
||||
heartbeat();
|
||||
}
|
||||
function onRpcSeverReady(callback) {
|
||||
let timer = null;
|
||||
const timeout = 120;
|
||||
function heartbeat() {
|
||||
if (rpcServer.value.clients.length > 0) {
|
||||
callback();
|
||||
clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
timer = setInterval(() => {
|
||||
heartbeat();
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/rpc/vite.ts
|
||||
const hooks = createHooks();
|
||||
const viteRpcFunctions = {
|
||||
on: (event, handler) => {
|
||||
hooks.hook(event, handler);
|
||||
},
|
||||
off: (event, handler) => {
|
||||
hooks.removeHook(event, handler);
|
||||
},
|
||||
once: (event, handler) => {
|
||||
hooks.hookOnce(event, handler);
|
||||
},
|
||||
emit: (event, ...args) => {
|
||||
hooks.callHook(event, ...args);
|
||||
},
|
||||
heartbeat: () => {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
const viteRpc = new Proxy({
|
||||
value: {},
|
||||
functions: {}
|
||||
}, { get(target$1, property) {
|
||||
const _rpc = getViteRpcClient();
|
||||
if (property === "value") return _rpc;
|
||||
else if (property === "functions") return _rpc?.$functions;
|
||||
} });
|
||||
function onViteRpcConnected(callback) {
|
||||
let timer = null;
|
||||
function heartbeat() {
|
||||
viteRpc.value?.heartbeat?.().then(() => {
|
||||
clearTimeout(timer);
|
||||
callback();
|
||||
}).catch(() => ({}));
|
||||
timer = setTimeout(() => {
|
||||
heartbeat();
|
||||
}, 80);
|
||||
}
|
||||
heartbeat();
|
||||
}
|
||||
function createViteClientRpc() {
|
||||
createRpcClient(viteRpcFunctions, { preset: "vite" });
|
||||
}
|
||||
function createViteServerRpc(functions$1) {
|
||||
createRpcServer(functions$1, { preset: "vite" });
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/vue-plugin/devtools-state.ts
|
||||
const VueDevToolsStateSymbol = Symbol.for("__VueDevToolsStateSymbol__");
|
||||
function VueDevToolsVuePlugin() {
|
||||
return { install(app) {
|
||||
const state = createDevToolsStateContext();
|
||||
state.getDevToolsState();
|
||||
app.provide(VueDevToolsStateSymbol, state);
|
||||
app.config.globalProperties.$getDevToolsState = state.getDevToolsState;
|
||||
app.config.globalProperties.$disconnectDevToolsClient = () => {
|
||||
state.clientConnected.value = false;
|
||||
state.connected.value = false;
|
||||
};
|
||||
} };
|
||||
}
|
||||
function createDevToolsStateContext() {
|
||||
const connected = ref(false);
|
||||
const clientConnected = ref(false);
|
||||
const vueVersion = ref("");
|
||||
const tabs = ref([]);
|
||||
const commands = ref([]);
|
||||
const vitePluginDetected = ref(false);
|
||||
const appRecords = ref([]);
|
||||
const activeAppRecordId = ref("");
|
||||
const timelineLayersState = ref({});
|
||||
function updateState(data) {
|
||||
connected.value = data.connected;
|
||||
clientConnected.value = data.clientConnected;
|
||||
vueVersion.value = data.vueVersion || "";
|
||||
tabs.value = data.tabs;
|
||||
commands.value = data.commands;
|
||||
vitePluginDetected.value = data.vitePluginDetected;
|
||||
appRecords.value = data.appRecords;
|
||||
activeAppRecordId.value = data.activeAppRecordId;
|
||||
timelineLayersState.value = data.timelineLayersState;
|
||||
}
|
||||
function getDevToolsState$1() {
|
||||
onRpcConnected(() => {
|
||||
rpc.value.devtoolsState().then((data) => {
|
||||
updateState(data);
|
||||
});
|
||||
rpc.functions.off(DevToolsMessagingEvents.DEVTOOLS_STATE_UPDATED, updateState);
|
||||
rpc.functions.on(DevToolsMessagingEvents.DEVTOOLS_STATE_UPDATED, updateState);
|
||||
});
|
||||
}
|
||||
return {
|
||||
getDevToolsState: getDevToolsState$1,
|
||||
connected,
|
||||
clientConnected,
|
||||
vueVersion,
|
||||
tabs,
|
||||
commands,
|
||||
vitePluginDetected,
|
||||
appRecords,
|
||||
activeAppRecordId,
|
||||
timelineLayersState
|
||||
};
|
||||
}
|
||||
function useDevToolsState() {
|
||||
return inject(VueDevToolsStateSymbol);
|
||||
}
|
||||
const fns = [];
|
||||
function onDevToolsConnected(fn) {
|
||||
const { connected, clientConnected } = useDevToolsState();
|
||||
fns.push(fn);
|
||||
onUnmounted(() => {
|
||||
fns.splice(fns.indexOf(fn), 1);
|
||||
});
|
||||
const devtoolsReady = computed(() => clientConnected.value && connected.value);
|
||||
if (devtoolsReady.value) fn();
|
||||
else {
|
||||
const stop = watch(devtoolsReady, (v) => {
|
||||
if (v) {
|
||||
fn();
|
||||
stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
return () => {
|
||||
fns.splice(fns.indexOf(fn), 1);
|
||||
};
|
||||
}
|
||||
function refreshCurrentPageData() {
|
||||
fns.forEach((fn) => fn());
|
||||
}
|
||||
|
||||
//#endregion
|
||||
export { DevToolsMessagingEvents, VueDevToolsVuePlugin, createDevToolsStateContext, createViteClientRpc, createViteServerRpc, functions, getDevToolsClientUrl, onDevToolsConnected, onRpcConnected, onRpcSeverReady, onViteRpcConnected, refreshCurrentPageData, rpc, rpcServer, setDevToolsClientUrl, useDevToolsState, viteRpc, viteRpcFunctions };
|
||||
70
node_modules/@vue/devtools-core/node_modules/pathe/LICENSE
generated
vendored
Normal file
70
node_modules/@vue/devtools-core/node_modules/pathe/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Pooya Parsa <pooya@pi0.io> - Daniel Roe <daniel@roe.dev>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
Copyright Joyent, Inc. and other Node contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
Bundled zeptomatch (https://github.com/fabiospampinato/zeptomatch)
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2023-present Fabio Spampinato
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
73
node_modules/@vue/devtools-core/node_modules/pathe/README.md
generated
vendored
Normal file
73
node_modules/@vue/devtools-core/node_modules/pathe/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# 🛣️ pathe
|
||||
|
||||
> Universal filesystem path utils
|
||||
|
||||
[![version][npm-v-src]][npm-v-href]
|
||||
[![downloads][npm-d-src]][npm-d-href]
|
||||
[![size][size-src]][size-href]
|
||||
|
||||
## ❓ Why
|
||||
|
||||
For [historical reasons](https://docs.microsoft.com/en-us/archive/blogs/larryosterman/why-is-the-dos-path-character), windows followed MS-DOS and used backslash for separating paths rather than slash used for macOS, Linux, and other Posix operating systems. Nowadays, [Windows](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN) supports both Slash and Backslash for paths. [Node.js's built-in `path` module](https://nodejs.org/api/path.html) in the default operation of the path module varies based on the operating system on which a Node.js application is running. Specifically, when running on a Windows operating system, the path module will assume that Windows-style paths are being used. **This makes inconsistent code behavior between Windows and POSIX.**
|
||||
|
||||
Compared to popular [upath](https://github.com/anodynos/upath), pathe provides **identical exports** of Node.js with normalization on **all operations** and is written in modern **ESM/TypeScript** and has **no dependency on Node.js**!
|
||||
|
||||
This package is a drop-in replacement of the Node.js's [path module](https://nodejs.org/api/path.html) module and ensures paths are normalized with slash `/` and work in environments including Node.js.
|
||||
|
||||
## 💿 Usage
|
||||
|
||||
Install using npm or yarn:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm i pathe
|
||||
|
||||
# yarn
|
||||
yarn add pathe
|
||||
|
||||
# pnpm
|
||||
pnpm i pathe
|
||||
```
|
||||
|
||||
Import:
|
||||
|
||||
```js
|
||||
// ESM / Typescript
|
||||
import { resolve, matchesGlob } from "pathe";
|
||||
|
||||
// CommonJS
|
||||
const { resolve, matchesGlob } = require("pathe");
|
||||
```
|
||||
|
||||
Read more about path utils from [Node.js documentation](https://nodejs.org/api/path.html) and rest assured behavior is consistently like POSIX regardless of your input paths format and running platform (the only exception is `delimiter` constant export, it will be set to `;` on windows platform).
|
||||
|
||||
### Extra utilities
|
||||
|
||||
Pathe exports some extra utilities that do not exist in standard Node.js [path module](https://nodejs.org/api/path.html).
|
||||
In order to use them, you can import from `pathe/utils` subpath:
|
||||
|
||||
```js
|
||||
import {
|
||||
filename,
|
||||
normalizeAliases,
|
||||
resolveAlias,
|
||||
reverseResolveAlias,
|
||||
} from "pathe/utils";
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Made with 💛 Published under the [MIT](./LICENSE) license.
|
||||
|
||||
Some code was used from the Node.js project. Glob supported is powered by [zeptomatch](https://github.com/fabiospampinato/zeptomatch).
|
||||
|
||||
<!-- Refs -->
|
||||
|
||||
[npm-v-src]: https://img.shields.io/npm/v/pathe?style=flat-square
|
||||
[npm-v-href]: https://npmjs.com/package/pathe
|
||||
[npm-d-src]: https://img.shields.io/npm/dm/pathe?style=flat-square
|
||||
[npm-d-href]: https://npmjs.com/package/pathe
|
||||
[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/pathe/ci/main?style=flat-square
|
||||
[github-actions-href]: https://github.com/unjs/pathe/actions?query=workflow%3Aci
|
||||
[size-src]: https://packagephobia.now.sh/badge?p=pathe
|
||||
[size-href]: https://packagephobia.now.sh/result?p=pathe
|
||||
39
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.cjs
generated
vendored
Normal file
39
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const _path = require('./shared/pathe.BSlhyZSM.cjs');
|
||||
|
||||
const delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
|
||||
const _platforms = { posix: void 0, win32: void 0 };
|
||||
const mix = (del = delimiter) => {
|
||||
return new Proxy(_path._path, {
|
||||
get(_, prop) {
|
||||
if (prop === "delimiter") return del;
|
||||
if (prop === "posix") return posix;
|
||||
if (prop === "win32") return win32;
|
||||
return _platforms[prop] || _path._path[prop];
|
||||
}
|
||||
});
|
||||
};
|
||||
const posix = /* @__PURE__ */ mix(":");
|
||||
const win32 = /* @__PURE__ */ mix(";");
|
||||
|
||||
exports.basename = _path.basename;
|
||||
exports.dirname = _path.dirname;
|
||||
exports.extname = _path.extname;
|
||||
exports.format = _path.format;
|
||||
exports.isAbsolute = _path.isAbsolute;
|
||||
exports.join = _path.join;
|
||||
exports.matchesGlob = _path.matchesGlob;
|
||||
exports.normalize = _path.normalize;
|
||||
exports.normalizeString = _path.normalizeString;
|
||||
exports.parse = _path.parse;
|
||||
exports.relative = _path.relative;
|
||||
exports.resolve = _path.resolve;
|
||||
exports.sep = _path.sep;
|
||||
exports.toNamespacedPath = _path.toNamespacedPath;
|
||||
exports.default = posix;
|
||||
exports.delimiter = delimiter;
|
||||
exports.posix = posix;
|
||||
exports.win32 = win32;
|
||||
47
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.d.cts
generated
vendored
Normal file
47
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.d.cts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import * as path from 'node:path';
|
||||
import path__default from 'node:path';
|
||||
|
||||
/**
|
||||
* Constant for path separator.
|
||||
*
|
||||
* Always equals to `"/"`.
|
||||
*/
|
||||
declare const sep = "/";
|
||||
declare const normalize: typeof path__default.normalize;
|
||||
declare const join: typeof path__default.join;
|
||||
declare const resolve: typeof path__default.resolve;
|
||||
/**
|
||||
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
||||
*
|
||||
* @param path - The path to normalise.
|
||||
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
||||
* @returns the normalised path string.
|
||||
*/
|
||||
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
||||
declare const isAbsolute: typeof path__default.isAbsolute;
|
||||
declare const toNamespacedPath: typeof path__default.toNamespacedPath;
|
||||
declare const extname: typeof path__default.extname;
|
||||
declare const relative: typeof path__default.relative;
|
||||
declare const dirname: typeof path__default.dirname;
|
||||
declare const format: typeof path__default.format;
|
||||
declare const basename: typeof path__default.basename;
|
||||
declare const parse: typeof path__default.parse;
|
||||
/**
|
||||
* The `path.matchesGlob()` method determines if `path` matches the `pattern`.
|
||||
* @param path The path to glob-match against.
|
||||
* @param pattern The glob to check the path against.
|
||||
*/
|
||||
declare const matchesGlob: (path: string, pattern: string | string[]) => boolean;
|
||||
|
||||
type NodePath = typeof path;
|
||||
/**
|
||||
* The platform-specific file delimiter.
|
||||
*
|
||||
* Equals to `";"` in windows and `":"` in all other platforms.
|
||||
*/
|
||||
declare const delimiter: ";" | ":";
|
||||
declare const posix: NodePath["posix"];
|
||||
declare const win32: NodePath["win32"];
|
||||
declare const _default: NodePath;
|
||||
|
||||
export { basename, _default as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };
|
||||
47
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.d.mts
generated
vendored
Normal file
47
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import * as path from 'node:path';
|
||||
import path__default from 'node:path';
|
||||
|
||||
/**
|
||||
* Constant for path separator.
|
||||
*
|
||||
* Always equals to `"/"`.
|
||||
*/
|
||||
declare const sep = "/";
|
||||
declare const normalize: typeof path__default.normalize;
|
||||
declare const join: typeof path__default.join;
|
||||
declare const resolve: typeof path__default.resolve;
|
||||
/**
|
||||
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
||||
*
|
||||
* @param path - The path to normalise.
|
||||
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
||||
* @returns the normalised path string.
|
||||
*/
|
||||
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
||||
declare const isAbsolute: typeof path__default.isAbsolute;
|
||||
declare const toNamespacedPath: typeof path__default.toNamespacedPath;
|
||||
declare const extname: typeof path__default.extname;
|
||||
declare const relative: typeof path__default.relative;
|
||||
declare const dirname: typeof path__default.dirname;
|
||||
declare const format: typeof path__default.format;
|
||||
declare const basename: typeof path__default.basename;
|
||||
declare const parse: typeof path__default.parse;
|
||||
/**
|
||||
* The `path.matchesGlob()` method determines if `path` matches the `pattern`.
|
||||
* @param path The path to glob-match against.
|
||||
* @param pattern The glob to check the path against.
|
||||
*/
|
||||
declare const matchesGlob: (path: string, pattern: string | string[]) => boolean;
|
||||
|
||||
type NodePath = typeof path;
|
||||
/**
|
||||
* The platform-specific file delimiter.
|
||||
*
|
||||
* Equals to `";"` in windows and `":"` in all other platforms.
|
||||
*/
|
||||
declare const delimiter: ";" | ":";
|
||||
declare const posix: NodePath["posix"];
|
||||
declare const win32: NodePath["win32"];
|
||||
declare const _default: NodePath;
|
||||
|
||||
export { basename, _default as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };
|
||||
47
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.d.ts
generated
vendored
Normal file
47
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import * as path from 'node:path';
|
||||
import path__default from 'node:path';
|
||||
|
||||
/**
|
||||
* Constant for path separator.
|
||||
*
|
||||
* Always equals to `"/"`.
|
||||
*/
|
||||
declare const sep = "/";
|
||||
declare const normalize: typeof path__default.normalize;
|
||||
declare const join: typeof path__default.join;
|
||||
declare const resolve: typeof path__default.resolve;
|
||||
/**
|
||||
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
||||
*
|
||||
* @param path - The path to normalise.
|
||||
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
||||
* @returns the normalised path string.
|
||||
*/
|
||||
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
||||
declare const isAbsolute: typeof path__default.isAbsolute;
|
||||
declare const toNamespacedPath: typeof path__default.toNamespacedPath;
|
||||
declare const extname: typeof path__default.extname;
|
||||
declare const relative: typeof path__default.relative;
|
||||
declare const dirname: typeof path__default.dirname;
|
||||
declare const format: typeof path__default.format;
|
||||
declare const basename: typeof path__default.basename;
|
||||
declare const parse: typeof path__default.parse;
|
||||
/**
|
||||
* The `path.matchesGlob()` method determines if `path` matches the `pattern`.
|
||||
* @param path The path to glob-match against.
|
||||
* @param pattern The glob to check the path against.
|
||||
*/
|
||||
declare const matchesGlob: (path: string, pattern: string | string[]) => boolean;
|
||||
|
||||
type NodePath = typeof path;
|
||||
/**
|
||||
* The platform-specific file delimiter.
|
||||
*
|
||||
* Equals to `";"` in windows and `":"` in all other platforms.
|
||||
*/
|
||||
declare const delimiter: ";" | ":";
|
||||
declare const posix: NodePath["posix"];
|
||||
declare const win32: NodePath["win32"];
|
||||
declare const _default: NodePath;
|
||||
|
||||
export { basename, _default as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };
|
||||
19
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.mjs
generated
vendored
Normal file
19
node_modules/@vue/devtools-core/node_modules/pathe/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { _ as _path } from './shared/pathe.M-eThtNZ.mjs';
|
||||
export { c as basename, d as dirname, e as extname, f as format, i as isAbsolute, j as join, m as matchesGlob, n as normalize, a as normalizeString, p as parse, b as relative, r as resolve, s as sep, t as toNamespacedPath } from './shared/pathe.M-eThtNZ.mjs';
|
||||
|
||||
const delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
|
||||
const _platforms = { posix: void 0, win32: void 0 };
|
||||
const mix = (del = delimiter) => {
|
||||
return new Proxy(_path, {
|
||||
get(_, prop) {
|
||||
if (prop === "delimiter") return del;
|
||||
if (prop === "posix") return posix;
|
||||
if (prop === "win32") return win32;
|
||||
return _platforms[prop] || _path[prop];
|
||||
}
|
||||
});
|
||||
};
|
||||
const posix = /* @__PURE__ */ mix(":");
|
||||
const win32 = /* @__PURE__ */ mix(";");
|
||||
|
||||
export { posix as default, delimiter, posix, win32 };
|
||||
266
node_modules/@vue/devtools-core/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs
generated
vendored
Normal file
266
node_modules/@vue/devtools-core/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
249
node_modules/@vue/devtools-core/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
generated
vendored
Normal file
249
node_modules/@vue/devtools-core/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
82
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.cjs
generated
vendored
Normal file
82
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.cjs
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
'use strict';
|
||||
|
||||
const _path = require('./shared/pathe.BSlhyZSM.cjs');
|
||||
|
||||
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
|
||||
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
|
||||
const SLASH_RE = /[/\\]/;
|
||||
function normalizeAliases(_aliases) {
|
||||
if (_aliases[normalizedAliasSymbol]) {
|
||||
return _aliases;
|
||||
}
|
||||
const aliases = Object.fromEntries(
|
||||
Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
|
||||
);
|
||||
for (const key in aliases) {
|
||||
for (const alias in aliases) {
|
||||
if (alias === key || key.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
if (aliases[key]?.startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
|
||||
aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
Object.defineProperty(aliases, normalizedAliasSymbol, {
|
||||
value: true,
|
||||
enumerable: false
|
||||
});
|
||||
return aliases;
|
||||
}
|
||||
function resolveAlias(path, aliases) {
|
||||
const _path$1 = _path.normalizeWindowsPath(path);
|
||||
aliases = normalizeAliases(aliases);
|
||||
for (const [alias, to] of Object.entries(aliases)) {
|
||||
if (!_path$1.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
||||
if (hasTrailingSlash(_path$1[_alias.length])) {
|
||||
return _path.join(to, _path$1.slice(alias.length));
|
||||
}
|
||||
}
|
||||
return _path$1;
|
||||
}
|
||||
function reverseResolveAlias(path, aliases) {
|
||||
const _path$1 = _path.normalizeWindowsPath(path);
|
||||
aliases = normalizeAliases(aliases);
|
||||
const matches = [];
|
||||
for (const [to, alias] of Object.entries(aliases)) {
|
||||
if (!_path$1.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
||||
if (hasTrailingSlash(_path$1[_alias.length])) {
|
||||
matches.push(_path.join(to, _path$1.slice(alias.length)));
|
||||
}
|
||||
}
|
||||
return matches.sort((a, b) => b.length - a.length);
|
||||
}
|
||||
function filename(path) {
|
||||
const base = path.split(SLASH_RE).pop();
|
||||
if (!base) {
|
||||
return void 0;
|
||||
}
|
||||
const separatorIndex = base.lastIndexOf(".");
|
||||
if (separatorIndex <= 0) {
|
||||
return base;
|
||||
}
|
||||
return base.slice(0, separatorIndex);
|
||||
}
|
||||
function _compareAliases(a, b) {
|
||||
return b.split("/").length - a.split("/").length;
|
||||
}
|
||||
function hasTrailingSlash(path = "/") {
|
||||
const lastChar = path[path.length - 1];
|
||||
return lastChar === "/" || lastChar === "\\";
|
||||
}
|
||||
|
||||
exports.filename = filename;
|
||||
exports.normalizeAliases = normalizeAliases;
|
||||
exports.resolveAlias = resolveAlias;
|
||||
exports.reverseResolveAlias = reverseResolveAlias;
|
||||
32
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.d.cts
generated
vendored
Normal file
32
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.d.cts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
|
||||
* This function also ensures that aliases do not resolve to themselves cyclically.
|
||||
*
|
||||
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
|
||||
* @returns a set of normalised alias mappings.
|
||||
*/
|
||||
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
||||
/**
|
||||
* Resolves a path string to its alias if applicable, otherwise returns the original path.
|
||||
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
|
||||
*
|
||||
* @param path - The path string to resolve.
|
||||
* @param aliases - A set of alias mappings to use for resolution.
|
||||
* @returns the resolved path as a string.
|
||||
*/
|
||||
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
||||
/**
|
||||
* Resolves a path string to its possible alias.
|
||||
*
|
||||
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
|
||||
*/
|
||||
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
|
||||
/**
|
||||
* Extracts the filename from a given path, excluding any directory paths and the file extension.
|
||||
*
|
||||
* @param path - The full path of the file from which to extract the filename.
|
||||
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
|
||||
*/
|
||||
declare function filename(path: string): string | undefined;
|
||||
|
||||
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
|
||||
32
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.d.mts
generated
vendored
Normal file
32
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.d.mts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
|
||||
* This function also ensures that aliases do not resolve to themselves cyclically.
|
||||
*
|
||||
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
|
||||
* @returns a set of normalised alias mappings.
|
||||
*/
|
||||
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
||||
/**
|
||||
* Resolves a path string to its alias if applicable, otherwise returns the original path.
|
||||
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
|
||||
*
|
||||
* @param path - The path string to resolve.
|
||||
* @param aliases - A set of alias mappings to use for resolution.
|
||||
* @returns the resolved path as a string.
|
||||
*/
|
||||
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
||||
/**
|
||||
* Resolves a path string to its possible alias.
|
||||
*
|
||||
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
|
||||
*/
|
||||
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
|
||||
/**
|
||||
* Extracts the filename from a given path, excluding any directory paths and the file extension.
|
||||
*
|
||||
* @param path - The full path of the file from which to extract the filename.
|
||||
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
|
||||
*/
|
||||
declare function filename(path: string): string | undefined;
|
||||
|
||||
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
|
||||
32
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.d.ts
generated
vendored
Normal file
32
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
|
||||
* This function also ensures that aliases do not resolve to themselves cyclically.
|
||||
*
|
||||
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
|
||||
* @returns a set of normalised alias mappings.
|
||||
*/
|
||||
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
||||
/**
|
||||
* Resolves a path string to its alias if applicable, otherwise returns the original path.
|
||||
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
|
||||
*
|
||||
* @param path - The path string to resolve.
|
||||
* @param aliases - A set of alias mappings to use for resolution.
|
||||
* @returns the resolved path as a string.
|
||||
*/
|
||||
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
||||
/**
|
||||
* Resolves a path string to its possible alias.
|
||||
*
|
||||
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
|
||||
*/
|
||||
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
|
||||
/**
|
||||
* Extracts the filename from a given path, excluding any directory paths and the file extension.
|
||||
*
|
||||
* @param path - The full path of the file from which to extract the filename.
|
||||
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
|
||||
*/
|
||||
declare function filename(path: string): string | undefined;
|
||||
|
||||
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
|
||||
77
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.mjs
generated
vendored
Normal file
77
node_modules/@vue/devtools-core/node_modules/pathe/dist/utils.mjs
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
import { g as normalizeWindowsPath, j as join } from './shared/pathe.M-eThtNZ.mjs';
|
||||
|
||||
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
|
||||
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
|
||||
const SLASH_RE = /[/\\]/;
|
||||
function normalizeAliases(_aliases) {
|
||||
if (_aliases[normalizedAliasSymbol]) {
|
||||
return _aliases;
|
||||
}
|
||||
const aliases = Object.fromEntries(
|
||||
Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
|
||||
);
|
||||
for (const key in aliases) {
|
||||
for (const alias in aliases) {
|
||||
if (alias === key || key.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
if (aliases[key]?.startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
|
||||
aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
Object.defineProperty(aliases, normalizedAliasSymbol, {
|
||||
value: true,
|
||||
enumerable: false
|
||||
});
|
||||
return aliases;
|
||||
}
|
||||
function resolveAlias(path, aliases) {
|
||||
const _path = normalizeWindowsPath(path);
|
||||
aliases = normalizeAliases(aliases);
|
||||
for (const [alias, to] of Object.entries(aliases)) {
|
||||
if (!_path.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
||||
if (hasTrailingSlash(_path[_alias.length])) {
|
||||
return join(to, _path.slice(alias.length));
|
||||
}
|
||||
}
|
||||
return _path;
|
||||
}
|
||||
function reverseResolveAlias(path, aliases) {
|
||||
const _path = normalizeWindowsPath(path);
|
||||
aliases = normalizeAliases(aliases);
|
||||
const matches = [];
|
||||
for (const [to, alias] of Object.entries(aliases)) {
|
||||
if (!_path.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
||||
if (hasTrailingSlash(_path[_alias.length])) {
|
||||
matches.push(join(to, _path.slice(alias.length)));
|
||||
}
|
||||
}
|
||||
return matches.sort((a, b) => b.length - a.length);
|
||||
}
|
||||
function filename(path) {
|
||||
const base = path.split(SLASH_RE).pop();
|
||||
if (!base) {
|
||||
return void 0;
|
||||
}
|
||||
const separatorIndex = base.lastIndexOf(".");
|
||||
if (separatorIndex <= 0) {
|
||||
return base;
|
||||
}
|
||||
return base.slice(0, separatorIndex);
|
||||
}
|
||||
function _compareAliases(a, b) {
|
||||
return b.split("/").length - a.split("/").length;
|
||||
}
|
||||
function hasTrailingSlash(path = "/") {
|
||||
const lastChar = path[path.length - 1];
|
||||
return lastChar === "/" || lastChar === "\\";
|
||||
}
|
||||
|
||||
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
|
||||
61
node_modules/@vue/devtools-core/node_modules/pathe/package.json
generated
vendored
Normal file
61
node_modules/@vue/devtools-core/node_modules/pathe/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"name": "pathe",
|
||||
"version": "2.0.3",
|
||||
"description": "Universal filesystem path utils",
|
||||
"repository": "unjs/pathe",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/index.d.cts",
|
||||
"default": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"./utils": {
|
||||
"import": {
|
||||
"types": "./dist/utils.d.mts",
|
||||
"default": "./dist/utils.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/utils.d.cts",
|
||||
"default": "./dist/utils.cjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"utils.d.ts"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.13.1",
|
||||
"@vitest/coverage-v8": "^3.0.5",
|
||||
"changelogen": "^0.5.7",
|
||||
"esbuild": "^0.25.0",
|
||||
"eslint": "^9.20.1",
|
||||
"eslint-config-unjs": "^0.4.2",
|
||||
"jiti": "^2.4.2",
|
||||
"prettier": "^3.5.0",
|
||||
"typescript": "^5.7.3",
|
||||
"unbuild": "^3.3.1",
|
||||
"vitest": "^3.0.5",
|
||||
"zeptomatch": "^2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "vitest",
|
||||
"lint": "eslint . && prettier -c src test",
|
||||
"lint:fix": "eslint . --fix && prettier -w src test",
|
||||
"release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
|
||||
"test": "pnpm lint && vitest run --coverage",
|
||||
"test:types": "tsc --noEmit"
|
||||
}
|
||||
}
|
||||
1
node_modules/@vue/devtools-core/node_modules/pathe/utils.d.ts
generated
vendored
Normal file
1
node_modules/@vue/devtools-core/node_modules/pathe/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./dist/utils";
|
||||
43
node_modules/@vue/devtools-core/package.json
generated
vendored
Normal file
43
node_modules/@vue/devtools-core/package.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "@vue/devtools-core",
|
||||
"type": "module",
|
||||
"version": "8.0.6",
|
||||
"author": "webfansplz",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"directory": "packages/core",
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/devtools.git"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
"files": [
|
||||
"dist",
|
||||
"server.d.ts"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"mitt": "^3.0.1",
|
||||
"nanoid": "^5.1.5",
|
||||
"pathe": "^2.0.3",
|
||||
"vite-hot-client": "^2.1.0",
|
||||
"@vue/devtools-kit": "^8.0.6",
|
||||
"@vue/devtools-shared": "^8.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vue": "^3.5.22"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsdown --clean",
|
||||
"prepare:type": "tsdown --dts-only",
|
||||
"stub": "tsdown --watch --onSuccess 'tsdown --dts-only'"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user