@vitejs/devtools 0.1.5 → 0.1.9
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.
- package/dist/{DockIcon-DNt-Vqy4.js → DockIcon-7v-JouW5.js} +27 -27
- package/dist/DockStandalone-DZ0INpRC.js +3246 -0
- package/dist/{LogItem-CZM2G41b.js → LogItem-Ca0SsU39.js} +23 -20
- package/dist/{ViewBuiltinLogs-1ABRTwzd.js → ViewBuiltinLogs-B_CLlali.js} +39 -39
- package/dist/{ViewBuiltinTerminals-Co7G-321.js → ViewBuiltinTerminals-ZrMObMte.js} +10 -11
- package/dist/{ViewJsonRender-ByPfpKFM.js → ViewJsonRender-Cc5BPfnv.js} +4 -4
- package/dist/auth-state-DXCxEqSd.js +54 -0
- package/dist/build-static-zB8LrlMJ.js +49 -0
- package/dist/cli-commands.js +57 -2
- package/dist/cli.js +8 -4
- package/dist/client/inject.js +231 -27
- package/dist/client/standalone/assets/DockStandalone-BUOgWTCb.js +1 -0
- package/dist/client/standalone/assets/LogItem-BnVhub2j.js +1 -0
- package/dist/client/standalone/assets/ViewBuiltinLogs-rU-E-8qT.js +1 -0
- package/dist/client/standalone/assets/{ViewBuiltinTerminals-UrMq7UXM.js → ViewBuiltinTerminals-UWfUyC_P.js} +2 -2
- package/dist/client/standalone/assets/{ViewJsonRender-BURuu55Z.js → ViewJsonRender-De5eeIha.js} +3 -3
- package/dist/client/standalone/assets/dist-CAaP5Isp.js +1 -0
- package/dist/client/standalone/assets/iconify-C-CPDXMf.js +2 -0
- package/dist/client/standalone/assets/index-DtZFMvER.css +1 -0
- package/dist/client/standalone/assets/index-hQ4JAD5S.js +3 -0
- package/dist/client/standalone/assets/runtime-core.esm-bundler-Bvz2jy0O.js +1 -0
- package/dist/client/standalone/index.html +6 -5
- package/dist/client/webcomponents.d.ts +1 -21628
- package/dist/client/webcomponents.js +54 -51
- package/dist/config.js +1 -1
- package/dist/constants-DfEeYo9W.js +142 -0
- package/dist/{plugins-DiuKIPkS.js → context-DmXts6Ac.js} +116 -673
- package/dist/{dist-D2Z6bwqJ.js → dist-CCdqIez-.js} +128 -5
- package/dist/dist-DpLy3ojW.js +229 -0
- package/dist/index.d.ts +43 -3
- package/dist/index.js +3 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/plugins-vfc-N600.js +59 -0
- package/dist/{popup-BUPO6e0I.js → popup-DcuzpgO2.js} +114 -55
- package/dist/server-C54I1zbj.js +2 -0
- package/dist/server-DH39-LHL.js +50 -0
- package/dist/server-DSh-GQIq.js +188 -0
- package/dist/standalone-w_GYdx1T.js +33 -0
- package/dist/static-dump-BqRb_x-O.js +65 -0
- package/package.json +12 -15
- package/dist/DockStandalone-DxFEMDp2.js +0 -1256
- package/dist/cli-commands-CnJ4eqDp.js +0 -180
- package/dist/client/standalone/assets/DockStandalone-C8ChyZLh.js +0 -1
- package/dist/client/standalone/assets/LogItem-Mx4UyReX.js +0 -1
- package/dist/client/standalone/assets/ViewBuiltinLogs-C4j4vgSn.js +0 -1
- package/dist/client/standalone/assets/dist-DIlAYcjk.js +0 -1
- package/dist/client/standalone/assets/index-BEyoIK7m.css +0 -1
- package/dist/client/standalone/assets/index-Rpv7PwRD.js +0 -4
- package/dist/client/standalone/assets/runtime-core.esm-bundler-CJlaYmKv.js +0 -1
- package/dist/vue.runtime.esm-bundler-CS1wMbap.js +0 -6988
- /package/dist/{context-internal-CvIHbZq4.js → context-internal-DZpoJjMz.js} +0 -0
- /package/dist/{context-internal-Du6FuGIu.d.ts → context-internal-Ys7Zu3q3.d.ts} +0 -0
- /package/dist/{iconify-BW79QmbD.js → iconify-JodklND-.js} +0 -0
- /package/dist/{utils-DaaVwEUH.js → utils-HWI9S6d-.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { s as useTimeAgo } from "./dist-CCdqIez-.js";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, reactive, renderList, renderSlot, toDisplayString, unref } from "vue";
|
|
3
3
|
//#region src/client/webcomponents/state/toasts.ts
|
|
4
4
|
const toasts = reactive([]);
|
|
5
5
|
const timers = /* @__PURE__ */ new Map();
|
|
@@ -154,16 +154,17 @@ const _hoisted_2 = {
|
|
|
154
154
|
key: 0,
|
|
155
155
|
class: "flex-none mt-0.5 border-2 border-current border-t-transparent rounded-full animate-spin op50 w-4 h-4"
|
|
156
156
|
};
|
|
157
|
-
const _hoisted_3 = { class: "flex-1 min-w-0" };
|
|
158
|
-
const _hoisted_4 = {
|
|
157
|
+
const _hoisted_3 = { class: "flex-1 min-w-0 space-y-0.5" };
|
|
158
|
+
const _hoisted_4 = { class: "flex items-center gap-2" };
|
|
159
|
+
const _hoisted_5 = ["title"];
|
|
160
|
+
const _hoisted_6 = {
|
|
159
161
|
key: 0,
|
|
160
|
-
class: "text-xs op80
|
|
162
|
+
class: "text-xs op80 whitespace-pre-wrap"
|
|
161
163
|
};
|
|
162
|
-
const
|
|
164
|
+
const _hoisted_7 = {
|
|
163
165
|
key: 1,
|
|
164
|
-
class: "flex items-center gap-2
|
|
166
|
+
class: "flex flex-wrap items-center gap-x-2 gap-y-0.5"
|
|
165
167
|
};
|
|
166
|
-
const _hoisted_6 = ["title"];
|
|
167
168
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
168
169
|
__name: "LogItem",
|
|
169
170
|
props: {
|
|
@@ -175,15 +176,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
175
176
|
const timeAgo = useTimeAgo(() => props.entry.timestamp);
|
|
176
177
|
return (_ctx, _cache) => {
|
|
177
178
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
178
|
-
|
|
179
|
+
createElementVNode("div", { class: normalizeClass(["w-2px flex-none absolute left-0 top-4px bottom-4px rounded-r", [unref(levels)[__props.entry.level]?.bg || "bg-gray"]]) }, null, 2),
|
|
179
180
|
__props.entry.status === "loading" ? (openBlock(), createElementBlock("div", _hoisted_2)) : (openBlock(), createElementBlock("div", {
|
|
180
181
|
key: 1,
|
|
181
182
|
class: normalizeClass(["flex-none mt-0.5 w-4 h-4", [unref(levels)[__props.entry.level]?.icon, unref(levels)[__props.entry.level]?.color]])
|
|
182
183
|
}, null, 2)),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
createElementVNode("div", _hoisted_3, [
|
|
185
|
+
createElementVNode("div", _hoisted_4, [
|
|
186
|
+
createElementVNode("div", { class: normalizeClass(["flex-1 min-w-0 truncate text-sm font-medium", [__props.entry.status === "loading" ? "op60" : ""]]) }, toDisplayString(__props.entry.message), 3),
|
|
187
|
+
!__props.compact ? (openBlock(), createElementBlock("span", {
|
|
188
|
+
key: 0,
|
|
189
|
+
class: "text-xs op40 flex-none",
|
|
190
|
+
title: new Date(__props.entry.timestamp).toLocaleString()
|
|
191
|
+
}, toDisplayString(unref(timeAgo)), 9, _hoisted_5)) : createCommentVNode("v-if", true),
|
|
192
|
+
renderSlot(_ctx.$slots, "actions")
|
|
193
|
+
]),
|
|
194
|
+
__props.entry.description ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(__props.entry.description), 1)) : createCommentVNode("v-if", true),
|
|
195
|
+
!__props.compact ? (openBlock(), createElementBlock("div", _hoisted_7, [__props.entry.category ? (openBlock(), createBlock(_sfc_main$1, {
|
|
187
196
|
key: 0,
|
|
188
197
|
label: __props.entry.category
|
|
189
198
|
}, null, 8, ["label"])) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.entry.labels, (label) => {
|
|
@@ -192,13 +201,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
192
201
|
label
|
|
193
202
|
}, null, 8, ["label"]);
|
|
194
203
|
}), 128))])) : createCommentVNode("v-if", true)
|
|
195
|
-
])
|
|
196
|
-
!__props.compact ? (openBlock(), createElementBlock("span", {
|
|
197
|
-
key: 2,
|
|
198
|
-
class: "text-xs op40 flex-none",
|
|
199
|
-
title: new Date(__props.entry.timestamp).toLocaleString()
|
|
200
|
-
}, toDisplayString(unref(timeAgo)), 9, _hoisted_6)) : createCommentVNode("v-if", true),
|
|
201
|
-
renderSlot(_ctx.$slots, "actions")
|
|
204
|
+
])
|
|
202
205
|
]);
|
|
203
206
|
};
|
|
204
207
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as
|
|
3
|
-
import {
|
|
1
|
+
import { s as useTimeAgo } from "./dist-CCdqIez-.js";
|
|
2
|
+
import { a as levels, i as getHashColorFromString, n as _sfc_main$3, o as markLogsAsRead, r as formEntries, s as useLogs, t as _sfc_main$2 } from "./LogItem-Ca0SsU39.js";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, toDisplayString, unref, vModelText, withCtx, withDirectives, withModifiers } from "vue";
|
|
4
4
|
//#region src/client/webcomponents/components/display/FilterToggles.vue
|
|
5
5
|
const _hoisted_1$1 = { class: "text-xs op40" };
|
|
6
6
|
const _hoisted_2$1 = { class: "flex flex-wrap items-center gap-0.5" };
|
|
@@ -17,7 +17,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
emits: ["toggle"],
|
|
18
18
|
setup(__props) {
|
|
19
19
|
return (_ctx, _cache) => {
|
|
20
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
20
|
+
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("span", _hoisted_1$1, toDisplayString(__props.label), 1), createElementVNode("div", _hoisted_2$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
21
21
|
return openBlock(), createElementBlock("button", {
|
|
22
22
|
key: item,
|
|
23
23
|
class: normalizeClass(["px-1.5 py-0.5 rounded text-xs flex items-center gap-0.5 hover:bg-active transition", [__props.active.size === 0 || __props.active.has(item) ? __props.styles?.[item]?.color || "" : "op30"]]),
|
|
@@ -29,7 +29,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
}, [__props.styles?.[item]?.icon ? (openBlock(), createElementBlock("div", {
|
|
30
30
|
key: 0,
|
|
31
31
|
class: normalizeClass([__props.styles[item].icon, "w-3.5 h-3.5"])
|
|
32
|
-
}, null, 2)) : createCommentVNode("v-if", true),
|
|
32
|
+
}, null, 2)) : createCommentVNode("v-if", true), createElementVNode("span", null, toDisplayString(__props.styles?.[item]?.label || item), 1)], 14, _hoisted_3$1);
|
|
33
33
|
}), 128))])], 64);
|
|
34
34
|
};
|
|
35
35
|
}
|
|
@@ -245,44 +245,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
245
245
|
return (_ctx, _cache) => {
|
|
246
246
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
247
247
|
createCommentVNode(" Toolbar "),
|
|
248
|
-
|
|
248
|
+
createElementVNode("div", _hoisted_2, [
|
|
249
249
|
createCommentVNode(" Row 1: Search + sort + actions "),
|
|
250
|
-
|
|
251
|
-
withDirectives(
|
|
250
|
+
createElementVNode("div", _hoisted_3, [
|
|
251
|
+
withDirectives(createElementVNode("input", {
|
|
252
252
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
253
253
|
type: "text",
|
|
254
254
|
placeholder: "Search logs...",
|
|
255
255
|
class: "bg-transparent border border-base rounded px-2 py-0.5 text-xs w-48 outline-none focus:border-purple"
|
|
256
256
|
}, null, 512), [[vModelText, search.value]]),
|
|
257
|
-
|
|
257
|
+
createElementVNode("button", {
|
|
258
258
|
class: "flex items-center gap-0.5 op50 hover:op100 p-1 rounded hover:bg-active transition",
|
|
259
259
|
title: sortLabels[sortBy.value],
|
|
260
260
|
onClick: cycleSortMode
|
|
261
|
-
}, [
|
|
262
|
-
_cache[7] || (_cache[7] =
|
|
261
|
+
}, [createElementVNode("div", { class: normalizeClass([sortIcons[sortBy.value], "w-4 h-4"]) }, null, 2)], 8, _hoisted_4),
|
|
262
|
+
_cache[7] || (_cache[7] = createElementVNode("div", { class: "flex-1" }, null, -1)),
|
|
263
263
|
filteredEntries.value.length !== unref(logsState).entries.length ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(filteredEntries.value.length) + "/" + toDisplayString(unref(logsState).entries.length), 1)) : createCommentVNode("v-if", true),
|
|
264
264
|
hasActiveFilter.value ? (openBlock(), createElementBlock("button", {
|
|
265
265
|
key: 1,
|
|
266
266
|
class: "text-xs op50 hover:op100 px-1.5 py-0.5 hover:bg-active rounded transition flex items-center gap-0.5",
|
|
267
267
|
title: "Reset all filters",
|
|
268
268
|
onClick: resetFilters
|
|
269
|
-
}, [..._cache[4] || (_cache[4] = [
|
|
269
|
+
}, [..._cache[4] || (_cache[4] = [createElementVNode("div", { class: "i-ph:funnel-x-duotone w-3.5 h-3.5" }, null, -1), createTextVNode(" Reset Filters ", -1)])])) : createCommentVNode("v-if", true),
|
|
270
270
|
hasActiveFilter.value ? (openBlock(), createElementBlock("div", _hoisted_6)) : createCommentVNode("v-if", true),
|
|
271
271
|
hasActiveFilter.value && filteredEntries.value.length > 0 ? (openBlock(), createElementBlock("button", {
|
|
272
272
|
key: 3,
|
|
273
273
|
class: "text-xs op50 hover:op100 px-1.5 py-0.5 hover:bg-active rounded transition flex items-center gap-0.5",
|
|
274
274
|
title: "Dismiss all matching the current filter",
|
|
275
275
|
onClick: dismissFiltered
|
|
276
|
-
}, [..._cache[5] || (_cache[5] = [
|
|
276
|
+
}, [..._cache[5] || (_cache[5] = [createElementVNode("div", { class: "i-ph:trash-duotone w-3.5 h-3.5" }, null, -1), createTextVNode(" Dismiss filtered ", -1)])])) : createCommentVNode("v-if", true),
|
|
277
277
|
!hasActiveFilter.value && unref(logsState).entries.length > 0 ? (openBlock(), createElementBlock("button", {
|
|
278
278
|
key: 4,
|
|
279
279
|
class: "text-xs op50 hover:op100 px-1.5 py-0.5 hover:bg-active rounded transition flex items-center gap-0.5",
|
|
280
280
|
title: "Dismiss all logs",
|
|
281
281
|
onClick: clearAll
|
|
282
|
-
}, [..._cache[6] || (_cache[6] = [
|
|
282
|
+
}, [..._cache[6] || (_cache[6] = [createElementVNode("div", { class: "i-ph:trash-duotone w-3.5 h-3.5" }, null, -1), createTextVNode(" Dismiss all ", -1)])])) : createCommentVNode("v-if", true)
|
|
283
283
|
]),
|
|
284
284
|
createCommentVNode(" Row 2: Level + source + category + label filters "),
|
|
285
|
-
|
|
285
|
+
createElementVNode("div", _hoisted_7, [
|
|
286
286
|
createVNode(_sfc_main$1, {
|
|
287
287
|
label: "Level",
|
|
288
288
|
items: unref(allLevels),
|
|
@@ -294,7 +294,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
294
294
|
"active",
|
|
295
295
|
"styles"
|
|
296
296
|
]),
|
|
297
|
-
_cache[10] || (_cache[10] =
|
|
297
|
+
_cache[10] || (_cache[10] = createElementVNode("div", { class: "border-l border-base h-4 mx-0.5" }, null, -1)),
|
|
298
298
|
createVNode(_sfc_main$1, {
|
|
299
299
|
label: "From",
|
|
300
300
|
items: unref(allFroms),
|
|
@@ -307,7 +307,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
307
307
|
"styles",
|
|
308
308
|
"onToggle"
|
|
309
309
|
]),
|
|
310
|
-
allCategories.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[8] || (_cache[8] =
|
|
310
|
+
allCategories.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[8] || (_cache[8] = createElementVNode("div", { class: "border-l border-base h-4 mx-1" }, null, -1)), createVNode(_sfc_main$1, {
|
|
311
311
|
label: "Category",
|
|
312
312
|
items: allCategories.value,
|
|
313
313
|
active: activeCategories.value,
|
|
@@ -318,7 +318,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
318
318
|
"active",
|
|
319
319
|
"hash-color"
|
|
320
320
|
])], 64)) : createCommentVNode("v-if", true),
|
|
321
|
-
allLabels.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[9] || (_cache[9] =
|
|
321
|
+
allLabels.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[9] || (_cache[9] = createElementVNode("div", { class: "border-l border-base h-4 mx-1" }, null, -1)), createVNode(_sfc_main$1, {
|
|
322
322
|
label: "Labels",
|
|
323
323
|
items: allLabels.value,
|
|
324
324
|
active: activeLabelFilters.value,
|
|
@@ -332,9 +332,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
332
332
|
])
|
|
333
333
|
]),
|
|
334
334
|
createCommentVNode(" Content "),
|
|
335
|
-
|
|
335
|
+
createElementVNode("div", { class: normalizeClass(["h-full of-hidden", selectedEntry.value ? "grid grid-cols-[1fr_1fr]" : ""]) }, [
|
|
336
336
|
createCommentVNode(" Log list "),
|
|
337
|
-
|
|
337
|
+
createElementVNode("div", _hoisted_8, [filteredEntries.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_9, " No logs ")) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(filteredEntries.value, (entry) => {
|
|
338
338
|
return openBlock(), createElementBlock("div", {
|
|
339
339
|
key: entry.id,
|
|
340
340
|
class: normalizeClass(["w-full text-left border-b border-base hover:bg-active transition border-l-2 text-sm group cursor-pointer", [selectedId.value === entry.id ? "bg-active" : ""]]),
|
|
@@ -343,45 +343,45 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
343
343
|
entry,
|
|
344
344
|
class: "px-3 py-2.5"
|
|
345
345
|
}, {
|
|
346
|
-
actions: withCtx(() => [
|
|
346
|
+
actions: withCtx(() => [createElementVNode("button", {
|
|
347
347
|
class: "op0 group-hover:op50 hover:op100! p-0.5 rounded hover:bg-active flex-none",
|
|
348
348
|
title: "Dismiss",
|
|
349
349
|
onClick: withModifiers(($event) => removeEntry(entry.id), ["stop"])
|
|
350
|
-
}, [..._cache[11] || (_cache[11] = [
|
|
350
|
+
}, [..._cache[11] || (_cache[11] = [createElementVNode("div", { class: "i-ph-trash-duotone w-3 h-3" }, null, -1)])], 8, _hoisted_11)]),
|
|
351
351
|
_: 2
|
|
352
352
|
}, 1032, ["entry"])], 10, _hoisted_10);
|
|
353
353
|
}), 128))]),
|
|
354
354
|
createCommentVNode(" Detail panel "),
|
|
355
355
|
selectedEntry.value ? (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
356
356
|
createCommentVNode(" Header "),
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
createElementVNode("div", _hoisted_13, [
|
|
358
|
+
createElementVNode("div", _hoisted_14, [createElementVNode("div", _hoisted_15, toDisplayString(selectedEntry.value.message), 1)]),
|
|
359
359
|
createCommentVNode(" Dismiss button "),
|
|
360
|
-
|
|
360
|
+
createElementVNode("button", {
|
|
361
361
|
class: "op50 hover:op100 p-1",
|
|
362
362
|
title: "Dismiss",
|
|
363
363
|
onClick: _cache[1] || (_cache[1] = ($event) => removeEntry(selectedEntry.value.id))
|
|
364
|
-
}, [..._cache[12] || (_cache[12] = [
|
|
364
|
+
}, [..._cache[12] || (_cache[12] = [createElementVNode("div", { class: "i-ph-trash-duotone w-4 h-4" }, null, -1)])]),
|
|
365
365
|
createCommentVNode(" Close button "),
|
|
366
|
-
|
|
366
|
+
createElementVNode("button", {
|
|
367
367
|
class: "op50 hover:op100 p-1",
|
|
368
368
|
title: "Close detail",
|
|
369
369
|
onClick: _cache[2] || (_cache[2] = ($event) => selectedId.value = null)
|
|
370
|
-
}, [..._cache[13] || (_cache[13] = [
|
|
370
|
+
}, [..._cache[13] || (_cache[13] = [createElementVNode("div", { class: "i-ph-x w-4 h-4" }, null, -1)])])
|
|
371
371
|
]),
|
|
372
372
|
createCommentVNode(" Metadata row "),
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
createElementVNode("div", _hoisted_16, [
|
|
374
|
+
createElementVNode("span", { class: normalizeClass(["flex items-center gap-1", unref(levels)[selectedEntry.value.level].color]) }, [createElementVNode("div", { class: normalizeClass([unref(levels)[selectedEntry.value.level].icon, "w-3.5 h-3.5"]) }, null, 2), createElementVNode("span", _hoisted_17, toDisplayString(selectedEntry.value.level), 1)], 2),
|
|
375
375
|
unref(formEntries)[selectedEntry.value.from] ? (openBlock(), createElementBlock("span", {
|
|
376
376
|
key: 0,
|
|
377
377
|
class: normalizeClass(["flex items-center gap-1", unref(formEntries)[selectedEntry.value.from].color])
|
|
378
|
-
}, [
|
|
379
|
-
selectedEntry.value.status === "loading" ? (openBlock(), createElementBlock("span", _hoisted_18, [..._cache[14] || (_cache[14] = [
|
|
380
|
-
|
|
378
|
+
}, [createElementVNode("div", { class: normalizeClass([unref(formEntries)[selectedEntry.value.from].icon, "w-3.5 h-3.5"]) }, null, 2), createTextVNode(" " + toDisplayString(unref(formEntries)[selectedEntry.value.from].label), 1)], 2)) : createCommentVNode("v-if", true),
|
|
379
|
+
selectedEntry.value.status === "loading" ? (openBlock(), createElementBlock("span", _hoisted_18, [..._cache[14] || (_cache[14] = [createElementVNode("div", { class: "w-3 h-3 border-1.5 border-current border-t-transparent rounded-full animate-spin" }, null, -1), createTextVNode(" Loading ", -1)])])) : createCommentVNode("v-if", true),
|
|
380
|
+
createElementVNode("span", {
|
|
381
381
|
class: "op40",
|
|
382
382
|
title: formatAbsoluteTime(selectedEntry.value.timestamp)
|
|
383
383
|
}, toDisplayString(unref(selectedTimeAgo)), 9, _hoisted_19),
|
|
384
|
-
selectedEntry.value.notify ? (openBlock(), createElementBlock("span", _hoisted_20, [..._cache[15] || (_cache[15] = [
|
|
384
|
+
selectedEntry.value.notify ? (openBlock(), createElementBlock("span", _hoisted_20, [..._cache[15] || (_cache[15] = [createElementVNode("div", { class: "i-ph:bell-duotone w-3.5 h-3.5" }, null, -1), createTextVNode(" notify ", -1)])])) : createCommentVNode("v-if", true)
|
|
385
385
|
]),
|
|
386
386
|
createCommentVNode(" Description "),
|
|
387
387
|
selectedEntry.value.description ? (openBlock(), createElementBlock("div", _hoisted_21, toDisplayString(selectedEntry.value.description), 1)) : createCommentVNode("v-if", true),
|
|
@@ -400,24 +400,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
400
400
|
key: 2,
|
|
401
401
|
class: "flex items-center gap-1.5 text-sm text-blue hover:underline mb-3",
|
|
402
402
|
onClick: _cache[3] || (_cache[3] = ($event) => openFile(selectedEntry.value))
|
|
403
|
-
}, [_cache[16] || (_cache[16] =
|
|
403
|
+
}, [_cache[16] || (_cache[16] = createElementVNode("div", { class: "i-ph:file-code-duotone w-4 h-4" }, null, -1)), createElementVNode("span", null, [
|
|
404
404
|
createTextVNode(toDisplayString(selectedEntry.value.filePosition.file), 1),
|
|
405
405
|
selectedEntry.value.filePosition.line ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(":" + toDisplayString(selectedEntry.value.filePosition.line), 1)], 64)) : createCommentVNode("v-if", true),
|
|
406
406
|
selectedEntry.value.filePosition.column ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(":" + toDisplayString(selectedEntry.value.filePosition.column), 1)], 64)) : createCommentVNode("v-if", true)
|
|
407
407
|
])])) : createCommentVNode("v-if", true),
|
|
408
408
|
createCommentVNode(" Element position "),
|
|
409
409
|
selectedEntry.value.elementPosition ? (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
410
|
-
_cache[17] || (_cache[17] =
|
|
410
|
+
_cache[17] || (_cache[17] = createElementVNode("div", { class: "op50 text-xs mb-1" }, " Element ", -1)),
|
|
411
411
|
selectedEntry.value.elementPosition.selector ? (openBlock(), createElementBlock("div", _hoisted_24, toDisplayString(selectedEntry.value.elementPosition.selector), 1)) : createCommentVNode("v-if", true),
|
|
412
412
|
selectedEntry.value.elementPosition.description ? (openBlock(), createElementBlock("div", _hoisted_25, toDisplayString(selectedEntry.value.elementPosition.description), 1)) : createCommentVNode("v-if", true),
|
|
413
413
|
selectedEntry.value.elementPosition.boundingBox ? (openBlock(), createElementBlock("div", _hoisted_26, toDisplayString(selectedEntry.value.elementPosition.boundingBox.x) + ", " + toDisplayString(selectedEntry.value.elementPosition.boundingBox.y) + " (" + toDisplayString(selectedEntry.value.elementPosition.boundingBox.width) + " × " + toDisplayString(selectedEntry.value.elementPosition.boundingBox.height) + ") ", 1)) : createCommentVNode("v-if", true)
|
|
414
414
|
])) : createCommentVNode("v-if", true),
|
|
415
415
|
createCommentVNode(" Stacktrace "),
|
|
416
|
-
selectedEntry.value.stacktrace ? (openBlock(), createElementBlock("div", _hoisted_27, [_cache[18] || (_cache[18] =
|
|
416
|
+
selectedEntry.value.stacktrace ? (openBlock(), createElementBlock("div", _hoisted_27, [_cache[18] || (_cache[18] = createElementVNode("div", { class: "op50 text-xs mb-1" }, " Stack Trace ", -1)), createElementVNode("pre", _hoisted_28, toDisplayString(selectedEntry.value.stacktrace), 1)])) : createCommentVNode("v-if", true),
|
|
417
417
|
createCommentVNode(" Timers "),
|
|
418
|
-
selectedEntry.value.autoDismiss || selectedEntry.value.autoDelete ? (openBlock(), createElementBlock("div", _hoisted_29, [selectedEntry.value.autoDismiss ? (openBlock(), createElementBlock("span", _hoisted_30, [_cache[19] || (_cache[19] =
|
|
418
|
+
selectedEntry.value.autoDismiss || selectedEntry.value.autoDelete ? (openBlock(), createElementBlock("div", _hoisted_29, [selectedEntry.value.autoDismiss ? (openBlock(), createElementBlock("span", _hoisted_30, [_cache[19] || (_cache[19] = createElementVNode("div", { class: "i-ph:bell-slash-duotone w-3.5 h-3.5" }, null, -1)), createTextVNode(" Auto-dismiss: " + toDisplayString(selectedEntry.value.autoDismiss / 1e3) + "s ", 1)])) : createCommentVNode("v-if", true), selectedEntry.value.autoDelete ? (openBlock(), createElementBlock("span", _hoisted_31, [_cache[20] || (_cache[20] = createElementVNode("div", { class: "i-ph:timer-duotone w-3.5 h-3.5" }, null, -1)), createTextVNode(" Auto-delete: " + toDisplayString(selectedEntry.value.autoDelete / 1e3) + "s ", 1)])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
|
|
419
419
|
createCommentVNode(" ID + Timestamp "),
|
|
420
|
-
|
|
420
|
+
createElementVNode("div", _hoisted_32, [createElementVNode("span", null, "ID: " + toDisplayString(selectedEntry.value.id), 1), createElementVNode("span", null, toDisplayString(formatAbsoluteTime(selectedEntry.value.timestamp)) + " (" + toDisplayString(new Date(selectedEntry.value.timestamp).toLocaleDateString()) + ")", 1)])
|
|
421
421
|
])) : createCommentVNode("v-if", true)
|
|
422
422
|
], 2)
|
|
423
423
|
]);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "./iconify-BW79QmbD.js";
|
|
1
|
+
import { d as watchImmediate, i as useEventListener } from "./dist-CCdqIez-.js";
|
|
2
|
+
import { t as _sfc_main$2 } from "./DockIcon-7v-JouW5.js";
|
|
3
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, markRaw, nextTick, normalizeClass, onMounted, onUnmounted, openBlock, reactive, ref, renderList, shallowRef, toDisplayString, unref, watch } from "vue";
|
|
5
4
|
//#region src/client/webcomponents/state/terminals.ts
|
|
6
5
|
let _terminalsMap;
|
|
7
6
|
function useTerminals(context) {
|
|
@@ -57,7 +56,7 @@ function useTerminals(context) {
|
|
|
57
56
|
* http://bellard.org/jslinux/
|
|
58
57
|
* Copyright (c) 2011 Fabrice Bellard
|
|
59
58
|
*/
|
|
60
|
-
var h = 2, _ = 1, o = class {
|
|
59
|
+
var h$1 = 2, _ = 1, o = class {
|
|
61
60
|
activate(e) {
|
|
62
61
|
this._terminal = e;
|
|
63
62
|
}
|
|
@@ -79,7 +78,7 @@ var h = 2, _ = 1, o = class {
|
|
|
79
78
|
left: parseInt(i.getPropertyValue("padding-left"))
|
|
80
79
|
}, m = n.top + n.bottom, d = n.right + n.left, c = l - m, p = a - d - s;
|
|
81
80
|
return {
|
|
82
|
-
cols: Math.max(h, Math.floor(p / t.css.cell.width)),
|
|
81
|
+
cols: Math.max(h$1, Math.floor(p / t.css.cell.width)),
|
|
83
82
|
rows: Math.max(_, Math.floor(c / t.css.cell.height))
|
|
84
83
|
};
|
|
85
84
|
}
|
|
@@ -10360,7 +10359,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10360
10359
|
props.terminal.terminal = null;
|
|
10361
10360
|
});
|
|
10362
10361
|
return (_ctx, _cache) => {
|
|
10363
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
10362
|
+
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", {
|
|
10364
10363
|
ref_key: "container",
|
|
10365
10364
|
ref: container,
|
|
10366
10365
|
class: "h-full w-full of-auto bg-black"
|
|
@@ -10388,7 +10387,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10388
10387
|
if (selectedTerminal.value == null && terminals.size > 0) selectedTerminal.value = terminals.values().next().value;
|
|
10389
10388
|
});
|
|
10390
10389
|
return (_ctx, _cache) => {
|
|
10391
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
10390
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(terminals).values(), (terminal) => {
|
|
10392
10391
|
return openBlock(), createElementBlock("button", {
|
|
10393
10392
|
key: terminal.info.id,
|
|
10394
10393
|
class: normalizeClass(["px3 py1.5 border-r border-base hover:bg-active text-sm flex items-center gap-1", { "bg-active": selectedTerminal.value?.info.id === terminal.info.id }]),
|
|
@@ -10396,12 +10395,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10396
10395
|
}, [createVNode(_sfc_main$2, {
|
|
10397
10396
|
icon: terminal.info.icon || "ph:terminal-duotone",
|
|
10398
10397
|
class: "w-4 h-4"
|
|
10399
|
-
}, null, 8, ["icon"]),
|
|
10400
|
-
}), 128))]),
|
|
10398
|
+
}, null, 8, ["icon"]), createElementVNode("span", null, toDisplayString(terminal.info.title), 1)], 10, _hoisted_3);
|
|
10399
|
+
}), 128))]), createElementVNode("div", _hoisted_4, [selectedTerminal.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
10401
10400
|
key: selectedTerminal.value.info.id,
|
|
10402
10401
|
context: __props.context,
|
|
10403
10402
|
terminal: selectedTerminal.value
|
|
10404
|
-
}, null, 8, ["context", "terminal"])) : (openBlock(), createElementBlock("div", _hoisted_5, [..._cache[0] || (_cache[0] = [
|
|
10403
|
+
}, null, 8, ["context", "terminal"])) : (openBlock(), createElementBlock("div", _hoisted_5, [..._cache[0] || (_cache[0] = [createElementVNode("div", null, "Select a terminal tab to start", -1)])]))])]);
|
|
10405
10404
|
};
|
|
10406
10405
|
}
|
|
10407
10406
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as getIconifySvg } from "./iconify-JodklND-.js";
|
|
2
|
+
import { computed, createBlock, createElementBlock, createVNode, defineComponent, h, inject, markRaw, onErrorCaptured, onMounted, onUnmounted, openBlock, provide, ref, shallowRef, toDisplayString, unref, watch, watchEffect, withCtx } from "vue";
|
|
3
3
|
Object.freeze({ status: "aborted" });
|
|
4
4
|
function $constructor(name, initializer, params) {
|
|
5
5
|
function init(inst, def) {
|
|
@@ -3393,7 +3393,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
3393
3393
|
inst.prefault = (def) => prefault(inst, def);
|
|
3394
3394
|
inst.catch = (params) => _catch(inst, params);
|
|
3395
3395
|
inst.pipe = (target) => pipe(inst, target);
|
|
3396
|
-
inst.readonly = () => readonly(inst);
|
|
3396
|
+
inst.readonly = () => readonly$1(inst);
|
|
3397
3397
|
inst.describe = (description) => {
|
|
3398
3398
|
const cl = inst.clone();
|
|
3399
3399
|
globalRegistry.add(cl, { description });
|
|
@@ -3932,7 +3932,7 @@ const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
|
3932
3932
|
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
3933
3933
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
3934
3934
|
});
|
|
3935
|
-
function readonly(innerType) {
|
|
3935
|
+
function readonly$1(innerType) {
|
|
3936
3936
|
return new ZodReadonly({
|
|
3937
3937
|
type: "readonly",
|
|
3938
3938
|
innerType
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { humanId } from "@vitejs/devtools-kit/utils/human-id";
|
|
2
|
+
//#region src/node/auth-state.ts
|
|
3
|
+
let pendingAuth = null;
|
|
4
|
+
let tempAuthToken = generateTempId();
|
|
5
|
+
function generateTempId() {
|
|
6
|
+
return humanId({
|
|
7
|
+
separator: "-",
|
|
8
|
+
capitalize: false
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function getTempAuthToken() {
|
|
12
|
+
return tempAuthToken;
|
|
13
|
+
}
|
|
14
|
+
function refreshTempAuthToken() {
|
|
15
|
+
tempAuthToken = generateTempId();
|
|
16
|
+
return tempAuthToken;
|
|
17
|
+
}
|
|
18
|
+
function setPendingAuth(request) {
|
|
19
|
+
pendingAuth = request;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Abort and clean up any existing pending auth request.
|
|
23
|
+
*/
|
|
24
|
+
function abortPendingAuth() {
|
|
25
|
+
if (pendingAuth) {
|
|
26
|
+
pendingAuth.abortController.abort();
|
|
27
|
+
clearTimeout(pendingAuth.timeout);
|
|
28
|
+
pendingAuth = null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Consume the temp auth ID: verify it matches, trust the pending client, and clean up.
|
|
33
|
+
* Returns the client's authToken if successful, null otherwise.
|
|
34
|
+
*/
|
|
35
|
+
function consumeTempAuthToken(id, storage) {
|
|
36
|
+
if (id !== tempAuthToken || !pendingAuth) return null;
|
|
37
|
+
const { clientAuthToken, session, ua, origin, resolve } = pendingAuth;
|
|
38
|
+
storage.mutate((state) => {
|
|
39
|
+
state.trusted[clientAuthToken] = {
|
|
40
|
+
authToken: clientAuthToken,
|
|
41
|
+
ua,
|
|
42
|
+
origin,
|
|
43
|
+
timestamp: Date.now()
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
session.meta.clientAuthToken = clientAuthToken;
|
|
47
|
+
session.meta.isTrusted = true;
|
|
48
|
+
resolve({ isTrusted: true });
|
|
49
|
+
abortPendingAuth();
|
|
50
|
+
refreshTempAuthToken();
|
|
51
|
+
return clientAuthToken;
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { setPendingAuth as a, refreshTempAuthToken as i, consumeTempAuthToken as n, getTempAuthToken as r, abortPendingAuth as t };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { n as ansis_default } from "./constants-DfEeYo9W.js";
|
|
2
|
+
import { dirClientStandalone } from "./dirs.js";
|
|
3
|
+
import { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_DIRNAME, DEVTOOLS_DOCK_IMPORTS_FILENAME, DEVTOOLS_MOUNT_PATH, DEVTOOLS_RPC_DUMP_DIRNAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME } from "@vitejs/devtools-kit/constants";
|
|
4
|
+
import { dirname, join, relative, resolve } from "pathe";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
6
|
+
import fs$1 from "node:fs/promises";
|
|
7
|
+
//#region src/node/build-static.ts
|
|
8
|
+
async function buildStaticDevTools(options) {
|
|
9
|
+
const { context, outDir } = options;
|
|
10
|
+
if (existsSync(outDir)) await fs$1.rm(outDir, { recursive: true });
|
|
11
|
+
const devToolsRoot = join(outDir, DEVTOOLS_DIRNAME);
|
|
12
|
+
await fs$1.mkdir(devToolsRoot, { recursive: true });
|
|
13
|
+
await fs$1.cp(dirClientStandalone, devToolsRoot, { recursive: true });
|
|
14
|
+
for (const { baseUrl, distDir } of context.views.buildStaticDirs) {
|
|
15
|
+
console.log(ansis_default.cyan`${"⬢"} Copying static files from ${distDir} to ${join(outDir, baseUrl)}`);
|
|
16
|
+
await fs$1.mkdir(join(outDir, baseUrl), { recursive: true });
|
|
17
|
+
await fs$1.cp(distDir, join(outDir, baseUrl), { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
const { renderDockImportsMap } = await import("./server-C54I1zbj.js");
|
|
20
|
+
await fs$1.mkdir(resolve(devToolsRoot, DEVTOOLS_RPC_DUMP_DIRNAME), { recursive: true });
|
|
21
|
+
await fs$1.writeFile(resolve(devToolsRoot, DEVTOOLS_CONNECTION_META_FILENAME), JSON.stringify({ backend: "static" }, null, 2), "utf-8");
|
|
22
|
+
await fs$1.writeFile(resolve(devToolsRoot, DEVTOOLS_DOCK_IMPORTS_FILENAME), renderDockImportsMap(context.docks.values()), "utf-8");
|
|
23
|
+
console.log(ansis_default.cyan`${"⬢"} Writing RPC dump to ${resolve(devToolsRoot, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME)}`);
|
|
24
|
+
const { collectStaticRpcDump } = await import("./static-dump-BqRb_x-O.js");
|
|
25
|
+
const dump = await collectStaticRpcDump(context.rpc.definitions.values(), context);
|
|
26
|
+
for (const [filepath, data] of Object.entries(dump.files)) {
|
|
27
|
+
const fullpath = resolve(devToolsRoot, filepath);
|
|
28
|
+
await fs$1.mkdir(dirname(fullpath), { recursive: true });
|
|
29
|
+
await fs$1.writeFile(fullpath, JSON.stringify(data, null, 2), "utf-8");
|
|
30
|
+
}
|
|
31
|
+
await fs$1.writeFile(resolve(devToolsRoot, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME), JSON.stringify(dump.manifest, null, 2), "utf-8");
|
|
32
|
+
await fs$1.writeFile(resolve(outDir, "index.html"), [
|
|
33
|
+
"<!doctype html>",
|
|
34
|
+
"<html lang=\"en\">",
|
|
35
|
+
"<head>",
|
|
36
|
+
" <meta charset=\"UTF-8\">",
|
|
37
|
+
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
|
|
38
|
+
" <title>Vite DevTools</title>",
|
|
39
|
+
` <meta http-equiv="refresh" content="0; url=${DEVTOOLS_MOUNT_PATH}">`,
|
|
40
|
+
"</head>",
|
|
41
|
+
"<body>",
|
|
42
|
+
` <script>location.replace(${JSON.stringify(DEVTOOLS_MOUNT_PATH)})<\/script>`,
|
|
43
|
+
"</body>",
|
|
44
|
+
"</html>"
|
|
45
|
+
].join("\n"), "utf-8");
|
|
46
|
+
console.log(ansis_default.green`${"⬢"} Built DevTools to ${relative(context.cwd, outDir)}`);
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { buildStaticDevTools };
|
package/dist/cli-commands.js
CHANGED
|
@@ -1,3 +1,58 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { n as
|
|
1
|
+
import { n as ansis_default } from "./constants-DfEeYo9W.js";
|
|
2
|
+
import { n as normalizeHttpServerUrl } from "./utils-HWI9S6d-.js";
|
|
3
|
+
import { DEVTOOLS_MOUNT_PATH } from "@vitejs/devtools-kit/constants";
|
|
4
|
+
import { resolve } from "pathe";
|
|
5
|
+
//#region src/node/cli-commands.ts
|
|
6
|
+
async function start(options) {
|
|
7
|
+
const { host } = options;
|
|
8
|
+
const { getPort } = await import("./dist-DpLy3ojW.js").then((n) => n.t);
|
|
9
|
+
const port = await getPort({
|
|
10
|
+
host,
|
|
11
|
+
port: options.port == null ? void 0 : +options.port,
|
|
12
|
+
portRange: [9999, 15e3]
|
|
13
|
+
});
|
|
14
|
+
const { startStandaloneDevTools } = await import("./standalone-w_GYdx1T.js");
|
|
15
|
+
const { createDevToolsMiddleware } = await import("./server-DSh-GQIq.js").then((n) => n.n);
|
|
16
|
+
const devtools = await startStandaloneDevTools({ cwd: options.root });
|
|
17
|
+
const { h3 } = await createDevToolsMiddleware({
|
|
18
|
+
cwd: devtools.config.root,
|
|
19
|
+
hostWebSocket: host,
|
|
20
|
+
context: devtools.context
|
|
21
|
+
});
|
|
22
|
+
const { createServer } = await import("node:http");
|
|
23
|
+
const { createApp, eventHandler, fromNodeMiddleware, sendRedirect, toNodeListener } = await import("h3");
|
|
24
|
+
const { default: sirv } = await import("sirv");
|
|
25
|
+
const app = createApp();
|
|
26
|
+
for (const { baseUrl, distDir } of devtools.context.views.buildStaticDirs) app.use(baseUrl, fromNodeMiddleware(sirv(distDir, {
|
|
27
|
+
dev: true,
|
|
28
|
+
single: true
|
|
29
|
+
})));
|
|
30
|
+
app.use(DEVTOOLS_MOUNT_PATH, h3.handler);
|
|
31
|
+
app.use("/", eventHandler(async (event) => {
|
|
32
|
+
if (event.node.req.url === "/") return sendRedirect(event, DEVTOOLS_MOUNT_PATH);
|
|
33
|
+
}));
|
|
34
|
+
createServer(toNodeListener(app)).listen(port, host, async () => {
|
|
35
|
+
const url = normalizeHttpServerUrl(host, port);
|
|
36
|
+
console.log(ansis_default.green`${"⬢"} Vite DevTools started at`, ansis_default.green(url), "\n");
|
|
37
|
+
const { default: open } = await import("open");
|
|
38
|
+
if (options.open) await open(url);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async function build(options) {
|
|
42
|
+
console.log(ansis_default.cyan`${"⬢"} Building static Vite DevTools...`);
|
|
43
|
+
const { startStandaloneDevTools } = await import("./standalone-w_GYdx1T.js");
|
|
44
|
+
const devtools = await startStandaloneDevTools({
|
|
45
|
+
cwd: options.root,
|
|
46
|
+
config: options.config
|
|
47
|
+
});
|
|
48
|
+
const outDir = resolve(devtools.config.root, options.outDir);
|
|
49
|
+
const { buildStaticDevTools } = await import("./build-static-zB8LrlMJ.js");
|
|
50
|
+
await buildStaticDevTools({
|
|
51
|
+
context: devtools.context,
|
|
52
|
+
outDir
|
|
53
|
+
});
|
|
54
|
+
console.warn(ansis_default.yellow`${"⬢"} Static build is still experimental and not yet complete.`);
|
|
55
|
+
console.warn(ansis_default.yellow`${"⬢"} Generated output may be missing features and can change without notice.`);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
3
58
|
export { build, start };
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "./plugins-DiuKIPkS.js";
|
|
2
|
-
import { n as start, t as build } from "./cli-commands-CnJ4eqDp.js";
|
|
3
1
|
import process from "node:process";
|
|
4
2
|
import cac from "cac";
|
|
5
3
|
//#region src/node/cli.ts
|
|
@@ -7,8 +5,14 @@ const cli = cac("vite-devtools");
|
|
|
7
5
|
process.on("SIGINT", () => {
|
|
8
6
|
process.exit(0);
|
|
9
7
|
});
|
|
10
|
-
cli.command("build", "Build devtools with current config file for static hosting").option("--root <root>", "Root directory", { default: process.cwd() }).option("--config <config>", "Vite config file").option("--base <baseURL>", "Base URL for deployment", { default: "/" }).option("--outDir <dir>", "Output directory", { default: ".vite-devtools" }).action(
|
|
11
|
-
|
|
8
|
+
cli.command("build", "Build devtools with current config file for static hosting").option("--root <root>", "Root directory", { default: process.cwd() }).option("--config <config>", "Vite config file").option("--base <baseURL>", "Base URL for deployment", { default: "/" }).option("--outDir <dir>", "Output directory", { default: ".vite-devtools" }).action(async (options) => {
|
|
9
|
+
const { build } = await import("./cli-commands.js");
|
|
10
|
+
return await build(options);
|
|
11
|
+
});
|
|
12
|
+
cli.command("", "Start devtools").option("--root <root>", "Root directory", { default: process.cwd() }).option("--config <config>", "Vite config file").option("--host <host>", "Host", { default: process.env.HOST || "127.0.0.1" }).option("--port <port>", "Port", { default: process.env.PORT || 9999 }).option("--open", "Open browser", { default: true }).action(async (options) => {
|
|
13
|
+
const { start } = await import("./cli-commands.js");
|
|
14
|
+
return await start(options);
|
|
15
|
+
});
|
|
12
16
|
cli.help();
|
|
13
17
|
cli.parse();
|
|
14
18
|
//#endregion
|