synthesisui 0.16.259 → 0.16.261
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.
|
@@ -180,6 +180,33 @@ function nameOfTag(tag) {
|
|
|
180
180
|
.replace(/[^a-z0-9]+/g, "-")
|
|
181
181
|
.replace(/^-|-$/g, "");
|
|
182
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* O NOME QUE ELE MESMO DEU AO ELEMENTO - a classe do CSS Module.
|
|
185
|
+
*
|
|
186
|
+
* `className={styles.senderConfigContent}` é o cliente nomeando aquele nó. Antes
|
|
187
|
+
* disto o nó virava `box`, que é o nosso nome para "caixa que carrega decisões e
|
|
188
|
+
* cujo papel não se lê da tag" - correto e mudo. Medido no monorepo do dono em
|
|
189
|
+
* 20/08: **1185 dos 5319 nós de sketch carregam `moduleClass`**, em 381 nomes
|
|
190
|
+
* distintos - `content`, `formControl`, `senderConfig`, `title`, `actions`, `list`.
|
|
191
|
+
* Todos eles chegavam como `box`.
|
|
192
|
+
*
|
|
193
|
+
* É a lei 12 no nível do nó: o que ele declarou vence o que a gente deduziria. E é
|
|
194
|
+
* a promessa de paridade SEMÂNTICA - devolver o componente com os nomes dele, não
|
|
195
|
+
* com os nossos.
|
|
196
|
+
*
|
|
197
|
+
* A PRIMEIRA palavra, e não a mais longa nem a mais rara: `styles.card styles.open`
|
|
198
|
+
* é o elemento (`card`) mais um estado (`open`), nessa ordem, porque é assim que
|
|
199
|
+
* uma pessoa escreve. Escolher outra seria adivinhar qual das duas é o papel.
|
|
200
|
+
*/
|
|
201
|
+
function nameOfModule(moduleClass) {
|
|
202
|
+
const first = String(moduleClass ?? "")
|
|
203
|
+
.trim()
|
|
204
|
+
.split(/\s+/)[0];
|
|
205
|
+
if (!first)
|
|
206
|
+
return undefined;
|
|
207
|
+
const name = nameOfTag(first);
|
|
208
|
+
return name || undefined;
|
|
209
|
+
}
|
|
183
210
|
/**
|
|
184
211
|
* A HEADLESS PRIMITIVE'S OWN MEMBER NAME, when it says what the thing is.
|
|
185
212
|
*
|
|
@@ -517,7 +544,12 @@ versionOf) {
|
|
|
517
544
|
* chegava com 2 das 35 (04/08).
|
|
518
545
|
*/
|
|
519
546
|
if (!name && (classes || node.moduleClass))
|
|
520
|
-
|
|
547
|
+
/**
|
|
548
|
+
* `box` VIROU A ÚLTIMA OPÇÃO, não a primeira - ver `nameOfModule`. Um nó com
|
|
549
|
+
* classe de module tem nome, e o nome é dele.
|
|
550
|
+
*/
|
|
551
|
+
name =
|
|
552
|
+
nameOfModule(node.moduleClass) ?? "box";
|
|
521
553
|
/**
|
|
522
554
|
* A NODE WHOSE CONTENT IS THE CALLER'S is a slot, and it keeps its own name
|
|
523
555
|
* and classes - the border and the hover on a `<tr>{children}</tr>` are real
|
package/dist/commands/import.js
CHANGED
|
@@ -13,7 +13,7 @@ import { isNearDuplicate, isNeutral, lightness, } from "../doctor/color-distance
|
|
|
13
13
|
import { describeGate, gateComponent, groupSkips, SCREENS_FOR_SYSTEM, } from "../doctor/component-gate.js";
|
|
14
14
|
import { emptyTally, internalSpecifiers, scanComponentsInto, tallyToInventory, } from "../doctor/components-scan.js";
|
|
15
15
|
import { countShape, describeCoverage, summarizeCoverage, } from "../doctor/coverage.js";
|
|
16
|
-
import { crosswalk, floorSize, isLibrary, observedRules, useLiveCatalogue, } from "../doctor/crosswalk.js";
|
|
16
|
+
import { classifyAside, crosswalk, floorSize, isLibrary, observedRules, useLiveCatalogue, } from "../doctor/crosswalk.js";
|
|
17
17
|
import { keyframeOffsets, moduleImports, partialCandidates, readGlobalClasses, readModuleCss, readModuleUsage, sheetImports, transcribeModule, } from "../doctor/css-modules.js";
|
|
18
18
|
import { dataContract } from "../doctor/data-contract.js";
|
|
19
19
|
import { reconcile, scanDefinitions, } from "../doctor/definitions-scan.js";
|
|
@@ -703,6 +703,10 @@ export async function takeCensus(root, opts) {
|
|
|
703
703
|
if (esize > 0 || etag || esketch.length > 0) {
|
|
704
704
|
looks[extra.name] = {
|
|
705
705
|
...(esketch.length > 0 ? { sketch: esketch } : {}),
|
|
706
|
+
/** Ver `CensusLook.aside` - o segundo componente do arquivo também. */
|
|
707
|
+
...(classifyAside(extra.name)
|
|
708
|
+
? { aside: classifyAside(extra.name) }
|
|
709
|
+
: {}),
|
|
706
710
|
...et,
|
|
707
711
|
...(etag ? { rootTag: etag } : {}),
|
|
708
712
|
...rootPackage(etag, esketch),
|
|
@@ -992,6 +996,10 @@ export async function takeCensus(root, opts) {
|
|
|
992
996
|
if (size > 0 || tag) {
|
|
993
997
|
looks[found[0].name] = {
|
|
994
998
|
...(sketch.length > 0 ? { sketch } : {}),
|
|
999
|
+
/** Ver `CensusLook.aside`: o fato viaja, a regra fica de um lado só. */
|
|
1000
|
+
...(classifyAside(found[0].name)
|
|
1001
|
+
? { aside: classifyAside(found[0].name) }
|
|
1002
|
+
: {}),
|
|
995
1003
|
...withoutDark,
|
|
996
1004
|
base,
|
|
997
1005
|
states,
|
|
@@ -115,6 +115,38 @@ export function architectureRule(a) {
|
|
|
115
115
|
evidence: `${a.evidence.join("/")} under ${a.root}, holding ${a.files} component file${a.files === 1 ? "" : "s"}`,
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* A ESTRUTURA, ESCRITA - as pastas que a forma tem, na ordem em que ela as usa.
|
|
120
|
+
*
|
|
121
|
+
* Uma opção que diz só o nome da forma e um número não é uma escolha de
|
|
122
|
+
* organização: "escada atômica, 6 arquivos" não diz a ninguém o que ele está
|
|
123
|
+
* escolhendo. O dono leu duas opções assim e a pergunta ficou ilegível (19/08).
|
|
124
|
+
* Então cada opção mostra a árvore, e ela é medida - `evidence` são os diretórios
|
|
125
|
+
* que fizeram a leitura.
|
|
126
|
+
*/
|
|
127
|
+
export function describeShape(a) {
|
|
128
|
+
return `${a.root}/${a.evidence.length > 0 ? `{${a.evidence.join(", ")}}` : ""}`;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* QUAIS FORMAS SÃO OPÇÃO, E QUAIS SÃO NOTA DE PÉ - decidido pela escala.
|
|
132
|
+
*
|
|
133
|
+
* Duas formas só são uma escolha quando as duas governam código de verdade. No
|
|
134
|
+
* monorepo do dono a segunda tinha 6 arquivos contra 780 da primeira - duas ordens
|
|
135
|
+
* de magnitude -, e oferecê-las lado a lado transformou um fato ("existe um canto
|
|
136
|
+
* organizado assim") numa pergunta que sugere que as duas disputam o repositório.
|
|
137
|
+
*
|
|
138
|
+
* O corte é um DÉCIMO da dominante: abaixo dele a forma continua verdadeira e é
|
|
139
|
+
* dita, mas não pede decisão. Um décimo e não um número redondo qualquer porque é
|
|
140
|
+
* a fronteira entre "convive" e "um canto".
|
|
141
|
+
*/
|
|
142
|
+
export const MINOR_SHARE = 0.1;
|
|
143
|
+
export function splitByWeight(found) {
|
|
144
|
+
if (found.length === 0)
|
|
145
|
+
return { options: [], notes: [] };
|
|
146
|
+
const top = found[0].files;
|
|
147
|
+
const options = found.filter((a) => a.files >= top * MINOR_SHARE);
|
|
148
|
+
return { options, notes: found.filter((a) => !options.includes(a)) };
|
|
149
|
+
}
|
|
118
150
|
/**
|
|
119
151
|
* One line naming what was found, and the choice it leaves open.
|
|
120
152
|
*
|
|
@@ -125,10 +157,17 @@ export function describeChoice(found) {
|
|
|
125
157
|
if (found.length === 0)
|
|
126
158
|
return null;
|
|
127
159
|
if (found.length === 1) {
|
|
128
|
-
return `One shape, read off your directories: ${found[0].kind}
|
|
160
|
+
return `One shape, read off your directories: ${found[0].kind} in \`${describeShape(found[0])}\`.`;
|
|
161
|
+
}
|
|
162
|
+
const { options, notes } = splitByWeight(found);
|
|
163
|
+
const say = (a) => `${a.kind} in \`${describeShape(a)}\` (${a.files} files)`;
|
|
164
|
+
/**
|
|
165
|
+
* Uma dominante e o resto em cantos: isto não é uma pergunta sobre o retrato, é
|
|
166
|
+
* uma pergunta sobre a REGRA daqui em diante - e a skill é quem a faz.
|
|
167
|
+
*/
|
|
168
|
+
if (options.length === 1) {
|
|
169
|
+
return `One shape governs this code: ${say(options[0])}. Also here, and staying true without deciding anything: ${notes.map(say).join(", ")}.`;
|
|
129
170
|
}
|
|
130
|
-
const list =
|
|
131
|
-
|
|
132
|
-
.join(", ");
|
|
133
|
-
return `${found.length} shapes, and none of them is a mistake: ${list}. A library organised atomically inside a monorepo whose apps are organised by feature is two true answers. Pick which one has PRIORITY - it becomes the rule every prompt reads, and the others stay true without deciding.`;
|
|
171
|
+
const list = options.map(say).join(", ");
|
|
172
|
+
return `${options.length} shapes govern real code, and none of them is a mistake: ${list}.${notes.length > 0 ? ` Smaller corners, reported and not asked about: ${notes.map(say).join(", ")}.` : ""} Pick which one has PRIORITY - it becomes the rule every prompt reads, and the others stay true without deciding.`;
|
|
134
173
|
}
|
package/dist/install-marks.js
CHANGED
|
@@ -202,7 +202,7 @@ export const CHECKER_SINCE = "0.16.250";
|
|
|
202
202
|
* (era 53% no melhor caminho; o derivado dava 38%). Um censo medido antes disto não
|
|
203
203
|
* tem versão nenhuma - e o mapa de blueprints por versão não tem o que consultar.
|
|
204
204
|
*/
|
|
205
|
-
export const READER_SINCE = "0.16.
|
|
205
|
+
export const READER_SINCE = "0.16.261";
|
|
206
206
|
/**
|
|
207
207
|
* O QUE ESTÁ INSTALADO AQUI FICOU PARA TRÁS - e as DUAS condições que fazem isso ser verdade.
|
|
208
208
|
*
|
package/package.json
CHANGED