synthesisui 0.16.52 → 0.16.53
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/commands/import.js +30 -3
- package/package.json +1 -1
package/dist/commands/import.js
CHANGED
|
@@ -291,10 +291,37 @@ export async function takeCensus(root) {
|
|
|
291
291
|
}
|
|
292
292
|
const d = diagnose(reports);
|
|
293
293
|
const inventory = tallyToInventory(tally);
|
|
294
|
+
/**
|
|
295
|
+
* THE TWO READINGS BECOME ONE LIST before anything is judged.
|
|
296
|
+
*
|
|
297
|
+
* The crosswalk saw only what a project COMPOSES, so a library's report said
|
|
298
|
+
* "only yours (4)" three lines above "37 components exported here" - the two
|
|
299
|
+
* sections talking past each other (dono, 31/07). Worse, the contracts that
|
|
300
|
+
* travel are picked from that list, so a library would have sent four.
|
|
301
|
+
*
|
|
302
|
+
* A component that is defined and never composed here is still a component:
|
|
303
|
+
* in a library that is the entire point. Its axes come from the TYPE, which
|
|
304
|
+
* is the better source anyway - usage shows what somebody picked, the
|
|
305
|
+
* declaration shows what the author designed.
|
|
306
|
+
*/
|
|
307
|
+
const composed = new Set(inventory.map((c) => c.name));
|
|
308
|
+
const fromTypes = defined
|
|
309
|
+
.filter((d) => !composed.has(d.name))
|
|
310
|
+
.map((d) => ({
|
|
311
|
+
name: d.name,
|
|
312
|
+
count: 0,
|
|
313
|
+
files: 0,
|
|
314
|
+
props: {
|
|
315
|
+
...Object.fromEntries(Object.entries(d.axes)),
|
|
316
|
+
...Object.fromEntries(d.flags.map((f) => [f, ["true"]])),
|
|
317
|
+
},
|
|
318
|
+
propFiles: {},
|
|
319
|
+
}));
|
|
320
|
+
const merged = [...inventory, ...fromTypes];
|
|
294
321
|
// The verdict travels WITH the payload: the platform reads one reading rather
|
|
295
322
|
// than computing a second opinion from the same numbers, which is how two
|
|
296
323
|
// implementations of the same judgement start disagreeing.
|
|
297
|
-
const verdicts = new Map(crosswalk(
|
|
324
|
+
const verdicts = new Map(crosswalk(merged).map((r) => [
|
|
298
325
|
r.component.name,
|
|
299
326
|
{ bucket: r.bucket, canonical: r.canonical, because: r.because },
|
|
300
327
|
]));
|
|
@@ -302,7 +329,7 @@ export async function takeCensus(root) {
|
|
|
302
329
|
for (const r of observedRules(inventory)) {
|
|
303
330
|
laws.set(r.component, [...(laws.get(r.component) ?? []), r.text]);
|
|
304
331
|
}
|
|
305
|
-
const components =
|
|
332
|
+
const components = merged.map((c) => ({
|
|
306
333
|
...c,
|
|
307
334
|
...(verdicts.get(c.name) ?? {}),
|
|
308
335
|
...(laws.has(c.name) ? { laws: laws.get(c.name) } : {}),
|
|
@@ -509,7 +536,7 @@ function printCrosswalk(mine) {
|
|
|
509
536
|
return;
|
|
510
537
|
console.log(body(paint.strong(title)));
|
|
511
538
|
for (const r of list.slice(0, limit)) {
|
|
512
|
-
console.log(body(` ${r.component.name.padEnd(18)} ${paint.faint(`${r.component.files} files`)} ${paint.dim(r.because)}`));
|
|
539
|
+
console.log(body(` ${r.component.name.padEnd(18)} ${paint.faint(r.component.files === 0 ? "declared" : `${r.component.files} files`)} ${paint.dim(r.because)}`));
|
|
513
540
|
}
|
|
514
541
|
if (list.length > limit) {
|
|
515
542
|
console.log(body(paint.faint(` (${list.length - limit} more)`)));
|
package/package.json
CHANGED