vite-plugin-vue-devtools 0.5.1 → 1.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/client.d.ts +55 -0
  2. package/dist/client/assets/{VIcon.vue_vue_type_script_setup_true_lang-3e22beca.js → Icon.vue_vue_type_script_setup_true_lang-f867c918.js} +2 -2
  3. package/dist/client/assets/{VIconButton.vue_vue_type_script_setup_true_lang-ff741416.js → IconButton.vue_vue_type_script_setup_true_lang-74db1ae6.js} +4 -5
  4. package/dist/client/assets/{VIconTitle.vue_vue_type_script_setup_true_lang-02e99d8a.js → IconTitle.vue_vue_type_script_setup_true_lang-d82eff77.js} +2 -2
  5. package/dist/client/assets/{IframeView.vue_vue_type_script_setup_true_lang-8e5b8335.js → IframeView.vue_vue_type_script_setup_true_lang-778923b2.js} +1 -1
  6. package/dist/client/assets/{VPanelGrids-885eb297.js → PanelGrids-93648569.js} +1 -1
  7. package/dist/client/assets/SectionBlock-0024395a.css +18 -0
  8. package/dist/client/assets/{VSectionBlock-2f35c742.js → SectionBlock-a8928e3c.js} +11 -11
  9. package/dist/client/assets/{StateFields.vue_vue_type_script_setup_true_lang-fe7c7e4d.js → StateFields.vue_vue_type_script_setup_true_lang-019c8d08.js} +13 -13
  10. package/dist/client/assets/{VSwitch.vue_vue_type_script_setup_true_lang-a0d66c22.js → Switch.vue_vue_type_script_setup_true_lang-3e126052.js} +6 -6
  11. package/dist/client/assets/{VTextInput.vue_vue_type_script_setup_true_lang-ae0954a4.js → TextInput.vue_vue_type_script_setup_true_lang-13bb76a1.js} +5 -5
  12. package/dist/client/assets/{__eyedropper-4021b943.js → __eyedropper-44f84f34.js} +9 -5
  13. package/dist/client/assets/{assets-02a93a40.js → assets-114c5f0e.js} +26 -27
  14. package/dist/client/assets/{component-docs-add44d87.js → component-docs-6d7e057c.js} +9 -10
  15. package/dist/client/assets/{components-c141317d.js → components-fc711123.js} +16 -16
  16. package/dist/client/assets/{documentations-30350ca6.js → documentations-4d7aa8fe.js} +4 -5
  17. package/dist/client/assets/{graph-ca7151be.js → graph-0860970b.js} +7 -8
  18. package/dist/client/assets/{index-133eebe9.js → index-95398468.js} +1 -1
  19. package/dist/client/assets/{index-14f26dd8.js → index-9f1190d8.js} +446 -107
  20. package/dist/client/assets/{inspect-5ed32f17.js → inspect-6bd0f86e.js} +2 -3
  21. package/dist/client/assets/{npm-804ed8d6.js → npm-ee43d18c.js} +17 -18
  22. package/dist/client/assets/{overview-84e0d21c.js → overview-8e63c4fa.js} +15 -16
  23. package/dist/client/assets/{pages-6df9c706.js → pages-323386ca.js} +16 -16
  24. package/dist/client/assets/{pinia-760b2ad2.js → pinia-58865e70.js} +6 -6
  25. package/dist/client/assets/{routes-6636ff43.js → routes-cd907bae.js} +13 -13
  26. package/dist/client/assets/{settings-3815e37a.css → settings-7bce89ae.css} +3 -3
  27. package/dist/client/assets/{settings-85b594bd.js → settings-b93aee1f.js} +36 -38
  28. package/dist/client/assets/{splitpanes.es-34ce2868.js → splitpanes.es-36fe45c8.js} +1 -1
  29. package/dist/client/assets/{timeline-34b2c182.js → timeline-8ce18510.js} +11 -11
  30. package/dist/client/index.html +1 -1
  31. package/dist/{index.cjs → vite.cjs} +9 -40
  32. package/dist/{index.mjs → vite.mjs} +7 -38
  33. package/package.json +25 -88
  34. package/src/app.js +4 -0
  35. package/src/{node/views → views}/Main.vue +14 -23
  36. package/README.md +0 -166
  37. package/dist/client/assets/VSectionBlock-52804693.css +0 -18
  38. package/dist/client/assets/rpc-acb85b35.js +0 -145
  39. package/src/node/app.js +0 -31
  40. /package/dist/{index.d.ts → vite.d.ts} +0 -0
  41. /package/src/{node/views → views}/ComponentInspector.vue +0 -0
  42. /package/src/{node/views → views}/FrameBox.vue +0 -0
  43. /package/src/{node/views → views}/composables.ts +0 -0
  44. /package/src/{node/views → views}/utils.ts +0 -0
@@ -1,11 +1,11 @@
1
- import { _ as _sfc_main$2 } from './StateFields.vue_vue_type_script_setup_true_lang-fe7c7e4d.js';
2
- import { _ as __unplugin_components_0 } from './VPanelGrids-885eb297.js';
3
- import { p as pushScopeId, a as popScopeId, n as nextTick, o as openBlock, c as createBlock, w as withScopeId, m as markRaw, s as shallowReactive, r as resolveComponent, b as resolveDirective, d as withDirectives, e as createElementBlock, f as renderSlot, g as createCommentVNode, h as withCtx, F as Fragment, i as renderList, j as resolveDynamicComponent, k as mergeProps, t as toHandlers, l as normalizeStyle, q as normalizeClass, u as createVNode, v as defineComponent, x as createBaseVNode, y as toDisplayString, z as unref, _ as __unplugin_components_7, A as timelineLayer, B as activeTimelineEvents, C as activeTimelineEventIndex, D as toggleTimelineEventIndex, E as timelineEventDetails, G as activeLayerId, H as toggleTimelineLayer } from './index-14f26dd8.js';
1
+ import { _ as _sfc_main$2 } from './StateFields.vue_vue_type_script_setup_true_lang-019c8d08.js';
2
+ import { _ as __unplugin_components_0 } from './PanelGrids-93648569.js';
3
+ import { p as pushScopeId, a as popScopeId, n as nextTick, o as openBlock, c as createBlock, w as withScopeId, m as markRaw, s as shallowReactive, r as resolveComponent, b as resolveDirective, d as withDirectives, e as createElementBlock, f as renderSlot, g as createCommentVNode, h as withCtx, F as Fragment, i as renderList, j as resolveDynamicComponent, k as mergeProps, t as toHandlers, l as normalizeStyle, q as normalizeClass, u as createVNode, v as defineComponent, x as createBaseVNode, y as toDisplayString, z as unref, _ as __unplugin_components_7, A as timelineLayer, B as activeTimelineEvents, C as activeTimelineEventIndex, D as toggleTimelineEventIndex, E as timelineEventDetails, G as activeLayerId, H as toggleTimelineLayer } from './index-9f1190d8.js';
4
4
  import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-65004790.js';
5
- import { g, M } from './splitpanes.es-34ce2868.js';
6
- import './VIcon.vue_vue_type_script_setup_true_lang-3e22beca.js';
7
- import './index-133eebe9.js';
8
- import './VIconButton.vue_vue_type_script_setup_true_lang-ff741416.js';
5
+ import { g, M } from './splitpanes.es-36fe45c8.js';
6
+ import './Icon.vue_vue_type_script_setup_true_lang-f867c918.js';
7
+ import './index-95398468.js';
8
+ import './IconButton.vue_vue_type_script_setup_true_lang-74db1ae6.js';
9
9
 
10
10
  var dayjs_min = {exports: {}};/* Injected with object hook! */
11
11
 
@@ -1329,8 +1329,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1329
1329
  emits: ["update-selected"],
1330
1330
  setup(__props, { emit: emits }) {
1331
1331
  return (_ctx, _cache) => {
1332
- const _component_VCard = __unplugin_components_7;
1333
- const _component_VPanelGrids = __unplugin_components_0;
1332
+ const _component_VDCard = __unplugin_components_7;
1333
+ const _component_VDPanelGrids = __unplugin_components_0;
1334
1334
  return _ctx.data.length ? (openBlock(), createElementBlock("ul", _hoisted_1$1, [
1335
1335
  createVNode(unref(script$2), {
1336
1336
  items: _ctx.data,
@@ -1365,12 +1365,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1365
1365
  ]),
1366
1366
  _: 1
1367
1367
  }, 8, ["items"])
1368
- ])) : (openBlock(), createBlock(_component_VPanelGrids, {
1368
+ ])) : (openBlock(), createBlock(_component_VDPanelGrids, {
1369
1369
  key: 1,
1370
1370
  px5: ""
1371
1371
  }, {
1372
1372
  default: withCtx(() => [
1373
- createVNode(_component_VCard, {
1373
+ createVNode(_component_VDCard, {
1374
1374
  flex: "~ col gap2",
1375
1375
  "min-w-30": "",
1376
1376
  "items-center": "",
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <link rel="icon" href="/favicon.svg" type="image/svg+xml">
7
7
  <title>Vue DevTools</title>
8
- <script type="module" crossorigin src="./assets/index-14f26dd8.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-9f1190d8.js"></script>
9
9
  <link rel="stylesheet" href="./assets/index-d3dcbe9e.css">
10
10
  </head>
11
11
  <body>
@@ -6,7 +6,7 @@ const vite = require('vite');
6
6
  const sirv = require('sirv');
7
7
  const Inspect = require('vite-plugin-inspect');
8
8
  const VueInspector = require('vite-plugin-vue-inspector');
9
- const birpc = require('birpc');
9
+ const core$1 = require('@vite-plugin-vue-devtools/core');
10
10
  const fs$9 = require('node:fs/promises');
11
11
  const require$$0 = require('os');
12
12
  const require$$0$1 = require('path');
@@ -50,37 +50,7 @@ const require$$0$3__default = /*#__PURE__*/_interopDefaultCompat(require$$0$3$1)
50
50
  const require$$0$5__default = /*#__PURE__*/_interopDefaultCompat(require$$0$5);
51
51
  const require$$1__default = /*#__PURE__*/_interopDefaultCompat(require$$1);
52
52
 
53
- function createRPCServer(name, ws, functions) {
54
- const event = `${name}:rpc`;
55
- const group = birpc.createBirpcGroup(
56
- functions,
57
- () => birpc.cachedMap(
58
- Array.from(ws?.clients || []),
59
- (socket) => {
60
- return {
61
- on: (fn) => {
62
- ws.on(event, (data, source) => {
63
- if (socket === source)
64
- fn(data);
65
- });
66
- },
67
- post: (data) => {
68
- socket.send(event, data);
69
- }
70
- };
71
- }
72
- ),
73
- {
74
- timeout: -1
75
- }
76
- );
77
- ws.on("connection", () => {
78
- group.updateChannels();
79
- });
80
- return group.broadcast;
81
- }
82
-
83
- const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : path$3$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href))));
53
+ const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : path$3$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('vite.cjs', document.baseURI).href))));
84
54
  const DIR_CLIENT = path$3$1.resolve(DIR_DIST, "../dist/client");
85
55
 
86
56
  async function getComponentsRelationships(rpc) {
@@ -13777,10 +13747,9 @@ async function getComponentInfo(root, filename) {
13777
13747
  });
13778
13748
  }
13779
13749
 
13780
- const NAME = "vite-plugin-vue-devtools";
13781
13750
  function getVueDevtoolsPath() {
13782
- const pluginPath = vite.normalizePath(path$3__default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)))));
13783
- return pluginPath.replace(/\/dist$/, "//src/node");
13751
+ const pluginPath = vite.normalizePath(path$3__default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('vite.cjs', document.baseURI).href)))));
13752
+ return pluginPath.replace(/\/dist$/, "//src");
13784
13753
  }
13785
13754
  function VitePluginVueDevTools(options = { appendTo: "" }) {
13786
13755
  const vueDevtoolsPath = getVueDevtoolsPath();
@@ -13794,9 +13763,10 @@ function VitePluginVueDevTools(options = { appendTo: "" }) {
13794
13763
  single: true,
13795
13764
  dev: true
13796
13765
  }));
13797
- const rpc = createRPCServer("vite-plugin-vue-devtools", server.ws, {
13798
- componentGraph: () => getComponentsRelationships(inspect.api.rpc),
13766
+ const rpc = core$1.createRPCServer(server.ws, {
13767
+ root: () => config.root,
13799
13768
  inspectClientUrl: () => `${config.base || "/"}__inspect/`,
13769
+ componentGraph: () => getComponentsRelationships(inspect.api.rpc),
13800
13770
  staticAssets: () => getStaticAssets(config),
13801
13771
  getImageMeta,
13802
13772
  getTextAssetContent,
@@ -13824,12 +13794,11 @@ function VitePluginVueDevTools(options = { appendTo: "" }) {
13824
13794
  else if (type === "exit")
13825
13795
  rpc.onTerminalExit({ data });
13826
13796
  }
13827
- }),
13828
- root: () => config.root
13797
+ })
13829
13798
  });
13830
13799
  }
13831
13800
  const plugin = {
13832
- name: NAME,
13801
+ name: core$1.PLUGIN_NAME,
13833
13802
  enforce: "pre",
13834
13803
  apply: "serve",
13835
13804
  configResolved(resolvedConfig) {
@@ -4,7 +4,7 @@ import { normalizePath } from 'vite';
4
4
  import sirv from 'sirv';
5
5
  import Inspect from 'vite-plugin-inspect';
6
6
  import VueInspector from 'vite-plugin-vue-inspector';
7
- import { createBirpcGroup, cachedMap } from 'birpc';
7
+ import { PLUGIN_NAME, createRPCServer } from '@vite-plugin-vue-devtools/core';
8
8
  import fs$9 from 'node:fs/promises';
9
9
  import require$$0 from 'os';
10
10
  import require$$0$1 from 'path';
@@ -24,36 +24,6 @@ import require$$0$5 from 'buffer';
24
24
  import { debuglog } from 'node:util';
25
25
  import require$$1 from 'tty';
26
26
 
27
- function createRPCServer(name, ws, functions) {
28
- const event = `${name}:rpc`;
29
- const group = createBirpcGroup(
30
- functions,
31
- () => cachedMap(
32
- Array.from(ws?.clients || []),
33
- (socket) => {
34
- return {
35
- on: (fn) => {
36
- ws.on(event, (data, source) => {
37
- if (socket === source)
38
- fn(data);
39
- });
40
- },
41
- post: (data) => {
42
- socket.send(event, data);
43
- }
44
- };
45
- }
46
- ),
47
- {
48
- timeout: -1
49
- }
50
- );
51
- ws.on("connection", () => {
52
- group.updateChannels();
53
- });
54
- return group.broadcast;
55
- }
56
-
57
27
  const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
58
28
  const DIR_CLIENT = resolve$1(DIR_DIST, "../dist/client");
59
29
 
@@ -13751,10 +13721,9 @@ async function getComponentInfo(root, filename) {
13751
13721
  });
13752
13722
  }
13753
13723
 
13754
- const NAME = "vite-plugin-vue-devtools";
13755
13724
  function getVueDevtoolsPath() {
13756
13725
  const pluginPath = normalizePath(path$3$1.dirname(fileURLToPath(import.meta.url)));
13757
- return pluginPath.replace(/\/dist$/, "//src/node");
13726
+ return pluginPath.replace(/\/dist$/, "//src");
13758
13727
  }
13759
13728
  function VitePluginVueDevTools(options = { appendTo: "" }) {
13760
13729
  const vueDevtoolsPath = getVueDevtoolsPath();
@@ -13768,9 +13737,10 @@ function VitePluginVueDevTools(options = { appendTo: "" }) {
13768
13737
  single: true,
13769
13738
  dev: true
13770
13739
  }));
13771
- const rpc = createRPCServer("vite-plugin-vue-devtools", server.ws, {
13772
- componentGraph: () => getComponentsRelationships(inspect.api.rpc),
13740
+ const rpc = createRPCServer(server.ws, {
13741
+ root: () => config.root,
13773
13742
  inspectClientUrl: () => `${config.base || "/"}__inspect/`,
13743
+ componentGraph: () => getComponentsRelationships(inspect.api.rpc),
13774
13744
  staticAssets: () => getStaticAssets(config),
13775
13745
  getImageMeta,
13776
13746
  getTextAssetContent,
@@ -13798,12 +13768,11 @@ function VitePluginVueDevTools(options = { appendTo: "" }) {
13798
13768
  else if (type === "exit")
13799
13769
  rpc.onTerminalExit({ data });
13800
13770
  }
13801
- }),
13802
- root: () => config.root
13771
+ })
13803
13772
  });
13804
13773
  }
13805
13774
  const plugin = {
13806
- name: NAME,
13775
+ name: PLUGIN_NAME,
13807
13776
  enforce: "pre",
13808
13777
  apply: "serve",
13809
13778
  configResolved(resolvedConfig) {
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "vite-plugin-vue-devtools",
3
- "version": "0.5.1",
4
- "packageManager": "pnpm@8.6.7",
3
+ "type": "module",
4
+ "version": "1.0.0-alpha.1",
5
5
  "description": "A vite plugin for Vue DevTools",
6
6
  "author": "webfansplz",
7
7
  "license": "MIT",
8
8
  "homepage": "https://github.com/webfansplz/vite-plugin-vue-devtools#readme",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/webfansplz/vite-plugin-vue-devtools.git"
11
+ "url": "git+https://github.com/webfansplz/vite-plugin-vue-devtools.git",
12
+ "directory": "packages/node"
12
13
  },
13
14
  "bugs": {
14
15
  "url": "https://github.com/webfansplz/vite-plugin-vue-devtools/issues"
@@ -21,111 +22,47 @@
21
22
  ],
22
23
  "exports": {
23
24
  ".": {
24
- "types": "./dist/index.d.ts",
25
- "require": "./dist/index.cjs",
26
- "import": "./dist/index.mjs"
25
+ "types": "./dist/vite.d.ts",
26
+ "require": "./dist/vite.cjs",
27
+ "import": "./dist/vite.mjs"
27
28
  },
28
- "./*": "./*"
29
+ "./*": "./*",
30
+ "./client": {
31
+ "types": "./client.d.ts"
32
+ }
29
33
  },
30
- "main": "dist/index.cjs",
31
- "module": "dist/index.mjs",
32
- "types": "dist/index.d.ts",
34
+ "main": "dist/vite.cjs",
35
+ "module": "dist/vite.mjs",
36
+ "types": "dist/vite.d.ts",
33
37
  "files": [
34
38
  "dist",
35
- "src/node/views/*",
36
- "src/node/app.js",
39
+ "./src/views/*",
40
+ "./src/app.js",
37
41
  "*.d.ts"
38
42
  ],
39
43
  "engines": {
40
- "node": ">=v14"
41
- },
42
- "scripts": {
43
- "build": "rimraf dist && run-s build:*",
44
- "build:client": "vite build src/client",
45
- "build:js": "unbuild",
46
- "dev": "nr stub && pnpm dev:client",
47
- "dev:client": "vite build src/client --watch",
48
- "play": "nr -C playground dev",
49
- "stub": "unbuild --stub",
50
- "lint": "eslint .",
51
- "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
52
- "prepublishOnly": "npm run build",
53
- "release": "bumpp && nr changelog && npm publish",
54
- "dep:up": "taze -I major"
44
+ "node": ">=v14.21.3"
55
45
  },
56
46
  "peerDependencies": {
57
47
  "vite": "^3.1.0 || ^4.0.0-0"
58
48
  },
59
49
  "dependencies": {
60
- "@vueuse/core": "^10.2.1",
61
- "@vueuse/integrations": "^10.2.1",
62
50
  "@webfansplz/vuedoc-parser": "^0.0.3",
63
- "algoliasearch": "^4.18.0",
64
51
  "birpc": "^0.2.12",
65
52
  "execa": "^7.1.1",
66
- "json-editor-vue": "^0.10.6",
67
- "minimatch": "^9.0.3",
68
- "nanoid": "^4.0.2",
69
53
  "sirv": "^2.0.3",
70
- "splitpanes": "^3.1.5",
71
- "vanilla-jsoneditor": "^0.17.8",
72
- "vite-hot-client": "^0.2.1",
73
- "vite-plugin-inspect": "^0.7.32",
54
+ "vite-plugin-inspect": "^0.7.33",
74
55
  "vite-plugin-vue-inspector": "^3.4.2",
75
- "vue-router": "^4.2.4",
76
- "vuedraggable": "^4.1.0",
77
- "xterm": "^5.2.1",
78
- "xterm-addon-fit": "^0.7.0"
56
+ "@vite-plugin-vue-devtools/core": "1.0.0-alpha.1"
79
57
  },
80
58
  "devDependencies": {
81
- "@algolia/client-search": "^4.18.0",
82
- "@antfu/eslint-config": "^0.39.7",
83
- "@antfu/ni": "^0.21.4",
84
- "@iconify/json": "^2.2.88",
85
- "@nuxt/devtools-ui-kit": "^0.6.7",
86
- "@types/codemirror": "^5.60.8",
87
- "@types/node": "^20.4.1",
88
- "@types/splitpanes": "^2.2.1",
89
- "@unocss/eslint-config": "^0.53.5",
90
- "@unocss/reset": "^0.53.5",
91
- "@vitejs/plugin-vue": "^4.2.3",
92
- "@vitejs/plugin-vue-jsx": "^3.0.1",
93
- "bumpp": "^9.1.1",
94
- "codemirror": "^6.0.1",
95
- "codemirror-theme-vars": "^0.1.2",
96
- "conventional-changelog-cli": "^3.0.0",
97
- "dayjs": "^1.11.9",
98
- "eslint": "8.44.0",
59
+ "@types/node": "^20.4.2",
99
60
  "fast-glob": "^3.3.0",
100
- "floating-vue": "2.0.0-beta.24",
101
- "fuse.js": "^6.6.2",
102
61
  "image-meta": "^0.1.1",
103
- "lint-staged": "^13.2.3",
104
- "npm-run-all": "^4.1.5",
105
- "ohash": "^1.1.2",
106
- "pathe": "^1.1.1",
107
- "pinia": "^2.1.4",
108
- "pnpm": "^8.6.7",
109
- "rimraf": "^5.0.1",
110
- "simple-git-hooks": "^2.8.1",
111
- "taze": "^0.11.2",
112
- "typescript": "^5.1.6",
113
- "unbuild": "^1.2.1",
114
- "unocss": "^0.53.5",
115
- "unplugin-auto-import": "^0.16.6",
116
- "unplugin-vue-components": "^0.25.1",
117
- "vis-data": "^7.1.6",
118
- "vis-network": "^9.1.6",
119
- "vite": "^4.4.2",
120
- "vite-dev-rpc": "^0.1.2",
121
- "vite-plugin-pages": "^0.31.0",
122
- "vue": "^3.3.4",
123
- "vue-virtual-scroller": "2.0.0-beta.8"
62
+ "pathe": "^1.1.1"
124
63
  },
125
- "simple-git-hooks": {
126
- "pre-commit": "pnpm lint-staged"
127
- },
128
- "lint-staged": {
129
- "*": "eslint --fix"
64
+ "scripts": {
65
+ "build": "unbuild",
66
+ "stub": "unbuild --stub"
130
67
  }
131
- }
68
+ }
package/src/app.js ADDED
@@ -0,0 +1,4 @@
1
+ import { createDevToolsContainer } from '@vite-plugin-vue-devtools/core'
2
+ import App from 'virtual:vue-devtools-path:views/Main.vue'
3
+
4
+ createDevToolsContainer(App)
@@ -3,6 +3,7 @@ import { computed, ref } from 'vue'
3
3
 
4
4
  // @ts-expect-error virtual module
5
5
  import vueDevToolsOptions from 'virtual:vue-devtools-options'
6
+ import { DevToolsHooks, collectDevToolsHookBuffer } from '@vite-plugin-vue-devtools/core'
6
7
  import Frame from './FrameBox.vue'
7
8
  import ComponentInspector from './ComponentInspector.vue'
8
9
  import { useHighlightComponent, useIframe, useInspector, usePanelVisible, usePiPMode, usePosition } from './composables'
@@ -17,19 +18,7 @@ const props = defineProps({
17
18
 
18
19
  const hook = props.hook
19
20
 
20
- const DevToolsHooks = {
21
- APP_INIT: 'app:init',
22
- COMPONENT_UPDATED: 'component:updated',
23
- COMPONENT_ADDED: 'component:added',
24
- COMPONENT_REMOVED: 'component:removed',
25
- COMPONENT_EMIT: 'component:emit',
26
- PERF_START: 'perf:start',
27
- PERF_END: 'perf:end',
28
- ADD_ROUTE: 'router:add-route',
29
- REMOVE_ROUTE: 'router:remove-route',
30
- }
31
-
32
- const hookBuffer: [string, { args: any[] }][] = []
21
+ const { hookBuffer, collect } = collectDevToolsHookBuffer()
33
22
 
34
23
  let isAppCreated = false
35
24
  const panelState = ref<{
@@ -138,10 +127,6 @@ async function setupClient(iframe: HTMLIFrameElement) {
138
127
  })
139
128
  }
140
129
 
141
- function updateHookBuffer(type, args) {
142
- hookBuffer.push([type, args])
143
- }
144
-
145
130
  function collectDynamicRoute(app) {
146
131
  const router = app?.config?.globalProperties?.$router
147
132
  if (!router)
@@ -152,7 +137,7 @@ function collectDynamicRoute(app) {
152
137
  const res = _addRoute(...args)
153
138
 
154
139
  if (!iframe.value?.contentWindow?.__VUE_DEVTOOLS_VIEW__?.loaded) {
155
- updateHookBuffer(DevToolsHooks.ADD_ROUTE, {
140
+ collect(DevToolsHooks.ADD_ROUTE, {
156
141
  args: [...args],
157
142
  })
158
143
  }
@@ -165,7 +150,7 @@ function collectDynamicRoute(app) {
165
150
  const res = _removeRoute(...args)
166
151
 
167
152
  if (!iframe.value?.contentWindow?.__VUE_DEVTOOLS_VIEW__?.loaded) {
168
- updateHookBuffer(DevToolsHooks.REMOVE_ROUTE, {
153
+ collect(DevToolsHooks.REMOVE_ROUTE, {
169
154
  args: [...args],
170
155
  })
171
156
  }
@@ -186,7 +171,7 @@ function collectHookBuffer() {
186
171
  return
187
172
 
188
173
  collectDynamicRoute(app)
189
- updateHookBuffer(DevToolsHooks.APP_INIT, {
174
+ collect(DevToolsHooks.APP_INIT, {
190
175
  app,
191
176
  })
192
177
  setTimeout(() => {
@@ -199,7 +184,7 @@ function collectHookBuffer() {
199
184
  // if (stopCollect(component))
200
185
  // return
201
186
 
202
- // updateHookBuffer(DevToolsHooks.COMPONENT_EMIT, {
187
+ // collect(DevToolsHooks.COMPONENT_EMIT, {
203
188
  // now: Date.now(),
204
189
  // app,
205
190
  // uid,
@@ -213,7 +198,7 @@ function collectHookBuffer() {
213
198
  // if (stopCollect(component))
214
199
  // return
215
200
 
216
- // updateHookBuffer(DevToolsHooks.PERF_END, {
201
+ // collect(DevToolsHooks.PERF_END, {
217
202
  // now: Date.now(),
218
203
  // app,
219
204
  // uid,
@@ -234,7 +219,7 @@ function collectHookBuffer() {
234
219
  if (!app || (typeof uid !== 'number' && !uid) || !component || stopCollect(component))
235
220
  return
236
221
 
237
- updateHookBuffer(item, {
222
+ collect(item, {
238
223
  app, uid, parentUid, component,
239
224
  })
240
225
  })
@@ -407,4 +392,10 @@ collectHookBuffer()
407
392
  opacity: 0.2;
408
393
  }
409
394
  }
395
+
396
+ @media print {
397
+ #vue-devtools-anchor {
398
+ display: none;
399
+ }
400
+ }
410
401
  </style>
package/README.md DELETED
@@ -1,166 +0,0 @@
1
- <p align="center">
2
- <img src="./assets/bg.png" />
3
- </p>
4
- <h1 align="center">
5
- Vue DevTools <sup>Preview</sup>
6
- </h1>
7
-
8
-
9
- <p align="center">
10
- <a href="https://www.npmjs.com/package/vite-plugin-vue-devtools" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/npm/v/vite-plugin-vue-devtools" alt="NPM Version" /></a>
11
- <a href="https://www.npmjs.com/package/vite-plugin-vue-devtools" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/npm/dt/vite-plugin-vue-devtools" alt="NPM Downloads" /></a>
12
- <a href="https://github.com/webfansplz/vite-plugin-vue-devtools/blob/main/LICENSE" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/github/license/webfansplz/vite-plugin-vue-devtools" alt="License" /></a>
13
- </p>
14
-
15
- <p align="center">
16
- <a href="https://github.com/webfansplz/vite-plugin-vue-devtools/discussions/1">💡 Ideas & Suggestions</a> |
17
- <a href="https://github.com/webfansplz/vite-plugin-vue-devtools/discussions/2">🗺️ Project Roadmap</a>
18
- </p>
19
-
20
- <p align="center">
21
- <a href="https://stackblitz.com/edit/vitejs-vite-oxbwzk?file=vite.config.ts&view=preview"><img src="https://developer.stackblitz.com/img/open_in_stackblitz.svg" alt=""></a>
22
- </p>
23
-
24
-
25
- ## 📖 Introduction
26
-
27
- `vite-plugin-vue-devtools` is a Vite plugin designed to enhance the Vue developer experience.
28
-
29
-
30
-
31
- ## 🎉 Features
32
-
33
- ### Pages
34
-
35
- The pages tab shows your current routes and provide a quick way to navigate to them. For dynamic routes, it also provide a form to fill with each params interactively. You can also use the textbox to play and test how each route is matched.
36
-
37
- <img src="./assets/pages.png" />
38
-
39
-
40
- ### Components
41
-
42
- Components tab show all the components you are using in your app and hierarchy. You can also select them to see the details of the component (e.g. data,props).
43
-
44
- <img src="./assets/components.png" />
45
-
46
- ### Assets
47
-
48
- Assets tab that shows all your static assets and their information. You can open the asset in the browser or download it.
49
-
50
- <img src="./assets/assets.png" />
51
-
52
- ### Timeline
53
-
54
- Timeline tab has three categories: Performance, Router Navigations, and Pinia. You can switch between them to see the state changes and timelines.
55
-
56
- <img src="./assets/timeline.png" />
57
-
58
- ### Routes
59
-
60
- Routes tab is a feature integrated with [Vue Router](https://github.com/vuejs/router), allowing you to view the registered routes and their details.
61
-
62
- <img src="./assets/routes.png" />
63
-
64
- ### Pinia
65
-
66
- Pinia tab is a feature integrated with [Pinia](https://github.com/vuejs/pinia), allowing you to view the registered modules and their details.
67
-
68
- <img src="./assets/pinia.png" />
69
-
70
- ### Graph
71
-
72
- Graph tab provides a graph view that show the relationship between components.
73
-
74
- <img src="./assets/graph.png" />
75
-
76
- ### Inspect
77
-
78
- Inspect expose the [vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect) integration, allowing you to inspect transformation steps of Vite. It can be helpful to understand how each plugin is transforming your code and spot potential issues.
79
-
80
- <img src="./assets/inspect.png" />
81
-
82
- ### Inspector
83
-
84
- You can also use the "Inspector" feature to inspect the DOM tree and see which component is rendering it. Click to go to your editor of the specific line. Making it much easier to make changes, without the requirement of understanding the project structure thoroughly. (This feature is implemented based on the [vite-plugin-vue-inspector](https://github.com/webfansplz/vite-plugin-vue-inspector))
85
-
86
- <img src="./assets/inspector.png" height=450 />
87
-
88
- ## 📦 Installation
89
-
90
- ```
91
-
92
- # vite-plugin-vue-devtools
93
-
94
- pnpm install vite-plugin-vue-devtools -D
95
-
96
- ```
97
-
98
- ## 🦄 Usage
99
-
100
- ### Configuration Vite
101
-
102
- ```ts
103
- import { defineConfig } from 'vite'
104
- import VueDevTools from 'vite-plugin-vue-devtools'
105
-
106
- export default defineConfig({
107
- plugins: [
108
- VueDevTools(),
109
- vue(),
110
- ],
111
- })
112
- ```
113
-
114
- ### Options
115
-
116
- ```ts
117
- interface VitePluginVueDevToolsOptions {
118
- /**
119
- * append an import to the module id ending with `appendTo` instead of adding a script into body
120
- * useful for projects that do not use html file as an entry
121
- *
122
- * WARNING: only set this if you know exactly what it does.
123
- */
124
- appendTo?: string | RegExp
125
- }
126
- ```
127
-
128
- ## 💡 Notice
129
-
130
- - Only available in development mode.
131
- - Only support Vue3.0+.
132
- - Currently only supports single-instance Vue applications (multi-instance support is coming soon).
133
- - Doesn't support SSR (If you're using Nuxt, use [nuxt/devtools](https://github.com/nuxt/devtools) directly).
134
- - The plugin follows Vue's DevTools configuration, so if you have configured the `hide` option, it will also be applied in this plugin. e.g.
135
-
136
- ```js
137
- // This Vue instance will be ignored by the plugin.
138
- createApp({
139
- render: () => h(App),
140
- devtools: {
141
- hide: true,
142
- },
143
- })
144
- ```
145
-
146
- ## 📖 Blog Post
147
-
148
- - [Introducing Vue DevTools (Vite Plugin)](https://gist.github.com/webfansplz/bc90a773a0dd474a34e043ab2d2a37a4)
149
-
150
- ## 🌸 Credits
151
-
152
- - This project is highly inspired by [nuxt/devtools](https://github.com/nuxt/devtools). Kudos to Anthony Fu and Nuxt team for the awesome work!
153
-
154
- - [vuejs/devtools](https://github.com/vuejs/devtools)
155
-
156
-
157
- ## 👨‍💻 Contributors
158
-
159
- <a href="https://github.com/webfansplz/vite-plugin-vue-devtools/graphs/contributors">
160
- <img src="https://contrib.rocks/image?repo=webfansplz/vite-plugin-vue-devtools" />
161
- </a>
162
-
163
- ## 📄 License
164
-
165
- [MIT LICENSE](./LICENSE)
166
-
@@ -1,18 +0,0 @@
1
-
2
- details[data-v-cf2e46eb] {
3
- border-style:none;;
4
- }
5
- summary[data-v-cf2e46eb] {
6
- border-style:none;;
7
- list-style: none;
8
- }
9
- details[open] summary[data-v-cf2e46eb] {
10
- border-style:none;;
11
- }
12
- details summary[data-v-cf2e46eb]::-webkit-details-marker {
13
- display:none;
14
- }
15
- details[open] .chevron[data-v-cf2e46eb] {
16
- transform: rotate(180deg);
17
- opacity: 0.75;
18
- }