synthesisui 0.16.477 → 0.16.478

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.
@@ -1,4 +1,5 @@
1
1
  import { readFile, stat, writeFile } from "node:fs/promises";
2
+ import { ourSpellingLines } from "../our-spelling.js";
2
3
  import { join, relative, resolve } from "node:path";
3
4
  import { readAutoSync, startSync } from "../auto-sync.js";
4
5
  import { changedSince } from "../changed-files.js";
@@ -309,6 +310,8 @@ async function report(root, filePath, mode) {
309
310
  const phantoms = d.files.flatMap((f) => f.phantoms ?? []);
310
311
  /** Fora da escala - ver `OffScale` (bateria, 28/09). Entra nas mesmas portas que os `phantoms`. */
311
312
  const offScale = describeOffScale(d.files);
313
+ /** A nossa grafia no arquivo dele - ver `our-spelling.ts`. Entra nas mesmas portas que os `phantoms`. */
314
+ const ours = d.tokenUses;
312
315
  // Every check leaves one line in the ledger - INCLUDING the clean ones,
313
316
  // because a fix is itself a write, so the clean re-check of a file that was
314
317
  // just flagged is the evidence the agent read the report and acted. Without
@@ -329,7 +332,8 @@ async function report(root, filePath, mode) {
329
332
  named.length === 0 &&
330
333
  phantoms.length === 0 &&
331
334
  offScale.length === 0 &&
332
- unnamed.length === 0) {
335
+ unnamed.length === 0 &&
336
+ ours === 0) {
333
337
  const hello = await greet(root, rel);
334
338
  return hello ? say(hello) : null;
335
339
  }
@@ -366,7 +370,8 @@ async function report(root, filePath, mode) {
366
370
  broke.length > 0 &&
367
371
  named.length === 0 &&
368
372
  phantoms.length === 0 &&
369
- offScale.length === 0)
373
+ offScale.length === 0 &&
374
+ ours === 0)
370
375
  return say(broke.join("\n"));
371
376
  const sample = unnamed
372
377
  .slice(0, 3)
@@ -376,7 +381,8 @@ async function report(root, filePath, mode) {
376
381
  broke.length === 0 &&
377
382
  named.length === 0 &&
378
383
  phantoms.length === 0 &&
379
- offScale.length === 0)
384
+ offScale.length === 0 &&
385
+ ours === 0)
380
386
  return say([
381
387
  `${rel} - ${unnamed.length} value${unnamed.length === 1 ? "" : "s"} here ${unnamed.length === 1 ? "has" : "have"} no name in this system, and nothing to replace ${unnamed.length === 1 ? "it" : "them"} with: ${sample}${unnamed.length > 3 ? `, +${unnamed.length - 3} more` : ""}.`,
382
388
  "Do not invent a name - leave them, or ask the person what they would call it.",
@@ -425,6 +431,8 @@ async function report(root, filePath, mode) {
425
431
  lines.push("", "Names this system does not declare. These look tokenized and apply nothing at all:", ...phantoms.slice(0, 20).map((p) => ` line ${p.line} ${p.name}`), "", "Use a name the system has, or say which value you need and what you would call it. Do NOT invent a token.");
426
432
  }
427
433
  lines.push(...offScale);
434
+ if (ours > 0)
435
+ lines.push("", ...ourSpellingLines(ours));
428
436
  return say(lines.join("\n"));
429
437
  }
430
438
  /**
@@ -1,4 +1,5 @@
1
1
  import { readFileSync } from "node:fs";
2
+ import { ourSpellingLines } from "../our-spelling.js";
2
3
  import { readdir, readFile } from "node:fs/promises";
3
4
  import { join, relative, resolve } from "node:path";
4
5
  import { provenanceAction, toolSlug, withSource, } from "../agent-provenance.js";
@@ -411,6 +412,8 @@ async function checkFile(root, path) {
411
412
  ? [
412
413
  `${table.name ?? table.slug}: ${d.reach.percent}% of design values come from the system - ${d.reach.uses} of ${d.reach.of}.`,
413
414
  `${d.tokenUses} from the system, ${d.findings.length} written by hand${d.phantomUses > 0 ? `, ${d.phantomUses} naming nothing` : ""}.`,
415
+ /** A nossa grafia, dita - ver `our-spelling.ts`. */
416
+ ...(d.tokenUses > 0 ? ourSpellingLines(d.tokenUses) : []),
414
417
  ]
415
418
  : [
416
419
  `${table.name ?? table.slug}: ${d.reach.why} here, so there is no coverage to report - not 0%, and not 100%.`,
@@ -501,7 +501,11 @@ export const COUNTED_DIFFERENTLY = "this run counts a value as named only when Y
501
501
  * que sai da escala - o ponto de quebra fora das larguras do sistema, a conta em cima de um token, e o `1px` de borda
502
502
  * num projeto que tem nome para ele. Um hook anterior aprova os três.
503
503
  */
504
- export const CHECKER_SINCE = "0.16.475";
504
+ /**
505
+ * 0.16.475 -> 0.16.478 em 28/09, e o passo 1 dá **SIM** (etapa 02, "a nossa grafia conta como nossa"): o fim do turno diz
506
+ * quando o arquivo usa `var(--ds-*)` - o valor do sistema com o NOSSO nome. Um hook anterior cala sobre esse arquivo.
507
+ */
508
+ export const CHECKER_SINCE = "0.16.478";
505
509
  /**
506
510
  * A ÚLTIMA VERSÃO EM QUE OS LEITORES PASSARAM A PRODUZIR UM CENSO DIFERENTE.
507
511
  *
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A NOSSA GRAFIA NO CÓDIGO DELE, DITA NUM LUGAR SÓ - etapa 02 da jornada "o projeto sem cor escolhe as suas", 28/09.
3
+ *
4
+ * `var(--ds-*)` é o valor do sistema com o NOSSO nome. No b6 da bateria o agente copiou 40 variáveis nossas para o
5
+ * `globals.css` do projeto, e as três vozes que medem um arquivo - o `sync`, o `check_file` e o fim do turno -
6
+ * contavam aquilo como vitória. A linha dele (28/09): o vocabulário no código é sempre o do cliente.
7
+ *
8
+ * A frase mora aqui porque são três leitores: com três cópias, a primeira edição faz duas discordarem.
9
+ */
10
+ export const OUR_SPELLING = "in our spelling (var(--ds-*)) - not a name your project declares";
11
+ /** As duas linhas do `check_file` e do fim do turno: o fato, com o número, e o que o agente faz com ele. */
12
+ export function ourSpellingLines(uses) {
13
+ return [
14
+ `${uses} value${uses === 1 ? "" : "s"} here come${uses === 1 ? "s" : ""} from the system ${OUR_SPELLING}.`,
15
+ "Tell the person in one line. Do not rename them on your own - which names the project uses is the person's decision.",
16
+ ];
17
+ }
package/dist/what-grew.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { readFile } from "node:fs/promises";
2
2
  import { dirname, join, relative } from "node:path";
3
3
  import { readStyleSheet } from "./doctor/scss-lens.js";
4
+ import { OUR_SPELLING } from "./our-spelling.js";
4
5
  import { loadSystem, walkAll } from "./commands/doctor.js";
5
6
  import { diagnose, scanSource } from "./doctor/scan.js";
6
7
  export async function whatGrew(root, census,
@@ -74,12 +75,24 @@ before) {
74
75
  fromSystem: d.reach.measured ? d.reach.uses : 0,
75
76
  of: d.reach.measured ? d.reach.of : 0,
76
77
  byHand: [...new Set(d.findings.map((f) => f.literal))],
78
+ ...(d.reach.measured && d.tokenUses > 0 ? { ours: d.tokenUses } : {}),
77
79
  ...(utilities ? { utilities: true } : {}),
78
80
  ...(composed(src, c.name) >= 3 ? { composes: composed(src, c.name) } : {}),
79
81
  });
80
82
  }
81
83
  return { born, gone };
82
84
  }
85
+ /**
86
+ * A NOSSA GRAFIA, DITA - o valor é do sistema, o nome é o nosso, e o vocabulário no código é sempre o dele (28/09).
87
+ * Contar `var(--ds-*)` como vitória premiava o agente que copia os nossos nomes para o projeto.
88
+ */
89
+ function ourSpelling(b) {
90
+ if (!b.ours)
91
+ return "";
92
+ return b.ours >= b.fromSystem
93
+ ? `, all ${b.ours} ${OUR_SPELLING}`
94
+ : `, ${b.ours} of them ${OUR_SPELLING}`;
95
+ }
83
96
  /** As linhas do bloco, ou nada. Uma por componente: o nome, o arquivo, a medida e o que ficou à mão. */
84
97
  export function describeGrowth(grown) {
85
98
  const out = [];
@@ -88,7 +101,7 @@ export function describeGrowth(grown) {
88
101
  ? b.utilities
89
102
  ? `${b.name} (${b.file}) - styled with utility classes; \`npx synthesisui doctor\` measures those`
90
103
  : `${b.name} (${b.file}) - no colour or spacing of its own to measure`
91
- : `${b.name} (${b.file}) - ${b.fromSystem} of ${b.of} values from your system${b.byHand.length > 0 ? `; by hand: ${b.byHand.slice(0, 4).join(", ")}${b.byHand.length > 4 ? ", …" : ""}` : ""}`);
104
+ : `${b.name} (${b.file}) - ${b.fromSystem} of ${b.of} values from your system${ourSpelling(b)}${b.byHand.length > 0 ? `; by hand: ${b.byHand.slice(0, 4).join(", ")}${b.byHand.length > 4 ? ", …" : ""}` : ""}`);
92
105
  /** A tela que mora na pasta de componentes: a linha pergunta, e quem responde decide. */
93
106
  for (const [i, b] of grown.born.entries())
94
107
  if (b.composes)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.477",
3
+ "version": "0.16.478",
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": {