synthesisui 0.16.433 → 0.16.434

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.
@@ -56,7 +56,7 @@ import { consumersOf, outsideScope, } from "../outside-scope.js";
56
56
  import { phase, startProgress } from "../progress.js";
57
57
  import { repoStateOf } from "../repo-state.js";
58
58
  import { relatorioHtml, secoesDe } from "../report-html.js";
59
- import { abertura, aneis, historiaDeCor } from "../report-insight.js";
59
+ import { abertura, aneis, historiaDeCor, oQueMuda } from "../report-insight.js";
60
60
  import { runtimeDeclaredVars, runtimeDeclaredVarsIn } from "../runtime-vars.js";
61
61
  import { detectStack, resolveDeps, stackVersions } from "../stack.js";
62
62
  import { desligarCaptura, ligarCaptura } from "../transcript.js";
@@ -3787,6 +3787,12 @@ async function mostrarInspecao(c, root, transcrito) {
3787
3787
  abertura: abertura(c, c.measured?.repo ?? basename(root)),
3788
3788
  aneis: aneis(c),
3789
3789
  cor: historiaDeCor(c),
3790
+ /**
3791
+ * O COMANDO NO TOPO E NO FIM (dono, 18/09): quem decidiu adotar no meio da leitura nao
3792
+ * deveria ter que voltar ao terminal para descobrir o que digitar.
3793
+ */
3794
+ comando: "npx synthesisui@latest import",
3795
+ muda: oQueMuda(c),
3790
3796
  });
3791
3797
  console.log(section("What came out of your files"));
3792
3798
  console.log(body(`${paint.strong(`${lidos} of ${total}`)} components came out with a blueprint${pct === null
@@ -82,7 +82,12 @@ ${layout()}
82
82
  <p class="kicker">Read by SynthesisUI</p>
83
83
  <p class="bar-repo">${escapar(cabecalho.repo)}</p>
84
84
  </div>
85
- <p class="meta">${escapar(quando)} &middot; CLI ${escapar(cabecalho.cli)} &middot; nothing left this machine</p>
85
+ <div class="bar-fim">
86
+ <p class="meta">${escapar(quando)} &middot; CLI ${escapar(cabecalho.cli)} &middot; nothing left this machine</p>${input.comando
87
+ ? `
88
+ <code class="comando">${escapar(input.comando)}</code>`
89
+ : ""}
90
+ </div>
86
91
  </div>
87
92
  </header>
88
93
 
@@ -107,6 +112,8 @@ ${desenharCor(input.cor)}
107
112
 
108
113
  ${corpo}
109
114
 
115
+ ${desenharMuda(input.muda ?? [], input.comando)}
116
+
110
117
  <footer>
111
118
  <p>Dressed by Halogen v${HALOGEN_VERSION}, a design system from the SynthesisUI gallery.</p>
112
119
  <p>This file lives in your project and was never sent anywhere. Re-run the command to refresh it.</p>
@@ -117,6 +124,24 @@ ${corpo}
117
124
  </html>
118
125
  `;
119
126
  }
127
+ /**
128
+ * A ÚLTIMA COISA QUE ELA LÊ: a conta, e não mais um inventário.
129
+ *
130
+ * Um relatório que termina na décima sexta lista deixa a pessoa com o diagnóstico e sem o passo.
131
+ * Este capítulo diz o que muda COM OS NÚMEROS DELA e entrega o comando ao lado - a mesma linha que
132
+ * já está no topo, porque quem chegou até aqui não deveria ter que subir para achá-la.
133
+ */
134
+ function desenharMuda(linhas, comando) {
135
+ if (linhas.length === 0)
136
+ return "";
137
+ return ` <section class="chapter muda" style="--ordem:12">
138
+ <h2><span>What changes if you bring it in</span></h2>
139
+ ${linhas.map((l) => ` <p class="callout">${escapar(l)}</p>`).join("\n")}${comando
140
+ ? `
141
+ <code class="comando grande">${escapar(comando)}</code>`
142
+ : ""}
143
+ </section>`;
144
+ }
120
145
  /**
121
146
  * OS TRÊS ANÉIS DA NOSSA LEITURA DE TOKEN (pedido dele, 18/09) - e eles abrem a página porque são
122
147
  * a régua do produto: quanto já vem de token, quanto ela declara, e quanto a leitura entendeu.
@@ -367,8 +392,11 @@ body {
367
392
  background: var(--ds-color-semantic-raised, var(--ds-color-semantic-surface));
368
393
  border-bottom: 1px solid var(--ds-color-semantic-border);
369
394
  }
395
+ /* A BARRA ALINHA COM A COLUNA DO CONTEUDO: mesma largura maxima, mesma margem lateral. Antes ela
396
+ media 920px enquanto o corpo media 1200, entao o titulo do topo e o titulo da pagina comecavam em
397
+ colunas diferentes - a primeira coisa que o olho nota, e a mais facil de consertar. */
370
398
  .bar-in {
371
- max-width: 920px;
399
+ max-width: 1200px;
372
400
  margin-inline: auto;
373
401
  padding: 11px 24px;
374
402
  display: flex;
@@ -378,6 +406,25 @@ body {
378
406
  justify-content: space-between;
379
407
  }
380
408
  .bar-repo { margin: 2px 0 0; font-weight: 600; }
409
+ .bar-fim { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
410
+
411
+ /* O COMANDO NO TOPO, sem rolar: quem decidiu adotar no meio da leitura nao volta para procura-lo. */
412
+ .comando {
413
+ font-family: ${mono};
414
+ font-size: 12px;
415
+ padding: 6px 12px;
416
+ border-radius: var(--ds-radius-sm, 8px);
417
+ border: 1px solid var(--ds-color-semantic-border);
418
+ background: var(--ds-color-semantic-canvas);
419
+ color: var(--ds-color-semantic-foreground);
420
+ user-select: all;
421
+ }
422
+ .comando.grande {
423
+ display: inline-block;
424
+ margin-top: 14px;
425
+ font-size: 14px;
426
+ padding: 12px 18px;
427
+ }
381
428
  .bar-id { min-width: 0; }
382
429
 
383
430
  .wrap {
@@ -385,7 +432,7 @@ body {
385
432
  margin-inline: auto;
386
433
  padding: 0 24px 96px;
387
434
  display: grid;
388
- grid-template-columns: 250px minmax(0, 1fr);
435
+ grid-template-columns: 230px minmax(0, 1fr);
389
436
  gap: 40px;
390
437
  align-items: start;
391
438
  }
@@ -453,7 +500,7 @@ h1 {
453
500
 
454
501
  nav { margin: 44px 0 8px; }
455
502
  nav ol {
456
- margin: 12px 0 0;
503
+ margin: 10px 0 0;
457
504
  padding: 0;
458
505
  list-style: none;
459
506
  counter-reset: capitulo;
@@ -465,10 +512,21 @@ nav li {
465
512
  counter-increment: capitulo;
466
513
  display: flex;
467
514
  align-items: baseline;
468
- gap: 12px;
469
- padding: 7px 10px;
515
+ gap: 10px;
516
+ padding: 5px 9px;
517
+ font-size: 13px;
518
+ line-height: 1.35;
519
+ border: 1px solid transparent;
470
520
  border-radius: var(--ds-radius-sm, 8px);
471
521
  }
522
+ /* O ITEM CLICADO FICA MARCADO: sem isto a lateral e uma lista de dezesseis iguais, e a pessoa perde
523
+ de onde veio no instante em que rola. O foco sobrevive ao clique, entao a marca tambem. */
524
+ nav li:has(a:focus),
525
+ nav li:has(a:focus-visible) {
526
+ border-color: var(--ds-color-semantic-accent);
527
+ background: var(--ds-color-semantic-surface);
528
+ }
529
+ nav li:has(a:focus) a { color: var(--ds-color-semantic-accent); }
472
530
  nav li:hover { background: var(--ds-color-semantic-surface); }
473
531
  nav li::before {
474
532
  content: counter(capitulo);
@@ -141,3 +141,31 @@ function colidem(valores) {
141
141
  }
142
142
  return n;
143
143
  }
144
+ /**
145
+ * O QUE MUDA SE ELA ADOTAR - com os números DELA, e sem uma promessa que a medição não sustente.
146
+ *
147
+ * O QUE O CLIENTE GANHA: a última coisa que ela lê não é mais um inventário, é a conta. Quantos dos
148
+ * valores que hoje ela repete à mão passam a ter um nome, e por que o problema para de voltar.
149
+ *
150
+ * E ELE NÃO PROMETE O QUE NÃO MEDIU: o número aqui é o que está escrito à mão HOJE, no repositório
151
+ * dela. Um texto que dissesse "seu design fica consistente" seria a mesma frase para todo mundo, e
152
+ * portanto verdade para ninguém.
153
+ */
154
+ export function oQueMuda(c) {
155
+ const observados = c.observed ?? [];
156
+ if (observados.length === 0)
157
+ return [];
158
+ const aMao = observados.filter((v) => !v.token);
159
+ if (aMao.length === 0)
160
+ return [
161
+ "Every design value in your code already comes from a token you declare. What SynthesisUI adds here is keeping it that way: the check runs after every file your agent writes, and a value that drifts off your own scale comes back to you as a decision instead of landing silently.",
162
+ ];
163
+ const repetidos = aMao.filter((v) => v.count > 1);
164
+ const usos = repetidos.reduce((n, v) => n + v.count, 0);
165
+ const linhas = [];
166
+ linhas.push(`${aMao.length} of your design values are written by hand today. Importing gives each one a name in your own vocabulary, so changing it later means changing it once instead of finding every copy.`);
167
+ if (repetidos.length > 0)
168
+ linhas.push(`${repetidos.length} of those are repeated - ${usos} uses across your files. Every copy is a place the next change can be forgotten, which is how two screens end up almost the same colour.`);
169
+ linhas.push("And it stops coming back: once the system is in the repository, the check runs after every file your agent writes and catches a value that drifts off your own scale, before it ships.");
170
+ return linhas;
171
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.433",
3
+ "version": "0.16.434",
4
4
  "description": "Bring SynthesisUI design systems into any project - tokens, typed components, whole pages and an agent-ready CLAUDE.md manifest.",
5
5
  "type": "module",
6
6
  "bin": {