synthesisui 0.16.247 → 0.16.249

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.
@@ -1586,7 +1586,7 @@ export async function takeCensus(root, opts) {
1586
1586
  islandRead: islandClassesRead,
1587
1587
  refused: new Set(skips.map((s) => s.file)),
1588
1588
  }));
1589
- const coverageLines = describeCoverage(coverage, composition);
1589
+ const coverageLines = describeCoverage(coverage, composition, skips.length);
1590
1590
  if (coverageLines.length > 0) {
1591
1591
  say("");
1592
1592
  say(section("What this version reads, on your files"));
@@ -1,8 +1,40 @@
1
1
  import { resolveRegistry } from "../config.js";
2
- import { fetchList } from "../registry.js";
3
- /** Lists the published design systems available in the registry. */
2
+ import { fetchList, fetchMine } from "../registry.js";
3
+ /**
4
+ * O CATÁLOGO, E OS SISTEMAS DELA - duas perguntas diferentes, um comando.
5
+ *
6
+ * Sem `--mine` este comando sempre respondeu "o que existe para instalar": a
7
+ * galeria pública, sem dono. Ele nunca mostrou os sistemas de quem o roda, ao
8
+ * contrário do que o levantamento dizia - e essa era a lacuna real.
9
+ *
10
+ * NO TERMINAL NÃO HAVIA COMO SABER DE QUE GRUPO É CADA SISTEMA, e isso passou a
11
+ * ter consequência: o `sync` escreve direto no rascunho e o Autopilot publica
12
+ * sozinho quando ligado. Até aqui, o único freio contra mexer no sistema errado
13
+ * era a pessoa lembrar de cabeça.
14
+ */
4
15
  export async function list(opts) {
5
16
  const base = resolveRegistry(opts.registry);
17
+ if (opts.mine) {
18
+ const mine = await fetchMine(base);
19
+ if (mine.length === 0) {
20
+ console.log("You have no design systems yet. `synthesisui init` starts one from this repo.");
21
+ return;
22
+ }
23
+ console.log("Your design systems:\n");
24
+ const width = Math.max(...mine.map((s) => s.slug.length));
25
+ for (const s of mine) {
26
+ /**
27
+ * O GRUPO ENTRE PARÊNTESES, e "invited" quando ele não é dela - as duas
28
+ * informações que decidem se aquele é o sistema em que ela quer escrever.
29
+ */
30
+ const group = s.group
31
+ ? `${s.group}${s.mine ? "" : ", invited"}`
32
+ : "no group";
33
+ console.log(` ${s.slug.padEnd(width)} ${s.name} (v${s.version}) · ${group}`);
34
+ }
35
+ console.log('\nWork in one with: synthesisui use <slug> "<what you are building>"');
36
+ return;
37
+ }
6
38
  const systems = await fetchList(base);
7
39
  if (systems.length === 0) {
8
40
  console.log(`No design systems published at ${base}.`);
@@ -14,4 +46,10 @@ export async function list(opts) {
14
46
  console.log(` ${s.slug.padEnd(width)} ${s.name} (v${s.version})`);
15
47
  }
16
48
  console.log(`\nBring one in with: synthesisui add <slug>`);
49
+ /**
50
+ * E A OUTRA PERGUNTA FICA DITA. Quem roda `list` procurando os PRÓPRIOS
51
+ * sistemas recebia a galeria e nenhuma pista de que existe outra lista - a
52
+ * lacuna calada mais barata de fechar que existe.
53
+ */
54
+ console.log(`Your own systems: synthesisui list --mine`);
17
55
  }
@@ -304,6 +304,13 @@ export function groupSkips(skips) {
304
304
  *
305
305
  * The sentence a person needs in order to trust a number that just dropped by an
306
306
  * order of magnitude - and to notice if it dropped too far.
307
+ *
308
+ * ─────────────────────────────────────────────────────────────────────────
309
+ * E ELA VIAJA COLADA À MANCHETE (dono, 18/08).
310
+ *
311
+ * "340 de 340 com blueprint - 100%" sozinho é autoelogio: um portão que admite
312
+ * pouco fecha 100% fácil. As duas linhas juntas são uma promessa que se pode
313
+ * conferir - o que entrou, e o que ficou de fora com o motivo de cada um.
307
314
  */
308
315
  export function describeGate(kept, skipped) {
309
316
  if (skipped === 0) {
@@ -110,7 +110,7 @@ export function summarizeCoverage(counts, components, read, declarations) {
110
110
  /**
111
111
  * The report, in the words a person needs before they decide whether to import.
112
112
  *
113
- * Leads with the number that matters - how many components came out with a look - and
113
+ * Leads with the number that matters - how many components came out with a blueprint - and
114
114
  * then names every shape that is not fully read, with the reason. No percentages without
115
115
  * the count behind them: "75%" of an unknown total is a marketing number.
116
116
  */
@@ -123,12 +123,41 @@ export function describeCoverage(c,
123
123
  * arranjo e fluxo, e é isso que a receita deles carrega. Medido no dashboard dele: 235 de
124
124
  * 271 (04/08).
125
125
  */
126
- composition) {
126
+ composition,
127
+ /**
128
+ * O QUE O PORTÃO DEIXOU DE FORA - e ele viaja COLADO à manchete (dono, 18/08).
129
+ *
130
+ * A explicação longa e a lista nominal continuam onde sempre estiveram, 79
131
+ * linhas abaixo. O que sobe para cá é só o número, porque é ele que impede a
132
+ * manchete de ser autoelogio: um portão que admite pouco fecha 100% fácil, e
133
+ * as duas contas juntas são uma promessa que se pode conferir.
134
+ */
135
+ leftOut) {
127
136
  if (c.components === 0)
128
137
  return [];
129
138
  const lines = [];
130
139
  const pct = Math.round((c.read / c.components) * 100);
131
- lines.push(`${c.read} of ${c.components} components came out with a look - ${pct}%, ${c.declarations} declarations in total. This is measured on your files, not an estimate.`);
140
+ /**
141
+ * A MANCHETE É BLUEPRINT POR COMPONENTE, e não fragmento de estilo (dono, 18/08).
142
+ *
143
+ * As duas contas existiam, e a que liderava era a errada. "62% dos fragmentos
144
+ * interpretados" mistura no mesmo denominador coisas que NÃO PODEM ser lidas
145
+ * por natureza - medido no repo real: 120 fragmentos são `computed`, o valor
146
+ * nasce no navegador e não está no código em nível nenhum; 4 são partials que
147
+ * o build dele nem compila. Perseguir 100% ali é perseguir um número que
148
+ * obriga a mentir.
149
+ *
150
+ * A conta que pode fechar em 100%, e que é o objetivo do recurso, é esta:
151
+ * dos componentes ADMITIDOS, quantos saíram com blueprint. Medido no
152
+ * `frontend-hub`: 340 de 340.
153
+ *
154
+ * `blueprint` é o nome público do que a plataforma produz; `recipe` continua
155
+ * sendo o nome interno, no documento e no código.
156
+ */
157
+ lines.push(`${c.read} of ${c.components} components came out with a blueprint - ${pct}%, ${c.declarations} declarations in total. This is measured on your files, not an estimate.`);
158
+ if (leftOut && leftOut > 0) {
159
+ lines.push(` and ${leftOut} export${leftOut === 1 ? "" : "s"} did not become one - each is named below with the reason, so a 100% here never means "we admitted little".`);
160
+ }
132
161
  if (composition && composition > 0) {
133
162
  lines.push(
134
163
  /**
package/dist/index.js CHANGED
@@ -39,6 +39,7 @@ Usage - deterministic, FREE:
39
39
  synthesisui login [options] connect the CLI to your account (device-flow; --force to switch accounts)
40
40
  synthesisui init [options] write _synthesisui/config.json (target, dirs); --ds to bring one in
41
41
  synthesisui list [options] list the published design systems
42
+ synthesisui list --mine your own systems, with their group
42
43
  synthesisui add <slug> [options] materialize a DS into _synthesisui/ds/<slug>/
43
44
  synthesisui component <slug> <name> bring one EXISTING component in as YOUR <Pascal>.tsx
44
45
  synthesisui template <slug> <name> materialize a whole page from a DS template
@@ -365,7 +366,17 @@ async function main() {
365
366
  });
366
367
  break;
367
368
  case "list":
368
- await list({ registry });
369
+ /**
370
+ * `--mine` responde a OUTRA pergunta: os sistemas desta pessoa, com o
371
+ * grupo de cada um. Sem a flag, o comando segue sendo o catálogo público
372
+ * que ele sempre foi.
373
+ */
374
+ /**
375
+ * `flags.mine`, e não `args`: o parser tira toda `--flag` dos
376
+ * posicionais, então procurá-la ali sempre responderia não - e o comando
377
+ * cairia calado no catálogo público, que é a lista errada.
378
+ */
379
+ await list({ registry, mine: flags.mine === true });
369
380
  break;
370
381
  case "add": {
371
382
  const slug = args[0];
package/dist/registry.js CHANGED
@@ -25,6 +25,24 @@ export async function fetchList(base) {
25
25
  const body = (await res.json());
26
26
  return body.designSystems ?? [];
27
27
  }
28
+ /**
29
+ * OS SISTEMAS DELA - e esta é a chamada que exige conta.
30
+ *
31
+ * `fetchList` traz a galeria pública e funciona deslogado. Esta responde sobre o
32
+ * que pertence a alguém, então um 401 aqui é uma resposta e não uma falha: quem
33
+ * chama transforma isso na frase que manda rodar `login`.
34
+ */
35
+ export async function fetchMine(base) {
36
+ const res = await request(`${base}/api/registry/mine`);
37
+ if (res.status === 401) {
38
+ throw new RegistryError("This lists your own systems, so it needs an account. Run `synthesisui login` and try again.");
39
+ }
40
+ if (!res.ok) {
41
+ throw new RegistryError(`Registry responded ${res.status} while listing.`);
42
+ }
43
+ const body = (await res.json());
44
+ return body.designSystems ?? [];
45
+ }
28
46
  /**
29
47
  * Fetches a published DS already compiled (document + artifacts). Without
30
48
  * `version` it returns the latest; with `version` it returns that one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.247",
3
+ "version": "0.16.249",
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": {