@nuxt/devtools 0.3.1 → 0.4.0

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 (122) hide show
  1. package/README.md +1 -60
  2. package/cli.mjs +1 -1
  3. package/dist/chunks/module-main.mjs +380 -8367
  4. package/dist/chunks/vscode.mjs +12 -41561
  5. package/dist/client/200.html +2 -2
  6. package/dist/client/404.html +2 -2
  7. package/dist/client/__inspecting/index.html +2 -2
  8. package/dist/client/_nuxt/Badge.0a290709.js +1 -0
  9. package/dist/client/_nuxt/DrawerRight.vue.a83a778f.js +1 -0
  10. package/dist/client/_nuxt/{DurationDisplay.vue.9b5b62d4.js → DurationDisplay.vue.9816695d.js} +1 -1
  11. package/dist/client/_nuxt/{FilepathItem.vue.178a1de3.js → FilepathItem.vue.288f8cb4.js} +1 -1
  12. package/dist/client/_nuxt/LaunchPage.vue.25e8c415.js +1 -0
  13. package/dist/client/_nuxt/NCheckbox.vue.f52d0a98.js +1 -0
  14. package/dist/client/_nuxt/NCodeBlock.vue.b2b8c3ac.js +2 -0
  15. package/dist/client/_nuxt/{NIconButton.vue.a83f99ea.js → NIconButton.vue.c1838c30.js} +1 -1
  16. package/dist/client/_nuxt/NIconTitle.vue.d1747349.js +1 -0
  17. package/dist/client/_nuxt/NLoading.f33a8f5a.js +1 -0
  18. package/dist/client/_nuxt/{NMarkdown.vue.11f68fad.js → NMarkdown.vue.20a8169f.js} +1 -1
  19. package/dist/client/_nuxt/NPanelGrids.ac7957ef.js +1 -0
  20. package/dist/client/_nuxt/NSectionBlock.e666450f.js +1 -0
  21. package/dist/client/_nuxt/NSelect.vue.7264b851.js +1 -0
  22. package/dist/client/_nuxt/NSwitch.vue.28747f12.js +1 -0
  23. package/dist/client/_nuxt/NTextInput.vue.352ba30f.js +1 -0
  24. package/dist/client/_nuxt/NTip.vue.eda7f11a.js +1 -0
  25. package/dist/client/_nuxt/{NpmVersionCheck.vue.0eab98c7.js → NpmVersionCheck.vue.d7b26b31.js} +1 -1
  26. package/dist/client/_nuxt/{NuxtLogo.38adb408.js → NuxtLogo.1c0728be.js} +1 -1
  27. package/dist/client/_nuxt/{PanelLeftRight.vue.90cdedcf.js → PanelLeftRight.vue.005018fa.js} +1 -1
  28. package/dist/client/_nuxt/StateEditor.vue.4b8051fa.js +1 -0
  29. package/dist/client/_nuxt/{TabIcon.vue.8236980c.js → TabIcon.vue.84eecba6.js} +1 -1
  30. package/dist/client/_nuxt/__inspecting.2df5f253.js +1 -0
  31. package/dist/client/_nuxt/assets.a19ea08e.css +1 -0
  32. package/dist/client/_nuxt/assets.c48069ab.js +16 -0
  33. package/dist/client/_nuxt/components.0e258eba.js +1 -0
  34. package/dist/client/_nuxt/constants.bd39e314.js +1 -0
  35. package/dist/client/_nuxt/{context.fe69916a.js → context.6844f837.js} +1 -1
  36. package/dist/client/_nuxt/custom-_name_.5de364a2.js +1 -0
  37. package/dist/client/_nuxt/default.57fc1d9b.js +1 -0
  38. package/dist/client/_nuxt/editor.59beec6a.js +1 -0
  39. package/dist/client/_nuxt/entry.9f02ddf0.css +32 -0
  40. package/dist/client/_nuxt/{entry.216b69f8.js → entry.bcd35db3.js} +102 -102
  41. package/dist/client/_nuxt/{error-404.51bdc645.js → error-404.5dd28b39.js} +1 -1
  42. package/dist/client/_nuxt/{error-500.15ac1dfe.js → error-500.40852059.js} +1 -1
  43. package/dist/client/_nuxt/{error-component.0a7a48e4.js → error-component.7b83568a.js} +2 -2
  44. package/dist/client/_nuxt/fuse.esm.69d72a3b.js +1 -0
  45. package/dist/client/_nuxt/{hooks.aa487478.js → hooks.b54081d4.js} +1 -1
  46. package/dist/client/_nuxt/imports.cca795e7.js +1 -0
  47. package/dist/client/_nuxt/{index.517491fb.js → index.b2230878.js} +1 -1
  48. package/dist/client/_nuxt/{index.3b3b7aca.js → index.ce8efa93.js} +1 -1
  49. package/dist/client/_nuxt/layouts.5513175b.js +1 -0
  50. package/dist/client/_nuxt/{middleware.e73473f1.js → middleware.d5000709.js} +1 -1
  51. package/dist/client/_nuxt/modules.26682582.js +1 -0
  52. package/dist/client/_nuxt/{none.3e2499ec.js → none.b1b5b9b7.js} +1 -1
  53. package/dist/client/_nuxt/overview.28a5ffd6.js +1 -0
  54. package/dist/client/_nuxt/pages.2c54d081.js +1 -0
  55. package/dist/client/_nuxt/{payload.ee430f3a.js → payload.28c2ffd0.js} +1 -1
  56. package/dist/client/_nuxt/{plugins.5095ec46.js → plugins.2a8f86bc.js} +1 -1
  57. package/dist/client/_nuxt/runtime-configs.255185da.js +1 -0
  58. package/dist/client/_nuxt/server-routes.f29871aa.js +9 -0
  59. package/dist/client/_nuxt/settings.2b491e6d.js +1 -0
  60. package/dist/client/_nuxt/storage.709c30ef.js +1 -0
  61. package/dist/client/_nuxt/terminals.7858d68a.js +1 -0
  62. package/dist/client/_nuxt/unocss-runtime.f4f04b37.js +2 -0
  63. package/dist/client/_nuxt/virtual-files.383ad39e.js +1 -0
  64. package/dist/client/index.html +2 -2
  65. package/dist/client/modules/assets/index.html +2 -2
  66. package/dist/client/modules/components/index.html +2 -2
  67. package/dist/client/modules/hooks/index.html +2 -2
  68. package/dist/client/modules/imports/index.html +2 -2
  69. package/dist/client/modules/layouts/index.html +2 -2
  70. package/dist/client/modules/middleware/index.html +2 -2
  71. package/dist/client/modules/modules/index.html +2 -2
  72. package/dist/client/modules/overview/index.html +2 -2
  73. package/dist/client/modules/pages/index.html +2 -2
  74. package/dist/client/modules/payload/index.html +2 -2
  75. package/dist/client/modules/plugins/index.html +2 -2
  76. package/dist/client/modules/runtime-configs/index.html +2 -2
  77. package/dist/client/modules/server-routes/index.html +2 -2
  78. package/dist/client/modules/storage/index.html +2 -2
  79. package/dist/client/modules/terminals/index.html +2 -2
  80. package/dist/client/modules/virtual-files/index.html +2 -2
  81. package/dist/client/settings/index.html +2 -2
  82. package/dist/module.json +1 -1
  83. package/dist/runtime/plugins/devtools.client.mjs +7 -2
  84. package/package.json +36 -35
  85. package/dist/cli.d.ts +0 -2
  86. package/dist/cli.mjs +0 -406
  87. package/dist/client/_nuxt/Badge.ec308af3.js +0 -1
  88. package/dist/client/_nuxt/DrawerRight.vue.a85afa62.js +0 -1
  89. package/dist/client/_nuxt/LaunchPage.vue.a0bbd67e.js +0 -1
  90. package/dist/client/_nuxt/NCheckbox.vue.4a02f339.js +0 -1
  91. package/dist/client/_nuxt/NCodeBlock.vue.593cb41f.js +0 -1
  92. package/dist/client/_nuxt/NIconTitle.vue.ce90e41b.js +0 -1
  93. package/dist/client/_nuxt/NSectionBlock.c955e75e.js +0 -1
  94. package/dist/client/_nuxt/NSelect.vue.e19311d6.js +0 -1
  95. package/dist/client/_nuxt/NSwitch.vue.76c93e66.js +0 -1
  96. package/dist/client/_nuxt/NTextInput.vue.d770ca6c.js +0 -1
  97. package/dist/client/_nuxt/NTip.vue.ac67cde4.js +0 -1
  98. package/dist/client/_nuxt/StateEditor.vue.c57dfe46.js +0 -1
  99. package/dist/client/_nuxt/__inspecting.143a746c.js +0 -1
  100. package/dist/client/_nuxt/assets.d6a1ab2b.js +0 -16
  101. package/dist/client/_nuxt/components.1b7f02b2.js +0 -1
  102. package/dist/client/_nuxt/custom-_name_.02ebd30e.js +0 -1
  103. package/dist/client/_nuxt/default.e6b60844.js +0 -1
  104. package/dist/client/_nuxt/editor.e10c09a2.js +0 -1
  105. package/dist/client/_nuxt/entry.654353dc.css +0 -32
  106. package/dist/client/_nuxt/fuse.esm.88e2763d.js +0 -1
  107. package/dist/client/_nuxt/icons.43eaabec.js +0 -1
  108. package/dist/client/_nuxt/icons.d5925320.js +0 -1
  109. package/dist/client/_nuxt/icons.eca62571.js +0 -1
  110. package/dist/client/_nuxt/imports.01c0f8be.js +0 -1
  111. package/dist/client/_nuxt/layouts.e447e192.js +0 -1
  112. package/dist/client/_nuxt/modules.304ea21e.js +0 -1
  113. package/dist/client/_nuxt/overview.b79bf694.js +0 -1
  114. package/dist/client/_nuxt/pages.fafa9fe0.js +0 -1
  115. package/dist/client/_nuxt/runtime-configs.b20fbeb6.js +0 -1
  116. package/dist/client/_nuxt/server-routes.7352d340.js +0 -1
  117. package/dist/client/_nuxt/settings.b6d3cae9.js +0 -1
  118. package/dist/client/_nuxt/storage.2e73159a.js +0 -1
  119. package/dist/client/_nuxt/terminals.65080a19.js +0 -1
  120. package/dist/client/_nuxt/unocss-runtime.5708ce83.js +0 -2
  121. package/dist/client/_nuxt/virtual-files.9eb05502.js +0 -1
  122. package/dist/shared/devtools.696fb428.mjs +0 -4
@@ -1,4 +1,4 @@
1
- import { createApp, markRaw } from "vue";
1
+ import { createApp, h, markRaw } from "vue";
2
2
  import { createHooks } from "hookable";
3
3
  import { setupHooksDebug } from "../shared/hooks.mjs";
4
4
  import Container from "./view/Container.vue";
@@ -37,6 +37,11 @@ export default defineNuxtPlugin((nuxt) => {
37
37
  if (e.code === "KeyD" && e.altKey && e.shiftKey)
38
38
  togglePanel();
39
39
  });
40
- const app = createApp(Container, { client });
40
+ const app = createApp({
41
+ render: () => h(Container, { client }),
42
+ devtools: {
43
+ hide: true
44
+ }
45
+ });
41
46
  app.mount(holder);
42
47
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/devtools",
3
3
  "type": "module",
4
- "version": "0.3.1",
4
+ "version": "0.4.0",
5
5
  "license": "MIT",
6
6
  "repository": "nuxt/devtools",
7
7
  "exports": {
@@ -30,73 +30,74 @@
30
30
  "vite": "*"
31
31
  },
32
32
  "dependencies": {
33
- "@nuxt/kit": "^3.3.1",
34
- "birpc": "^0.2.10",
35
- "consola": "^2.15.3",
33
+ "@nuxt/kit": "^3.3.3",
34
+ "birpc": "^0.2.11",
35
+ "consola": "^3.0.1",
36
36
  "execa": "^7.1.1",
37
37
  "fast-glob": "^3.2.12",
38
- "h3": "^1.6.2",
39
- "hookable": "^5.5.1",
38
+ "get-port-please": "^3.0.1",
39
+ "global-dirs": "^3.0.1",
40
+ "h3": "^1.6.4",
41
+ "hookable": "^5.5.3",
40
42
  "image-meta": "^0.1.1",
41
43
  "is-installed-globally": "^0.4.0",
42
44
  "launch-editor": "^2.6.0",
43
45
  "local-pkg": "^0.4.3",
46
+ "nypm": "^0.1.0",
44
47
  "pacote": "^15.1.1",
45
48
  "pathe": "^1.1.0",
49
+ "picocolors": "^1.0.0",
46
50
  "pkg-types": "^1.0.2",
47
- "rc9": "^2.0.1",
48
- "unimport": "^3.0.3",
49
- "vite-plugin-inspect": "^0.7.18",
51
+ "rc9": "^2.1.0",
52
+ "semver": "^7.4.0",
53
+ "sirv": "^2.0.2",
54
+ "tinyws": "^0.1.0",
55
+ "unimport": "^3.0.6",
56
+ "vite-plugin-inspect": "^0.7.20",
50
57
  "vite-plugin-vue-inspector": "^3.4.0",
51
- "@nuxt/devtools-kit": "0.3.1"
58
+ "wait-on": "^7.0.1",
59
+ "which": "^3.0.0",
60
+ "ws": "^8.13.0",
61
+ "@nuxt/devtools-kit": "0.4.0",
62
+ "@nuxt/devtools-wizard": "0.4.0"
52
63
  },
53
64
  "devDependencies": {
54
65
  "@antfu/utils": "^0.7.2",
55
66
  "@iconify-json/carbon": "^1.1.16",
56
- "@iconify-json/logos": "^1.1.23",
67
+ "@iconify-json/logos": "^1.1.24",
57
68
  "@iconify-json/mdi": "^1.1.50",
58
- "@iconify-json/ri": "^1.1.5",
59
- "@iconify-json/tabler": "^1.1.68",
69
+ "@iconify-json/ri": "^1.1.7",
70
+ "@iconify-json/tabler": "^1.1.71",
60
71
  "@nuxtjs/color-mode": "^3.2.0",
61
- "@unocss/nuxt": "^0.50.6",
62
- "@unocss/preset-icons": "^0.50.6",
63
- "@unocss/preset-uno": "^0.50.6",
64
- "@unocss/runtime": "^0.50.6",
72
+ "@unocss/nuxt": "^0.51.4",
73
+ "@unocss/preset-icons": "^0.51.4",
74
+ "@unocss/preset-uno": "^0.51.4",
75
+ "@unocss/runtime": "^0.51.4",
65
76
  "@vueuse/nuxt": "^9.13.0",
66
77
  "esno": "^0.16.3",
67
78
  "flatted": "^3.2.7",
68
79
  "floating-vue": "2.0.0-beta.20",
69
80
  "fuse.js": "^6.6.2",
70
- "get-port-please": "^3.0.1",
71
- "global-dirs": "^3.0.1",
72
81
  "json-editor-vue": "^0.10.5",
73
82
  "markdown-it": "^13.0.1",
74
- "nanoid": "^4.0.1",
75
- "nuxt": "^3.3.1",
83
+ "nanoid": "^4.0.2",
84
+ "nuxt": "^3.3.3",
76
85
  "nuxt-vitest": "^0.6.9",
77
- "nypm": "^0.1.0",
78
86
  "ofetch": "^1.0.1",
79
87
  "ohash": "^1.0.0",
80
- "picocolors": "^1.0.0",
81
- "semver": "^7.3.8",
82
88
  "shiki": "^0.14.1",
83
89
  "shiki-es": "^0.2.0",
84
- "sirv": "^2.0.2",
85
90
  "splitpanes": "^3.1.5",
86
91
  "theme-vitesse": "^0.6.4",
87
- "tinyws": "^0.1.0",
88
- "unocss": "^0.50.6",
89
- "vanilla-jsoneditor": "^0.16.0",
90
- "vis-data": "^7.1.5",
91
- "vis-network": "^9.1.5",
92
- "vue-template-promise": "^0.1.1",
92
+ "unocss": "^0.51.4",
93
+ "vanilla-jsoneditor": "^0.16.1",
94
+ "vis-data": "^7.1.6",
95
+ "vis-network": "^9.1.6",
96
+ "vue-template-promise": "^0.1.3",
93
97
  "vue-tsc": "^1.2.0",
94
- "wait-on": "^7.0.1",
95
- "which": "^3.0.0",
96
- "ws": "^8.13.0",
97
98
  "xterm": "^5.1.0",
98
99
  "xterm-addon-fit": "^0.7.0",
99
- "@nuxt/devtools": "0.3.1"
100
+ "@nuxt/devtools": "0.4.0"
100
101
  },
101
102
  "scripts": {
102
103
  "build": "pnpm dev:prepare && pnpm build:module && pnpm build:client && esno scripts/prepare.ts",
package/dist/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }
package/dist/cli.mjs DELETED
@@ -1,406 +0,0 @@
1
- import fs from 'node:fs';
2
- import consola from 'consola';
3
- import { execa } from 'execa';
4
- import { readUser, writeUser } from 'rc9';
5
- import require$$1 from 'path';
6
- import require$$1$1 from 'os';
7
- import require$$0__default from 'fs';
8
- import { resolve } from 'pathe';
9
- import { n as name } from './shared/devtools.696fb428.mjs';
10
-
11
- var globalDirs = {};
12
-
13
- const { hasOwnProperty } = Object.prototype;
14
-
15
- const eol = typeof process !== 'undefined' &&
16
- process.platform === 'win32' ? '\r\n' : '\n';
17
-
18
- const encode = (obj, opt) => {
19
- const children = [];
20
- let out = '';
21
-
22
- if (typeof opt === 'string') {
23
- opt = {
24
- section: opt,
25
- whitespace: false,
26
- };
27
- } else {
28
- opt = opt || Object.create(null);
29
- opt.whitespace = opt.whitespace === true;
30
- }
31
-
32
- const separator = opt.whitespace ? ' = ' : '=';
33
-
34
- for (const k of Object.keys(obj)) {
35
- const val = obj[k];
36
- if (val && Array.isArray(val)) {
37
- for (const item of val)
38
- out += safe(k + '[]') + separator + safe(item) + '\n';
39
- } else if (val && typeof val === 'object')
40
- children.push(k);
41
- else
42
- out += safe(k) + separator + safe(val) + eol;
43
- }
44
-
45
- if (opt.section && out.length)
46
- out = '[' + safe(opt.section) + ']' + eol + out;
47
-
48
- for (const k of children) {
49
- const nk = dotSplit(k).join('\\.');
50
- const section = (opt.section ? opt.section + '.' : '') + nk;
51
- const { whitespace } = opt;
52
- const child = encode(obj[k], {
53
- section,
54
- whitespace,
55
- });
56
- if (out.length && child.length)
57
- out += eol;
58
-
59
- out += child;
60
- }
61
-
62
- return out
63
- };
64
-
65
- const dotSplit = str =>
66
- str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
67
- .replace(/\\\./g, '\u0001')
68
- .split(/\./)
69
- .map(part =>
70
- part.replace(/\1/g, '\\.')
71
- .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001'));
72
-
73
- const decode = str => {
74
- const out = Object.create(null);
75
- let p = out;
76
- let section = null;
77
- // section |key = value
78
- const re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
79
- const lines = str.split(/[\r\n]+/g);
80
-
81
- for (const line of lines) {
82
- if (!line || line.match(/^\s*[;#]/))
83
- continue
84
- const match = line.match(re);
85
- if (!match)
86
- continue
87
- if (match[1] !== undefined) {
88
- section = unsafe(match[1]);
89
- if (section === '__proto__') {
90
- // not allowed
91
- // keep parsing the section, but don't attach it.
92
- p = Object.create(null);
93
- continue
94
- }
95
- p = out[section] = out[section] || Object.create(null);
96
- continue
97
- }
98
- const keyRaw = unsafe(match[2]);
99
- const isArray = keyRaw.length > 2 && keyRaw.slice(-2) === '[]';
100
- const key = isArray ? keyRaw.slice(0, -2) : keyRaw;
101
- if (key === '__proto__')
102
- continue
103
- const valueRaw = match[3] ? unsafe(match[4]) : true;
104
- const value = valueRaw === 'true' ||
105
- valueRaw === 'false' ||
106
- valueRaw === 'null' ? JSON.parse(valueRaw)
107
- : valueRaw;
108
-
109
- // Convert keys with '[]' suffix to an array
110
- if (isArray) {
111
- if (!hasOwnProperty.call(p, key))
112
- p[key] = [];
113
- else if (!Array.isArray(p[key]))
114
- p[key] = [p[key]];
115
- }
116
-
117
- // safeguard against resetting a previously defined
118
- // array by accidentally forgetting the brackets
119
- if (Array.isArray(p[key]))
120
- p[key].push(value);
121
- else
122
- p[key] = value;
123
- }
124
-
125
- // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
126
- // use a filter to return the keys that have to be deleted.
127
- const remove = [];
128
- for (const k of Object.keys(out)) {
129
- if (!hasOwnProperty.call(out, k) ||
130
- typeof out[k] !== 'object' ||
131
- Array.isArray(out[k]))
132
- continue
133
-
134
- // see if the parent section is also an object.
135
- // if so, add it to that, and mark this one for deletion
136
- const parts = dotSplit(k);
137
- let p = out;
138
- const l = parts.pop();
139
- const nl = l.replace(/\\\./g, '.');
140
- for (const part of parts) {
141
- if (part === '__proto__')
142
- continue
143
- if (!hasOwnProperty.call(p, part) || typeof p[part] !== 'object')
144
- p[part] = Object.create(null);
145
- p = p[part];
146
- }
147
- if (p === out && nl === l)
148
- continue
149
-
150
- p[nl] = out[k];
151
- remove.push(k);
152
- }
153
- for (const del of remove)
154
- delete out[del];
155
-
156
- return out
157
- };
158
-
159
- const isQuoted = val =>
160
- (val.charAt(0) === '"' && val.slice(-1) === '"') ||
161
- (val.charAt(0) === "'" && val.slice(-1) === "'");
162
-
163
- const safe = val =>
164
- (typeof val !== 'string' ||
165
- val.match(/[=\r\n]/) ||
166
- val.match(/^\[/) ||
167
- (val.length > 1 &&
168
- isQuoted(val)) ||
169
- val !== val.trim())
170
- ? JSON.stringify(val)
171
- : val.replace(/;/g, '\\;').replace(/#/g, '\\#');
172
-
173
- const unsafe = (val, doUnesc) => {
174
- val = (val || '').trim();
175
- if (isQuoted(val)) {
176
- // remove the single quotes before calling JSON.parse
177
- if (val.charAt(0) === "'")
178
- val = val.substr(1, val.length - 2);
179
-
180
- try {
181
- val = JSON.parse(val);
182
- } catch (_) {}
183
- } else {
184
- // walk the val to find the first not-escaped ; character
185
- let esc = false;
186
- let unesc = '';
187
- for (let i = 0, l = val.length; i < l; i++) {
188
- const c = val.charAt(i);
189
- if (esc) {
190
- if ('\\;#'.indexOf(c) !== -1)
191
- unesc += c;
192
- else
193
- unesc += '\\' + c;
194
-
195
- esc = false;
196
- } else if (';#'.indexOf(c) !== -1)
197
- break
198
- else if (c === '\\')
199
- esc = true;
200
- else
201
- unesc += c;
202
- }
203
- if (esc)
204
- unesc += '\\';
205
-
206
- return unesc.trim()
207
- }
208
- return val
209
- };
210
-
211
- var ini = {
212
- parse: decode,
213
- decode,
214
- stringify: encode,
215
- encode,
216
- safe,
217
- unsafe,
218
- };
219
-
220
- (function (exports) {
221
- const path = require$$1;
222
- const os = require$$1$1;
223
- const fs = require$$0__default;
224
- const ini$1 = ini;
225
-
226
- const isWindows = process.platform === 'win32';
227
-
228
- const readRc = filePath => {
229
- try {
230
- return ini$1.parse(fs.readFileSync(filePath, 'utf8')).prefix;
231
- } catch {}
232
- };
233
-
234
- const getEnvNpmPrefix = () => {
235
- // TODO: Remove the `.reduce` call.
236
- // eslint-disable-next-line unicorn/no-array-reduce
237
- return Object.keys(process.env).reduce((prefix, name) => {
238
- return /^npm_config_prefix$/i.test(name) ? process.env[name] : prefix;
239
- }, undefined);
240
- };
241
-
242
- const getGlobalNpmrc = () => {
243
- if (isWindows && process.env.APPDATA) {
244
- // Hardcoded contents of `c:\Program Files\nodejs\node_modules\npm\npmrc`
245
- return path.join(process.env.APPDATA, '/npm/etc/npmrc');
246
- }
247
-
248
- // Homebrew special case: `$(brew --prefix)/lib/node_modules/npm/npmrc`
249
- if (process.execPath.includes('/Cellar/node')) {
250
- const homebrewPrefix = process.execPath.slice(0, process.execPath.indexOf('/Cellar/node'));
251
- return path.join(homebrewPrefix, '/lib/node_modules/npm/npmrc');
252
- }
253
-
254
- if (process.execPath.endsWith('/bin/node')) {
255
- const installDir = path.dirname(path.dirname(process.execPath));
256
- return path.join(installDir, '/etc/npmrc');
257
- }
258
- };
259
-
260
- const getDefaultNpmPrefix = () => {
261
- if (isWindows) {
262
- const {APPDATA} = process.env;
263
- // `c:\node\node.exe` → `prefix=c:\node\`
264
- return APPDATA ? path.join(APPDATA, 'npm') : path.dirname(process.execPath);
265
- }
266
-
267
- // `/usr/local/bin/node` → `prefix=/usr/local`
268
- return path.dirname(path.dirname(process.execPath));
269
- };
270
-
271
- const getNpmPrefix = () => {
272
- const envPrefix = getEnvNpmPrefix();
273
- if (envPrefix) {
274
- return envPrefix;
275
- }
276
-
277
- const homePrefix = readRc(path.join(os.homedir(), '.npmrc'));
278
- if (homePrefix) {
279
- return homePrefix;
280
- }
281
-
282
- if (process.env.PREFIX) {
283
- return process.env.PREFIX;
284
- }
285
-
286
- const globalPrefix = readRc(getGlobalNpmrc());
287
- if (globalPrefix) {
288
- return globalPrefix;
289
- }
290
-
291
- return getDefaultNpmPrefix();
292
- };
293
-
294
- const npmPrefix = path.resolve(getNpmPrefix());
295
-
296
- const getYarnWindowsDirectory = () => {
297
- if (isWindows && process.env.LOCALAPPDATA) {
298
- const dir = path.join(process.env.LOCALAPPDATA, 'Yarn');
299
- if (fs.existsSync(dir)) {
300
- return dir;
301
- }
302
- }
303
-
304
- return false;
305
- };
306
-
307
- const getYarnPrefix = () => {
308
- if (process.env.PREFIX) {
309
- return process.env.PREFIX;
310
- }
311
-
312
- const windowsPrefix = getYarnWindowsDirectory();
313
- if (windowsPrefix) {
314
- return windowsPrefix;
315
- }
316
-
317
- const configPrefix = path.join(os.homedir(), '.config/yarn');
318
- if (fs.existsSync(configPrefix)) {
319
- return configPrefix;
320
- }
321
-
322
- const homePrefix = path.join(os.homedir(), '.yarn-config');
323
- if (fs.existsSync(homePrefix)) {
324
- return homePrefix;
325
- }
326
-
327
- // Yarn supports the npm conventions but the inverse is not true
328
- return npmPrefix;
329
- };
330
-
331
- exports.npm = {};
332
- exports.npm.prefix = npmPrefix;
333
- exports.npm.packages = path.join(npmPrefix, isWindows ? 'node_modules' : 'lib/node_modules');
334
- exports.npm.binaries = isWindows ? npmPrefix : path.join(npmPrefix, 'bin');
335
-
336
- const yarnPrefix = path.resolve(getYarnPrefix());
337
- exports.yarn = {};
338
- exports.yarn.prefix = yarnPrefix;
339
- exports.yarn.packages = path.join(yarnPrefix, getYarnWindowsDirectory() ? 'Data/global/node_modules' : 'global/node_modules');
340
- exports.yarn.binaries = path.join(exports.yarn.packages, '.bin');
341
- } (globalDirs));
342
-
343
- const RC_PATH = ".nuxtrc";
344
- function enable(rc, path) {
345
- const modulePath = resolve(globalDirs.npm.packages, name);
346
- const targetPath = resolve(modulePath, "module.cjs").replace(/\\/g, "/");
347
- if (!fs.existsSync(targetPath))
348
- throw new Error("Failed to locate the global Nuxt Devtools module. You may try it again");
349
- removeModule(rc);
350
- if (!rc.modules?.includes(targetPath))
351
- rc.modules = [...rc.modules || [], targetPath];
352
- if (!rc.devtoolsGlobal)
353
- rc.devtoolsGlobal = {};
354
- if (!rc.devtoolsGlobal.projects)
355
- rc.devtoolsGlobal.projects = [];
356
- if (!rc.devtoolsGlobal.projects.includes(path))
357
- rc.devtoolsGlobal.projects.push(path);
358
- }
359
- function disable(rc, path) {
360
- if (rc.devtoolsGlobal?.projects?.includes(path)) {
361
- rc.devtoolsGlobal.projects = rc.devtoolsGlobal.projects.filter((p) => p !== path);
362
- return true;
363
- }
364
- if (!rc.devtoolsGlobal.projects?.length)
365
- removeModule(rc);
366
- return false;
367
- }
368
- const pathRegex = /[\\\/]@nuxt[\\\/]devtools[\\\/]/;
369
- function removeModule(rc) {
370
- if (Array.isArray(rc.modules))
371
- rc.modules = rc.modules.filter((p) => !p.match(pathRegex));
372
- return true;
373
- }
374
- async function run() {
375
- const args = process.argv.slice(2);
376
- const command = args[0];
377
- const cwd = process.cwd();
378
- const rc = readUser(RC_PATH);
379
- if (command === "enable") {
380
- consola.info("Installed Nuxt Devtools...");
381
- await execa("npm", ["install", "-g", `${name}@latest`], { stdio: "inherit" });
382
- enable(rc, cwd);
383
- consola.info("Nuxt Devtools enabled! Restart your Nuxt app to start using it.");
384
- } else if (command === "disable") {
385
- const isRemove = args.includes("--remove");
386
- if (disable(rc, cwd))
387
- consola.success("Nuxt Devtools disabled for this project.");
388
- else if (!isRemove)
389
- consola.warn("Nuxt Devtools is not enabled for this project.");
390
- if (isRemove) {
391
- removeModule(rc);
392
- consola.success("Nuxt Devtools is removed globally");
393
- }
394
- } else if (!command) {
395
- console.log(`npx ${name} enable|disable`);
396
- process.exit(1);
397
- } else {
398
- consola.log(`Unknown command "${command}"`);
399
- process.exit(1);
400
- }
401
- writeUser(rc, RC_PATH);
402
- }
403
- run().catch((err) => {
404
- consola.error(err);
405
- process.exit(1);
406
- });
@@ -1 +0,0 @@
1
- import{aj as n,o,f as s,J as t}from"./entry.216b69f8.js";const c={},r={class:"text-xs rounded whitespace-nowrap px-1.5 py-0.5 mx-0.5 select-none"};function a(e,_){return o(),s("span",r,[t(e.$slots,"default")])}const l=n(c,[["render",a]]);export{l as _};
@@ -1 +0,0 @@
1
- import{_ as i}from"./NIconButton.vue.a83f99ea.js";import{a as u,E as m,Y as f,Z as d,o as l,c as p,w as _,a0 as b,f as v,i as h,h as x,J as y,a1 as g,u as k,y as B}from"./entry.216b69f8.js";const C={"w-full":"","of-auto":"","h-full":"",relative:""},V={inheritAttrs:!1},N=u({...V,__name:"DrawerRight",props:{modelValue:{type:Boolean},navbar:null,autoClose:{type:Boolean}},emits:["close"],setup(o,{emit:r}){const e=o,a=m(),{height:n}=f(()=>e.navbar,void 0,{box:"border-box"});return d(a,()=>{e.modelValue&&e.autoClose&&r("close")},{ignore:["a","button","summary"]}),(t,s)=>{const c=i;return l(),p(b,{"enter-active-class":"duration-200 ease-in","enter-from-class":"transform translate-x-1/1","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-out","leave-from-class":"opacity-100","leave-to-class":"transform translate-x-1/1"},{default:_(()=>[o.modelValue?(l(),v("div",g({key:0,ref_key:"el",ref:a,border:"l base",flex:"~ col gap-1","text-sm":"",absolute:"","of-auto":"","right-0":"","bottom-0":"","glass-effect":"","z-10":"","z-20":"",style:{top:`${k(n)}px`}},t.$attrs),[h(c,{absolute:"","z-20":"","text-xl":"","right-2":"","top-2":"",icon:"carbon-close",onClick:s[0]||(s[0]=$=>t.$emit("close"))}),x("div",C,[y(t.$slots,"default")])],16)):B("",!0)]),_:3})}}});export{N as _};
@@ -1 +0,0 @@
1
- import{_ as f}from"./TabIcon.vue.8236980c.js";import{_ as p}from"./NMarkdown.vue.11f68fad.js";import{a as k,o as n,f as s,i as h,h as c,t as i,c as a,y as l,F as g,v as x,w as b,l as y,a1 as N,I as w,k as B}from"./entry.216b69f8.js";const C={flex:"~ col gap2","h-full":"","items-center":"","justify-center":""},$={"text-xl":""},v={flex:"~ gap2 wrap"},P=k({__name:"LaunchPage",props:{icon:null,title:null,description:null,actions:null},emits:["action"],setup(e){return(r,V)=>{const m=f,d=p,_=w,u=B;return n(),s("div",C,[h(m,{"text-5xl":"",mb4:"",icon:e.icon||e.icon,title:e.title},null,8,["icon","title"]),c("h1",$,i(e.title),1),e.description?(n(),a(d,{key:0,op50:"","text-center":"","text-base":"","mt--1":"",mb2:"",markdown:e.description},null,8,["markdown"])):l("",!0),c("div",v,[(n(!0),s(g,null,x(e.actions,(t,o)=>(n(),a(u,N({key:o,n:"solid primary",disabled:t.pending,to:t.src,target:t.src?"_blank":void 0},t.attrs,{onClick:()=>{t.handle?.(),r.$emit("action",o)}}),{default:b(()=>[t.pending?(n(),a(_,{key:0,icon:"carbon-circle-dash","animate-spin":""})):l("",!0),y(" "+i(t.label),1)]),_:2},1040,["disabled","to","target","onClick"]))),128))])])}}});export{P as _};
@@ -1 +0,0 @@
1
- import{a as i,ay as r,o as b,f as p,aD as u,aM as h,u as a,h as n,H as k,av as f,i as m,J as v,x,I as _}from"./entry.216b69f8.js";const y=["checked","disabled"],V=["disabled"],B={class:"n-transition n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base"},M=i({__name:"NCheckbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(o,{emit:l}){const e=r(o,"modelValue",l,{passive:!0});return(t,s)=>{const d=_;return b(),p("label",{class:"items-center select-none n-disabled:n-disabled n-checkbox hover:n-checkbox-hover",checked:a(e)||null,disabled:o.disabled||null},[u(n("input",{"onUpdate:modelValue":s[0]||(s[0]=c=>k(e)?e.value=c:null),type:"checkbox",class:"absolute op0 peer",disabled:o.disabled,onKeypress:s[1]||(s[1]=f(c=>e.value=!a(e),["enter"]))},null,40,V),[[h,a(e)]]),n("span",B,[m(d,{class:"n-transition op0 n-checkbox-icon transform scale-0 n-checked:op100 n-checked:scale-100"})]),n("span",{class:x([a(e)?"":"op50","n-transition"])},[v(t.$slots,"default")],2)],8,y)}}});export{M as _};
@@ -1 +0,0 @@
1
- import{a,m as d,aw as r,u as l,o as t,f as s,x as c,t as i}from"./entry.216b69f8.js";const u=["innerHTML"],p=["textContent"],C=a({__name:"NCodeBlock",props:{code:null,lang:null,lines:{type:Boolean,default:!0}},setup(e){const n=e,o=d(()=>r.value?.devtools.renderCodeHighlight(n.code,n.lang)||{code:n.code,supported:!1});return(k,m)=>e.lang&&l(o).supported?(t(),s("pre",{key:0,class:c(["n-code-block",e.lines?"n-code-block-lines":""]),innerHTML:l(o).code},null,10,u)):(t(),s("pre",{key:1,class:c(["n-code-block",e.lines?"n-code-block-lines":""]),textContent:i(e.code)},null,10,p))}});export{C as _};
@@ -1 +0,0 @@
1
- import{a as s,o as t,f as a,x as l,y as o,J as c,h as i,t as r}from"./entry.216b69f8.js";const m={class:"items-center flex flex-gap2"},f=s({__name:"NIconTitle",props:{icon:null,text:null},setup(e){return(n,d)=>(t(),a("div",m,[e.icon?(t(),a("div",{key:0,class:l(e.icon)},null,2)):o("",!0),c(n.$slots,"default",{},()=>[i("div",null,r(e.text),1)])]))}});export{f as _};
@@ -1 +0,0 @@
1
- import{a as f,o as a,f as l,h as o,x as n,i as m,w as v,J as s,F as x,l as c,t as i,y as d,c as h,aB as b,aC as g,I as y,aj as B}from"./entry.216b69f8.js";import{_ as $}from"./NIconTitle.vue.ce90e41b.js";const r=e=>(b("data-v-dcb9bb68"),e=e(),g(),e),C=["open"],I={key:0,class:"op50 text-sm"},N=r(()=>o("div",{class:"flex-auto"},null,-1)),S=r(()=>o("div",{class:"x-divider"},null,-1)),k=f({__name:"NSectionBlock",props:{icon:null,text:null,description:null,containerClass:{default:""},collapse:{type:Boolean,default:!0},open:{type:Boolean,default:!0},padding:{type:[Boolean,String],default:!0}},setup(e){return(t,_)=>{const u=y,p=$;return a(),l(x,null,[o("details",{open:e.open},[o("summary",{class:n(["select-none cursor-pointer p4 hover:bg-active",e.collapse?"":"pointer-events-none"])},[m(p,{icon:e.icon,text:e.text,class:"text-xl op75"},{default:v(()=>[o("div",null,[s(t.$slots,"text",{},()=>[c(i(e.text),1)],!0),e.description||t.$slots.description?(a(),l("div",I,[s(t.$slots,"description",{},()=>[c(i(e.description),1)],!0)])):d("",!0)]),N,s(t.$slots,"actions",{},void 0,!0),e.collapse?(a(),h(u,{key:0,icon:"carbon-chevron-down",class:"op50 cursor-pointer text-base transition duration-500 place-self-start chevron"})):d("",!0)]),_:3},8,["icon","text"])],2),o("div",{class:n(["flex flex-col flex-gap2 pt2 pb6",typeof e.padding=="string"?e.padding:e.padding?"px8":""])},[s(t.$slots,"details",{},void 0,!0),o("div",{class:n([e.containerClass,"mt1"])},[s(t.$slots,"default",{},void 0,!0)],2),s(t.$slots,"footer",{},void 0,!0)],2)],8,C),S],64)}}}),F=B(k,[["__scopeId","data-v-dcb9bb68"]]);export{F as _};
@@ -1 +0,0 @@
1
- import{a as r,ay as f,o as s,f as l,J as n,aD as m,aN as p,u as b,h,t as v,y as d,H as x,c as y,I as V}from"./entry.216b69f8.js";const k={class:"flex items-center flex n-bg-base rounded py-1 border n-border-base px-2 n-text-input focus-within:n-focus-base focus-within:border-context"},B=["disabled"],N={key:0,value:"",disabled:"",hidden:""},g=r({__name:"NSelect",props:{modelValue:{default:void 0},placeholder:{default:""},icon:{default:""},disabled:{type:Boolean,default:!1}},setup(e,{emit:c}){const o=f(e,"modelValue",c,{passive:!0});return(t,a)=>{const i=V;return s(),l("div",k,[n(t.$slots,"icon",{},()=>[e.icon?(s(),y(i,{key:0,icon:e.icon,class:"op50 mr-0.4em text-1.1em"},null,8,["icon"])):d("",!0)]),m(h("select",{"onUpdate:modelValue":a[0]||(a[0]=u=>x(o)?o.value=u:null),disabled:e.disabled,class:"n-bg-base flex-auto w-full !outline-none"},[e.placeholder?(s(),l("option",N,v(e.placeholder),1)):d("",!0),n(t.$slots,"default")],8,B),[[p,b(o)]])])}}});export{g as _};
@@ -1 +0,0 @@
1
- import{a as o,ay as c,o as u,f as r,aD as h,aM as b,u as t,h as l,H as p,av as f,J as v}from"./entry.216b69f8.js";const k=["checked","disabled"],m=["disabled"],w=l("div",{class:"n-transition peer-active:n-active-base peer-focus-visible:n-focus-base n-switch-slider n-checked:n-switch-slider-checked"},[l("div",{class:"n-transition n-switch-thumb n-checked:n-switch-thumb-checked"})],-1),V=o({__name:"NSwitch",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(a,{emit:d}){const e=c(a,"modelValue",d,{passive:!0});return(i,s)=>(u(),r("label",{class:"n-disabled:n-disabled n-switch n-switch-base",checked:t(e)||null,disabled:a.disabled||null},[h(l("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>p(e)?e.value=n:null),type:"checkbox",class:"absolute op0 peer",disabled:a.disabled,onKeypress:s[1]||(s[1]=f(n=>e.value=!t(e),["enter"]))},null,40,m),[[b,t(e)]]),w,v(i.$slots,"default")],8,k))}});export{V as _};
@@ -1 +0,0 @@
1
- import{a as d,ay as i,o as a,f as u,J as r,aD as p,aL as f,u as m,h as b,H as x,c as y,y as h,I as V}from"./entry.216b69f8.js";const v={class:"n-bg-base rounded py-1 border n-border-base flex items-center flex n-text-input focus-within:n-focus-base focus-within:border-context px-2"},B=["type","disabled","placeholder"],N=d({__name:"NTextInput",props:{modelValue:{default:""},placeholder:null,icon:null,disabled:{type:Boolean,default:!1},type:{default:"text"}},setup(e,{emit:n}){const t=i(e,"modelValue",n,{passive:!0});return(l,o)=>{const s=V;return a(),u("div",v,[r(l.$slots,"icon",{},()=>[e.icon?(a(),y(s,{key:0,icon:e.icon,class:"op50 mr-0.4em text-1.1em"},null,8,["icon"])):h("",!0)]),p(b("input",{"onUpdate:modelValue":o[0]||(o[0]=c=>x(t)?t.value=c:null),class:"flex-auto n-bg-base w-full !outline-none",type:e.type,disabled:e.disabled,placeholder:e.placeholder},null,8,B),[[f,m(t)]])])}}});export{N as _};
@@ -1 +0,0 @@
1
- import{a as t,o,f as a,J as s,h as i,c as l,y as r,I as m}from"./entry.216b69f8.js";const p={class:"n-tip n-tip-base"},u=t({__name:"NTip",props:{icon:null},setup(e){return(n,_)=>{const c=m;return o(),a("div",p,[s(n.$slots,"icon",{},()=>[e.icon?(o(),l(c,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):r("",!0)]),i("div",null,[s(n.$slots,"default")])])}}});export{u as _};
@@ -1 +0,0 @@
1
- import{_ as h}from"./NIconButton.vue.a83f99ea.js";import{a as N,ay as S,L as x,E as B,az as O,o as i,f as c,h as u,x as d,u as s,t as V,y as m,J as C,n as w,g as J,c as v,F as j,a1 as z,H as P,aA as $,a4 as A}from"./entry.216b69f8.js";const E=["open"],M={flex:"~ gap2","select-none":"","items-center":"",px4:""},R={key:1,p5:"","bg-active":"",italic:""},F=u("span",{op50:""},"No data",-1),D=[F],L=N({__name:"StateEditor",props:{name:null,open:{type:Boolean},state:null,readonly:{type:Boolean}},emits:["update:open"],setup(t,{emit:k}){const r=t,n=S(r,"open",k,{passive:!0}),g=x(),l=B();l.value=JSON.parse(JSON.stringify(r.state));const y=O(l,e=>{p(e,r.state)},{deep:!0});function p(e,o){for(const a in e)e[a]===null?o[a]=null:Array.isArray(e[a])?o[a]=e[a].slice():typeof e[a]=="object"?p(e[a],o[a]):o[a]=e[a]}async function b(){y.pause(),l.value=JSON.parse(JSON.stringify(r.state)),await A(),y.resume()}return(e,o)=>{const a=h;return i(),c("div",{class:"state-editor-details",open:t.name?s(n):!0},[u("div",M,[t.name?(i(),c("button",{key:0,flex:"~","items-center":"","cursor-pointer":"",class:d(s(n)?"":"op50"),onClick:o[0]||(o[0]=f=>n.value=!s(n))},[u("div",{transition:"","i-carbon-chevron-right":"",class:d(s(n)?"rotate-90 op0":"")},null,2),u("code",{py1:"","font-mono":"",px3:"",class:d(s(n)?"bg-[#8881] rounded-t":"rounded hover:bg-active")},V(t.name),3)],2)):m("",!0),C(e.$slots,"actions",w(J({isOpen:s(n),name:t.name,state:t.state}))),s(n)?(i(),v(a,{key:1,title:"Refresh View",icon:"carbon-renew",onClick:b})):m("",!0)]),s(n)||!t.name?(i(),c(j,{key:0},[t.state&&Object.keys(t.state).length>0?(i(),v(s($),z({key:0,modelValue:s(l),"onUpdate:modelValue":o[1]||(o[1]=f=>P(l)?l.value=f:null)},e.$attrs,{class:["json-editor-vue",[s(g).value==="dark"?"jse-theme-dark":"",(t.name,"")]],"main-menu-bar":!1,"navigation-bar":!1,"status-bar":!1,"read-only":t.readonly,indentation:2,"tab-size":2}),null,16,["modelValue","class","read-only"])):(i(),c("div",R,D))],64)):m("",!0)],8,E)}}});export{L as _};
@@ -1 +0,0 @@
1
- import{a as o,b as c,e as a,o as i,f as r,h as e}from"./entry.216b69f8.js";const p={flex:"~","items-center":"","justify-center":"","bg-base":"","h-screen":"",px5:""},l=e("div",null," Inspecting Vue components ",-1),f=o({__name:"__inspecting",setup(_){const s=c();a("keydown",n=>{n.key==="Escape"&&t()});function t(){s.value?.inspector?.disable()}return(n,u)=>(i(),r("div",p,[e("div",{absolute:"","right-0":"","top-0":"",p2:""},[e("button",{"text-xl":"",op50:"","hover:op100":"",ma:"","carbon-close":"",onClick:t})]),l]))}});export{f as default};