devframe 0.1.21 → 0.1.22
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/README.md +41 -18
- package/dist/{_shared-iZy45oG3.mjs → _shared-DcJX9-Az.mjs} +2 -2
- package/dist/adapters/build.d.mts +5 -5
- package/dist/adapters/build.mjs +13 -12
- package/dist/adapters/cli.d.mts +2 -2
- package/dist/adapters/cli.mjs +5 -5
- package/dist/adapters/dev.d.mts +18 -9
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +5 -5
- package/dist/adapters/embedded.mjs +2 -2
- package/dist/adapters/mcp.d.mts +3 -3
- package/dist/adapters/mcp.mjs +5 -5
- package/dist/adapters/vite.d.mts +45 -12
- package/dist/adapters/vite.mjs +81 -18
- package/dist/chunk-e9Ob2GDo.mjs +26 -0
- package/dist/client/index.d.mts +10 -5
- package/dist/client/index.mjs +19 -10
- package/dist/colors-Bl4W18Mh.mjs +123 -0
- package/dist/{context-internal-saIAfNVw.d.mts → context-DBd794Rn.d.mts} +2 -2
- package/dist/{context-BJ4r2SmR.mjs → context-DUibxhrR.mjs} +14 -31
- package/dist/{dev-CdAy400a.mjs → dev-BGpTpYiR.mjs} +19 -20
- package/dist/{devtool-CNvLs2_Y.d.mts → devframe-DulcIxwu.d.mts} +49 -58
- package/dist/{diagnostics-DxPnRoXO.mjs → diagnostics-BFhNNmST.mjs} +7 -2
- package/dist/hash-BHZbo80D.mjs +126 -0
- package/dist/{human-id-BLoGo_e5.mjs → human-id-adtUWQLr.mjs} +12 -3
- package/dist/{index-CuLRIMto.d.mts → index-DB2Ie0Or.d.mts} +2 -3
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +2 -5
- package/dist/launch-editor-KA_21J1T.mjs +581 -0
- package/dist/node/auth.d.mts +44 -0
- package/dist/node/auth.mjs +55 -0
- package/dist/node/index.d.mts +10 -51
- package/dist/node/index.mjs +6 -62
- package/dist/{internal/index.d.mts → node/internal.d.mts} +5 -5
- package/dist/node/internal.mjs +50 -0
- package/dist/{open-Dede_w9r.mjs → open-DmFp0qZA.mjs} +12 -3
- package/dist/recipes/open-helpers.d.mts +4 -9
- package/dist/recipes/open-helpers.mjs +7 -12
- package/dist/revoke-DIMz1r7-.mjs +35 -0
- package/dist/rpc/index.d.mts +3 -3
- package/dist/rpc/index.mjs +4 -4
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +2 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +2 -1
- package/dist/{rpc-INbWfHoX.mjs → rpc-CkZuoz-m.mjs} +3 -2
- package/dist/{serialization-DwKi05Pn.mjs → serialization-CwO31axa.mjs} +1 -2
- package/dist/{server-CBsxXIH5.mjs → server-ma8-ZVyX.mjs} +1 -1
- package/dist/{server-BAqOajx_.d.mts → server-zKEDxgqD.d.mts} +4 -3
- package/dist/shared-state-DCDs0e7y.mjs +928 -0
- package/dist/{static-dump-D5VH8Iqk.mjs → static-dump-D7AvjrgL.mjs} +1 -1
- package/dist/{context-internal-Dx_NoSv1.mjs → storage-CNC38eU-.mjs} +4 -86
- package/dist/structured-clone-DcDc2Dds.mjs +221 -0
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +11 -2
- package/dist/utils/colors.d.mts +28 -0
- package/dist/utils/colors.mjs +2 -0
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/hash.d.mts +7 -0
- package/dist/utils/hash.mjs +2 -0
- package/dist/utils/human-id.d.mts +6 -8
- package/dist/utils/human-id.mjs +1 -2
- package/dist/utils/launch-editor.d.mts +13 -0
- package/dist/utils/launch-editor.mjs +2 -0
- package/dist/utils/open.d.mts +16 -0
- package/dist/utils/open.mjs +2 -0
- package/dist/utils/serve-static.d.mts +30 -0
- package/dist/utils/serve-static.mjs +152 -0
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -35
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/structured-clone.d.mts +21 -0
- package/dist/utils/structured-clone.mjs +2 -0
- package/dist/utils/when.d.mts +32 -49
- package/dist/utils/when.mjs +20 -2
- package/dist/{ws-client-CjPuPFbA.d.mts → ws-client-Bavoya6-.d.mts} +1 -1
- package/dist/{ws-server-C7LnhOHi.d.mts → ws-server-DjvlwLuM.d.mts} +1 -1
- package/package.json +23 -10
- package/skills/devframe/SKILL.md +45 -23
- package/skills/devframe/templates/{counter-devtool.ts → counter-devframe.ts} +4 -4
- package/skills/devframe/templates/{spa-devtool.ts → spa-devframe.ts} +3 -3
- package/skills/devframe/templates/vite-client.ts +2 -2
- package/dist/internal/index.mjs +0 -3
- package/dist/utils/state.d.mts +0 -50
- package/dist/utils/state.mjs +0 -26
- package/dist/{define-Bb4zh-Dc.mjs → define-CW9gLnyG.mjs} +0 -0
- package/dist/{host-h3-9jeHcltx.mjs → host-h3-Dz8YnFgu.mjs} +1 -1
- /package/dist/{transports-DSV5_5QM.mjs → transports-BnCs4rj9.mjs} +0 -0
- /package/dist/{types-C5OVe4AC.d.mts → types-4rdUEi2R.d.mts} +0 -0
package/dist/client/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { l as RpcCacheManager, o as RpcFunctionsCollectorBase } from "../rpc-
|
|
3
|
-
import { r as structuredCloneDeserialize } from "../serialization-DwKi05Pn.mjs";
|
|
1
|
+
import { t as hash } from "../hash-BHZbo80D.mjs";
|
|
2
|
+
import { l as RpcCacheManager, o as RpcFunctionsCollectorBase } from "../rpc-CkZuoz-m.mjs";
|
|
4
3
|
import { createRpcClient } from "../rpc/client.mjs";
|
|
4
|
+
import { t as structuredCloneDeserialize } from "../structured-clone-DcDc2Dds.mjs";
|
|
5
5
|
import { createWsRpcChannel } from "../rpc/transports/ws-client.mjs";
|
|
6
6
|
import { createEventEmitter } from "../utils/events.mjs";
|
|
7
|
-
import { createSharedState } from "../
|
|
7
|
+
import { t as createSharedState } from "../shared-state-DCDs0e7y.mjs";
|
|
8
8
|
import { createStreamReader, createStreamSink } from "../utils/streaming-channel.mjs";
|
|
9
9
|
import { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
|
|
10
|
+
import { t as humanId } from "../human-id-adtUWQLr.mjs";
|
|
10
11
|
import { promiseWithResolver } from "../utils/promise.mjs";
|
|
11
|
-
import { hash } from "ohash";
|
|
12
12
|
//#region src/client/rpc-shared-state.ts
|
|
13
13
|
function createRpcSharedStateClientHost(rpc) {
|
|
14
14
|
const sharedState = /* @__PURE__ */ new Map();
|
|
@@ -1541,10 +1541,7 @@ function getConnectionAuthTokenFromWindows(userAuthToken) {
|
|
|
1541
1541
|
value = getter();
|
|
1542
1542
|
if (value) break;
|
|
1543
1543
|
} catch {}
|
|
1544
|
-
if (!value) value = (
|
|
1545
|
-
separator: "-",
|
|
1546
|
-
capitalize: false
|
|
1547
|
-
});
|
|
1544
|
+
if (!value) value = humanId();
|
|
1548
1545
|
localStorage.setItem(CONNECTION_AUTH_TOKEN_KEY, value);
|
|
1549
1546
|
globalThis[CONNECTION_AUTH_TOKEN_KEY] = value;
|
|
1550
1547
|
return value;
|
|
@@ -1661,4 +1658,16 @@ async function getDevToolsRpcClient(options = {}) {
|
|
|
1661
1658
|
return rpc;
|
|
1662
1659
|
}
|
|
1663
1660
|
//#endregion
|
|
1664
|
-
|
|
1661
|
+
//#region src/client/index.ts
|
|
1662
|
+
const connectDevframe = getDevToolsRpcClient;
|
|
1663
|
+
let warnedConnectDevtool = false;
|
|
1664
|
+
/** @deprecated Use `connectDevframe`. */
|
|
1665
|
+
function connectDevtool(...args) {
|
|
1666
|
+
if (!warnedConnectDevtool) {
|
|
1667
|
+
warnedConnectDevtool = true;
|
|
1668
|
+
console.warn("[devframe] `connectDevtool` is deprecated; use `connectDevframe` instead.");
|
|
1669
|
+
}
|
|
1670
|
+
return getDevToolsRpcClient(...args);
|
|
1671
|
+
}
|
|
1672
|
+
//#endregion
|
|
1673
|
+
export { connectDevframe, connectDevtool, createRpcStreamingClientHost, getDevToolsRpcClient };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { r as __toESM, t as __commonJSMin } from "./chunk-e9Ob2GDo.mjs";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region ../../../node_modules/.pnpm/ansis@4.2.0/node_modules/ansis/index.mjs
|
|
4
|
+
var import_ansis = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
let e, t, r, { defineProperty: l, setPrototypeOf: n, create: o, keys: s } = Object, i = "", { round: c, max: a } = Math, p = (e) => {
|
|
6
|
+
let t = /([a-f\d]{3,6})/i.exec(e)?.[1], r = t?.length, l = parseInt(6 ^ r ? 3 ^ r ? "0" : t[0] + t[0] + t[1] + t[1] + t[2] + t[2] : t, 16);
|
|
7
|
+
return [
|
|
8
|
+
l >> 16 & 255,
|
|
9
|
+
l >> 8 & 255,
|
|
10
|
+
255 & l
|
|
11
|
+
];
|
|
12
|
+
}, u = (e, t, r) => e ^ t || t ^ r ? 16 + 36 * c(e / 51) + 6 * c(t / 51) + c(r / 51) : 8 > e ? 16 : e > 248 ? 231 : c(24 * (e - 8) / 247) + 232, d = (e) => {
|
|
13
|
+
let t, r, l, n, o;
|
|
14
|
+
return 8 > e ? 30 + e : 16 > e ? e - 8 + 90 : (232 > e ? (o = (e -= 16) % 36, t = (e / 36 | 0) / 5, r = (o / 6 | 0) / 5, l = o % 6 / 5) : t = r = l = (10 * (e - 232) + 8) / 255, n = 2 * a(t, r, l), n ? 30 + (c(l) << 2 | c(r) << 1 | c(t)) + (2 ^ n ? 0 : 60) : 30);
|
|
15
|
+
}, f = (() => {
|
|
16
|
+
let r = (e) => o.some(((t) => e.test(t))), l = globalThis, n = l.process ?? {}, o = n.argv ?? [], i = n.env ?? {}, c = -1;
|
|
17
|
+
try {
|
|
18
|
+
e = "," + s(i).join(",");
|
|
19
|
+
} catch (e) {
|
|
20
|
+
i = {}, c = 0;
|
|
21
|
+
}
|
|
22
|
+
let a = "FORCE_COLOR", p = {
|
|
23
|
+
false: 0,
|
|
24
|
+
0: 0,
|
|
25
|
+
1: 1,
|
|
26
|
+
2: 2,
|
|
27
|
+
3: 3
|
|
28
|
+
}[i[a]] ?? -1, u = a in i && p || r(/^--color=?(true|always)?$/);
|
|
29
|
+
return u && (c = p), ~c || (c = ((r, l, n) => (t = r.TERM, {
|
|
30
|
+
"24bit": 3,
|
|
31
|
+
truecolor: 3,
|
|
32
|
+
ansi256: 2,
|
|
33
|
+
ansi: 1
|
|
34
|
+
}[r.COLORTERM] || (r.CI ? /,GITHUB/.test(e) ? 3 : 1 : l && "dumb" !== t ? n ? 3 : /-256/.test(t) ? 2 : 1 : 0)))(i, !!i.PM2_HOME || i.NEXT_RUNTIME?.includes("edge") || !!n.stdout?.isTTY, "win32" === n.platform)), !p || i.NO_COLOR || r(/^--(no-color|color=(false|never))$/) ? 0 : l.window?.chrome || u && !c ? 3 : c;
|
|
35
|
+
})(), g = {
|
|
36
|
+
open: i,
|
|
37
|
+
close: i
|
|
38
|
+
}, h = 39, b = 49, O = {}, m = ({ p: e }, { open: t, close: l }) => {
|
|
39
|
+
let o = (e, ...r) => {
|
|
40
|
+
if (!e) {
|
|
41
|
+
if (t && t === l) return t;
|
|
42
|
+
if ((e ?? i) === i) return i;
|
|
43
|
+
}
|
|
44
|
+
let n, s = e.raw ? String.raw({ raw: e }, ...r) : i + e, c = o.p, a = c.o, p = c.c;
|
|
45
|
+
if (s.includes("\x1B")) for (; c; c = c.p) {
|
|
46
|
+
let { open: e, close: t } = c, r = t.length, l = i, o = 0;
|
|
47
|
+
if (r) for (; ~(n = s.indexOf(t, o)); o = n + r) l += s.slice(o, n) + e;
|
|
48
|
+
s = l + s.slice(o);
|
|
49
|
+
}
|
|
50
|
+
return a + (s.includes("\n") ? s.replace(/(\r?\n)/g, p + "$1" + a) : s) + p;
|
|
51
|
+
}, s = t, c = l;
|
|
52
|
+
return e && (s = e.o + t, c = l + e.c), n(o, r), o.p = {
|
|
53
|
+
open: t,
|
|
54
|
+
close: l,
|
|
55
|
+
o: s,
|
|
56
|
+
c,
|
|
57
|
+
p: e
|
|
58
|
+
}, o.open = s, o.close = c, o;
|
|
59
|
+
};
|
|
60
|
+
const w = new function e(t = f) {
|
|
61
|
+
let s = {
|
|
62
|
+
Ansis: e,
|
|
63
|
+
level: t,
|
|
64
|
+
isSupported: () => a,
|
|
65
|
+
strip: (e) => e.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
|
|
66
|
+
extend(e) {
|
|
67
|
+
for (let t in e) {
|
|
68
|
+
let r = e[t], l = (typeof r)[0];
|
|
69
|
+
"s" === l ? (c(t, T(...p(r))), c(_(t), v(...p(r)))) : c(t, r, "f" === l);
|
|
70
|
+
}
|
|
71
|
+
return r = o({}, O), n(s, r), s;
|
|
72
|
+
}
|
|
73
|
+
}, c = (e, t, r) => {
|
|
74
|
+
O[e] = { get() {
|
|
75
|
+
let n = r ? (...e) => m(this, t(...e)) : m(this, t);
|
|
76
|
+
return l(this, e, { value: n }), n;
|
|
77
|
+
} };
|
|
78
|
+
}, a = t > 0, w = (e, t) => a ? {
|
|
79
|
+
open: `[${e}m`,
|
|
80
|
+
close: `[${t}m`
|
|
81
|
+
} : g, y = (e) => (t) => e(...p(t)), R = (e, t) => (r, l, n) => w(`${e}8;2;${r};${l};${n}`, t), $ = (e, t) => (r, l, n) => w(((e, t, r) => d(u(e, t, r)))(r, l, n) + e, t), x = (e) => (t, r, l) => e(u(t, r, l)), T = R(3, h), v = R(4, b), C = (e) => w("38;5;" + e, h), E = (e) => w("48;5;" + e, b);
|
|
82
|
+
2 === t ? (T = x(C), v = x(E)) : 1 === t && (T = $(0, h), v = $(10, b), C = (e) => w(d(e), h), E = (e) => w(d(e) + 10, b));
|
|
83
|
+
let M, I = {
|
|
84
|
+
fg: C,
|
|
85
|
+
bg: E,
|
|
86
|
+
rgb: T,
|
|
87
|
+
bgRgb: v,
|
|
88
|
+
hex: y(T),
|
|
89
|
+
bgHex: y(v),
|
|
90
|
+
visible: g,
|
|
91
|
+
reset: w(0, 0),
|
|
92
|
+
bold: w(1, 22),
|
|
93
|
+
dim: w(2, 22),
|
|
94
|
+
italic: w(3, 23),
|
|
95
|
+
underline: w(4, 24),
|
|
96
|
+
inverse: w(7, 27),
|
|
97
|
+
hidden: w(8, 28),
|
|
98
|
+
strikethrough: w(9, 29)
|
|
99
|
+
}, _ = (e) => "bg" + e[0].toUpperCase() + e.slice(1), k = "Bright";
|
|
100
|
+
return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e, t) => {
|
|
101
|
+
M = _(e), 8 > t ? (I[e + k] = w(90 + t, h), I[M + k] = w(100 + t, b)) : t = 60, I[e] = w(30 + t, h), I[M] = w(40 + t, b);
|
|
102
|
+
})), s.extend(I);
|
|
103
|
+
}();
|
|
104
|
+
module.exports = w, w.default = w;
|
|
105
|
+
})))(), 1);
|
|
106
|
+
var ansis_default = import_ansis.default;
|
|
107
|
+
const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = import_ansis.default;
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/utils/colors.ts
|
|
110
|
+
const colors = {
|
|
111
|
+
blue: ansis_default.blue,
|
|
112
|
+
cyan: ansis_default.cyan,
|
|
113
|
+
gray: ansis_default.gray,
|
|
114
|
+
green: ansis_default.green,
|
|
115
|
+
red: ansis_default.red,
|
|
116
|
+
yellow: ansis_default.yellow,
|
|
117
|
+
bold: ansis_default.bold,
|
|
118
|
+
dim: ansis_default.dim,
|
|
119
|
+
reset: ansis_default.reset,
|
|
120
|
+
underline: ansis_default.underline
|
|
121
|
+
};
|
|
122
|
+
//#endregion
|
|
123
|
+
export { colors as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as SharedState, y as DevToolsNodeContext } from "./devframe-DulcIxwu.mjs";
|
|
2
2
|
|
|
3
|
-
//#region src/node/context
|
|
3
|
+
//#region src/node/internal/context.d.ts
|
|
4
4
|
interface InternalAnonymousAuthStorage {
|
|
5
5
|
trusted: Record<string, {
|
|
6
6
|
authToken: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { o as RpcFunctionsCollectorBase } from "./rpc-
|
|
2
|
-
import {
|
|
1
|
+
import { o as RpcFunctionsCollectorBase } from "./rpc-CkZuoz-m.mjs";
|
|
2
|
+
import { r as diagnostics } from "./serialization-CwO31axa.mjs";
|
|
3
3
|
import { defineRpcFunction } from "./index.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { t as colors$1 } from "./colors-Bl4W18Mh.mjs";
|
|
5
|
+
import { n as logger, t as diagnostics$1 } from "./diagnostics-BFhNNmST.mjs";
|
|
5
6
|
import { createEventEmitter } from "./utils/events.mjs";
|
|
6
|
-
import { createSharedState } from "./
|
|
7
|
+
import { t as createSharedState } from "./shared-state-DCDs0e7y.mjs";
|
|
7
8
|
import { createStreamReader, createStreamSink } from "./utils/streaming-channel.mjs";
|
|
8
9
|
import { consoleReporter, createLogger, defineDiagnostics } from "logs-sdk";
|
|
9
|
-
import c from "ansis";
|
|
10
10
|
import { ansiFormatter } from "logs-sdk/formatters/ansi";
|
|
11
11
|
import { isatty } from "node:tty";
|
|
12
12
|
import { formatWithOptions, inspect } from "node:util";
|
|
@@ -14,13 +14,14 @@ import { existsSync } from "node:fs";
|
|
|
14
14
|
//#region src/node/host-agent.ts
|
|
15
15
|
/**
|
|
16
16
|
* Framework-neutral host aggregating the agent-exposed surface of a
|
|
17
|
-
*
|
|
17
|
+
* devframe. Auto-discovers RPC functions with an `agent` field from
|
|
18
18
|
* `ctx.rpc.definitions`, and accepts plugin-registered tools /
|
|
19
19
|
* resources via `registerTool` / `registerResource`.
|
|
20
20
|
*
|
|
21
21
|
* @experimental
|
|
22
22
|
*/
|
|
23
23
|
var DevToolsAgentHost = class {
|
|
24
|
+
context;
|
|
24
25
|
events = createEventEmitter();
|
|
25
26
|
tools = /* @__PURE__ */ new Map();
|
|
26
27
|
resources = /* @__PURE__ */ new Map();
|
|
@@ -185,6 +186,7 @@ function hasPositionalKeys(obj) {
|
|
|
185
186
|
//#endregion
|
|
186
187
|
//#region src/node/host-diagnostics.ts
|
|
187
188
|
var DevToolsDiagnosticsHost = class {
|
|
189
|
+
context;
|
|
188
190
|
_definitions = [];
|
|
189
191
|
_logger;
|
|
190
192
|
defineDiagnostics = defineDiagnostics;
|
|
@@ -204,7 +206,7 @@ var DevToolsDiagnosticsHost = class {
|
|
|
204
206
|
_rebuild() {
|
|
205
207
|
this._logger = createLogger({
|
|
206
208
|
diagnostics: this._definitions,
|
|
207
|
-
formatter: ansiFormatter(
|
|
209
|
+
formatter: ansiFormatter(colors$1),
|
|
208
210
|
reporters: consoleReporter
|
|
209
211
|
});
|
|
210
212
|
}
|
|
@@ -921,6 +923,7 @@ var RpcFunctionsHost = class extends RpcFunctionsCollectorBase {
|
|
|
921
923
|
//#endregion
|
|
922
924
|
//#region src/node/host-views.ts
|
|
923
925
|
var DevToolsViewHost = class {
|
|
926
|
+
context;
|
|
924
927
|
/**
|
|
925
928
|
* @internal
|
|
926
929
|
*/
|
|
@@ -998,10 +1001,10 @@ const BUILTIN_AGENT_RPC = [
|
|
|
998
1001
|
/**
|
|
999
1002
|
* Framework-neutral core of the DevTools node context. Wires the RPC
|
|
1000
1003
|
* host, view (HTTP file-serving) host, diagnostics, and agent
|
|
1001
|
-
* subsystems
|
|
1002
|
-
*
|
|
1004
|
+
* subsystems. Hub-level subsystems (`docks`, `terminals`, `messages`,
|
|
1005
|
+
* `commands`, `createJsonRenderer`) are owned by
|
|
1003
1006
|
* `@vitejs/devtools-kit` — its `createKitContext` wraps this and
|
|
1004
|
-
* attaches them when the
|
|
1007
|
+
* attaches them when the devframe is mounted into a multi-integration
|
|
1005
1008
|
* hub.
|
|
1006
1009
|
*/
|
|
1007
1010
|
async function createHostContext(options) {
|
|
@@ -1014,8 +1017,7 @@ async function createHostContext(options) {
|
|
|
1014
1017
|
rpc: void 0,
|
|
1015
1018
|
views: void 0,
|
|
1016
1019
|
diagnostics: void 0,
|
|
1017
|
-
agent: void 0
|
|
1018
|
-
createJsonRenderer: void 0
|
|
1020
|
+
agent: void 0
|
|
1019
1021
|
};
|
|
1020
1022
|
const rpcHost = new RpcFunctionsHost(context);
|
|
1021
1023
|
const viewsHost = new DevToolsViewHost(context);
|
|
@@ -1024,25 +1026,6 @@ async function createHostContext(options) {
|
|
|
1024
1026
|
context.views = viewsHost;
|
|
1025
1027
|
context.diagnostics = diagnosticsHost;
|
|
1026
1028
|
context.agent = new DevToolsAgentHost(context);
|
|
1027
|
-
let jrCounter = 0;
|
|
1028
|
-
context.createJsonRenderer = (initialSpec) => {
|
|
1029
|
-
const stateKey = `devframe:json-render:${jrCounter++}`;
|
|
1030
|
-
const statePromise = rpcHost.sharedState.get(stateKey, { initialValue: initialSpec });
|
|
1031
|
-
return {
|
|
1032
|
-
_stateKey: stateKey,
|
|
1033
|
-
async updateSpec(spec) {
|
|
1034
|
-
(await statePromise).mutate(() => spec);
|
|
1035
|
-
},
|
|
1036
|
-
async updateState(newState) {
|
|
1037
|
-
(await statePromise).mutate((draft) => {
|
|
1038
|
-
draft.state = {
|
|
1039
|
-
...draft.state,
|
|
1040
|
-
...newState
|
|
1041
|
-
};
|
|
1042
|
-
});
|
|
1043
|
-
}
|
|
1044
|
-
};
|
|
1045
|
-
};
|
|
1046
1029
|
for (const fn of BUILTIN_AGENT_RPC) rpcHost.register(fn);
|
|
1047
1030
|
for (const fn of builtinRpcDeclarations) rpcHost.register(fn);
|
|
1048
1031
|
return context;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { t as createHostContext } from "./context-
|
|
2
|
-
import { t as createH3DevToolsHost } from "./host-h3-
|
|
3
|
-
import { t as startHttpAndWs } from "./server-
|
|
1
|
+
import { t as createHostContext } from "./context-DUibxhrR.mjs";
|
|
2
|
+
import { t as createH3DevToolsHost } from "./host-h3-Dz8YnFgu.mjs";
|
|
3
|
+
import { t as startHttpAndWs } from "./server-ma8-ZVyX.mjs";
|
|
4
4
|
import { DEVTOOLS_CONNECTION_META_FILENAME } from "./constants.mjs";
|
|
5
|
-
import { n as resolveBasePath, t as normalizeBasePath } from "./_shared-
|
|
6
|
-
import {
|
|
5
|
+
import { n as resolveBasePath, t as normalizeBasePath } from "./_shared-DcJX9-Az.mjs";
|
|
6
|
+
import { t as open } from "./open-DmFp0qZA.mjs";
|
|
7
|
+
import { serveStaticHandler } from "./utils/serve-static.mjs";
|
|
7
8
|
import { networkInterfaces } from "node:os";
|
|
8
9
|
import process$1 from "node:process";
|
|
9
|
-
import {
|
|
10
|
+
import { resolve } from "pathe";
|
|
11
|
+
import { createApp, eventHandler } from "h3";
|
|
10
12
|
import { createServer } from "node:net";
|
|
11
|
-
import sirv from "sirv";
|
|
12
13
|
//#region ../../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
|
|
13
14
|
const unsafePorts = /* @__PURE__ */ new Set([
|
|
14
15
|
1,
|
|
@@ -245,9 +246,15 @@ async function resolveDevServerPort(def, options = {}) {
|
|
|
245
246
|
return getPort(portOptions);
|
|
246
247
|
}
|
|
247
248
|
/**
|
|
248
|
-
* Start a devframe dev server for a {@link
|
|
249
|
-
* h3 + WebSocket RPC + the author's SPA mounted at the
|
|
250
|
-
* path.
|
|
249
|
+
* Start a devframe dev server for a {@link DevframeDefinition} —
|
|
250
|
+
* h3 + WebSocket RPC + (optionally) the author's SPA mounted at the
|
|
251
|
+
* resolved base path.
|
|
252
|
+
*
|
|
253
|
+
* When `distDir` is omitted (and `def.cli?.distDir` is unset) the
|
|
254
|
+
* server runs in **bridge mode**: only `__connection.json` and the WS
|
|
255
|
+
* endpoint are mounted, with no SPA mount. The SPA is expected to be
|
|
256
|
+
* hosted elsewhere (e.g. by a parent Vite/Nuxt dev server) — see
|
|
257
|
+
* `createVitePlugin({ devMiddleware })`.
|
|
251
258
|
*
|
|
252
259
|
* Returns the underlying {@link StartedServer} handle so callers can
|
|
253
260
|
* close it gracefully (SIGINT, hot-reload, test teardown).
|
|
@@ -258,7 +265,6 @@ async function resolveDevServerPort(def, options = {}) {
|
|
|
258
265
|
*/
|
|
259
266
|
async function createDevServer(def, options = {}) {
|
|
260
267
|
const distDir = options.distDir ?? def.cli?.distDir;
|
|
261
|
-
if (!distDir) throw new Error(`[devframe] createDevServer: no distDir for "${def.id}". Set \`cli.distDir\` on the definition or pass it as an option.`);
|
|
262
268
|
const host = options.host ?? def.cli?.host ?? "localhost";
|
|
263
269
|
const port = options.port ?? await resolveDevServerPort(def, { host });
|
|
264
270
|
const flags = options.flags ?? {};
|
|
@@ -268,10 +274,7 @@ async function createDevServer(def, options = {}) {
|
|
|
268
274
|
origin: `http://${host}:${port}`,
|
|
269
275
|
appName: def.id,
|
|
270
276
|
mount: (base, dir) => {
|
|
271
|
-
app.use(base,
|
|
272
|
-
dev: true,
|
|
273
|
-
single: true
|
|
274
|
-
})));
|
|
277
|
+
app.use(base, serveStaticHandler(dir));
|
|
275
278
|
}
|
|
276
279
|
});
|
|
277
280
|
const ctx = await createHostContext({
|
|
@@ -289,10 +292,7 @@ async function createDevServer(def, options = {}) {
|
|
|
289
292
|
websocket: port
|
|
290
293
|
}));
|
|
291
294
|
}));
|
|
292
|
-
app.use(basePath,
|
|
293
|
-
dev: true,
|
|
294
|
-
single: true
|
|
295
|
-
})));
|
|
295
|
+
if (distDir) app.use(basePath, serveStaticHandler(resolve(distDir)));
|
|
296
296
|
return startHttpAndWs({
|
|
297
297
|
context: ctx,
|
|
298
298
|
host,
|
|
@@ -312,7 +312,6 @@ async function maybeOpenBrowser(def, flags, origin, override) {
|
|
|
312
312
|
if (resolved === void 0 || resolved === false) return;
|
|
313
313
|
const target = typeof resolved === "string" ? resolveOpenTarget(origin, resolved) : origin;
|
|
314
314
|
try {
|
|
315
|
-
const { default: open } = await import("./open-Dede_w9r.mjs");
|
|
316
315
|
await open(target);
|
|
317
316
|
} catch {}
|
|
318
317
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-
|
|
1
|
+
import { f as RpcFunctionsCollectorBase } from "./index-DB2Ie0Or.mjs";
|
|
2
|
+
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-DjvlwLuM.mjs";
|
|
3
3
|
import { Logger, createLogger, defineDiagnostics } from "logs-sdk";
|
|
4
4
|
import { BirpcReturn } from "birpc";
|
|
5
|
-
import { Objectish, Patch, Patch as SharedStatePatch } from "immer";
|
|
6
5
|
import { CAC } from "cac";
|
|
7
6
|
import { GenericSchema, InferOutput } from "valibot";
|
|
8
7
|
|
|
@@ -25,7 +24,7 @@ type CliFlagsSchema = Record<string, GenericSchema>;
|
|
|
25
24
|
* config: v.optional(v.string()),
|
|
26
25
|
* })
|
|
27
26
|
*
|
|
28
|
-
*
|
|
27
|
+
* defineDevframe({
|
|
29
28
|
* cli: { flags: appFlags },
|
|
30
29
|
* setup(ctx, info) {
|
|
31
30
|
* const flags = info.flags as InferCliFlags<typeof appFlags>
|
|
@@ -387,35 +386,6 @@ interface DevToolsHost {
|
|
|
387
386
|
getStorageDir: (scope: 'workspace' | 'global') => string;
|
|
388
387
|
}
|
|
389
388
|
//#endregion
|
|
390
|
-
//#region src/types/json-render.d.ts
|
|
391
|
-
interface JsonRenderElement {
|
|
392
|
-
type: string;
|
|
393
|
-
props?: Record<string, unknown>;
|
|
394
|
-
children?: string[];
|
|
395
|
-
/** json-render event bindings (e.g. `{ press: { action: "my:action" } }`) */
|
|
396
|
-
on?: Record<string, unknown>;
|
|
397
|
-
/** json-render visibility condition */
|
|
398
|
-
visible?: unknown;
|
|
399
|
-
/** json-render repeat binding */
|
|
400
|
-
repeat?: unknown;
|
|
401
|
-
/** Allow additional json-render element fields */
|
|
402
|
-
[key: string]: unknown;
|
|
403
|
-
}
|
|
404
|
-
interface JsonRenderSpec {
|
|
405
|
-
root: string;
|
|
406
|
-
elements: Record<string, JsonRenderElement>;
|
|
407
|
-
/** Initial client-side state model for $state/$bindState expressions */
|
|
408
|
-
state?: Record<string, unknown>;
|
|
409
|
-
}
|
|
410
|
-
interface JsonRenderer {
|
|
411
|
-
/** Replace the entire spec */
|
|
412
|
-
updateSpec: (spec: JsonRenderSpec) => void | Promise<void>;
|
|
413
|
-
/** Update json-render state values (shallow merge into spec.state) */
|
|
414
|
-
updateState: (state: Record<string, unknown>) => void | Promise<void>;
|
|
415
|
-
/** Internal: shared state key used by the client to subscribe */
|
|
416
|
-
readonly _stateKey: string;
|
|
417
|
-
}
|
|
418
|
-
//#endregion
|
|
419
389
|
//#region src/types/rpc-augments.d.ts
|
|
420
390
|
/**
|
|
421
391
|
* To be extended
|
|
@@ -557,6 +527,15 @@ type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
|
|
|
557
527
|
type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
|
|
558
528
|
type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
|
|
559
529
|
type ImmutableObject<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
530
|
+
/**
|
|
531
|
+
* Serializable patch describing a single mutation to a `SharedState`.
|
|
532
|
+
* Structurally compatible with JSON-Patch and is safe to send over RPC.
|
|
533
|
+
*/
|
|
534
|
+
interface SharedStatePatch {
|
|
535
|
+
op: 'add' | 'remove' | 'replace';
|
|
536
|
+
path: readonly (string | number)[];
|
|
537
|
+
value?: unknown;
|
|
538
|
+
}
|
|
560
539
|
/**
|
|
561
540
|
* State host that is immutable by default with explicit mutate.
|
|
562
541
|
*/
|
|
@@ -576,14 +555,14 @@ interface SharedState<T> {
|
|
|
576
555
|
/**
|
|
577
556
|
* Apply patches to the state.
|
|
578
557
|
*/
|
|
579
|
-
patch: (patches:
|
|
558
|
+
patch: (patches: SharedStatePatch[], syncId?: string) => void;
|
|
580
559
|
/**
|
|
581
560
|
* Sync IDs that have been applied to the state.
|
|
582
561
|
*/
|
|
583
562
|
syncIds: Set<string>;
|
|
584
563
|
}
|
|
585
564
|
interface SharedStateEvents<T> {
|
|
586
|
-
updated: (fullState: T, patches:
|
|
565
|
+
updated: (fullState: T, patches: SharedStatePatch[] | undefined, syncId: string) => void;
|
|
587
566
|
}
|
|
588
567
|
interface SharedStateOptions<T> {
|
|
589
568
|
/**
|
|
@@ -597,7 +576,7 @@ interface SharedStateOptions<T> {
|
|
|
597
576
|
*/
|
|
598
577
|
enablePatches?: boolean;
|
|
599
578
|
}
|
|
600
|
-
declare function createSharedState<T extends
|
|
579
|
+
declare function createSharedState<T extends object>(options: SharedStateOptions<T>): SharedState<T>;
|
|
601
580
|
//#endregion
|
|
602
581
|
//#region src/utils/streaming-channel.d.ts
|
|
603
582
|
/**
|
|
@@ -929,10 +908,6 @@ interface DevToolsNodeContext {
|
|
|
929
908
|
* @experimental
|
|
930
909
|
*/
|
|
931
910
|
agent: DevToolsAgentHost;
|
|
932
|
-
/**
|
|
933
|
-
* Create a JsonRenderer handle for building json-render powered UIs.
|
|
934
|
-
*/
|
|
935
|
-
createJsonRenderer: (spec: JsonRenderSpec) => JsonRenderer;
|
|
936
911
|
}
|
|
937
912
|
interface ConnectionMeta {
|
|
938
913
|
backend: 'websocket' | 'static';
|
|
@@ -948,17 +923,17 @@ interface ConnectionMeta {
|
|
|
948
923
|
jsonSerializableMethods?: string[];
|
|
949
924
|
}
|
|
950
925
|
//#endregion
|
|
951
|
-
//#region src/types/
|
|
952
|
-
type
|
|
926
|
+
//#region src/types/devframe.d.ts
|
|
927
|
+
type DevframeRuntime = 'cli' | 'build' | 'spa' | 'vite' | 'kit' | 'embedded';
|
|
953
928
|
/**
|
|
954
|
-
* Classification of how a
|
|
929
|
+
* Classification of how a devframe is being deployed. Hosted adapters
|
|
955
930
|
* (`vite`, `kit`, `embedded`) share their origin with a host app and
|
|
956
931
|
* must namespace their mount path under `/__<id>/`. Standalone adapters
|
|
957
932
|
* (`cli`, `spa`, `build`) own the origin and default to `/`.
|
|
958
933
|
*/
|
|
959
|
-
type
|
|
960
|
-
interface
|
|
961
|
-
/** Binary name; default: the
|
|
934
|
+
type DevframeDeploymentKind = 'standalone' | 'hosted';
|
|
935
|
+
interface DevframeCliOptions {
|
|
936
|
+
/** Binary name; default: the devframe's `id`. */
|
|
962
937
|
command?: string;
|
|
963
938
|
/** Preferred port for the dev server (default 9999). */
|
|
964
939
|
port?: number;
|
|
@@ -983,7 +958,7 @@ interface DevtoolCliOptions {
|
|
|
983
958
|
* `devtools.clientAuth` today.
|
|
984
959
|
*/
|
|
985
960
|
auth?: boolean;
|
|
986
|
-
/** Author's SPA dist directory (served as the
|
|
961
|
+
/** Author's SPA dist directory (served as the devframe's UI). */
|
|
987
962
|
distDir?: string;
|
|
988
963
|
/**
|
|
989
964
|
* Capability-side CAC hook. Called with the CAC instance after the
|
|
@@ -1009,7 +984,7 @@ interface DevtoolCliOptions {
|
|
|
1009
984
|
* config: v.optional(v.string()),
|
|
1010
985
|
* })
|
|
1011
986
|
*
|
|
1012
|
-
*
|
|
987
|
+
* defineDevframe({
|
|
1013
988
|
* cli: { flags: appFlags },
|
|
1014
989
|
* setup(ctx, info) {
|
|
1015
990
|
* const flags = info.flags as InferCliFlags<typeof appFlags>
|
|
@@ -1019,7 +994,7 @@ interface DevtoolCliOptions {
|
|
|
1019
994
|
*/
|
|
1020
995
|
flags?: CliFlagsSchema;
|
|
1021
996
|
}
|
|
1022
|
-
interface
|
|
997
|
+
interface DevframeSpaOptions {
|
|
1023
998
|
base?: string;
|
|
1024
999
|
/**
|
|
1025
1000
|
* How the deployed SPA loads its data.
|
|
@@ -1029,7 +1004,7 @@ interface DevtoolSpaOptions {
|
|
|
1029
1004
|
*/
|
|
1030
1005
|
loader?: 'query' | 'upload' | 'none';
|
|
1031
1006
|
}
|
|
1032
|
-
interface
|
|
1007
|
+
interface DevframeBrowserContext {
|
|
1033
1008
|
/**
|
|
1034
1009
|
* The connected RPC client (may be write-disabled in static/spa modes).
|
|
1035
1010
|
*/
|
|
@@ -1040,11 +1015,11 @@ interface DevtoolBrowserContext {
|
|
|
1040
1015
|
* populate the fields that make sense for their deployment. In
|
|
1041
1016
|
* particular, `createCli` fills `flags` with the parsed CAC bag.
|
|
1042
1017
|
*/
|
|
1043
|
-
interface
|
|
1018
|
+
interface DevframeSetupInfo {
|
|
1044
1019
|
/** Parsed CLI flags, populated by the CLI adapter. */
|
|
1045
1020
|
flags?: Record<string, unknown>;
|
|
1046
1021
|
}
|
|
1047
|
-
interface
|
|
1022
|
+
interface DevframeDefinition {
|
|
1048
1023
|
id: string;
|
|
1049
1024
|
name: string;
|
|
1050
1025
|
icon?: string | {
|
|
@@ -1064,12 +1039,28 @@ interface DevtoolDefinition {
|
|
|
1064
1039
|
spa?: boolean | Record<string, boolean>;
|
|
1065
1040
|
};
|
|
1066
1041
|
/** Server-side setup — the primary entrypoint. Runs in every runtime. */
|
|
1067
|
-
setup: (ctx: DevToolsNodeContext, info?:
|
|
1042
|
+
setup: (ctx: DevToolsNodeContext, info?: DevframeSetupInfo) => void | Promise<void>;
|
|
1068
1043
|
/** Browser-only setup for the SPA adapter (bundled into the client). */
|
|
1069
|
-
setupBrowser?: (ctx:
|
|
1070
|
-
cli?:
|
|
1071
|
-
spa?:
|
|
1044
|
+
setupBrowser?: (ctx: DevframeBrowserContext) => void | Promise<void>;
|
|
1045
|
+
cli?: DevframeCliOptions;
|
|
1046
|
+
spa?: DevframeSpaOptions;
|
|
1072
1047
|
}
|
|
1073
|
-
declare function
|
|
1048
|
+
declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
|
|
1049
|
+
/** @deprecated Use `DevframeRuntime`. */
|
|
1050
|
+
type DevtoolRuntime = DevframeRuntime;
|
|
1051
|
+
/** @deprecated Use `DevframeDeploymentKind`. */
|
|
1052
|
+
type DevtoolDeploymentKind = DevframeDeploymentKind;
|
|
1053
|
+
/** @deprecated Use `DevframeCliOptions`. */
|
|
1054
|
+
type DevtoolCliOptions = DevframeCliOptions;
|
|
1055
|
+
/** @deprecated Use `DevframeSpaOptions`. */
|
|
1056
|
+
type DevtoolSpaOptions = DevframeSpaOptions;
|
|
1057
|
+
/** @deprecated Use `DevframeBrowserContext`. */
|
|
1058
|
+
type DevtoolBrowserContext = DevframeBrowserContext;
|
|
1059
|
+
/** @deprecated Use `DevframeSetupInfo`. */
|
|
1060
|
+
type DevtoolSetupInfo = DevframeSetupInfo;
|
|
1061
|
+
/** @deprecated Use `DevframeDefinition`. */
|
|
1062
|
+
type DevtoolDefinition = DevframeDefinition;
|
|
1063
|
+
/** @deprecated Use `defineDevframe`. */
|
|
1064
|
+
declare function defineDevtool(d: DevframeDefinition): DevframeDefinition;
|
|
1074
1065
|
//#endregion
|
|
1075
|
-
export {
|
|
1066
|
+
export { DevToolsRpcSharedStates as $, CreateStreamSinkOptions as A, ImmutableObject as B, RpcSharedStateGetOptions as C, RpcStreamingHost as D, RpcStreamingChannelOptions as E, createStreamReader as F, SharedStatePatch as G, SharedState as H, createStreamSink as I, EntriesToObject as J, createSharedState as K, Immutable as L, StreamReader as M, StreamSink as N, BufferedChunk as O, StreamSinkEvents as P, DevToolsRpcServerFunctions as Q, ImmutableArray as R, RpcFunctionsHost as S, RpcStreamingChannel as T, SharedStateEvents as U, ImmutableSet as V, SharedStateOptions as W, Thenable as X, PartialWithoutId as Y, DevToolsRpcClientFunctions as Z, ConnectionMeta as _, InferCliFlags as _t, DevframeRuntime as a, AgentManifest as at, DevToolsNodeRpcSession as b, DevtoolBrowserContext as c, AgentResourceInput as ct, DevtoolDeploymentKind as d, DevToolsAgentHost as dt, DevToolsHost as et, DevtoolRuntime as f, DevToolsAgentHostEvents as ft, defineDevtool as g, CliFlagsSchema as gt, defineDevframe as h, EventsMap as ht, DevframeDeploymentKind as i, AgentHandle as it, StreamErrorPayload as j, CreateStreamReaderOptions as k, DevtoolCliOptions as l, AgentTool as lt, DevtoolSpaOptions as m, EventUnsubscribe as mt, DevframeCliOptions as n, DevToolsDiagnosticsHost as nt, DevframeSetupInfo as o, AgentResource as ot, DevtoolSetupInfo as p, EventEmitter as pt, DevToolsViewHost as q, DevframeDefinition as r, DevToolsDiagnosticsLogger as rt, DevframeSpaOptions as s, AgentResourceContent as st, DevframeBrowserContext as t, DevToolsDiagnosticsDefinition as tt, DevtoolDefinition as u, AgentToolInput as ut, DevToolsCapabilities as v, defineCliFlags as vt, RpcSharedStateHost as w, RpcBroadcastOptions as x, DevToolsNodeContext as y, parseCliFlags as yt, ImmutableMap as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { t as colors } from "./colors-Bl4W18Mh.mjs";
|
|
1
2
|
import { consoleReporter, createLogger, defineDiagnostics } from "logs-sdk";
|
|
2
|
-
import c from "ansis";
|
|
3
3
|
import { ansiFormatter } from "logs-sdk/formatters/ansi";
|
|
4
4
|
//#region src/node/diagnostics.ts
|
|
5
5
|
const diagnostics = defineDiagnostics({
|
|
@@ -39,12 +39,17 @@ const diagnostics = defineDiagnostics({
|
|
|
39
39
|
DF0032: {
|
|
40
40
|
message: (p) => `Streaming channel "${p.channel}" is already registered.`,
|
|
41
41
|
hint: "Each channel name must be unique within a context. Pick a different name or reuse the existing channel handle."
|
|
42
|
+
},
|
|
43
|
+
DF0033: {
|
|
44
|
+
message: (p) => `Failed to start dev RPC bridge for "${p.id}": ${p.reason}`,
|
|
45
|
+
hint: "Verify the bridge port is free and the devframe setup function does not throw. Pin a port via `cli.port` / `cli.portRange` on the definition, or via `devMiddleware.port` on `createVitePlugin`.",
|
|
46
|
+
level: "warn"
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
49
|
});
|
|
45
50
|
const logger = createLogger({
|
|
46
51
|
diagnostics: [diagnostics],
|
|
47
|
-
formatter: ansiFormatter(
|
|
52
|
+
formatter: ansiFormatter(colors),
|
|
48
53
|
reporters: consoleReporter
|
|
49
54
|
});
|
|
50
55
|
//#endregion
|