synthesisui 0.16.68 → 0.16.70
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 +5 -6
- package/dist/doctor/idiom.js +29 -1
- package/dist/doctor/transcribe.js +17 -0
- package/package.json +1 -1
package/dist/commands/import.js
CHANGED
|
@@ -6,7 +6,7 @@ import { isNearDuplicate, isNeutral, lightness, } from "../doctor/color-distance
|
|
|
6
6
|
import { emptyTally, internalSpecifiers, scanComponentsInto, tallyToInventory, } from "../doctor/components-scan.js";
|
|
7
7
|
import { crosswalk, observedRules } from "../doctor/crosswalk.js";
|
|
8
8
|
import { reconcile, scanDefinitions, } from "../doctor/definitions-scan.js";
|
|
9
|
-
import { describeConvention,
|
|
9
|
+
import { describeConvention, describeRemainder, detectConventions, } from "../doctor/idiom.js";
|
|
10
10
|
import { diagnose, scanSource } from "../doctor/scan.js";
|
|
11
11
|
import { parseSchemeBlocks } from "../doctor/scheme-blocks.js";
|
|
12
12
|
import { buildTable } from "../doctor/tokens.js";
|
|
@@ -490,13 +490,12 @@ function sayConventions(c) {
|
|
|
490
490
|
console.log(section("How you reference a value"));
|
|
491
491
|
for (const conv of list) {
|
|
492
492
|
console.log(body(describeConvention(conv)));
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
495
|
-
console.log(body(paint.faint(`
|
|
496
|
-
}
|
|
493
|
+
const remainder = describeRemainder(conv);
|
|
494
|
+
if (remainder)
|
|
495
|
+
console.log(body(paint.faint(` ${remainder}`)));
|
|
497
496
|
}
|
|
498
497
|
console.log("");
|
|
499
|
-
console.log(body(paint.faint("Nothing here is a rule we brought
|
|
498
|
+
console.log(body(paint.faint("Nothing here is a rule we brought - it is what your own files already do, and the system now knows it. None of the rest has to move today: this is a complement, not a correction.")));
|
|
500
499
|
}
|
|
501
500
|
/**
|
|
502
501
|
* NOT DRIFT - BROKEN. A `var()` no declaration answers renders nothing at all,
|
package/dist/doctor/idiom.js
CHANGED
|
@@ -122,10 +122,38 @@ export function detectConventions(sources, minReferences = 20) {
|
|
|
122
122
|
export function describeConvention(c) {
|
|
123
123
|
const pct = Math.round(c.share * 100);
|
|
124
124
|
if (c.idiom === "raw-hex") {
|
|
125
|
-
return `${c.language} has no convention - ${pct}% of its ${c.total} references are values typed in place`;
|
|
125
|
+
return `${c.language} has no single convention yet - ${pct}% of its ${c.total} references are values typed in place`;
|
|
126
126
|
}
|
|
127
127
|
return `${c.language} reaches for ${IDIOM_LABEL[c.idiom]} - ${pct}% of the ${c.total} references in it`;
|
|
128
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* WHAT IS NOT YET IN THE CONVENTION - and the wording is the whole point.
|
|
131
|
+
*
|
|
132
|
+
* "and 1154 raw hex" reads as 1154 errors in the author's face. The measurement
|
|
133
|
+
* is the same and the accusation is gratuitous: this system exists to make their
|
|
134
|
+
* work SCALABLE, not to mark it wrong, and a design system is somebody's
|
|
135
|
+
* judgement before it is anybody's audit (dono, 01/08 - "entrar como um
|
|
136
|
+
* complemento").
|
|
137
|
+
*
|
|
138
|
+
* So the number is stated as coverage, not as a count of mistakes, and it says
|
|
139
|
+
* out loud that none of it has to change today.
|
|
140
|
+
*/
|
|
141
|
+
export function describeRemainder(c) {
|
|
142
|
+
const off = c.offIdiom.filter((o) => o.count > 0);
|
|
143
|
+
if (off.length === 0)
|
|
144
|
+
return null;
|
|
145
|
+
const total = off.reduce((n, o) => n + o.count, 0);
|
|
146
|
+
const named = off
|
|
147
|
+
.slice(0, 3)
|
|
148
|
+
.map((o) => `${o.count} ${IDIOM_LABEL[o.idiom]}`)
|
|
149
|
+
.join(", ");
|
|
150
|
+
// The reassurance belongs at the END of the section, once. Repeated on every
|
|
151
|
+
// line it becomes noise, and noise is how a report stops being read.
|
|
152
|
+
if (!hasConvention(c)) {
|
|
153
|
+
return `the other ${total} are ${named} - no single answer dominates here yet`;
|
|
154
|
+
}
|
|
155
|
+
return `${total} are not in it yet: ${named}`;
|
|
156
|
+
}
|
|
129
157
|
/** True when this language's dominant answer is "no answer". */
|
|
130
158
|
export function hasConvention(c) {
|
|
131
159
|
return c.idiom !== "raw-hex";
|
|
@@ -227,6 +227,7 @@ export function transcribe(classes, declared) {
|
|
|
227
227
|
states: {},
|
|
228
228
|
dark: {},
|
|
229
229
|
skipped: [],
|
|
230
|
+
literals: [],
|
|
230
231
|
fromToken: 0,
|
|
231
232
|
fromLiteral: 0,
|
|
232
233
|
};
|
|
@@ -267,12 +268,28 @@ export function transcribe(classes, declared) {
|
|
|
267
268
|
}
|
|
268
269
|
if (!decl || !target)
|
|
269
270
|
continue;
|
|
271
|
+
/**
|
|
272
|
+
* EVERYTHING IT READS TRAVELS, literals included - as DATA.
|
|
273
|
+
*
|
|
274
|
+
* Which of these becomes a recipe declaration is not this module's call: a
|
|
275
|
+
* literal cannot re-theme, and whether `#ffffff` is a white or a SURFACE
|
|
276
|
+
* depends on the two palettes, which only exist on the platform. An earlier
|
|
277
|
+
* version wrote literals straight into `base` and a dark preview rendered a
|
|
278
|
+
* white box with white text on it; the version after that dropped them and
|
|
279
|
+
* carried almost nothing. Both were this module deciding something it cannot
|
|
280
|
+
* see (dono, 01/08).
|
|
281
|
+
*
|
|
282
|
+
* So it reports the whole reading and the platform pairs base against dark
|
|
283
|
+
* to recover the role. See `exclusive-contract.ts`.
|
|
284
|
+
*/
|
|
270
285
|
// First write wins, matching how a class list resolves for the properties
|
|
271
286
|
// we read: later duplicates in the same list are almost always a merge
|
|
272
287
|
// artefact rather than an override.
|
|
273
288
|
if (target[decl.property] != null)
|
|
274
289
|
continue;
|
|
275
290
|
target[decl.property] = decl.value;
|
|
291
|
+
// Both travel now, so both are counted honestly. The platform decides which
|
|
292
|
+
// becomes a declaration; this only reports what the reading was made of.
|
|
276
293
|
if (decl.token)
|
|
277
294
|
out.fromToken += 1;
|
|
278
295
|
else
|
package/package.json
CHANGED