@imfusion/web-ui 0.10.1-dev.34.gb01a818e → 0.10.1-dev.41.g467e0e1a
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/CHANGELOG.md +28 -2
- package/README.md +19 -16
- package/dist/components/app-shell/app-shell.d.ts +35 -23
- package/dist/components/select/select.d.ts +7 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-disclosure.d.ts +17 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1849 -1746
- package/dist/paths-CZtwNknt.js +132 -0
- package/dist/style.css +1 -1
- package/dist/vite/local-web-ui-link.d.ts +7 -3
- package/dist/vite.js +38 -22
- package/dist/web-ui-cli.js +154 -122
- package/package.json +2 -2
- package/src/docgen/doc.gen.json +25 -66
- package/src/llms/skills/imf-web-ui/SKILL.md +15 -13
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +2 -1
- package/src/llms/skills/imf-web-ui-conventions/SKILL.md +24 -23
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +1 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/data.md +4 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +32 -4
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +8 -1
- package/dist/paths-B5Ht3ETc.js +0 -26
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { chmodSync as e, copyFileSync as t, cpSync as n, existsSync as r, mkdirSync as i, readFileSync as a, readdirSync as o, rmSync as s, watch as c, writeFileSync as l } from "node:fs";
|
|
2
|
+
import { dirname as u, join as d, relative as f, resolve as p } from "node:path";
|
|
3
|
+
import { fileURLToPath as m } from "node:url";
|
|
4
|
+
import { spawnSync as h } from "node:child_process";
|
|
5
|
+
//#region src/cli/link.ts
|
|
6
|
+
var g = "@imfusion/web-ui", _ = ".local-link.json", v = [
|
|
7
|
+
"exports",
|
|
8
|
+
"module",
|
|
9
|
+
"types",
|
|
10
|
+
"bin"
|
|
11
|
+
], y = class extends Error {};
|
|
12
|
+
function b(e) {
|
|
13
|
+
return p(e, "node_modules", "@imfusion", "web-ui");
|
|
14
|
+
}
|
|
15
|
+
function x(e) {
|
|
16
|
+
return r(d(e, _));
|
|
17
|
+
}
|
|
18
|
+
function S(e) {
|
|
19
|
+
return p(e, "node_modules", ".web-ui-link");
|
|
20
|
+
}
|
|
21
|
+
function C(e) {
|
|
22
|
+
let t = JSON.parse(a(e, "utf-8"));
|
|
23
|
+
if (typeof t != "object" || !t || Array.isArray(t)) throw new y(`${e} is not a JSON object.`);
|
|
24
|
+
return Object.fromEntries(Object.entries(t));
|
|
25
|
+
}
|
|
26
|
+
function w(e) {
|
|
27
|
+
if (!r(d(e, "package.json"))) throw new y(`${g} is not installed at ${e}. Run npm install in the consumer first.`);
|
|
28
|
+
}
|
|
29
|
+
function T(e) {
|
|
30
|
+
let t = d(e, "package.json");
|
|
31
|
+
if (!r(t) || C(t).name !== g) throw new y(`${e} is not a ${g} checkout.`);
|
|
32
|
+
if (!r(d(e, "dist", "index.js"))) throw new y(`${e} has no dist/ build. Run npm run dev:lib in that checkout first.`);
|
|
33
|
+
}
|
|
34
|
+
function E(e, t) {
|
|
35
|
+
i(t, { recursive: !0 }), n(e, t, {
|
|
36
|
+
recursive: !0,
|
|
37
|
+
force: !0
|
|
38
|
+
});
|
|
39
|
+
for (let n of o(t, {
|
|
40
|
+
recursive: !0,
|
|
41
|
+
withFileTypes: !0
|
|
42
|
+
})) {
|
|
43
|
+
let i = d(n.parentPath, n.name);
|
|
44
|
+
r(d(e, f(t, i))) || s(i, {
|
|
45
|
+
recursive: !0,
|
|
46
|
+
force: !0
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function D(e, t) {
|
|
51
|
+
let n = { ...e };
|
|
52
|
+
for (let e of v) e in t && (n[e] = t[e]);
|
|
53
|
+
return n;
|
|
54
|
+
}
|
|
55
|
+
function O(t, n) {
|
|
56
|
+
let r = n.bin, i = typeof r == "string" ? [r] : typeof r == "object" && r ? Object.values(r) : [];
|
|
57
|
+
for (let n of i) typeof n == "string" && e(d(t, n), 493);
|
|
58
|
+
}
|
|
59
|
+
function k(e, t) {
|
|
60
|
+
let n = b(e), r = d(S(e), "backup");
|
|
61
|
+
if (!x(n)) return;
|
|
62
|
+
E(d(t, "dist"), d(n, "dist"));
|
|
63
|
+
let i = D(C(d(r, "package.json")), C(d(t, "package.json")));
|
|
64
|
+
l(d(n, "package.json"), `${JSON.stringify(i, null, 2)}\n`), O(n, i);
|
|
65
|
+
}
|
|
66
|
+
function A(e, n) {
|
|
67
|
+
let r = b(e);
|
|
68
|
+
if (w(r), T(n), !x(r)) {
|
|
69
|
+
let n = d(S(e), "backup");
|
|
70
|
+
s(n, {
|
|
71
|
+
recursive: !0,
|
|
72
|
+
force: !0
|
|
73
|
+
}), E(d(r, "dist"), d(n, "dist")), i(n, { recursive: !0 }), t(d(r, "package.json"), d(n, "package.json"));
|
|
74
|
+
}
|
|
75
|
+
return l(d(r, _), `${JSON.stringify({
|
|
76
|
+
checkout: n,
|
|
77
|
+
linkedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
78
|
+
}, null, 2)}\n`), k(e, n), r;
|
|
79
|
+
}
|
|
80
|
+
function j(e) {
|
|
81
|
+
let n = b(e);
|
|
82
|
+
if (!x(n)) return [`${n} is not linked. Nothing to restore.`];
|
|
83
|
+
let i = S(e), a = d(i, "backup");
|
|
84
|
+
if (!r(d(a, "dist")) || !r(d(a, "package.json"))) throw new y(`No backup at ${a}. Run npm install to restore the published package.`);
|
|
85
|
+
return E(d(a, "dist"), d(n, "dist")), t(d(a, "package.json"), d(n, "package.json")), s(d(n, _)), s(i, {
|
|
86
|
+
recursive: !0,
|
|
87
|
+
force: !0
|
|
88
|
+
}), [
|
|
89
|
+
"Restored dist/ from the published build.",
|
|
90
|
+
"Restored package.json.",
|
|
91
|
+
"Removed the link marker and the backup."
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
function M(e, t, n) {
|
|
95
|
+
let r = b(e), i, a = c(d(t, "dist"), { recursive: !0 }, () => {
|
|
96
|
+
clearTimeout(i), i = setTimeout(() => {
|
|
97
|
+
if (!x(r)) {
|
|
98
|
+
n("Package is no longer linked; stopped syncing."), a.close();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
k(e, t), n(`Synced at ${(/* @__PURE__ */ new Date()).toLocaleTimeString()}`);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
n(`Sync failed, retrying on the next change: ${e instanceof Error ? e.message : String(e)}`);
|
|
105
|
+
}
|
|
106
|
+
}, 150);
|
|
107
|
+
});
|
|
108
|
+
return a;
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/cli/paths.ts
|
|
112
|
+
function N(e) {
|
|
113
|
+
let t = e;
|
|
114
|
+
for (; !r(p(t, "package.json"));) {
|
|
115
|
+
let n = u(t);
|
|
116
|
+
if (n === t) throw Error(`Could not find package.json above ${e}`);
|
|
117
|
+
t = n;
|
|
118
|
+
}
|
|
119
|
+
return t;
|
|
120
|
+
}
|
|
121
|
+
var P = N(u(m(import.meta.url))), F = process.cwd();
|
|
122
|
+
function I(e) {
|
|
123
|
+
let t = F;
|
|
124
|
+
for (; t !== u(t) && !r(p(t, "node_modules", ".bin"));) t = u(t);
|
|
125
|
+
let n = p(t, "node_modules", ".bin"), i = p(n, "vp"), [a, o] = r(i) ? [i, ["fmt", ...e]] : [p(n, "prettier"), ["--write", ...e]];
|
|
126
|
+
r(a) && h(a, o, {
|
|
127
|
+
cwd: F,
|
|
128
|
+
stdio: "ignore"
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
export { A as a, M as c, y as i, P as n, j as o, F as r, x as s, I as t };
|