@fluixi/devtools 1.0.0-alpha.108 → 1.0.0-alpha.110
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/callsite.mjs +4 -63
- package/dist/change-view.mjs +6 -106
- package/dist/chunk-235BSS43.mjs +185 -0
- package/dist/chunk-2ACSNLS6.mjs +87 -0
- package/dist/chunk-2VDMQ3VF.mjs +520 -0
- package/dist/chunk-33U2S43X.mjs +121 -0
- package/dist/chunk-B3SAJ7QG.mjs +72 -0
- package/dist/chunk-BTCWJTXR.mjs +216 -0
- package/dist/chunk-CPZWLBCQ.mjs +35 -0
- package/dist/chunk-D25KZZBZ.mjs +212 -0
- package/dist/chunk-EBSROPWJ.mjs +314 -0
- package/dist/chunk-F664XLZL.mjs +743 -0
- package/dist/chunk-FY5K3QVT.mjs +35 -0
- package/dist/chunk-GDQXCOQB.mjs +43 -0
- package/dist/chunk-JLNWT36I.mjs +118 -0
- package/dist/chunk-JTHAZJJZ.mjs +780 -0
- package/dist/chunk-L6XQGNMW.mjs +106 -0
- package/dist/chunk-MN6O673L.mjs +90 -0
- package/dist/chunk-NDUBBBNL.mjs +70 -0
- package/dist/chunk-NT7YMK77.mjs +157 -0
- package/dist/chunk-NVULLJDH.mjs +120 -0
- package/dist/chunk-NWLSDERQ.mjs +68 -0
- package/dist/chunk-OPIGF5XB.mjs +184 -0
- package/dist/chunk-P5I7DWFX.mjs +292 -0
- package/dist/chunk-PSSBFXBD.mjs +155 -0
- package/dist/chunk-PTQ5VCYE.mjs +103 -0
- package/dist/chunk-UAEJ3N7F.mjs +76 -0
- package/dist/chunk-V6DKWEYD.mjs +67 -0
- package/dist/chunk-VO2V7AC5.mjs +80 -0
- package/dist/chunk-WGQH7RUW.mjs +25 -0
- package/dist/chunk-Z6KYHEKY.mjs +64 -0
- package/dist/copy.mjs +3 -39
- package/dist/describe.mjs +3 -31
- package/dist/detail-panel.cjs +2 -1
- package/dist/detail-panel.d.ts.map +1 -1
- package/dist/detail-panel.js +1 -0
- package/dist/detail-panel.mjs +6 -280
- package/dist/diff.mjs +4 -201
- package/dist/dom.mjs +7 -176
- package/dist/export.mjs +6 -207
- package/dist/float.mjs +5 -206
- package/dist/format.mjs +5 -151
- package/dist/graph-view.mjs +9 -875
- package/dist/highlight.mjs +6 -113
- package/dist/history.cjs +14 -2
- package/dist/history.d.ts +8 -1
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +15 -2
- package/dist/history.mjs +4 -70
- package/dist/hook.cjs +26 -1
- package/dist/hook.d.ts +4 -0
- package/dist/hook.d.ts.map +1 -1
- package/dist/hook.js +13 -0
- package/dist/hook.mjs +16 -1719
- package/dist/index.cjs +34 -5
- package/dist/index.mjs +106 -4673
- package/dist/inspector.mjs +11 -677
- package/dist/instrument.mjs +9 -486
- package/dist/kind-filter.mjs +6 -148
- package/dist/menu.mjs +4 -116
- package/dist/observe.cjs +15 -1
- package/dist/observe.d.ts +2 -0
- package/dist/observe.d.ts.map +1 -1
- package/dist/observe.js +3 -0
- package/dist/observe.mjs +14 -1510
- package/dist/palette.mjs +6 -28
- package/dist/path.mjs +3 -21
- package/dist/plugin.mjs +9 -57
- package/dist/plugins/context.mjs +6 -71
- package/dist/plugins/directives.mjs +8 -68
- package/dist/plugins/index.cjs +1 -1
- package/dist/plugins/index.mjs +13 -136
- package/dist/source.mjs +12 -93
- package/dist/timeline.cjs +5 -2
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.js +5 -1
- package/dist/timeline.mjs +7 -323
- package/dist/tree.mjs +11 -558
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/value-pane.mjs +6 -196
- package/dist/wire.cjs +1 -1
- package/dist/wire.mjs +6 -86
- package/package.json +3 -3
package/dist/palette.mjs
CHANGED
|
@@ -1,31 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
resource: "#fb7185",
|
|
8
|
-
component: "#f0abfc",
|
|
9
|
-
provider: "#fb923c",
|
|
10
|
-
control: "#22d3ee",
|
|
11
|
-
router: "#818cf8",
|
|
12
|
-
handler: "#f472b6",
|
|
13
|
-
context: "#a3e635",
|
|
14
|
-
directive: "#5eead4",
|
|
15
|
-
binding: "#5eead4",
|
|
16
|
-
setter: "#fb7185",
|
|
17
|
-
group: "#8a90a2",
|
|
18
|
-
element: "#8a90a2",
|
|
19
|
-
"custom-element": "#2dd4bf",
|
|
20
|
-
module: "#facc15",
|
|
21
|
-
service: "#60a5fa"
|
|
22
|
-
};
|
|
23
|
-
var kindVar = (kind) => `--fx-kind-${kind}`;
|
|
24
|
-
var kindColor = (kind) => `var(${kindVar(kind)}, ${KIND_COLOR[kind]})`;
|
|
25
|
-
var KINDS = Object.keys(KIND_COLOR);
|
|
26
|
-
function kindRules(selector, property) {
|
|
27
|
-
return KINDS.map((kind) => `${selector(kind)} { ${property}: ${kindColor(kind)}; }`).join("\n");
|
|
28
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
KIND_COLOR,
|
|
3
|
+
kindColor,
|
|
4
|
+
kindRules,
|
|
5
|
+
kindVar
|
|
6
|
+
} from "./chunk-FY5K3QVT.mjs";
|
|
29
7
|
export {
|
|
30
8
|
KIND_COLOR,
|
|
31
9
|
kindColor,
|
package/dist/path.mjs
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var WORKSPACE_DIRS = /* @__PURE__ */ new Set(["packages", "apps", "libs", "examples"]);
|
|
5
|
-
function shortenPath(file, root) {
|
|
6
|
-
const path = normalize(file);
|
|
7
|
-
if (root) {
|
|
8
|
-
const base = normalize(root).replace(/\/+$/, "");
|
|
9
|
-
if (base && path.startsWith(`${base}/`)) return path.slice(base.length + 1);
|
|
10
|
-
if (base.startsWith("/") && path.startsWith(`${base.slice(1)}/`)) return path.slice(base.length);
|
|
11
|
-
}
|
|
12
|
-
const installed = path.lastIndexOf("node_modules/");
|
|
13
|
-
if (installed >= 0) return path.slice(installed + "node_modules/".length);
|
|
14
|
-
if (ROOTED.test(path)) {
|
|
15
|
-
const segments = path.split("/");
|
|
16
|
-
for (let i = segments.length - 2; i > 0; i--) {
|
|
17
|
-
if (WORKSPACE_DIRS.has(segments[i])) return segments.slice(i).join("/");
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return path;
|
|
21
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
shortenPath
|
|
3
|
+
} from "./chunk-WGQH7RUW.mjs";
|
|
22
4
|
export {
|
|
23
5
|
shortenPath
|
|
24
6
|
};
|
package/dist/plugin.mjs
CHANGED
|
@@ -1,60 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
function annotationOf(node, name) {
|
|
12
|
-
return node.extra?.[name];
|
|
13
|
-
}
|
|
14
|
-
function pluginRows(node, graph) {
|
|
15
|
-
const out = [];
|
|
16
|
-
for (const plugin of plugins) {
|
|
17
|
-
if (!plugin.rows) continue;
|
|
18
|
-
try {
|
|
19
|
-
out.push(...plugin.rows(node, graph));
|
|
20
|
-
} catch {
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return out;
|
|
24
|
-
}
|
|
25
|
-
function pluginElementRows(extra) {
|
|
26
|
-
if (!extra) return [];
|
|
27
|
-
const out = [];
|
|
28
|
-
for (const plugin of plugins) {
|
|
29
|
-
if (!plugin.elementRows) continue;
|
|
30
|
-
try {
|
|
31
|
-
out.push(...plugin.elementRows(extra));
|
|
32
|
-
} catch {
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return out;
|
|
36
|
-
}
|
|
37
|
-
function pluginElementBadge(extra) {
|
|
38
|
-
if (!extra) return void 0;
|
|
39
|
-
for (const plugin of plugins) {
|
|
40
|
-
try {
|
|
41
|
-
const badge = plugin.elementBadge?.(extra);
|
|
42
|
-
if (badge) return badge;
|
|
43
|
-
} catch {
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return void 0;
|
|
47
|
-
}
|
|
48
|
-
function pluginBadge(node) {
|
|
49
|
-
for (const plugin of plugins) {
|
|
50
|
-
try {
|
|
51
|
-
const badge = plugin.badge?.(node);
|
|
52
|
-
if (badge) return badge;
|
|
53
|
-
} catch {
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return void 0;
|
|
57
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
annotationOf,
|
|
3
|
+
devtoolsPlugins,
|
|
4
|
+
pluginBadge,
|
|
5
|
+
pluginElementBadge,
|
|
6
|
+
pluginElementRows,
|
|
7
|
+
pluginRows,
|
|
8
|
+
registerDevtoolsPlugin
|
|
9
|
+
} from "./chunk-V6DKWEYD.mjs";
|
|
58
10
|
export {
|
|
59
11
|
annotationOf,
|
|
60
12
|
devtoolsPlugins,
|
package/dist/plugins/context.mjs
CHANGED
|
@@ -1,74 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// src/format.ts
|
|
10
|
-
function shorten(text, limit = 18) {
|
|
11
|
-
return text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// src/plugins/context.ts
|
|
15
|
-
var NAME = "context";
|
|
16
|
-
var contextPlugin = {
|
|
17
|
-
name: NAME,
|
|
18
|
-
collect(ctx) {
|
|
19
|
-
const nodes = /* @__PURE__ */ new Map();
|
|
20
|
-
ctx.onContext((report) => {
|
|
21
|
-
if (report.owner === void 0) return;
|
|
22
|
-
let node = nodes.get(report.id);
|
|
23
|
-
if (node === void 0) {
|
|
24
|
-
const label = report.name === "context" && report.ownerLabel ? `${report.ownerLabel} context` : report.name;
|
|
25
|
-
node = ctx.add({
|
|
26
|
-
label,
|
|
27
|
-
kind: "context",
|
|
28
|
-
// A context is created at module scope with nothing running, so the only line it
|
|
29
|
-
// can carry is the one that provided or read it.
|
|
30
|
-
...report.at ? { source: report.at } : {},
|
|
31
|
-
// The router's own contexts are the framework's, and belong in its card rather
|
|
32
|
-
// than beside the ones the application wrote.
|
|
33
|
-
authored: report.at?.external !== true,
|
|
34
|
-
// Under whoever provided it. A context read with no provider above it belongs to
|
|
35
|
-
// the reader, which is the honest place for a default value.
|
|
36
|
-
createdIn: report.owner,
|
|
37
|
-
// Short on the card, whole in the inspector, the way every other node works.
|
|
38
|
-
...report.value !== void 0 ? { value: shorten(report.value), detail: report.value } : {}
|
|
39
|
-
});
|
|
40
|
-
nodes.set(report.id, node);
|
|
41
|
-
}
|
|
42
|
-
if (report.kind === "provide") ctx.retype(report.owner, "provider");
|
|
43
|
-
const held = ctx.annotation(report.owner) ?? [];
|
|
44
|
-
const already = held.some((n) => n.name === report.name && n.kind === report.kind);
|
|
45
|
-
if (already) return;
|
|
46
|
-
held.push({
|
|
47
|
-
name: report.name,
|
|
48
|
-
kind: report.kind,
|
|
49
|
-
...report.value !== void 0 ? { value: report.value } : {}
|
|
50
|
-
});
|
|
51
|
-
ctx.annotate(report.owner, held);
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
rows(node) {
|
|
55
|
-
const notes = node.extra?.[NAME];
|
|
56
|
-
if (!notes?.length) return [];
|
|
57
|
-
return notes.map((note) => ({
|
|
58
|
-
label: note.kind === "provide" ? `provides ${note.name}` : `reads ${note.name}`,
|
|
59
|
-
...note.value !== void 0 ? { value: note.value } : {}
|
|
60
|
-
}));
|
|
61
|
-
},
|
|
62
|
-
badge(node) {
|
|
63
|
-
const notes = node.extra?.[NAME];
|
|
64
|
-
if (!notes?.length) return void 0;
|
|
65
|
-
const given = notes.filter((n) => n.kind === "provide");
|
|
66
|
-
if (given.length === 1) return `provides ${given[0].name}`;
|
|
67
|
-
if (given.length > 1) return `provides ${given.length}`;
|
|
68
|
-
return notes.length === 1 ? `reads ${notes[0].name}` : `reads ${notes.length}`;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
registerDevtoolsPlugin(contextPlugin);
|
|
1
|
+
import {
|
|
2
|
+
NAME,
|
|
3
|
+
contextPlugin
|
|
4
|
+
} from "../chunk-NDUBBBNL.mjs";
|
|
5
|
+
import "../chunk-V6DKWEYD.mjs";
|
|
6
|
+
import "../chunk-NT7YMK77.mjs";
|
|
72
7
|
export {
|
|
73
8
|
NAME,
|
|
74
9
|
contextPlugin
|
|
@@ -1,71 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// src/plugins/directives.ts
|
|
10
|
-
var NAME = "directives";
|
|
11
|
-
function directivesOn(extra) {
|
|
12
|
-
return extra?.[NAME] ?? [];
|
|
13
|
-
}
|
|
14
|
-
function directiveBadge(notes) {
|
|
15
|
-
if (!notes.length) return void 0;
|
|
16
|
-
const first = notes[0];
|
|
17
|
-
const short = first.kind === "ref" ? "ref" : label(first);
|
|
18
|
-
return notes.length > 1 ? `${short} +${notes.length - 1}` : short;
|
|
19
|
-
}
|
|
20
|
-
function directiveRows(notes) {
|
|
21
|
-
return notes.map((note) => ({
|
|
22
|
-
label: label(note),
|
|
23
|
-
value: note.element,
|
|
24
|
-
...note.at ? { at: note.at } : {}
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
var label = (note) => note.kind === "ref" ? `ref ${note.name}` : `${note.kind}:${note.name}`;
|
|
28
|
-
var directivesPlugin = {
|
|
29
|
-
name: NAME,
|
|
30
|
-
collect(ctx) {
|
|
31
|
-
ctx.onDirective((report) => {
|
|
32
|
-
if (!report.target) return;
|
|
33
|
-
const held = ctx.elementAnnotation(report.target) ?? [];
|
|
34
|
-
const already = held.some((n) => n.kind === report.kind && n.name === report.name);
|
|
35
|
-
if (already) return;
|
|
36
|
-
held.push({
|
|
37
|
-
kind: report.kind,
|
|
38
|
-
name: report.name,
|
|
39
|
-
element: report.element,
|
|
40
|
-
...report.at ? { at: report.at } : {}
|
|
41
|
-
});
|
|
42
|
-
ctx.annotateElement(report.target, held);
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
rows(node) {
|
|
46
|
-
const notes = node.extra?.[NAME];
|
|
47
|
-
if (!notes?.length) return [];
|
|
48
|
-
return notes.map((note) => ({
|
|
49
|
-
label: label(note),
|
|
50
|
-
value: note.element,
|
|
51
|
-
...note.at ? { at: note.at } : {}
|
|
52
|
-
}));
|
|
53
|
-
},
|
|
54
|
-
elementRows(extra) {
|
|
55
|
-
return directiveRows(directivesOn(extra));
|
|
56
|
-
},
|
|
57
|
-
elementBadge(extra) {
|
|
58
|
-
return directiveBadge(directivesOn(extra));
|
|
59
|
-
},
|
|
60
|
-
badge(node) {
|
|
61
|
-
const notes = node.extra?.[NAME];
|
|
62
|
-
if (!notes?.length) return void 0;
|
|
63
|
-
const first = notes[0];
|
|
64
|
-
const short = first.kind === "ref" ? "ref" : label(first);
|
|
65
|
-
return notes.length > 1 ? `${short} +${notes.length - 1}` : short;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
registerDevtoolsPlugin(directivesPlugin);
|
|
1
|
+
import {
|
|
2
|
+
NAME,
|
|
3
|
+
directiveBadge,
|
|
4
|
+
directiveRows,
|
|
5
|
+
directivesOn,
|
|
6
|
+
directivesPlugin
|
|
7
|
+
} from "../chunk-B3SAJ7QG.mjs";
|
|
8
|
+
import "../chunk-V6DKWEYD.mjs";
|
|
69
9
|
export {
|
|
70
10
|
NAME,
|
|
71
11
|
directiveBadge,
|
package/dist/plugins/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/devtools v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/devtools v1.0.0-alpha.110 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,140 +1,17 @@
|
|
|
1
|
-
/*! @fluixi/devtools v1.0.0-alpha.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var NAME = "directives";
|
|
13
|
-
function directivesOn(extra) {
|
|
14
|
-
return extra?.[NAME] ?? [];
|
|
15
|
-
}
|
|
16
|
-
function directiveBadge(notes) {
|
|
17
|
-
if (!notes.length) return void 0;
|
|
18
|
-
const first = notes[0];
|
|
19
|
-
const short = first.kind === "ref" ? "ref" : label(first);
|
|
20
|
-
return notes.length > 1 ? `${short} +${notes.length - 1}` : short;
|
|
21
|
-
}
|
|
22
|
-
function directiveRows(notes) {
|
|
23
|
-
return notes.map((note) => ({
|
|
24
|
-
label: label(note),
|
|
25
|
-
value: note.element,
|
|
26
|
-
...note.at ? { at: note.at } : {}
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
var label = (note) => note.kind === "ref" ? `ref ${note.name}` : `${note.kind}:${note.name}`;
|
|
30
|
-
var directivesPlugin = {
|
|
31
|
-
name: NAME,
|
|
32
|
-
collect(ctx) {
|
|
33
|
-
ctx.onDirective((report) => {
|
|
34
|
-
if (!report.target) return;
|
|
35
|
-
const held = ctx.elementAnnotation(report.target) ?? [];
|
|
36
|
-
const already = held.some((n) => n.kind === report.kind && n.name === report.name);
|
|
37
|
-
if (already) return;
|
|
38
|
-
held.push({
|
|
39
|
-
kind: report.kind,
|
|
40
|
-
name: report.name,
|
|
41
|
-
element: report.element,
|
|
42
|
-
...report.at ? { at: report.at } : {}
|
|
43
|
-
});
|
|
44
|
-
ctx.annotateElement(report.target, held);
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
rows(node) {
|
|
48
|
-
const notes = node.extra?.[NAME];
|
|
49
|
-
if (!notes?.length) return [];
|
|
50
|
-
return notes.map((note) => ({
|
|
51
|
-
label: label(note),
|
|
52
|
-
value: note.element,
|
|
53
|
-
...note.at ? { at: note.at } : {}
|
|
54
|
-
}));
|
|
55
|
-
},
|
|
56
|
-
elementRows(extra) {
|
|
57
|
-
return directiveRows(directivesOn(extra));
|
|
58
|
-
},
|
|
59
|
-
elementBadge(extra) {
|
|
60
|
-
return directiveBadge(directivesOn(extra));
|
|
61
|
-
},
|
|
62
|
-
badge(node) {
|
|
63
|
-
const notes = node.extra?.[NAME];
|
|
64
|
-
if (!notes?.length) return void 0;
|
|
65
|
-
const first = notes[0];
|
|
66
|
-
const short = first.kind === "ref" ? "ref" : label(first);
|
|
67
|
-
return notes.length > 1 ? `${short} +${notes.length - 1}` : short;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
registerDevtoolsPlugin(directivesPlugin);
|
|
71
|
-
|
|
72
|
-
// src/format.ts
|
|
73
|
-
function shorten(text, limit = 18) {
|
|
74
|
-
return text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// src/plugins/context.ts
|
|
78
|
-
var NAME2 = "context";
|
|
79
|
-
var contextPlugin = {
|
|
80
|
-
name: NAME2,
|
|
81
|
-
collect(ctx) {
|
|
82
|
-
const nodes = /* @__PURE__ */ new Map();
|
|
83
|
-
ctx.onContext((report) => {
|
|
84
|
-
if (report.owner === void 0) return;
|
|
85
|
-
let node = nodes.get(report.id);
|
|
86
|
-
if (node === void 0) {
|
|
87
|
-
const label2 = report.name === "context" && report.ownerLabel ? `${report.ownerLabel} context` : report.name;
|
|
88
|
-
node = ctx.add({
|
|
89
|
-
label: label2,
|
|
90
|
-
kind: "context",
|
|
91
|
-
// A context is created at module scope with nothing running, so the only line it
|
|
92
|
-
// can carry is the one that provided or read it.
|
|
93
|
-
...report.at ? { source: report.at } : {},
|
|
94
|
-
// The router's own contexts are the framework's, and belong in its card rather
|
|
95
|
-
// than beside the ones the application wrote.
|
|
96
|
-
authored: report.at?.external !== true,
|
|
97
|
-
// Under whoever provided it. A context read with no provider above it belongs to
|
|
98
|
-
// the reader, which is the honest place for a default value.
|
|
99
|
-
createdIn: report.owner,
|
|
100
|
-
// Short on the card, whole in the inspector, the way every other node works.
|
|
101
|
-
...report.value !== void 0 ? { value: shorten(report.value), detail: report.value } : {}
|
|
102
|
-
});
|
|
103
|
-
nodes.set(report.id, node);
|
|
104
|
-
}
|
|
105
|
-
if (report.kind === "provide") ctx.retype(report.owner, "provider");
|
|
106
|
-
const held = ctx.annotation(report.owner) ?? [];
|
|
107
|
-
const already = held.some((n) => n.name === report.name && n.kind === report.kind);
|
|
108
|
-
if (already) return;
|
|
109
|
-
held.push({
|
|
110
|
-
name: report.name,
|
|
111
|
-
kind: report.kind,
|
|
112
|
-
...report.value !== void 0 ? { value: report.value } : {}
|
|
113
|
-
});
|
|
114
|
-
ctx.annotate(report.owner, held);
|
|
115
|
-
});
|
|
116
|
-
},
|
|
117
|
-
rows(node) {
|
|
118
|
-
const notes = node.extra?.[NAME2];
|
|
119
|
-
if (!notes?.length) return [];
|
|
120
|
-
return notes.map((note) => ({
|
|
121
|
-
label: note.kind === "provide" ? `provides ${note.name}` : `reads ${note.name}`,
|
|
122
|
-
...note.value !== void 0 ? { value: note.value } : {}
|
|
123
|
-
}));
|
|
124
|
-
},
|
|
125
|
-
badge(node) {
|
|
126
|
-
const notes = node.extra?.[NAME2];
|
|
127
|
-
if (!notes?.length) return void 0;
|
|
128
|
-
const given = notes.filter((n) => n.kind === "provide");
|
|
129
|
-
if (given.length === 1) return `provides ${given[0].name}`;
|
|
130
|
-
if (given.length > 1) return `provides ${given.length}`;
|
|
131
|
-
return notes.length === 1 ? `reads ${notes[0].name}` : `reads ${notes.length}`;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
registerDevtoolsPlugin(contextPlugin);
|
|
1
|
+
/*! @fluixi/devtools v1.0.0-alpha.110 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
import {
|
|
3
|
+
NAME,
|
|
4
|
+
contextPlugin
|
|
5
|
+
} from "../chunk-NDUBBBNL.mjs";
|
|
6
|
+
import {
|
|
7
|
+
NAME as NAME2,
|
|
8
|
+
directivesPlugin
|
|
9
|
+
} from "../chunk-B3SAJ7QG.mjs";
|
|
10
|
+
import "../chunk-V6DKWEYD.mjs";
|
|
11
|
+
import "../chunk-NT7YMK77.mjs";
|
|
135
12
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
13
|
+
NAME as CONTEXT,
|
|
14
|
+
NAME2 as DIRECTIVES,
|
|
138
15
|
contextPlugin,
|
|
139
16
|
directivesPlugin
|
|
140
17
|
};
|
package/dist/source.mjs
CHANGED
|
@@ -1,96 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
host[MARKS] = shared;
|
|
15
|
-
shared.classes ??= /* @__PURE__ */ new WeakMap();
|
|
16
|
-
function markReactiveSource(file, line, column, name, self) {
|
|
17
|
-
const location = locate(file, line, column);
|
|
18
|
-
if (shared.pending && location.external && !shared.pending.location?.external) return;
|
|
19
|
-
shared.pending = self && typeof self === "object" ? { name, location, self } : { name, location };
|
|
20
|
-
shared.expiring = false;
|
|
21
|
-
}
|
|
22
|
-
function dropReactiveSource() {
|
|
23
|
-
shared.pending = null;
|
|
24
|
-
}
|
|
25
|
-
function locate(file, line, column) {
|
|
26
|
-
const external = !!file && (/^([a-zA-Z]:)?[\\/]/.test(file) || file.includes("node_modules/"));
|
|
27
|
-
return external ? { file, line, column, external } : { file, line, column };
|
|
28
|
-
}
|
|
29
|
-
function markComponentSource(name, file, line, column) {
|
|
30
|
-
const seen = shared.components.get(name);
|
|
31
|
-
const next = locate(file, line, column);
|
|
32
|
-
if (seen === void 0) {
|
|
33
|
-
shared.components.set(name, next);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (!seen || seen.file !== file || seen.line !== line) shared.components.set(name, null);
|
|
37
|
-
}
|
|
38
|
-
function markClassSource(constructor, file, line, column) {
|
|
39
|
-
if (typeof constructor === "function") shared.classes.set(constructor, locate(file, line, column));
|
|
40
|
-
}
|
|
41
|
-
function classSource(constructor) {
|
|
42
|
-
return typeof constructor === "function" ? shared.classes.get(constructor) : void 0;
|
|
43
|
-
}
|
|
44
|
-
function componentSource(name) {
|
|
45
|
-
return shared.components.get(name) ?? void 0;
|
|
46
|
-
}
|
|
47
|
-
function takeReactiveSource() {
|
|
48
|
-
const mark = shared.pending;
|
|
49
|
-
if (mark) {
|
|
50
|
-
if (mark.name !== void 0 || mark.self) shared.pending = { location: mark.location };
|
|
51
|
-
if (!shared.expiring) {
|
|
52
|
-
shared.expiring = true;
|
|
53
|
-
queueMicrotask(() => {
|
|
54
|
-
shared.expiring = false;
|
|
55
|
-
shared.pending = null;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return mark;
|
|
60
|
-
}
|
|
61
|
-
var HOLES = /* @__PURE__ */ new WeakMap();
|
|
62
|
-
var HOLE_TAG = "__fx_at";
|
|
63
|
-
function markHole(accessor, line, column, name) {
|
|
64
|
-
if (accessor && (typeof accessor === "object" || typeof accessor === "function")) {
|
|
65
|
-
const at = name === void 0 ? { line, column } : { line, column, name };
|
|
66
|
-
HOLES.set(accessor, at);
|
|
67
|
-
try {
|
|
68
|
-
Object.defineProperty(accessor, HOLE_TAG, { value: at, configurable: true });
|
|
69
|
-
} catch {
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
shared.pending = null;
|
|
73
|
-
return accessor;
|
|
74
|
-
}
|
|
75
|
-
var PROPS = /* @__PURE__ */ new WeakMap();
|
|
76
|
-
function markProps(props, at) {
|
|
77
|
-
if (props && typeof props === "object") PROPS.set(props, at);
|
|
78
|
-
return props;
|
|
79
|
-
}
|
|
80
|
-
function propsLocations(props) {
|
|
81
|
-
return props && typeof props === "object" ? PROPS.get(props) : void 0;
|
|
82
|
-
}
|
|
83
|
-
function holeLocation(accessor) {
|
|
84
|
-
if (!accessor || typeof accessor !== "object" && typeof accessor !== "function") return void 0;
|
|
85
|
-
return HOLES.get(accessor) ?? accessor[HOLE_TAG];
|
|
86
|
-
}
|
|
87
|
-
function installSourceMarker() {
|
|
88
|
-
if (typeof host[MARKER] !== "function") host[MARKER] = markReactiveSource;
|
|
89
|
-
if (typeof host[COMPONENT_MARKER] !== "function") host[COMPONENT_MARKER] = markComponentSource;
|
|
90
|
-
if (typeof host[CLASS_MARKER] !== "function") host[CLASS_MARKER] = markClassSource;
|
|
91
|
-
if (typeof host[HOLE_MARKER] !== "function") host[HOLE_MARKER] = markHole;
|
|
92
|
-
if (typeof host[PROPS_MARKER] !== "function") host[PROPS_MARKER] = markProps;
|
|
93
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
classSource,
|
|
3
|
+
componentSource,
|
|
4
|
+
dropReactiveSource,
|
|
5
|
+
holeLocation,
|
|
6
|
+
installSourceMarker,
|
|
7
|
+
markClassSource,
|
|
8
|
+
markComponentSource,
|
|
9
|
+
markReactiveSource,
|
|
10
|
+
propsLocations,
|
|
11
|
+
takeReactiveSource
|
|
12
|
+
} from "./chunk-L6XQGNMW.mjs";
|
|
94
13
|
export {
|
|
95
14
|
classSource,
|
|
96
15
|
componentSource,
|
package/dist/timeline.cjs
CHANGED
|
@@ -37,7 +37,8 @@ function toCommits(events) {
|
|
|
37
37
|
commit,
|
|
38
38
|
t: group[0].t,
|
|
39
39
|
events: group,
|
|
40
|
-
cause: group.find((e) => e.kind === "write" && e.by === void 0)
|
|
40
|
+
cause: group.find((e) => e.kind === "write" && e.by === void 0),
|
|
41
|
+
mark: group.find((e) => e.kind === "mark")
|
|
41
42
|
}));
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -156,10 +157,12 @@ var clock = (t) => {
|
|
|
156
157
|
return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}.${pad(d.getMilliseconds(), 3)}`;
|
|
157
158
|
};
|
|
158
159
|
function subject(commit, nameOf) {
|
|
160
|
+
if (commit.mark) return commit.mark.label ?? "marked";
|
|
159
161
|
if (!commit.cause) return commit.commit === 0 ? "first render" : "continued";
|
|
160
162
|
return nameOf(commit.cause);
|
|
161
163
|
}
|
|
162
164
|
function change(commit) {
|
|
165
|
+
if (commit.mark) return "";
|
|
163
166
|
const cause = commit.cause;
|
|
164
167
|
if (!cause || cause.from === void 0 || cause.to === void 0) return "";
|
|
165
168
|
return `${cause.from} → ${cause.to}`;
|
|
@@ -177,7 +180,7 @@ function detail(commit, nameOf) {
|
|
|
177
180
|
return lines.join("\n");
|
|
178
181
|
}
|
|
179
182
|
function summary(commit) {
|
|
180
|
-
const counts = { ran: 0, created: 0, disposed: 0, write: 0 };
|
|
183
|
+
const counts = { ran: 0, created: 0, disposed: 0, write: 0, mark: 0 };
|
|
181
184
|
for (const event of commit.events) counts[event.kind]++;
|
|
182
185
|
const writes = counts.write - (commit.cause ? 1 : 0);
|
|
183
186
|
return [
|
package/dist/timeline.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAOA,OAAO,EAAa,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,QAAQ;IACvB,4FAA4F;IAC5F,IAAI,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,IAAI,CAAC;IAC1C,qFAAqF;IACrF,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,8EAA8E;IAC9E,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IACxC,6FAA6F;IAC7F,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACtD,0FAA0F;IAC1F,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAWD,qFAAqF;AACrF,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAOA,OAAO,EAAa,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,QAAQ;IACvB,4FAA4F;IAC5F,IAAI,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,IAAI,CAAC;IAC1C,qFAAqF;IACrF,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,8EAA8E;IAC9E,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IACxC,6FAA6F;IAC7F,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACtD,0FAA0F;IAC1F,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAWD,qFAAqF;AACrF,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;AA+CnD,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,GAAE,eAAoB,GAAG,QAAQ,CAwLzF;AAED,yFAAyF;AACzF,eAAO,MAAM,YAAY,o8HAwCX,CAAC"}
|
package/dist/timeline.js
CHANGED
|
@@ -15,12 +15,16 @@ const clock = (t) => {
|
|
|
15
15
|
};
|
|
16
16
|
/** The name of what the commit started from: `count`, or what to say when there is none. */
|
|
17
17
|
function subject(commit, nameOf) {
|
|
18
|
+
if (commit.mark)
|
|
19
|
+
return commit.mark.label ?? 'marked';
|
|
18
20
|
if (!commit.cause)
|
|
19
21
|
return commit.commit === 0 ? 'first render' : 'continued';
|
|
20
22
|
return nameOf(commit.cause);
|
|
21
23
|
}
|
|
22
24
|
/** `0 → 1`, when the write carried both sides of it. */
|
|
23
25
|
function change(commit) {
|
|
26
|
+
if (commit.mark)
|
|
27
|
+
return '';
|
|
24
28
|
const cause = commit.cause;
|
|
25
29
|
if (!cause || cause.from === undefined || cause.to === undefined)
|
|
26
30
|
return '';
|
|
@@ -42,7 +46,7 @@ function detail(commit, nameOf) {
|
|
|
42
46
|
}
|
|
43
47
|
/** "2 ran · 1 created": what the commit caused, without listing every line of it. */
|
|
44
48
|
function summary(commit) {
|
|
45
|
-
const counts = { ran: 0, created: 0, disposed: 0, write: 0 };
|
|
49
|
+
const counts = { ran: 0, created: 0, disposed: 0, write: 0, mark: 0 };
|
|
46
50
|
for (const event of commit.events)
|
|
47
51
|
counts[event.kind]++;
|
|
48
52
|
// The opening write is the title, so it is not also a thing the commit did.
|