synthesisui 0.16.397 → 0.16.399

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.
@@ -585,6 +585,28 @@ export async function add(slug, opts) {
585
585
  const sheet = await globalSheetOf(projectRoot, `${appDir}/globals.css`);
586
586
  const importPrefix = prefixFrom(sheet);
587
587
  console.log(section("One-time setup (once per app)"));
588
+ /**
589
+ * QUANDO O SETUP É NECESSÁRIO, E QUANDO ELE É UMA ESCOLHA - a última porta onde a pergunta faltava.
590
+ *
591
+ * O `doctor` e o `component` passaram a perguntar antes de cobrar (ver `sheet-needed.ts`, 07/09,
592
+ * a partir da objeção do dono: *"esse import gera dependência ao design system, e a gente quer
593
+ * isolar os dois pontos - o nosso deve ser apenas uma REFERÊNCIA"*). Aqui a pergunta não tem como
594
+ * ser respondida da mesma forma: o sistema acabou de ser instalado e não há código gerado para
595
+ * medir.
596
+ *
597
+ * O QUE MUDA É A HONESTIDADE DO ENUNCIADO. "One-time setup" lido logo após a instalação soa como
598
+ * obrigação, e para metade dos casos ele não é: quem vai trazer componentes como CÓDIGO SEU não
599
+ * precisa de folha nenhuma - o `component` traduz para o vocabulário do próprio repositório e diz,
600
+ * arquivo a arquivo, se sobrou algo. Quem vai ESCREVER as classes do sistema (`bg-brand`,
601
+ * `rounded-lg` no valor dele) precisa, porque só o `@theme` do adaptador as gera.
602
+ *
603
+ * Então a instrução continua inteira - suprimi-la entregaria um projeto sem as classes - e ganha a
604
+ * linha que diz QUAL dos dois casos exige cada coisa. A escolha volta a ser dele, informada.
605
+ */
606
+ console.log(line("(needed if you will WRITE this system's utility classes - only its @theme generates them."));
607
+ console.log(line(" Bringing components in as YOUR code needs none of it: `component` translates them into"));
608
+ console.log(line(" your own vocabulary and tells you, per file, if anything is left.)"));
609
+ console.log("");
588
610
  /**
589
611
  * "ONCE PER APP" É LITERAL NUM MONOREPO, e calar os outros apps entrega metade da fiação. Os
590
612
  * caminhos abaixo são de um só; sem esta linha o cliente conclui que o repositório inteiro está
@@ -24,6 +24,7 @@ import { body, paint, section, snippet } from "../output.js";
24
24
  import { setupPrompt } from "../setup-prompt.js";
25
25
  import { installedThemeCss, whatOnlyTheSheetResolves, } from "../sheet-needed.js";
26
26
  import { resolveDeps } from "../stack.js";
27
+ import { projectTongue } from "../their-tongue.js";
27
28
  import { danglingTheirVars } from "../their-vars.js";
28
29
  /**
29
30
  * `synthesisui doctor` - the check nobody else ships.
@@ -1054,8 +1055,24 @@ export async function doctor(opts) {
1054
1055
  * Sem esta linha, quem lê não tem como saber que a dependência é REMOVÍVEL, e a única saída
1055
1056
  * visível é aceitar o import.
1056
1057
  */
1058
+ /**
1059
+ * E A SAÍDA SÓ É OFERECIDA QUANDO ELA EXISTE - senão o comando manda consertar o que não conserta.
1060
+ *
1061
+ * "re-run `component` and it speaks your own names instead" só é verdade onde há MAPA: onde algum
1062
+ * valor do sistema coincide com um nome que o repositório dele já declara. Sem mapa, a tradução
1063
+ * roda e não tem o que traduzir, regerar devolve o mesmo arquivo, e a folha é o caminho legítimo.
1064
+ *
1065
+ * MEDIDO EM 07/09, validando o binário publicado num `create-next-app` que instalou o
1066
+ * `codelevel`: `.lock` sem `tokenMap`, o componente saiu com 14 linhas `--ds-*`, e esta frase
1067
+ * mandava regerar. No `codelevel-monorepo`, onde o `.lock` tem 33 pares, regerar É a saída - e o
1068
+ * mesmo texto servia os dois. É o defeito que o `CLAUDE.md` registra em primeira pessoa: afirmar
1069
+ * que um comando conserta o que ele não conserta.
1070
+ */
1071
+ const translatable = (await projectTongue(root, table.slug ?? "")) !== null;
1057
1072
  const asks = sheetNeed.variables.length > 0
1058
- ? `${sheetNeed.variables.slice(0, 3).join(", ")}${sheetNeed.variables.length > 3 ? `, +${sheetNeed.variables.length - 3} more` : ""} - re-run \`component\` on whatever writes ${sheetNeed.variables.length === 1 ? "it" : "them"} and it speaks your own names instead`
1073
+ ? `${sheetNeed.variables.slice(0, 3).join(", ")}${sheetNeed.variables.length > 3 ? `, +${sheetNeed.variables.length - 3} more` : ""}${translatable
1074
+ ? ` - re-run \`component\` on whatever writes ${sheetNeed.variables.length === 1 ? "it" : "them"} and it speaks your own names instead`
1075
+ : ` - your code names no value this system also holds, so there is nothing to translate ${sheetNeed.variables.length === 1 ? "it" : "them"} into, and the sheet is the way`}`
1059
1076
  : `the ${sheetNeed.classes.slice(0, 3).join(", ")}${sheetNeed.classes.length > 3 ? `, +${sheetNeed.classes.length - 3} more` : ""} ${sheetNeed.classes.length === 1 ? "utility" : "utilities"}, which only this system's @theme generates`;
1060
1077
  console.log(body(` what asks for it: ${asks}`));
1061
1078
  console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.397",
3
+ "version": "0.16.399",
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": {