synthesisui 0.16.362 → 0.16.363
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/gaps.js +45 -2
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/dist/commands/gaps.js
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
import { readdir, readFile } from "node:fs/promises";
|
|
16
16
|
import { join } from "node:path";
|
|
17
17
|
import { describeTriage, triageLedger } from "../doctor/gap-triage.js";
|
|
18
|
-
import { body, section } from "../output.js";
|
|
18
|
+
import { body, bodyWrapped, paint, section } from "../output.js";
|
|
19
19
|
export async function gaps(opts) {
|
|
20
20
|
const root = opts.dir ?? process.cwd();
|
|
21
21
|
const path = opts.census ?? join(root, "_synthesisui", "census.json");
|
|
22
22
|
const raw = await readFile(path, "utf8").catch(() => null);
|
|
23
|
-
console.log(section("What this pipeline did not read"));
|
|
23
|
+
console.log(section(opts.brief ? "What we read" : "What this pipeline did not read"));
|
|
24
24
|
if (!raw) {
|
|
25
25
|
console.log(body(`No measurement at ${path}. Run \`synthesisui import --dry\` first - that is what measures your files, and it writes the result there.`));
|
|
26
26
|
return;
|
|
@@ -46,6 +46,8 @@ export async function gaps(opts) {
|
|
|
46
46
|
console.log(body(`This measurement was written by a tool version that did not count style fragments yet, so the numbers do not exist rather than being zero. Run \`synthesisui import --dry\` again with ${opts.cli} to measure.`));
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
+
if (opts.brief)
|
|
50
|
+
return brief(ledger, values);
|
|
49
51
|
for (const line of describeTriage(triageLedger(ledger, opts.cli), values))
|
|
50
52
|
console.log(body(line));
|
|
51
53
|
/**
|
|
@@ -91,6 +93,47 @@ export async function gaps(opts) {
|
|
|
91
93
|
* vazia. Em qualquer um dos três não há nada a dizer, e uma frase que aparece sempre é uma frase que
|
|
92
94
|
* ninguém lê.
|
|
93
95
|
*/
|
|
96
|
+
/**
|
|
97
|
+
* O RESULTADO E UMA AÇÃO - o fechamento de um import.
|
|
98
|
+
*
|
|
99
|
+
* TRÊS DECISÕES DE DESENHO, e cada uma responde a algo que o dono viu na tela em 03/09:
|
|
100
|
+
*
|
|
101
|
+
* O PERCENTUAL EM AZUL. `paint.blue` é a cor que este produto reserva para o que está VIVO - a
|
|
102
|
+
* barra de cobertura, os comandos, os links. A cobertura é o número que resume a entrega, e num
|
|
103
|
+
* bloco de prosa cinza ela desaparecia ("deixe com um tom de outra cor").
|
|
104
|
+
*
|
|
105
|
+
* A LACUNA EM UMA LINHA, COM ENDEREÇO. Ela continua dita - quantos fragmentos, em quantos
|
|
106
|
+
* lugares - e a LISTA mora no comando sem `--brief`. Uma lacuna sem número seria silêncio; uma
|
|
107
|
+
* lista no momento da entrega é pedir desculpa quando era hora de mostrar o resultado.
|
|
108
|
+
*
|
|
109
|
+
* UMA CTA, COM O QUE ELA GANHA. O v2 já existe como rascunho; o que faltava era dizer o que
|
|
110
|
+
* aprová-lo FAZ - agrupar cores quase iguais, nomear valor que carrega peso e não tem nome,
|
|
111
|
+
* resolver o valor que carrega dois nomes dele. Um link sem consequência dita é um link que
|
|
112
|
+
* espera para sempre.
|
|
113
|
+
*/
|
|
114
|
+
async function brief(ledger, values) {
|
|
115
|
+
const places = ledger.unread.length;
|
|
116
|
+
if (!values)
|
|
117
|
+
return;
|
|
118
|
+
const decisions = values.seen - values.structure;
|
|
119
|
+
const closed = values.interpreted + values.answered;
|
|
120
|
+
const pct = decisions > 0 ? Math.round((closed / decisions) * 100) : 0;
|
|
121
|
+
console.log(bodyWrapped(`${paint.blue(paint.strong(`${pct}%`))} of your design decisions are in the system - ${closed} of ${decisions}.`).join("\n"));
|
|
122
|
+
/**
|
|
123
|
+
* O QUE FALTA, NA MESMA UNIDADE DA LINHA DE CIMA - e a primeira versão desta função errou
|
|
124
|
+
* exatamente nisso.
|
|
125
|
+
*
|
|
126
|
+
* Ela dizia "222 fragments are not", ao lado de "920 de 1008": quem lê subtrai 88 e vê 222. É o
|
|
127
|
+
* mesmo defeito de duas unidades vizinhas que este PR conserta duas linhas acima, e eu o
|
|
128
|
+
* reintroduzi na frase nova. O resto vai em PONTOS PERCENTUAIS, que é a unidade que a pessoa
|
|
129
|
+
* acabou de ler, e o número de LUGARES é endereço e não contagem concorrente.
|
|
130
|
+
*
|
|
131
|
+
* E cala em 100%: "the other 0%" é uma linha que faz o leitor procurar o que não existe.
|
|
132
|
+
*/
|
|
133
|
+
if (pct >= 100 || places === 0)
|
|
134
|
+
return;
|
|
135
|
+
console.log(bodyWrapped(paint.dim(`The other ${100 - pct}% sits in ${places} ${places === 1 ? "place" : "places"} - \`synthesisui gaps\` lists each one with the file and the line.`)).join("\n"));
|
|
136
|
+
}
|
|
94
137
|
async function carriedByGlobals(root) {
|
|
95
138
|
const dir = join(root, "_synthesisui", "ds");
|
|
96
139
|
const slugs = await readdir(dir).catch(() => []);
|
package/dist/index.js
CHANGED
|
@@ -347,6 +347,8 @@ async function main() {
|
|
|
347
347
|
*/
|
|
348
348
|
await gaps({
|
|
349
349
|
dir,
|
|
350
|
+
/** `--brief`: o fechamento de um import - o resultado e UMA ação. Ver `gaps.ts`. */
|
|
351
|
+
...(boolFlag(flags, "brief") ? { brief: true } : {}),
|
|
350
352
|
census: typeof flags.census === "string" ? flags.census : undefined,
|
|
351
353
|
cli: CLI_VERSION,
|
|
352
354
|
});
|
package/package.json
CHANGED