synthesisui 0.16.299 → 0.16.301

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.
@@ -12,7 +12,7 @@
12
12
  * E o texto que ele imprime é o que a pessoa manda para quem vai escrever o leitor - por isso ele
13
13
  * nomeia o módulo e nunca sugere código.
14
14
  */
15
- import { readFile } from "node:fs/promises";
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
18
  import { body, section } from "../output.js";
@@ -44,4 +44,79 @@ export async function gaps(opts) {
44
44
  }
45
45
  for (const line of describeTriage(triageLedger(ledger, opts.cli)))
46
46
  console.log(body(line));
47
+ /**
48
+ * E O QUE A CAMADA GLOBAL JÁ LEVOU - o desconto, sem o qual este comando repete a mentira que ele
49
+ * veio consertar.
50
+ *
51
+ * MEDIDO no repositório do dono (24/08): a triagem acima diz *"214 fragmentos, 96% do que não foi
52
+ * interpretado"*, e 141 daquelas declarações estão no sistema dele - `globals.base`,
53
+ * `globals.utilities`, `globals.properties`. As 22 `@utility` que ele escreveu estão lá com o nome
54
+ * dele.
55
+ *
56
+ * A triagem não está errada: ela responde *"o que nenhum leitor interpretou"*, e uma regra
57
+ * `::selection` continua sem leitor. O que faltava é que "sem leitor" deixou de significar "sem
58
+ * lugar" quando a camada global nasceu.
59
+ *
60
+ * LIDO DO DOCUMENTO INSTALADO, e não recalculado: quem decide o que entra na camada é o servidor,
61
+ * e refazer a classificação aqui seria uma segunda opinião livre para discordar da primeira. Sem
62
+ * sistema instalado não há o que dizer, e o comando cala - que é o caso de quem só rodou
63
+ * `import --dry`.
64
+ */
65
+ const carried = await carriedByGlobals(root);
66
+ if (carried) {
67
+ console.log("");
68
+ console.log(body(`${carried.total} of those declarations are already in your system - ${carried.parts}. They are not component recipes, which is why they count as "not interpreted" above; they did arrive.`));
69
+ }
70
+ }
71
+ /**
72
+ * O QUE A CAMADA GLOBAL DO SISTEMA INSTALADO CARREGA - lido, nunca recalculado.
73
+ *
74
+ * `null` quando não há sistema instalado, quando o documento não tem camada, ou quando ela está
75
+ * vazia. Em qualquer um dos três não há nada a dizer, e uma frase que aparece sempre é uma frase que
76
+ * ninguém lê.
77
+ */
78
+ async function carriedByGlobals(root) {
79
+ const dir = join(root, "_synthesisui", "ds");
80
+ const slugs = await readdir(dir).catch(() => []);
81
+ for (const slug of slugs) {
82
+ const lock = join(dir, slug);
83
+ const versions = await readdir(lock).catch(() => []);
84
+ /** A maior versão instalada - `v1`, `v2`… - é a que o repositório dele está usando. */
85
+ const latest = versions
86
+ .filter((v) => /^v\d+$/.test(v))
87
+ .sort((a, b) => Number(b.slice(1)) - Number(a.slice(1)))[0];
88
+ if (!latest)
89
+ continue;
90
+ const doc = await readFile(join(lock, latest, "design-system.json"), "utf8").catch(() => null);
91
+ if (!doc)
92
+ continue;
93
+ let globals;
94
+ try {
95
+ globals = JSON.parse(doc).globals ?? {};
96
+ }
97
+ catch {
98
+ continue;
99
+ }
100
+ const rules = (globals.base ?? []).reduce((n, r) => n + Object.keys(r.declarations ?? {}).length, 0);
101
+ const utils = Object.values(globals.utilities ?? {}).reduce((n, u) => n + Object.keys(u.declarations ?? {}).length, 0);
102
+ const props = Object.keys(globals.properties ?? {}).length;
103
+ const total = rules + utils + props;
104
+ if (total === 0)
105
+ continue;
106
+ const parts = [
107
+ (globals.base ?? []).length > 0
108
+ ? `${(globals.base ?? []).length} base rules`
109
+ : "",
110
+ Object.keys(globals.utilities ?? {}).length > 0
111
+ ? `${Object.keys(globals.utilities ?? {}).length} of your utilities`
112
+ : "",
113
+ props > 0
114
+ ? `${props} registered ${props === 1 ? "property" : "properties"}`
115
+ : "",
116
+ ]
117
+ .filter(Boolean)
118
+ .join(", ");
119
+ return { total, parts };
120
+ }
121
+ return null;
47
122
  }
@@ -117,7 +117,20 @@ const A_READER_REACHES = new Set([
117
117
  "component-not-admitted",
118
118
  ]);
119
119
  const BECAUSE = {
120
- "shape-not-read": "no reader in this version understands this shape, so the styles it holds reach no recipe",
120
+ "shape-not-read":
121
+ /**
122
+ * A FRASE DIZ O QUE ESTE LADO SABE, E PARA AÍ - conserto de 24/08.
123
+ *
124
+ * Ela dizia *"so the styles it holds reach no recipe"*, e um cliente leu isso sobre 198
125
+ * declarações cujas 22 `@utility` estavam no sistema dele. A frase não mentia sobre receita:
126
+ * uma regra `::selection` não é receita de componente nenhum. Ela mentia por PROMETER O
127
+ * DESFECHO - e o desfecho acontece do outro lado, na camada global, depois do envio.
128
+ *
129
+ * O CLI não tem como saber: a classificação roda no servidor. Então ele relata o que mediu -
130
+ * nenhum leitor DESTA versão entendeu a forma - e deixa de afirmar onde aquilo foi parar. Quem
131
+ * sabe é quem escreve, e é de lá que sai a nota com o número.
132
+ */
133
+ "no reader in this version understands this shape - what happens to these depends on where they belong, and the system says so once it is built",
121
134
  "value-not-read": "the shape is read and this value is not - a utility or property outside the scales this project declares",
122
135
  computed: "the value is assembled at render time, so it is not in the source at any level and there is nothing to read",
123
136
  "component-not-admitted": "read, and it belongs to a component this scope does not admit into the system - the styles exist and no recipe claims them",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.299",
3
+ "version": "0.16.301",
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": {