@jonmilner/ui 0.11.12 → 0.11.14
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/Text/Text.css +1 -1
- package/dist/cli/doctor.mjs +150 -40
- package/dist/cli/ui-doctor.mjs +1 -1
- package/dist/docs/Text.md +1 -1
- package/dist/docs/doctor.md +12 -2
- package/dist/docs/manifest.json +3 -2
- package/dist/docs/manifest.schema.json +15 -1
- package/package.json +1 -1
package/dist/Text/Text.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.visually-hidden, components.table;
|
|
2
|
-
@layer components.text{._1mgdisq3{--_1mgdisq0:var(--line-height-med);--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body);font-size:var(--font-size-med);font-weight:var(--font-weight-regular);line-height:var(--_1mgdisq0)}._1mgdisq3:before{content:"";margin-block-end:var(--_1mgdisq1);display:table}._1mgdisq3:after{content:"";margin-block-start:var(--_1mgdisq2);display:table}:where(li)>._1mgdisq4{display:flow-root}:where(li)>._1mgdisq4:before,:where(li)>._1mgdisq4:after{display:block}:where(li:has(>._1mgdisq4))::marker{line-height:0}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var){--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;display:inline}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):before,:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):after{content:none}._1mgdisq5{--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}._1mgdisq5:before,._1mgdisq5:after{content:none}._1mgdisq6{--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body)}._1mgdisq7{--_1mgdisq1:calc((var(--font-trim-heading-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-heading-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-heading)}._1mgdisq8{--_1mgdisq1:calc((var(--font-trim-display-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-display-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-display)}._1mgdisq9{--_1mgdisq1:calc((var(--font-trim-label-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-label-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-label)}._1mgdisqa{--_1mgdisq1:calc((var(--font-trim-mono-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-mono-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-mono)}._1mgdisqb{font-size:var(--font-size-xs)}._1mgdisqc{font-size:var(--font-size-sm)}._1mgdisqd{font-size:var(--font-size-med)}._1mgdisqe{font-size:var(--font-size-lg)}._1mgdisqf{font-size:var(--font-size-xl)}._1mgdisqg{font-size:var(--font-size-2xl)}._1mgdisqh{font-size:var(--font-size-3xl)}._1mgdisqi{font-size:var(--font-size-4xl)}._1mgdisqj{font-weight:var(--font-weight-regular)}._1mgdisqk{font-weight:var(--font-weight-medium)}._1mgdisql{font-weight:var(--font-weight-semibold)}._1mgdisqm{font-weight:var(--font-weight-bold)}._1mgdisqn{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqo{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqp{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqq{font-variant-numeric:tabular-nums}._1mgdisqr{white-space:nowrap}._1mgdisqs{white-space:pre-wrap;overflow-wrap:anywhere}._1mgdisqt{white-space:pre}._1mgdisqu{text-overflow:ellipsis;white-space:nowrap;margin-block-start:var(--_1mgdisq1);margin-block-end:var(--_1mgdisq2);padding-block-start:calc(-1 * var(--_1mgdisq1));padding-block-end:calc(-1 * var(--_1mgdisq2))}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) ._1mgdisqu{white-space:normal;text-overflow:clip}}
|
|
2
|
+
@layer components.text{._1mgdisq3{--_1mgdisq0:var(--line-height-med);--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body);font-size:var(--font-size-med);font-weight:var(--font-weight-regular);line-height:var(--_1mgdisq0)}._1mgdisq3:before{content:"";margin-block-end:var(--_1mgdisq1);display:table}._1mgdisq3:after{content:"";margin-block-start:var(--_1mgdisq2);display:table}:where(li)>._1mgdisq4{display:flow-root}:where(li)>._1mgdisq4:before,:where(li)>._1mgdisq4:after{display:block}:where(li:has(>._1mgdisq4))::marker{font-family:var(--font-body);line-height:0}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var){--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;display:inline}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):before,:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):after{content:none}._1mgdisq5{--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}._1mgdisq5:before,._1mgdisq5:after{content:none}._1mgdisq6{--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body)}._1mgdisq7{--_1mgdisq1:calc((var(--font-trim-heading-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-heading-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-heading)}._1mgdisq8{--_1mgdisq1:calc((var(--font-trim-display-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-display-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-display)}._1mgdisq9{--_1mgdisq1:calc((var(--font-trim-label-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-label-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-label)}._1mgdisqa{--_1mgdisq1:calc((var(--font-trim-mono-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-mono-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-mono)}._1mgdisqb{font-size:var(--font-size-xs)}._1mgdisqc{font-size:var(--font-size-sm)}._1mgdisqd{font-size:var(--font-size-med)}._1mgdisqe{font-size:var(--font-size-lg)}._1mgdisqf{font-size:var(--font-size-xl)}._1mgdisqg{font-size:var(--font-size-2xl)}._1mgdisqh{font-size:var(--font-size-3xl)}._1mgdisqi{font-size:var(--font-size-4xl)}._1mgdisqj{font-weight:var(--font-weight-regular)}._1mgdisqk{font-weight:var(--font-weight-medium)}._1mgdisql{font-weight:var(--font-weight-semibold)}._1mgdisqm{font-weight:var(--font-weight-bold)}._1mgdisqn{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqo{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqp{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqq{font-variant-numeric:tabular-nums}._1mgdisqr{white-space:nowrap}._1mgdisqs{white-space:pre-wrap;overflow-wrap:anywhere}._1mgdisqt{white-space:pre}._1mgdisqu{text-overflow:ellipsis;white-space:nowrap;margin-block-start:var(--_1mgdisq1);margin-block-end:var(--_1mgdisq2);padding-block-start:calc(-1 * var(--_1mgdisq1));padding-block-end:calc(-1 * var(--_1mgdisq2))}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) ._1mgdisqu{white-space:normal;text-overflow:clip}}
|
package/dist/cli/doctor.mjs
CHANGED
|
@@ -122,7 +122,97 @@ async function w(e, t, n) {
|
|
|
122
122
|
published: Object.keys(a.versions)
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
var T = ["vite.config", "oxlint.config"].flatMap((e) => [
|
|
126
|
+
"ts",
|
|
127
|
+
"mts",
|
|
128
|
+
"cts",
|
|
129
|
+
"js",
|
|
130
|
+
"mjs",
|
|
131
|
+
"cjs"
|
|
132
|
+
].map((t) => `${e}.${t}`)), E = (e) => e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|[^:])\/\/.*$/gm, "$1"), D = (e) => e.includes("@jonmilner/oxlint-config") && /\buiLint\b/.test(e);
|
|
133
|
+
function O(n) {
|
|
134
|
+
for (let r = n;; r = i(r)) {
|
|
135
|
+
let s = !1;
|
|
136
|
+
for (let e of T) {
|
|
137
|
+
let i = a(r, e), c;
|
|
138
|
+
try {
|
|
139
|
+
c = E(t(i, "utf8"));
|
|
140
|
+
} catch {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (D(c)) return o(n, i);
|
|
144
|
+
s ||= e.startsWith("oxlint.") || /\blint\b/.test(c);
|
|
145
|
+
}
|
|
146
|
+
if (s || ["pnpm-workspace.yaml", ".git"].some((t) => e(a(r, t))) || i(r) === r) return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function k(e) {
|
|
150
|
+
let t = v(a(e, "dist", "docs", "manifest.json"))?.deprecated;
|
|
151
|
+
return typeof t != "object" || !t || Array.isArray(t) ? null : new Map(Object.entries(t).filter((e) => typeof e[1] == "string"));
|
|
152
|
+
}
|
|
153
|
+
var A = /\.(?:[cm]?[jt]s|[jt]sx)$/, j = /* @__PURE__ */ new Set([
|
|
154
|
+
"dist",
|
|
155
|
+
"build",
|
|
156
|
+
"coverage",
|
|
157
|
+
"out"
|
|
158
|
+
]);
|
|
159
|
+
function* M(e, t = !0) {
|
|
160
|
+
let r;
|
|
161
|
+
try {
|
|
162
|
+
r = n(e, { withFileTypes: !0 });
|
|
163
|
+
} catch {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
for (let n of r.sort((e, t) => e.name.localeCompare(t.name, "en"))) {
|
|
167
|
+
if (n.name.startsWith(".") || n.name === "node_modules" || t && n.isDirectory() && j.has(n.name)) continue;
|
|
168
|
+
let r = a(e, n.name);
|
|
169
|
+
n.isDirectory() ? yield* M(r, !1) : n.isFile() && A.test(n.name) && !/\.d\.[cm]?ts$/.test(n.name) && (yield r);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
var N = /\b(?:import|export)\s+(?:type\s+)?(?:[\w$]+\s*,\s*)?(?:\*\s+as\s+([\w$]+)|\{([^}]*)\})\s*from\s*["']@jonmilner\/ui(?:\/[^"']*)?["']/g, P = (e) => e.replaceAll("$", "\\$");
|
|
173
|
+
function F(e, t) {
|
|
174
|
+
let n = /* @__PURE__ */ new Map(), r = (e, t) => n.set(e, [...n.get(e) ?? [], new RegExp(t)]);
|
|
175
|
+
for (let n of e.matchAll(N)) {
|
|
176
|
+
let [e, i, a] = n;
|
|
177
|
+
if (i) for (let e of t.keys()) r(e, `(?<![\\w$.])${P(i)}\\.${P(e)}(?![\\w$])`);
|
|
178
|
+
for (let n of a?.split(",") ?? []) {
|
|
179
|
+
let i = n.trim().replace(/^type\s+/, "").split(/\s+as\s+/), a = i[0];
|
|
180
|
+
a && t.has(a) && r(a, `(?<![\\w$.])${P(e.startsWith("export") ? a : i[1] ?? a)}(?![\\w$])`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return n;
|
|
184
|
+
}
|
|
185
|
+
function I(e, n) {
|
|
186
|
+
if (n.size === 0) return [];
|
|
187
|
+
let r = /* @__PURE__ */ new Map();
|
|
188
|
+
for (let i of M(e)) {
|
|
189
|
+
let a;
|
|
190
|
+
try {
|
|
191
|
+
a = t(i, "utf8");
|
|
192
|
+
} catch {
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (!a.includes("@jonmilner/ui")) continue;
|
|
196
|
+
let s = F(a, n);
|
|
197
|
+
if (s.size === 0) continue;
|
|
198
|
+
let c = a.split("\n");
|
|
199
|
+
for (let [t, n] of s) {
|
|
200
|
+
let a = r.get(t) ?? [];
|
|
201
|
+
c.forEach((t, r) => {
|
|
202
|
+
n.some((e) => e.test(t)) && a.push({
|
|
203
|
+
path: o(e, i),
|
|
204
|
+
line: r + 1
|
|
205
|
+
});
|
|
206
|
+
}), r.set(t, a);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return [...r].filter(([, e]) => e.length > 0).sort(([e], [t]) => e.localeCompare(t, "en")).map(([e, t]) => ({
|
|
210
|
+
name: e,
|
|
211
|
+
message: n.get(e),
|
|
212
|
+
uses: t
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
function L(e) {
|
|
126
216
|
if (e instanceof Error) {
|
|
127
217
|
if (e.name === "TimeoutError") return "timed out";
|
|
128
218
|
let t = e.cause;
|
|
@@ -130,95 +220,110 @@ function T(e) {
|
|
|
130
220
|
}
|
|
131
221
|
return String(e);
|
|
132
222
|
}
|
|
133
|
-
async function
|
|
223
|
+
async function R(t) {
|
|
134
224
|
let { cwd: n, registry: r = c, timeoutMs: i = l, fetch: o = fetch } = t, p = [], m = [], h = a(n, "package.json"), g = e(h) ? v(h) : null;
|
|
135
225
|
g || m.push({
|
|
136
226
|
code: "no-package-json",
|
|
137
227
|
message: `No readable package.json in ${n}.`
|
|
138
228
|
});
|
|
139
|
-
let
|
|
140
|
-
g && !
|
|
229
|
+
let T = g ? C(g) : null;
|
|
230
|
+
g && !T && p.push({
|
|
141
231
|
code: "not-declared",
|
|
142
232
|
message: `package.json does not list ${s} in ${u.join(", ")}.`
|
|
143
233
|
});
|
|
144
|
-
let
|
|
145
|
-
|
|
234
|
+
let E = y(n), D = E?.version ?? null;
|
|
235
|
+
D || p.push({
|
|
146
236
|
code: "not-installed",
|
|
147
237
|
message: `${s} is not installed; run the package manager's install.`
|
|
148
238
|
});
|
|
149
|
-
let
|
|
239
|
+
let A = null, j = [];
|
|
150
240
|
try {
|
|
151
|
-
({latest:
|
|
241
|
+
({latest: A, published: j} = await w(r, i, o));
|
|
152
242
|
} catch (e) {
|
|
153
243
|
m.push({
|
|
154
244
|
code: "registry",
|
|
155
|
-
message: `Could not read the latest version from ${r}: ${
|
|
245
|
+
message: `Could not read the latest version from ${r}: ${L(e)}. Version lag not checked.`
|
|
156
246
|
});
|
|
157
247
|
}
|
|
158
|
-
let
|
|
159
|
-
if (
|
|
160
|
-
let e =
|
|
248
|
+
let M = D && A ? _(D, A, j) : null;
|
|
249
|
+
if (M && M.breaking.length > 0) {
|
|
250
|
+
let e = M.breaking.length;
|
|
161
251
|
p.push({
|
|
162
252
|
code: "breaking-lag",
|
|
163
|
-
message: `${
|
|
253
|
+
message: `${D} is ${e} breaking release${e === 1 ? "" : "s"} behind ${A}: ${M.breaking.join(", ")}. Upgrade, then apply each release's node_modules/${s}/dist/docs/migrations/<version>.md, oldest first.`
|
|
164
254
|
});
|
|
165
|
-
} else
|
|
255
|
+
} else M && (M.minors > 0 || M.patches > 0) && m.push({
|
|
166
256
|
code: "minor-lag",
|
|
167
|
-
message: `${
|
|
257
|
+
message: `${D} is behind ${A} by releases that break nothing; upgrading needs no migration.`
|
|
168
258
|
});
|
|
169
|
-
let
|
|
170
|
-
if (
|
|
171
|
-
let e =
|
|
259
|
+
let N = g ? x(g)?.[d] : void 0, P = typeof N == "string" && f.test(N) ? N : null, F = T ? b(T.range) : null, R = P ?? F;
|
|
260
|
+
if (T && E && !P) {
|
|
261
|
+
let e = N === void 0 ? `package.json has no "${s}": { "${d}" } marker` : `package.json's "${s}".${d} is not a version: ${JSON.stringify(N)}`, t = F ? `migrations are listed from the declared ${T.range}` : "the declared range names no version, so migrations are not checked";
|
|
172
262
|
m.push({
|
|
173
263
|
code: "no-marker",
|
|
174
|
-
message: `${e}, so ${t}. Once the app has applied every migration up to ${
|
|
264
|
+
message: `${e}, so ${t}. Once the app has applied every migration up to ${E.version}, run \`ui-doctor migrated ${E.version}\`, before the next upgrade: an upgrade rewrites the declared range, and the migrations it skips are then listed only from the marker.`
|
|
175
265
|
});
|
|
176
266
|
}
|
|
177
|
-
let
|
|
178
|
-
if (
|
|
179
|
-
let e =
|
|
267
|
+
let z = E && R ? S(n, E.dir, R, E.version) : null;
|
|
268
|
+
if (z && z.length > 0) {
|
|
269
|
+
let e = z.length, t = z[e - 1].version;
|
|
180
270
|
p.push({
|
|
181
271
|
code: "unapplied-migrations",
|
|
182
|
-
message: `${e} migration${e === 1 ? "" : "s"} above ${
|
|
272
|
+
message: `${e} migration${e === 1 ? "" : "s"} above ${R} not applied: ${z.map((e) => e.version).join(", ")}. Apply each, oldest first, running \`ui-doctor migrated <version>\` after each (\`ui-doctor migrated ${t}\` after the last).`
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
let B = O(n);
|
|
276
|
+
B || m.push({
|
|
277
|
+
code: "no-lint-preset",
|
|
278
|
+
message: "No vite.config.* or oxlint.config.* from here to the workspace root enables the ui lint preset, which checks raw values, raw text and the rest: add `...uiLint()` from @jonmilner/oxlint-config next to `lint`."
|
|
279
|
+
});
|
|
280
|
+
let V = E ? k(E.dir) : null, H = V ? I(n, V) : null;
|
|
281
|
+
if (H && H.length > 0) {
|
|
282
|
+
let e = new Set(H.flatMap((e) => e.uses.map((e) => `${e.path}:${e.line}`))).size;
|
|
283
|
+
m.push({
|
|
284
|
+
code: "deprecated-api",
|
|
285
|
+
message: `${e === 1 ? "1 line uses" : `${e} lines use`} deprecated ${H.map((e) => e.name).join(", ")}. Move each to the replacement its message names before upgrading to the release that removes it.`
|
|
183
286
|
});
|
|
184
287
|
}
|
|
185
288
|
return {
|
|
186
289
|
package: s,
|
|
187
|
-
installed:
|
|
188
|
-
declared:
|
|
189
|
-
latest:
|
|
190
|
-
behind:
|
|
191
|
-
migratedTo:
|
|
192
|
-
migrations:
|
|
290
|
+
installed: D,
|
|
291
|
+
declared: T,
|
|
292
|
+
latest: A,
|
|
293
|
+
behind: M,
|
|
294
|
+
migratedTo: P,
|
|
295
|
+
migrations: z,
|
|
296
|
+
lintPreset: B,
|
|
297
|
+
deprecated: H,
|
|
193
298
|
findings: p,
|
|
194
299
|
warnings: m
|
|
195
300
|
};
|
|
196
301
|
}
|
|
197
|
-
var
|
|
302
|
+
var z = class extends Error {
|
|
198
303
|
argument;
|
|
199
304
|
constructor(e, t = !1) {
|
|
200
305
|
super(e), this.argument = t;
|
|
201
306
|
}
|
|
202
307
|
};
|
|
203
|
-
function
|
|
308
|
+
function B(e, n) {
|
|
204
309
|
let i = f.test(n) ? p(n) : null;
|
|
205
|
-
if (!i) throw new
|
|
310
|
+
if (!i) throw new z(`${JSON.stringify(n)} is not a version (x.y.z).`, !0);
|
|
206
311
|
let o = y(e)?.version, c = o ? p(o) : null;
|
|
207
|
-
if (!c) throw new
|
|
208
|
-
if (h(i, c) > 0) throw new
|
|
312
|
+
if (!c) throw new z(`${s} is not installed here: install it, then mark its migrations.`);
|
|
313
|
+
if (h(i, c) > 0) throw new z(`${n} is above the installed ${o}.`, !0);
|
|
209
314
|
let l = a(e, "package.json"), u;
|
|
210
315
|
try {
|
|
211
316
|
u = t(l, "utf8");
|
|
212
317
|
} catch {
|
|
213
|
-
throw new
|
|
318
|
+
throw new z(`No readable package.json in ${e}.`);
|
|
214
319
|
}
|
|
215
320
|
let m;
|
|
216
321
|
try {
|
|
217
322
|
m = JSON.parse(u);
|
|
218
323
|
} catch {
|
|
219
|
-
throw new
|
|
324
|
+
throw new z(`${l} is not valid JSON.`);
|
|
220
325
|
}
|
|
221
|
-
if (typeof m != "object" || !m || Array.isArray(m)) throw new
|
|
326
|
+
if (typeof m != "object" || !m || Array.isArray(m)) throw new z(`${l} is not a JSON object.`);
|
|
222
327
|
let g = m;
|
|
223
328
|
g[s] = {
|
|
224
329
|
...x(g),
|
|
@@ -228,11 +333,11 @@ function O(e, n) {
|
|
|
228
333
|
try {
|
|
229
334
|
r(l, b + (u.endsWith("\n") ? _ : ""));
|
|
230
335
|
} catch (e) {
|
|
231
|
-
throw new
|
|
336
|
+
throw new z(`Could not write ${l}: ${L(e)}.`);
|
|
232
337
|
}
|
|
233
338
|
return l;
|
|
234
339
|
}
|
|
235
|
-
function
|
|
340
|
+
function V(e) {
|
|
236
341
|
let t = [
|
|
237
342
|
`${e.package} doctor`,
|
|
238
343
|
` installed ${e.installed ?? "not installed"}`,
|
|
@@ -241,8 +346,13 @@ function k(e) {
|
|
|
241
346
|
];
|
|
242
347
|
e.behind && t.push(` behind ${e.behind.majors} major, ${e.behind.minors} minor, ${e.behind.patches} patch` + (e.behind.breaking.length > 0 ? `; breaking: ${e.behind.breaking.join(", ")}` : "")), t.push(` migrated ${e.migratedTo ?? "no valid marker"}`);
|
|
243
348
|
for (let n of e.migrations ?? []) t.push(` apply ${n.version} ${n.path}`);
|
|
349
|
+
t.push(` lint ${e.lintPreset ?? "no ui preset"}`);
|
|
350
|
+
for (let n of e.deprecated ?? []) {
|
|
351
|
+
t.push(` deprecated ${n.name}: ${n.message}`);
|
|
352
|
+
for (let e of n.uses) t.push(` ${e.path}:${e.line}`);
|
|
353
|
+
}
|
|
244
354
|
for (let n of e.warnings) t.push(`warning: ${n.message}`);
|
|
245
355
|
for (let n of e.findings) t.push(`error: ${n.message}`);
|
|
246
356
|
return e.findings.length === 0 && t.push("ok: no findings"), `${t.join("\n")}\n`;
|
|
247
357
|
}
|
|
248
|
-
export { c as DEFAULT_REGISTRY, d as MARKER,
|
|
358
|
+
export { c as DEFAULT_REGISTRY, d as MARKER, z as MarkError, s as PACKAGE, l as TIMEOUT_MS, I as deprecatedUses, R as diagnose, V as formatReport, _ as lag, O as lintPreset, B as markMigrated, p as parseVersion, S as pendingMigrations, b as rangeFloor, w as registryVersions };
|
package/dist/cli/ui-doctor.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { MARKER as e, MarkError as t, PACKAGE as n, diagnose as r, formatReport
|
|
|
3
3
|
// src/cli/ui-doctor.ts
|
|
4
4
|
var o = `Usage: ui-doctor [--json]
|
|
5
5
|
ui-doctor migrated <version>
|
|
6
|
-
Reports how far this app's ${n} lags npm's latest
|
|
6
|
+
Reports how far this app's ${n} lags npm's latest, which migration docs it has not applied, whether its lint config enables the ui preset, and where it uses deprecated exports.\n\`migrated <version>\` records, as package.json's "${n}".${e}, that the app has applied every migration up to <version>.\n`;
|
|
7
7
|
function s(e, t) {
|
|
8
8
|
process.stderr.write(`ui-doctor: ${e}\n${t === 2 ? o : ""}`), process.exitCode = t;
|
|
9
9
|
}
|
package/dist/docs/Text.md
CHANGED
|
@@ -34,7 +34,7 @@ The base of all visible text, and the primitive every text component builds on.
|
|
|
34
34
|
- `wrap="pre"` keeps newlines and runs of spaces on unwrapped lines, so a long line overflows its box: aligned output whose columns must not reflow. Text is not a scroll container; where the box cannot grow, use `pre-wrap`.
|
|
35
35
|
- `truncate` wins over `wrap`: a Text with both keeps one line, collapses whitespace and ignores `wrap`.
|
|
36
36
|
- Plain wrapped text with a long unbroken string and no whitespace to keep has no `wrap` value; its component sets `overflow-wrap` in its own styles.
|
|
37
|
-
- A list item's text is a Text directly inside the `li`: `<li><Text>…</Text></li>`. At its default `display`, that Text keeps the marker on its first line at the trimmed height; with another `display` it does not. Do not render the Text as the `li` itself. Trimmed items touch, so space them with the list's `gap`: `<Stack as="ul" gap="8">`.
|
|
37
|
+
- A list item's text is a Text directly inside the `li`: `<li><Text>…</Text></li>`. At its default `display`, that Text keeps the marker on its first line at the trimmed height; with another `display` it does not. Do not render the Text as the `li` itself. Trimmed items touch, so space them with the list's `gap`: `<Stack as="ul" gap="8">`. The marker takes the body font, whatever the `li` or the Text's `font` sets; to change it, style `li::marker`.
|
|
38
38
|
- The trim is two pseudo-elements; do not style `::before` or `::after` on a Text.
|
|
39
39
|
- No native `text-box`; capsize only (ADR 0016).
|
|
40
40
|
|
package/dist/docs/doctor.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Doctor
|
|
2
2
|
|
|
3
|
-
`ui-doctor` is a command the library installs in the app. Run it in the app's root to see how far its `@jonmilner/ui` lags npm's `latest`, which upgrades need a migration,
|
|
3
|
+
`ui-doctor` is a command the library installs in the app. Run it in the app's root to see how far its `@jonmilner/ui` lags npm's `latest`, which upgrades need a migration, which migrations the app has not applied yet, whether its lint config enables the `ui` preset, and where it still uses deprecated exports.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
pnpm exec ui-doctor
|
|
@@ -24,6 +24,14 @@ The doctor lists every `migrations/<version>.md` the installed package ships abo
|
|
|
24
24
|
|
|
25
25
|
With no marker, once the package is installed, the doctor warns and lists from the lowest version the declared range names (`>=0.8.0` gives 0.8.0). A package manager rewrites the range on upgrade, so under `^0.x` or `~0.x` that floor never sits below the installed line and nothing is listed: only the marker sees the releases an upgrade skipped. Set it before upgrading: an app at 0.8.4 runs `ui-doctor migrated 0.8.4`, as the warning says, then upgrades. A range that names no version (`*`, `workspace:*`, `<0.11.0`) lists nothing.
|
|
26
26
|
|
|
27
|
+
## Lint preset
|
|
28
|
+
|
|
29
|
+
The doctor reads each `vite.config.*` and `oxlint.config.*` from the app's root up to the workspace root (the nearest directory with a `pnpm-workspace.yaml` or `.git`) and checks the nearest directory with a lint config (an `oxlint.config.*`, or a `vite.config.*` that names `lint`): any config there may enable the preset. It enables the preset when it imports `@jonmilner/oxlint-config` and names `uiLint` outside a comment. It matches the text and never runs the config, so a miss is a warning, not a finding. The preset, not the doctor, checks raw values, raw text and the rest of the house rules: run the linter for those.
|
|
30
|
+
|
|
31
|
+
## Deprecated exports
|
|
32
|
+
|
|
33
|
+
The installed package's `dist/docs/manifest.json` lists, under `deprecated`, each export marked `@deprecated`, with the tag's text: the replacement and the release that removes it. The doctor lists every line of the app's source (`.ts`, `.tsx`, `.js` and the rest, skipping `node_modules` and hidden directories, and `dist`, `build`, `coverage` and `out` at the app's root) that names one, through a named import (by its local name), a re-export, or a namespace import (`UI.Name`). It matches names, not types, so a shadowed local of the same name counts too. Any use is the warning `deprecated-api` (exit 0): 0126 deprecates only what an app cannot leave in one step, so it may not be able to move yet. Move each to its replacement before upgrading to the release that removes it; that release's migration doc is then a finding. A manifest from before the list skips the check (`deprecated` is `null`).
|
|
34
|
+
|
|
27
35
|
## Exit codes
|
|
28
36
|
|
|
29
37
|
- `0`: no findings. Warnings may still print: the registry was unreachable (the local checks still run), or the app trails `latest` only by releases that break nothing.
|
|
@@ -43,7 +51,9 @@ With no marker, once the package is installed, the doctor warns and lists from t
|
|
|
43
51
|
- `minor-lag`: behind only by releases that break nothing.
|
|
44
52
|
- `no-marker`: `package.json` has no valid `migratedTo`; see [Applied migrations](#applied-migrations).
|
|
45
53
|
- `no-package-json`: run the doctor in the app's root.
|
|
54
|
+
- `no-lint-preset`: no lint config enables the `ui` preset; add `...uiLint()` from `@jonmilner/oxlint-config` next to `lint`. See [Lint preset](#lint-preset).
|
|
55
|
+
- `deprecated-api`: move each listed line to the replacement its message names; see [Deprecated exports](#deprecated-exports).
|
|
46
56
|
|
|
47
57
|
## JSON
|
|
48
58
|
|
|
49
|
-
`--json` prints one object: `package`, `installed`, `declared` (`{ range, field }`), `latest`, `behind` (`{ majors, minors, patches, breaking }`, with `breaking` the versions whose migrations apply), `migratedTo` (the marker), `migrations` (`[{ version, path }]`, the docs not yet applied, oldest first), `findings` and `warnings` (each `{ code, message }`). Any value the doctor could not read is `null`. Branch on `code`, never on `message`.
|
|
59
|
+
`--json` prints one object: `package`, `installed`, `declared` (`{ range, field }`), `latest`, `behind` (`{ majors, minors, patches, breaking }`, with `breaking` the versions whose migrations apply), `migratedTo` (the marker), `migrations` (`[{ version, path }]`, the docs not yet applied, oldest first), `lintPreset` (the config's path from the app's root, `null` for none), `deprecated` (`[{ name, message, uses: [{ path, line }] }]`, by name), `findings` and `warnings` (each `{ code, message }`). Any value the doctor could not read is `null`. Branch on `code`, never on `message`.
|
package/dist/docs/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./manifest.schema.json",
|
|
3
3
|
"package": "@jonmilner/ui",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.14",
|
|
5
5
|
"components": [
|
|
6
6
|
{
|
|
7
7
|
"name": "AlertDialog",
|
|
@@ -3879,5 +3879,6 @@
|
|
|
3879
3879
|
"fontTrim.label.baseline": "var(--font-trim-label-baseline)",
|
|
3880
3880
|
"fontTrim.mono.cap": "var(--font-trim-mono-cap)",
|
|
3881
3881
|
"fontTrim.mono.baseline": "var(--font-trim-mono-baseline)"
|
|
3882
|
-
}
|
|
3882
|
+
},
|
|
3883
|
+
"deprecated": {}
|
|
3883
3884
|
}
|
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
"title": "@jonmilner/ui manifest",
|
|
5
5
|
"description": "Every component, prop, variant, icon and token in @jonmilner/ui, generated from the TypeScript types by scripts/docs.ts.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"required": [
|
|
7
|
+
"required": [
|
|
8
|
+
"$schema",
|
|
9
|
+
"package",
|
|
10
|
+
"version",
|
|
11
|
+
"components",
|
|
12
|
+
"styleProps",
|
|
13
|
+
"icons",
|
|
14
|
+
"tokens",
|
|
15
|
+
"deprecated"
|
|
16
|
+
],
|
|
8
17
|
"additionalProperties": false,
|
|
9
18
|
"properties": {
|
|
10
19
|
"$schema": { "const": "./manifest.schema.json" },
|
|
@@ -32,6 +41,11 @@
|
|
|
32
41
|
"type": "object",
|
|
33
42
|
"minProperties": 1,
|
|
34
43
|
"additionalProperties": { "type": "string", "pattern": "^var\\(--[\\w-]+\\)$" }
|
|
44
|
+
},
|
|
45
|
+
"deprecated": {
|
|
46
|
+
"description": "Exports, from any entry point, marked `@deprecated` in their JSDoc, to the tag's text: the replacement and the release that removes them. Read by ui-doctor.",
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": { "type": "string" }
|
|
35
49
|
}
|
|
36
50
|
},
|
|
37
51
|
"$defs": {
|