@nuxt/devtools 0.0.1 → 0.1.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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +242 -0
  3. package/cli.mjs +1 -1
  4. package/dist/chunks/index.mjs +47749 -0
  5. package/dist/chunks/module-main.mjs +8424 -0
  6. package/dist/chunks/vite-inspect.mjs +49 -0
  7. package/dist/chunks/vscode.mjs +40137 -0
  8. package/dist/chunks/vue-inspector.mjs +14 -0
  9. package/dist/cli.d.ts +2 -0
  10. package/dist/cli.mjs +66 -0
  11. package/dist/client/200.html +7 -0
  12. package/dist/client/404.html +7 -0
  13. package/dist/client/__inspecting/index.html +7 -0
  14. package/dist/client/_nuxt/Badge.23dc2d8f.js +1 -0
  15. package/dist/client/_nuxt/ComponentItem.f7b53cb0.js +1 -0
  16. package/dist/client/_nuxt/ComponentItem.vue.d48d83d8.js +1 -0
  17. package/dist/client/_nuxt/ComponentsGraph.94420499.js +1 -0
  18. package/dist/client/_nuxt/ComponentsGraph.vue.687b60ce.js +1 -0
  19. package/dist/client/_nuxt/ComponentsList.27e171d0.js +1 -0
  20. package/dist/client/_nuxt/ComponentsList.vue.24e7149d.js +1 -0
  21. package/dist/client/_nuxt/ComposableItem.a0f590b3.js +1 -0
  22. package/dist/client/_nuxt/ComposableItem.vue.645a2668.js +1 -0
  23. package/dist/client/_nuxt/ComposableTree.08cf808f.js +1 -0
  24. package/dist/client/_nuxt/ComposableTree.vue.a160c715.js +1 -0
  25. package/dist/client/_nuxt/CurrentRoute.4a32c426.js +1 -0
  26. package/dist/client/_nuxt/Drawer.6d261f16.js +1 -0
  27. package/dist/client/_nuxt/Drawer.vue.4d7d190a.js +1 -0
  28. package/dist/client/_nuxt/DrawerItem.0c4e93e1.js +1 -0
  29. package/dist/client/_nuxt/DrawerItem.vue.30f032f8.js +1 -0
  30. package/dist/client/_nuxt/FileIcon.4f6c385a.js +1 -0
  31. package/dist/client/_nuxt/FileIcon.vue.e650fe14.js +1 -0
  32. package/dist/client/_nuxt/FilepathItem.6f861b0b.js +1 -0
  33. package/dist/client/_nuxt/FilepathItem.vue.fcbe3a7a.js +1 -0
  34. package/dist/client/_nuxt/HooksTable.e9c5c41d.js +1 -0
  35. package/dist/client/_nuxt/HooksTable.vue.93af23f8.js +1 -0
  36. package/dist/client/_nuxt/IconTitle.576c2413.js +1 -0
  37. package/dist/client/_nuxt/IconTitle.vue.909d2a6b.js +1 -0
  38. package/dist/client/_nuxt/IframeView.d58e614f.js +1 -0
  39. package/dist/client/_nuxt/IframeView.vue.46f9c325.js +1 -0
  40. package/dist/client/_nuxt/LaunchPage.7f56830a.js +1 -0
  41. package/dist/client/_nuxt/LaunchPage.vue.29133098.js +1 -0
  42. package/dist/client/_nuxt/ModuleItem.9523008d.js +1 -0
  43. package/dist/client/_nuxt/ModuleItem.vue.07190cb3.js +1 -0
  44. package/dist/client/_nuxt/ModuleTreeNode.040f6e05.js +1 -0
  45. package/dist/client/_nuxt/NButton.d5a0d397.js +1 -0
  46. package/dist/client/_nuxt/NButton.vue.3df758c5.js +1 -0
  47. package/dist/client/_nuxt/NCard.47038127.js +1 -0
  48. package/dist/client/_nuxt/NCheckbox.ec4f225e.js +1 -0
  49. package/dist/client/_nuxt/NCheckbox.vue.25b386b6.js +1 -0
  50. package/dist/client/_nuxt/NDarkToggle.46f06112.js +1 -0
  51. package/dist/client/_nuxt/NDarkToggle.vue.c227b1bd.js +1 -0
  52. package/dist/client/_nuxt/NDialog.09638209.js +7 -0
  53. package/dist/client/_nuxt/NDropdown.d94508d4.js +1 -0
  54. package/dist/client/_nuxt/NIcon.e9d8d4d5.js +1 -0
  55. package/dist/client/_nuxt/NIcon.vue.2481694f.js +1 -0
  56. package/dist/client/_nuxt/NLink.34fc60fd.js +1 -0
  57. package/dist/client/_nuxt/NLink.vue.17c2cd3a.js +1 -0
  58. package/dist/client/_nuxt/NRadio.a5c0205d.js +1 -0
  59. package/dist/client/_nuxt/NSwitch.4c2c96d6.js +1 -0
  60. package/dist/client/_nuxt/NSwitch.vue.36ec57ea.js +1 -0
  61. package/dist/client/_nuxt/NTextInput.3c1a9b08.js +1 -0
  62. package/dist/client/_nuxt/NTextInput.vue.2d3f9e19.js +1 -0
  63. package/dist/client/_nuxt/NTip.ff4fea4e.js +1 -0
  64. package/dist/client/_nuxt/Notification.f594eb13.js +1 -0
  65. package/dist/client/_nuxt/Notification.vue.b0304237.js +1 -0
  66. package/dist/client/_nuxt/NuxtContentLogo.1ca13565.js +1 -0
  67. package/dist/client/_nuxt/NuxtExampleLayout.904da69e.js +1 -0
  68. package/dist/client/_nuxt/NuxtLogo.acbeec62.js +1 -0
  69. package/dist/client/_nuxt/PluginItem.78f70695.js +1 -0
  70. package/dist/client/_nuxt/PluginItem.vue.a18a8580.js +1 -0
  71. package/dist/client/_nuxt/RoutePathItem.77ebd238.js +1 -0
  72. package/dist/client/_nuxt/RoutePathItem.vue.a16a2a5a.js +1 -0
  73. package/dist/client/_nuxt/RoutesTable.3a51b11e.js +1 -0
  74. package/dist/client/_nuxt/RoutesTable.vue.66423aa5.js +1 -0
  75. package/dist/client/_nuxt/SectionBlock.6bf10c9f.js +1 -0
  76. package/dist/client/_nuxt/SectionBlock.a75bb023.css +1 -0
  77. package/dist/client/_nuxt/Settings.ceefb680.js +1 -0
  78. package/dist/client/_nuxt/Settings.vue.6d6be237.js +1 -0
  79. package/dist/client/_nuxt/StateEditor.b25ca4bb.js +1 -0
  80. package/dist/client/_nuxt/StateEditor.f3649b84.css +1 -0
  81. package/dist/client/_nuxt/StateEditor.vue.4c95ce8f.js +135 -0
  82. package/dist/client/_nuxt/StateEditor.vue.94361847.js +1 -0
  83. package/dist/client/_nuxt/StateGroup.03356999.js +1 -0
  84. package/dist/client/_nuxt/StateGroup.vue.2dd6ea33.js +1 -0
  85. package/dist/client/_nuxt/TabIcon.0eec1314.js +1 -0
  86. package/dist/client/_nuxt/TabIcon.vue.8a3fdf6c.js +1 -0
  87. package/dist/client/_nuxt/UnoIcon.58399ac9.js +1 -0
  88. package/dist/client/_nuxt/__inspecting.06a43aaf.js +1 -0
  89. package/dist/client/_nuxt/_plugin-vue_export-helper.c27b6911.js +1 -0
  90. package/dist/client/_nuxt/app.config.a09258b3.js +1 -0
  91. package/dist/client/_nuxt/asyncData.0d07d609.js +1 -0
  92. package/dist/client/_nuxt/client-only.57dcb5bd.js +4 -0
  93. package/dist/client/_nuxt/client.ef9805ed.js +1 -0
  94. package/dist/client/_nuxt/color-mode-options.00c15dd1.js +1 -0
  95. package/dist/client/_nuxt/component.vue3.70214810.js +1 -0
  96. package/dist/client/_nuxt/components.238910b6.js +1 -0
  97. package/dist/client/_nuxt/components.bcdd3ff8.js +1 -0
  98. package/dist/client/_nuxt/components.client.73756aea.js +113 -0
  99. package/dist/client/_nuxt/composables.3d6ee8a2.js +1 -0
  100. package/dist/client/_nuxt/composables.7fd231ea.js +1 -0
  101. package/dist/client/_nuxt/context.dc73232e.js +1 -0
  102. package/dist/client/_nuxt/custom-_name_.3a92fd5f.js +1 -0
  103. package/dist/client/_nuxt/default.d86039a2.js +1 -0
  104. package/dist/client/_nuxt/dev-only.fb81821a.js +1 -0
  105. package/dist/client/_nuxt/editor.9a00fe97.js +1 -0
  106. package/dist/client/_nuxt/entry.1076cab0.js +1 -0
  107. package/dist/client/_nuxt/entry.53569115.css +1 -0
  108. package/dist/client/_nuxt/error-404.1469f10f.css +1 -0
  109. package/dist/client/_nuxt/error-404.f7be8ae4.js +1 -0
  110. package/dist/client/_nuxt/error-500.31030cf5.js +1 -0
  111. package/dist/client/_nuxt/error-500.92b94fae.css +1 -0
  112. package/dist/client/_nuxt/error-component.916ef420.js +3 -0
  113. package/dist/client/_nuxt/error.10b092f1.js +1 -0
  114. package/dist/client/_nuxt/fuse.esm.88e2763d.js +1 -0
  115. package/dist/client/_nuxt/hooks.03df1882.js +1 -0
  116. package/dist/client/_nuxt/icons.7b11eba5.js +1 -0
  117. package/dist/client/_nuxt/icons.d5925320.js +1 -0
  118. package/dist/client/_nuxt/icons.eca62571.js +1 -0
  119. package/dist/client/_nuxt/imports.0ab9b18e.js +1 -0
  120. package/dist/client/_nuxt/index.6cafd97e.js +1 -0
  121. package/dist/client/_nuxt/index.7c6751e3.js +1 -0
  122. package/dist/client/_nuxt/index.96e42b53.js +1 -0
  123. package/dist/client/_nuxt/index.a6656ecb.js +17 -0
  124. package/dist/client/_nuxt/index.adfbbcc3.js +1 -0
  125. package/dist/client/_nuxt/layout.50e89109.js +1 -0
  126. package/dist/client/_nuxt/layouts.22623cd4.js +1 -0
  127. package/dist/client/_nuxt/middleware.8875601d.js +1 -0
  128. package/dist/client/_nuxt/modules.4e9ddad7.js +1 -0
  129. package/dist/client/_nuxt/none.1c37aed4.js +1 -0
  130. package/dist/client/_nuxt/nuxt-error-boundary.fc4d7c25.js +1 -0
  131. package/dist/client/_nuxt/nuxt-link.724f8a66.js +1 -0
  132. package/dist/client/_nuxt/nuxt-loading-indicator.494ea32c.js +1 -0
  133. package/dist/client/_nuxt/overview.dca34e56.js +1 -0
  134. package/dist/client/_nuxt/page.8df04ed4.js +1 -0
  135. package/dist/client/_nuxt/pages.bdf1c147.js +1 -0
  136. package/dist/client/_nuxt/payload.8cf95895.js +1 -0
  137. package/dist/client/_nuxt/plugins.bb7d1e18.js +1 -0
  138. package/dist/client/_nuxt/rpc.65a41b65.js +1 -0
  139. package/dist/client/_nuxt/runtime-configs.e1c67255.js +1 -0
  140. package/dist/client/_nuxt/runtime-core.esm-bundler.5019e930.js +1 -0
  141. package/dist/client/_nuxt/runtime-dom.esm-bundler.b0076367.js +1 -0
  142. package/dist/client/_nuxt/server-placeholder.735ae8e9.js +1 -0
  143. package/dist/client/_nuxt/server-routes.ff745565.js +1 -0
  144. package/dist/client/_nuxt/state.5364a68a.js +1 -0
  145. package/dist/client/_nuxt/state.68f6a8e0.js +1 -0
  146. package/dist/client/_nuxt/storage.82519452.js +1 -0
  147. package/dist/client/_nuxt/unocss-runtime.cde2ffdd.js +2 -0
  148. package/dist/client/_nuxt/utils.3921fcc0.js +5 -0
  149. package/dist/client/_nuxt/utils.c2a3506b.js +1 -0
  150. package/dist/client/_nuxt/virtual-files.8b6129f7.js +9 -0
  151. package/dist/client/_nuxt/virtual-files.a8748389.css +1 -0
  152. package/dist/client/_nuxt/welcome.432c9232.js +1 -0
  153. package/dist/client/_nuxt/welcome.db724adb.css +1 -0
  154. package/dist/client/index.html +7 -0
  155. package/dist/client/modules/components/index.html +7 -0
  156. package/dist/client/modules/hooks/index.html +7 -0
  157. package/dist/client/modules/imports/index.html +7 -0
  158. package/dist/client/modules/layouts/index.html +7 -0
  159. package/dist/client/modules/middleware/index.html +7 -0
  160. package/dist/client/modules/modules/index.html +7 -0
  161. package/dist/client/modules/overview/index.html +7 -0
  162. package/dist/client/modules/pages/index.html +7 -0
  163. package/dist/client/modules/payload/index.html +7 -0
  164. package/dist/client/modules/plugins/index.html +7 -0
  165. package/dist/client/modules/runtime-configs/index.html +7 -0
  166. package/dist/client/modules/server-routes/index.html +7 -0
  167. package/dist/client/modules/virtual-files/index.html +7 -0
  168. package/dist/client/nuxt.svg +3 -0
  169. package/dist/dirs.d.ts +6 -0
  170. package/dist/dirs.mjs +9 -0
  171. package/dist/iframe-client.d.ts +13 -0
  172. package/dist/iframe-client.mjs +30 -0
  173. package/dist/module.cjs +5 -0
  174. package/dist/module.d.ts +33 -0
  175. package/dist/module.json +5 -0
  176. package/dist/module.mjs +6 -0
  177. package/dist/runtime/plugins/devtools.client.d.ts +2 -0
  178. package/dist/runtime/plugins/devtools.client.mjs +36 -0
  179. package/dist/runtime/plugins/view/Container.vue +95 -0
  180. package/dist/runtime/plugins/view/Frame.vue +270 -0
  181. package/dist/runtime/plugins/view/state.d.ts +10 -0
  182. package/dist/runtime/plugins/view/state.mjs +30 -0
  183. package/dist/runtime/plugins/view/utils.d.ts +4 -0
  184. package/dist/runtime/plugins/view/utils.mjs +39 -0
  185. package/dist/runtime/shared/hooks.d.ts +3 -0
  186. package/dist/runtime/shared/hooks.mjs +32 -0
  187. package/dist/shared/devtools.34d9e53a.mjs +68 -0
  188. package/dist/shared/devtools.7127abb3.mjs +4 -0
  189. package/dist/shared/devtools.8467d016.mjs +1504 -0
  190. package/dist/shared/devtools.861712a3.mjs +337 -0
  191. package/dist/types.d.ts +313 -0
  192. package/dist/types.mjs +1 -0
  193. package/iframe-client.d.ts +1 -0
  194. package/package.json +104 -2
  195. package/types.d.ts +1 -0
@@ -0,0 +1,337 @@
1
+ import require$$1 from 'path';
2
+ import require$$1$1 from 'os';
3
+ import require$$0__default from 'fs';
4
+
5
+ var globalDirs = {};
6
+
7
+ const { hasOwnProperty } = Object.prototype;
8
+
9
+ const eol = typeof process !== 'undefined' &&
10
+ process.platform === 'win32' ? '\r\n' : '\n';
11
+
12
+ const encode = (obj, opt) => {
13
+ const children = [];
14
+ let out = '';
15
+
16
+ if (typeof opt === 'string') {
17
+ opt = {
18
+ section: opt,
19
+ whitespace: false,
20
+ };
21
+ } else {
22
+ opt = opt || Object.create(null);
23
+ opt.whitespace = opt.whitespace === true;
24
+ }
25
+
26
+ const separator = opt.whitespace ? ' = ' : '=';
27
+
28
+ for (const k of Object.keys(obj)) {
29
+ const val = obj[k];
30
+ if (val && Array.isArray(val)) {
31
+ for (const item of val)
32
+ out += safe(k + '[]') + separator + safe(item) + '\n';
33
+ } else if (val && typeof val === 'object')
34
+ children.push(k);
35
+ else
36
+ out += safe(k) + separator + safe(val) + eol;
37
+ }
38
+
39
+ if (opt.section && out.length)
40
+ out = '[' + safe(opt.section) + ']' + eol + out;
41
+
42
+ for (const k of children) {
43
+ const nk = dotSplit(k).join('\\.');
44
+ const section = (opt.section ? opt.section + '.' : '') + nk;
45
+ const { whitespace } = opt;
46
+ const child = encode(obj[k], {
47
+ section,
48
+ whitespace,
49
+ });
50
+ if (out.length && child.length)
51
+ out += eol;
52
+
53
+ out += child;
54
+ }
55
+
56
+ return out
57
+ };
58
+
59
+ const dotSplit = str =>
60
+ str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
61
+ .replace(/\\\./g, '\u0001')
62
+ .split(/\./)
63
+ .map(part =>
64
+ part.replace(/\1/g, '\\.')
65
+ .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001'));
66
+
67
+ const decode = str => {
68
+ const out = Object.create(null);
69
+ let p = out;
70
+ let section = null;
71
+ // section |key = value
72
+ const re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
73
+ const lines = str.split(/[\r\n]+/g);
74
+
75
+ for (const line of lines) {
76
+ if (!line || line.match(/^\s*[;#]/))
77
+ continue
78
+ const match = line.match(re);
79
+ if (!match)
80
+ continue
81
+ if (match[1] !== undefined) {
82
+ section = unsafe(match[1]);
83
+ if (section === '__proto__') {
84
+ // not allowed
85
+ // keep parsing the section, but don't attach it.
86
+ p = Object.create(null);
87
+ continue
88
+ }
89
+ p = out[section] = out[section] || Object.create(null);
90
+ continue
91
+ }
92
+ const keyRaw = unsafe(match[2]);
93
+ const isArray = keyRaw.length > 2 && keyRaw.slice(-2) === '[]';
94
+ const key = isArray ? keyRaw.slice(0, -2) : keyRaw;
95
+ if (key === '__proto__')
96
+ continue
97
+ const valueRaw = match[3] ? unsafe(match[4]) : true;
98
+ const value = valueRaw === 'true' ||
99
+ valueRaw === 'false' ||
100
+ valueRaw === 'null' ? JSON.parse(valueRaw)
101
+ : valueRaw;
102
+
103
+ // Convert keys with '[]' suffix to an array
104
+ if (isArray) {
105
+ if (!hasOwnProperty.call(p, key))
106
+ p[key] = [];
107
+ else if (!Array.isArray(p[key]))
108
+ p[key] = [p[key]];
109
+ }
110
+
111
+ // safeguard against resetting a previously defined
112
+ // array by accidentally forgetting the brackets
113
+ if (Array.isArray(p[key]))
114
+ p[key].push(value);
115
+ else
116
+ p[key] = value;
117
+ }
118
+
119
+ // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
120
+ // use a filter to return the keys that have to be deleted.
121
+ const remove = [];
122
+ for (const k of Object.keys(out)) {
123
+ if (!hasOwnProperty.call(out, k) ||
124
+ typeof out[k] !== 'object' ||
125
+ Array.isArray(out[k]))
126
+ continue
127
+
128
+ // see if the parent section is also an object.
129
+ // if so, add it to that, and mark this one for deletion
130
+ const parts = dotSplit(k);
131
+ let p = out;
132
+ const l = parts.pop();
133
+ const nl = l.replace(/\\\./g, '.');
134
+ for (const part of parts) {
135
+ if (part === '__proto__')
136
+ continue
137
+ if (!hasOwnProperty.call(p, part) || typeof p[part] !== 'object')
138
+ p[part] = Object.create(null);
139
+ p = p[part];
140
+ }
141
+ if (p === out && nl === l)
142
+ continue
143
+
144
+ p[nl] = out[k];
145
+ remove.push(k);
146
+ }
147
+ for (const del of remove)
148
+ delete out[del];
149
+
150
+ return out
151
+ };
152
+
153
+ const isQuoted = val =>
154
+ (val.charAt(0) === '"' && val.slice(-1) === '"') ||
155
+ (val.charAt(0) === "'" && val.slice(-1) === "'");
156
+
157
+ const safe = val =>
158
+ (typeof val !== 'string' ||
159
+ val.match(/[=\r\n]/) ||
160
+ val.match(/^\[/) ||
161
+ (val.length > 1 &&
162
+ isQuoted(val)) ||
163
+ val !== val.trim())
164
+ ? JSON.stringify(val)
165
+ : val.replace(/;/g, '\\;').replace(/#/g, '\\#');
166
+
167
+ const unsafe = (val, doUnesc) => {
168
+ val = (val || '').trim();
169
+ if (isQuoted(val)) {
170
+ // remove the single quotes before calling JSON.parse
171
+ if (val.charAt(0) === "'")
172
+ val = val.substr(1, val.length - 2);
173
+
174
+ try {
175
+ val = JSON.parse(val);
176
+ } catch (_) {}
177
+ } else {
178
+ // walk the val to find the first not-escaped ; character
179
+ let esc = false;
180
+ let unesc = '';
181
+ for (let i = 0, l = val.length; i < l; i++) {
182
+ const c = val.charAt(i);
183
+ if (esc) {
184
+ if ('\\;#'.indexOf(c) !== -1)
185
+ unesc += c;
186
+ else
187
+ unesc += '\\' + c;
188
+
189
+ esc = false;
190
+ } else if (';#'.indexOf(c) !== -1)
191
+ break
192
+ else if (c === '\\')
193
+ esc = true;
194
+ else
195
+ unesc += c;
196
+ }
197
+ if (esc)
198
+ unesc += '\\';
199
+
200
+ return unesc.trim()
201
+ }
202
+ return val
203
+ };
204
+
205
+ var ini = {
206
+ parse: decode,
207
+ decode,
208
+ stringify: encode,
209
+ encode,
210
+ safe,
211
+ unsafe,
212
+ };
213
+
214
+ (function (exports) {
215
+ const path = require$$1;
216
+ const os = require$$1$1;
217
+ const fs = require$$0__default;
218
+ const ini$1 = ini;
219
+
220
+ const isWindows = process.platform === 'win32';
221
+
222
+ const readRc = filePath => {
223
+ try {
224
+ return ini$1.parse(fs.readFileSync(filePath, 'utf8')).prefix;
225
+ } catch {}
226
+ };
227
+
228
+ const getEnvNpmPrefix = () => {
229
+ // TODO: Remove the `.reduce` call.
230
+ // eslint-disable-next-line unicorn/no-array-reduce
231
+ return Object.keys(process.env).reduce((prefix, name) => {
232
+ return /^npm_config_prefix$/i.test(name) ? process.env[name] : prefix;
233
+ }, undefined);
234
+ };
235
+
236
+ const getGlobalNpmrc = () => {
237
+ if (isWindows && process.env.APPDATA) {
238
+ // Hardcoded contents of `c:\Program Files\nodejs\node_modules\npm\npmrc`
239
+ return path.join(process.env.APPDATA, '/npm/etc/npmrc');
240
+ }
241
+
242
+ // Homebrew special case: `$(brew --prefix)/lib/node_modules/npm/npmrc`
243
+ if (process.execPath.includes('/Cellar/node')) {
244
+ const homebrewPrefix = process.execPath.slice(0, process.execPath.indexOf('/Cellar/node'));
245
+ return path.join(homebrewPrefix, '/lib/node_modules/npm/npmrc');
246
+ }
247
+
248
+ if (process.execPath.endsWith('/bin/node')) {
249
+ const installDir = path.dirname(path.dirname(process.execPath));
250
+ return path.join(installDir, '/etc/npmrc');
251
+ }
252
+ };
253
+
254
+ const getDefaultNpmPrefix = () => {
255
+ if (isWindows) {
256
+ const {APPDATA} = process.env;
257
+ // `c:\node\node.exe` → `prefix=c:\node\`
258
+ return APPDATA ? path.join(APPDATA, 'npm') : path.dirname(process.execPath);
259
+ }
260
+
261
+ // `/usr/local/bin/node` → `prefix=/usr/local`
262
+ return path.dirname(path.dirname(process.execPath));
263
+ };
264
+
265
+ const getNpmPrefix = () => {
266
+ const envPrefix = getEnvNpmPrefix();
267
+ if (envPrefix) {
268
+ return envPrefix;
269
+ }
270
+
271
+ const homePrefix = readRc(path.join(os.homedir(), '.npmrc'));
272
+ if (homePrefix) {
273
+ return homePrefix;
274
+ }
275
+
276
+ if (process.env.PREFIX) {
277
+ return process.env.PREFIX;
278
+ }
279
+
280
+ const globalPrefix = readRc(getGlobalNpmrc());
281
+ if (globalPrefix) {
282
+ return globalPrefix;
283
+ }
284
+
285
+ return getDefaultNpmPrefix();
286
+ };
287
+
288
+ const npmPrefix = path.resolve(getNpmPrefix());
289
+
290
+ const getYarnWindowsDirectory = () => {
291
+ if (isWindows && process.env.LOCALAPPDATA) {
292
+ const dir = path.join(process.env.LOCALAPPDATA, 'Yarn');
293
+ if (fs.existsSync(dir)) {
294
+ return dir;
295
+ }
296
+ }
297
+
298
+ return false;
299
+ };
300
+
301
+ const getYarnPrefix = () => {
302
+ if (process.env.PREFIX) {
303
+ return process.env.PREFIX;
304
+ }
305
+
306
+ const windowsPrefix = getYarnWindowsDirectory();
307
+ if (windowsPrefix) {
308
+ return windowsPrefix;
309
+ }
310
+
311
+ const configPrefix = path.join(os.homedir(), '.config/yarn');
312
+ if (fs.existsSync(configPrefix)) {
313
+ return configPrefix;
314
+ }
315
+
316
+ const homePrefix = path.join(os.homedir(), '.yarn-config');
317
+ if (fs.existsSync(homePrefix)) {
318
+ return homePrefix;
319
+ }
320
+
321
+ // Yarn supports the npm conventions but the inverse is not true
322
+ return npmPrefix;
323
+ };
324
+
325
+ exports.npm = {};
326
+ exports.npm.prefix = npmPrefix;
327
+ exports.npm.packages = path.join(npmPrefix, isWindows ? 'node_modules' : 'lib/node_modules');
328
+ exports.npm.binaries = isWindows ? npmPrefix : path.join(npmPrefix, 'bin');
329
+
330
+ const yarnPrefix = path.resolve(getYarnPrefix());
331
+ exports.yarn = {};
332
+ exports.yarn.prefix = yarnPrefix;
333
+ exports.yarn.packages = path.join(yarnPrefix, getYarnWindowsDirectory() ? 'Data/global/node_modules' : 'global/node_modules');
334
+ exports.yarn.binaries = path.join(exports.yarn.packages, '.bin');
335
+ } (globalDirs));
336
+
337
+ export { globalDirs as g };
@@ -0,0 +1,313 @@
1
+ import { Nuxt, NuxtOptions, Component, NuxtPage, NuxtLayout, AppConfig } from '@nuxt/schema';
2
+ import { Import, UnimportMeta } from 'unimport';
3
+ import { NuxtApp } from 'nuxt/dist/app/nuxt';
4
+ import { RouteRecordNormalized } from 'vue-router';
5
+ import { VueInspectorClient } from 'vite-plugin-vue-inspector';
6
+ import { Hookable } from 'hookable';
7
+ import { BirpcReturn } from 'birpc';
8
+ import { VNode } from 'vue';
9
+
10
+ declare function enablePages(nuxt: Nuxt): Promise<void>;
11
+
12
+ declare const wizard: {
13
+ enablePages: typeof enablePages;
14
+ };
15
+ type Wizard = typeof wizard;
16
+ type WizardActions = keyof Wizard;
17
+ type WizardArgs<T extends WizardActions> = Wizard[T] extends (nuxt: any, ...args: infer A) => any ? A : never;
18
+
19
+ interface ModuleOptions {
20
+ /**
21
+ * Enable DevTools
22
+ *
23
+ * @default true
24
+ */
25
+ enabled?: boolean;
26
+ /**
27
+ * VS Code Server integration options.
28
+ */
29
+ vscode?: VSCodeIntegrationOptions;
30
+ }
31
+ interface ModuleGlobalOptions {
32
+ /**
33
+ * List of projects to enable devtools for. Only works when devtools is installed globally.
34
+ */
35
+ projects?: string[];
36
+ }
37
+ interface ServerFunctions {
38
+ getServerConfig(): NuxtOptions;
39
+ getComponents(): Component[];
40
+ getComponentsRelationships(): Promise<ComponentRelationship[]>;
41
+ getAutoImports(): AutoImportsWithMetadata;
42
+ getServerPages(): NuxtPage[];
43
+ getCustomTabs(): ModuleCustomTab[];
44
+ getServerHooks(): HookInfo[];
45
+ getServerLayouts(): NuxtLayout[];
46
+ usePackageVersions(): UpdateInfo[];
47
+ customTabAction(name: string, action: number): Promise<boolean>;
48
+ runWizard<T extends WizardActions>(name: T, ...args: WizardArgs<T>): Promise<void>;
49
+ openInEditor(filepath: string): void;
50
+ }
51
+ interface UpdateInfo {
52
+ name: string;
53
+ current: string;
54
+ latest?: string;
55
+ needsUpdate?: boolean;
56
+ }
57
+ interface AutoImportsWithMetadata {
58
+ imports: Import[];
59
+ metadata?: UnimportMeta;
60
+ }
61
+ type ClientUpdateEvent = keyof ServerFunctions;
62
+ interface ClientFunctions {
63
+ refresh(event: ClientUpdateEvent): void;
64
+ }
65
+ interface RouteInfo extends Pick<RouteRecordNormalized, 'name' | 'path' | 'meta' | 'props' | 'children'> {
66
+ file?: string;
67
+ }
68
+ interface Payload {
69
+ url: string;
70
+ time: number;
71
+ data?: Record<string, any>;
72
+ state?: Record<string, any>;
73
+ functions?: Record<string, any>;
74
+ }
75
+ interface BasicModuleInfo {
76
+ entryPath?: string;
77
+ meta?: {
78
+ name?: string;
79
+ };
80
+ }
81
+ interface ModuleMetric {
82
+ name: string;
83
+ description: string;
84
+ repo: string;
85
+ npm: string;
86
+ icon?: string;
87
+ github: string;
88
+ website: string;
89
+ learn_more: string;
90
+ category: string;
91
+ type: ModuleType;
92
+ maintainers: MaintainerInfo[];
93
+ contributors: GitHubContributor[];
94
+ compatibility: ModuleCompatibility;
95
+ }
96
+ interface ModuleCompatibility {
97
+ nuxt: string;
98
+ requires: {
99
+ bridge?: boolean | 'optional';
100
+ };
101
+ }
102
+ type CompatibilityStatus = 'working' | 'wip' | 'unknown' | 'not-working';
103
+ type ModuleType = 'community' | 'official' | '3rd-party';
104
+ interface MaintainerInfo {
105
+ name: string;
106
+ github: string;
107
+ twitter?: string;
108
+ }
109
+ interface GitHubContributor {
110
+ login: string;
111
+ name?: string;
112
+ avatar_url?: string;
113
+ }
114
+ interface ModuleCustomTab {
115
+ /**
116
+ * The name of the tab, must be unique
117
+ */
118
+ name: string;
119
+ /**
120
+ * Icon of the tab, support any Iconify icons, or a url to an image
121
+ */
122
+ icon?: string;
123
+ /**
124
+ * Title of the tab
125
+ */
126
+ title: string;
127
+ /**
128
+ * Main view of the tab
129
+ */
130
+ view: ModuleView;
131
+ /**
132
+ * Insert static vnode to the tab entry
133
+ *
134
+ * Advanced options. You don't usually need this.
135
+ */
136
+ extraTabVNode?: VNode;
137
+ }
138
+ interface ModuleLaunchView {
139
+ /**
140
+ * A view for module to lazy launch some actions
141
+ */
142
+ type: 'launch';
143
+ title?: string;
144
+ icon?: string;
145
+ description: string;
146
+ /**
147
+ * Action buttons
148
+ */
149
+ actions: ModuleLaunchAction[];
150
+ }
151
+ interface ModuleIframeView {
152
+ /**
153
+ * Iframe view
154
+ */
155
+ type: 'iframe';
156
+ /**
157
+ * Url of the iframe
158
+ */
159
+ src: string;
160
+ /**
161
+ * Persist the iframe instance even if the tab is not active
162
+ *
163
+ * @default true
164
+ */
165
+ persistent?: boolean;
166
+ }
167
+ interface ModuleVNodeView {
168
+ /**
169
+ * Vue's VNode view
170
+ */
171
+ type: 'vnode';
172
+ /**
173
+ * Send vnode to the client, they must be static and serializable
174
+ *
175
+ * Call `nuxt.hook('devtools:customTabs:refresh')` to trigger manual refresh
176
+ */
177
+ vnode: VNode;
178
+ }
179
+ interface ModuleLaunchAction {
180
+ /**
181
+ * Label of the action button
182
+ */
183
+ label: string;
184
+ /**
185
+ * Additional HTML attributes to the action button
186
+ */
187
+ attrs?: Record<string, string>;
188
+ /**
189
+ * Indicate if the action is pending, will show a loading indicator and disable the button
190
+ */
191
+ pending?: boolean;
192
+ /**
193
+ * Function to handle the action, this is executed on the server side.
194
+ * Will automatically refresh the tabs after the action is resolved.
195
+ */
196
+ handle?: () => void | Promise<void>;
197
+ /**
198
+ * Treat the action as a link, will open the link in a new tab
199
+ */
200
+ src?: string;
201
+ }
202
+ type ModuleView = ModuleIframeView | ModuleLaunchView | ModuleVNodeView;
203
+ interface ModuleIframeTabLazyOptions {
204
+ description?: string;
205
+ onLoad?: () => Promise<void>;
206
+ }
207
+ interface ModuleBuiltinTab {
208
+ name: string;
209
+ icon?: string;
210
+ title?: string;
211
+ path?: string;
212
+ requireClient?: boolean;
213
+ }
214
+ type ModuleTabInfo = ModuleCustomTab | ModuleBuiltinTab;
215
+ interface HookInfo {
216
+ name: string;
217
+ start: number;
218
+ end?: number;
219
+ duration?: number;
220
+ listeners: number;
221
+ executions: number[];
222
+ }
223
+ type VueInspectorData = VueInspectorClient['linkParams'] & VueInspectorClient['position'];
224
+ interface NuxtDevtoolsClientHooks {
225
+ /**
226
+ * When the devtools navigates, used for persisting the current tab
227
+ */
228
+ 'devtools:navigate': (path: string) => void;
229
+ /**
230
+ * Event emitted when the component inspector is updated
231
+ */
232
+ 'host:inspector:update': (data: VueInspectorData) => void;
233
+ /**
234
+ * Event emitted when the component inspector is clicked
235
+ */
236
+ 'host:inspector:click': (baseUrl: string, file: string, line: number, column: number) => void;
237
+ /**
238
+ * Event to close the component inspector
239
+ */
240
+ 'host:inspector:close': () => void;
241
+ /**
242
+ * Triggers reactivity manually, since Vue won't be reactive across frames)
243
+ */
244
+ 'host:update:reactivity': () => void;
245
+ }
246
+ /**
247
+ * Host client from the App
248
+ */
249
+ interface NuxtDevtoolsHostClient {
250
+ nuxt: NuxtApp;
251
+ appConfig: AppConfig;
252
+ getHooksMetrics(): HookInfo[];
253
+ hooks: Hookable<NuxtDevtoolsClientHooks>;
254
+ inspector?: {
255
+ instance?: VueInspectorClient;
256
+ enable: () => void;
257
+ };
258
+ closeDevTools(): void;
259
+ }
260
+ interface NuxtDevtoolsClient {
261
+ rpc: BirpcReturn<ServerFunctions>;
262
+ }
263
+ interface NuxtDevtoolsIframeClient {
264
+ host: NuxtDevtoolsHostClient;
265
+ devtools: NuxtDevtoolsClient;
266
+ }
267
+ interface NuxtDevtoolsGlobal {
268
+ setClient(client: NuxtDevtoolsHostClient): void;
269
+ }
270
+ interface DevToolsFrameState {
271
+ width: number;
272
+ height: number;
273
+ bottom: number;
274
+ left: number;
275
+ open: boolean;
276
+ route: string;
277
+ position: 'left' | 'right' | 'bottom' | 'top';
278
+ }
279
+ interface DevToolsUISettings {
280
+ customTabs: boolean;
281
+ componentsView: 'list' | 'graph';
282
+ componentsGraphShowNodeModules: boolean;
283
+ componentsGraphShowPages: boolean;
284
+ componentsGraphShowLayouts: boolean;
285
+ }
286
+ interface ComponentRelationship {
287
+ id: string;
288
+ deps: string[];
289
+ }
290
+ interface VSCodeIntegrationOptions {
291
+ /**
292
+ * Enable VS Code Server integration
293
+ */
294
+ enabled?: boolean;
295
+ /**
296
+ * Start VS Code Server on boot
297
+ *
298
+ * @default false
299
+ */
300
+ startOnBoot?: boolean;
301
+ /**
302
+ * Port to start VS Code Server
303
+ *
304
+ * @default 3080
305
+ */
306
+ port?: number;
307
+ /**
308
+ * Reuse existing server if available (same port)
309
+ */
310
+ reuseExistingServer?: boolean;
311
+ }
312
+
313
+ export { AutoImportsWithMetadata, BasicModuleInfo, ClientFunctions, ClientUpdateEvent, CompatibilityStatus, ComponentRelationship, DevToolsFrameState, DevToolsUISettings, GitHubContributor, HookInfo, MaintainerInfo, ModuleBuiltinTab, ModuleCompatibility, ModuleCustomTab, ModuleGlobalOptions, ModuleIframeTabLazyOptions, ModuleIframeView, ModuleLaunchAction, ModuleLaunchView, ModuleMetric, ModuleOptions, ModuleTabInfo, ModuleType, ModuleVNodeView, ModuleView, NuxtDevtoolsClient, NuxtDevtoolsClientHooks, NuxtDevtoolsGlobal, NuxtDevtoolsHostClient, NuxtDevtoolsIframeClient, Payload, RouteInfo, ServerFunctions, UpdateInfo, VSCodeIntegrationOptions, VueInspectorData };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ export * from './dist/iframe-client'