synthesisui 0.16.207 → 0.16.208
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/doctor.js +20 -0
- package/dist/doctor/transcribe.js +49 -3
- package/dist/install-marks.js +11 -4
- package/package.json +1 -1
package/dist/commands/doctor.js
CHANGED
|
@@ -758,6 +758,26 @@ export async function doctor(opts) {
|
|
|
758
758
|
console.log("");
|
|
759
759
|
console.log(body(`Token coverage ${meter(d.coverage)} ${paint.strong(`${String(d.coverage).padStart(3)}%`)}`));
|
|
760
760
|
console.log(body(paint.dim(` ${d.tokenUses} from the system, ${d.findings.length} by hand${d.phantomUses > 0 ? `, ${d.phantomUses} naming nothing` : ""}`)));
|
|
761
|
+
/**
|
|
762
|
+
* ZERO NUM REPO QUE ORIGINOU O SISTEMA É O ESTADO CERTO, e sem esta linha ele lê como falha
|
|
763
|
+
* NOSSA.
|
|
764
|
+
*
|
|
765
|
+
* "Token coverage 0% - 1 from the system, 4433 by hand" é literalmente verdade e ainda assim
|
|
766
|
+
* engana: quando o sistema foi medido A PARTIR daqui, esses valores escritos à mão são a FONTE
|
|
767
|
+
* de onde os tokens saíram, não um desvio deles. Não há nada consertado ainda porque não havia
|
|
768
|
+
* nada quebrado - o passo seguinte é o código passar a apontar para os nomes que agora existem.
|
|
769
|
+
*
|
|
770
|
+
* O sinal é `measured.system`: a pasta de onde o import mediu. Ele só existe quando este
|
|
771
|
+
* repositório é a origem, então a frase não aparece para quem instalou um sistema de fora - ali
|
|
772
|
+
* um zero significa outra coisa e merece outra frase.
|
|
773
|
+
*
|
|
774
|
+
* A lei 14 em uma linha: um zero pelado lê como falha nossa, um zero com motivo lê como fato.
|
|
775
|
+
*/
|
|
776
|
+
if (d.tokenUses === 0 && measured.system) {
|
|
777
|
+
console.log(body(paint.dim(` zero is the expected start here - this system was measured FROM`)));
|
|
778
|
+
console.log(body(paint.dim(` \`${measured.system}\`, so these values are its source, not a drift`)));
|
|
779
|
+
console.log(body(paint.dim(` from it. They count once the code points at the names they became.`)));
|
|
780
|
+
}
|
|
761
781
|
// The strongest number leads, not trails: it used to sit two screens
|
|
762
782
|
// down, after the phantom list (30/07). For the reader who already owns
|
|
763
783
|
// a system - the ICP - THIS line is the report.
|
|
@@ -1325,12 +1325,44 @@ function layerFor(out, when, at) {
|
|
|
1325
1325
|
* attempt.
|
|
1326
1326
|
*/
|
|
1327
1327
|
const INLINE_STYLE = /style=\{\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}\}/;
|
|
1328
|
+
/**
|
|
1329
|
+
* AS PROPRIEDADES, SEPARADAS PELA VÍRGULA QUE SEPARA - e não pela que está dentro de um valor.
|
|
1330
|
+
*
|
|
1331
|
+
* `split(",")` partia `var(--color-track, var(--color-darkgray-300))` ao meio e entregava duas
|
|
1332
|
+
* metades que não são nada. Vírgula dentro de parêntese ou de aspas pertence ao valor.
|
|
1333
|
+
*/
|
|
1334
|
+
function splitProperties(body) {
|
|
1335
|
+
const out = [];
|
|
1336
|
+
let depth = 0;
|
|
1337
|
+
let quote = null;
|
|
1338
|
+
let start = 0;
|
|
1339
|
+
for (let i = 0; i < body.length; i += 1) {
|
|
1340
|
+
const c = body[i];
|
|
1341
|
+
if (quote) {
|
|
1342
|
+
if (c === quote && body[i - 1] !== "\\")
|
|
1343
|
+
quote = null;
|
|
1344
|
+
continue;
|
|
1345
|
+
}
|
|
1346
|
+
if (c === '"' || c === "'" || c === "`")
|
|
1347
|
+
quote = c;
|
|
1348
|
+
else if (c === "(" || c === "[")
|
|
1349
|
+
depth += 1;
|
|
1350
|
+
else if (c === ")" || c === "]")
|
|
1351
|
+
depth -= 1;
|
|
1352
|
+
else if (c === "," && depth === 0) {
|
|
1353
|
+
out.push(body.slice(start, i));
|
|
1354
|
+
start = i + 1;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
out.push(body.slice(start));
|
|
1358
|
+
return out;
|
|
1359
|
+
}
|
|
1328
1360
|
export function readInlineStyle(source) {
|
|
1329
1361
|
const m = INLINE_STYLE.exec(source);
|
|
1330
1362
|
if (!m)
|
|
1331
1363
|
return {};
|
|
1332
1364
|
const out = {};
|
|
1333
|
-
for (const piece of m[1]
|
|
1365
|
+
for (const piece of splitProperties(m[1])) {
|
|
1334
1366
|
const colon = piece.indexOf(":");
|
|
1335
1367
|
if (colon === -1)
|
|
1336
1368
|
continue;
|
|
@@ -1339,10 +1371,24 @@ export function readInlineStyle(source) {
|
|
|
1339
1371
|
.trim()
|
|
1340
1372
|
.replace(/^["']|["']$/g, "");
|
|
1341
1373
|
let value = piece.slice(colon + 1).trim();
|
|
1374
|
+
/**
|
|
1375
|
+
* UMA STRING ENTRE ASPAS ESTÁ NO FONTE, e o que ela tem dentro não muda isso.
|
|
1376
|
+
*
|
|
1377
|
+
* O guarda descartava todo valor com parêntese, e com isso todo `var()`, `linear-gradient()`,
|
|
1378
|
+
* `calc()` e `rgb()` escrito em estilo inline - que são exatamente os valores que carregam
|
|
1379
|
+
* decisão de design. Medido em 11/08 no repo dele: 2 dos 6 fragmentos que o censo chamava de
|
|
1380
|
+
* `computed` eram literais, entre eles
|
|
1381
|
+
* `style={{ stroke: "var(--color-track, var(--color-darkgray-300))" }}`.
|
|
1382
|
+
*
|
|
1383
|
+
* A distinção certa não é "tem parêntese", é "está no fonte": literal entre aspas se lê inteiro,
|
|
1384
|
+
* e só o que NÃO está entre aspas passa pelo guarda de expressão.
|
|
1385
|
+
*/
|
|
1386
|
+
const quoted = /^(["'])([\s\S]*)\1$/.exec(value);
|
|
1387
|
+
if (quoted)
|
|
1388
|
+
value = quoted[2];
|
|
1342
1389
|
// A value computed at runtime is not in the source, so there is nothing to read.
|
|
1343
|
-
if (!value || /[`$]|\?|=>|\(/.test(value))
|
|
1390
|
+
else if (!value || /[`$]|\?|=>|\(/.test(value))
|
|
1344
1391
|
continue;
|
|
1345
|
-
value = value.replace(/^["']|["']$/g, "");
|
|
1346
1392
|
if (!/^[a-zA-Z][\w]*$/.test(prop))
|
|
1347
1393
|
continue;
|
|
1348
1394
|
if (/[<>{}@;]/.test(value))
|
package/dist/install-marks.js
CHANGED
|
@@ -85,8 +85,15 @@ export const CHECKER_SINCE = "0.16.202";
|
|
|
85
85
|
* Ou seja, o `READER` estava errado e ninguém tinha sido avisado. A marca nasceu em `0.16.202`,
|
|
86
86
|
* bisseccionada: o censo de 0.16.201 difere do de então, o de 0.16.202 é byte a byte igual.
|
|
87
87
|
*
|
|
88
|
-
* ANDOU
|
|
89
|
-
*
|
|
90
|
-
*
|
|
88
|
+
* ANDOU DUAS VEZES no mesmo dia, e nas duas foi o portão que mandou:
|
|
89
|
+
*
|
|
90
|
+
* 0.16.207 `fragmentsOfSource` parou de tomar operando de `===` e texto de comentário por
|
|
91
|
+
* classe - 11 das 26 declarações que o censo dele listava como ilegíveis eram
|
|
92
|
+
* acusação NOSSA
|
|
93
|
+
* 0.16.208 `readInlineStyle` parou de descartar valor com parêntese - `var()` e
|
|
94
|
+
* `linear-gradient()` em `style={{}}` chegam na receita, e 2 dos 6 fragmentos
|
|
95
|
+
* chamados de `computed` eram literais no fonte
|
|
96
|
+
*
|
|
97
|
+
* Um censo medido antes disto carrega as duas leituras erradas.
|
|
91
98
|
*/
|
|
92
|
-
export const READER_SINCE = "0.16.
|
|
99
|
+
export const READER_SINCE = "0.16.208";
|
package/package.json
CHANGED