synthesisui 0.16.129 → 0.16.130
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.
- package/dist/commands/import.js +50 -12
- package/package.json +1 -1
package/dist/commands/import.js
CHANGED
|
@@ -261,6 +261,8 @@ export async function takeCensus(root, opts) {
|
|
|
261
261
|
const tally = emptyTally();
|
|
262
262
|
const internal = await internalSpecifiers(root);
|
|
263
263
|
const defined = [];
|
|
264
|
+
/** Nome → arquivo e fonte, para toda leitura por componente - ver o preenchimento abaixo. */
|
|
265
|
+
const sourceOf = new Map();
|
|
264
266
|
/** What the gate turned away, with the reason. Never dropped in silence. */
|
|
265
267
|
const skips = [];
|
|
266
268
|
// Kept for the reference check below, which needs every file at once: a name
|
|
@@ -411,6 +413,21 @@ export async function takeCensus(root, opts) {
|
|
|
411
413
|
componentFiles += 1;
|
|
412
414
|
}
|
|
413
415
|
defined.push(...found);
|
|
416
|
+
/**
|
|
417
|
+
* O ARQUIVO E A FONTE DE CADA COMPONENTE QUE GANHA UM LOOK.
|
|
418
|
+
*
|
|
419
|
+
* O contrato de dados era estampado a partir de `defined`, a lista que o PORTÃO de
|
|
420
|
+
* componente aceita - 36 numa biblioteca e 29 num app de 690 arquivos. Então 242 receitas
|
|
421
|
+
* do dashboard dele e 19 do web-review chegavam sem `api` nenhum: sem props, sem
|
|
422
|
+
* derivação, sem tipo de eixo e sem o especificador de import, embora 41% e 61% dos
|
|
423
|
+
* arquivos declarem um `<Nome>Props` (04/08).
|
|
424
|
+
*
|
|
425
|
+
* É a mesma classe de defeito da elegibilidade, um nível ao lado: uma leitura pendurada
|
|
426
|
+
* numa lista feita para biblioteca. O look já nasce aqui, com o arquivo e a fonte na mão,
|
|
427
|
+
* e é aqui que a leitura tem que se pendurar.
|
|
428
|
+
*/
|
|
429
|
+
for (const d of found)
|
|
430
|
+
sourceOf.set(d.name, { file: rel, source: src });
|
|
414
431
|
// THE LOOK, from their own class names. One transcription per file, keyed
|
|
415
432
|
// by the component it defines - the root element's classes are the
|
|
416
433
|
// component's own look, and everything below it is a part this slice does
|
|
@@ -1239,12 +1256,23 @@ export async function takeCensus(root, opts) {
|
|
|
1239
1256
|
* as not exported. See `publicApi`.
|
|
1240
1257
|
*/
|
|
1241
1258
|
const api = await publicApi(root);
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1259
|
+
/**
|
|
1260
|
+
* TODO NOME QUE TEM LEITURA, e não só os que o inventário de USO lista.
|
|
1261
|
+
*
|
|
1262
|
+
* O laço iterava `components` - o inventário de uso - e pendurava o arquivo em `defined`. Duas
|
|
1263
|
+
* listas feitas para biblioteca, e num app nenhuma das duas alcança uma tela: 242 receitas do
|
|
1264
|
+
* dashboard dele ficaram sem `api` (04/08). Agora a leitura acompanha o LOOK, que é onde o
|
|
1265
|
+
* resto da leitura daquele componente já vive, e o inventário continua sendo inventário.
|
|
1266
|
+
*/
|
|
1267
|
+
const named = [
|
|
1268
|
+
...new Set([...components.map((c) => c.name), ...Object.keys(looks)]),
|
|
1269
|
+
];
|
|
1270
|
+
for (const name of named) {
|
|
1271
|
+
const c = components.find((x) => x.name === name);
|
|
1272
|
+
const at = sourceOf.get(name);
|
|
1273
|
+
const file = at?.file;
|
|
1274
|
+
const source = at?.source;
|
|
1275
|
+
const required = source ? requiredProps(source, name) : [];
|
|
1248
1276
|
/**
|
|
1249
1277
|
* THE COMPONENT'S DATA CONTRACT - its props, its derivations, the copy an option
|
|
1250
1278
|
* carries, and the type that names an axis's options.
|
|
@@ -1256,11 +1284,11 @@ export async function takeCensus(root, opts) {
|
|
|
1256
1284
|
* Stamped whether or not the folder is a package: a `src/components` with no
|
|
1257
1285
|
* manifest of its own has no specifier to offer and its components still have props.
|
|
1258
1286
|
*/
|
|
1259
|
-
const span = source ? definitionSpan(source,
|
|
1287
|
+
const span = source ? definitionSpan(source, name) : null;
|
|
1260
1288
|
const contract = source
|
|
1261
|
-
? dataContract(source, span ? source.slice(span.from, span.to) : source,
|
|
1289
|
+
? dataContract(source, span ? source.slice(span.from, span.to) : source, name, (c?.declaredAxes ?? looks[name]?.declaredAxes ?? {}))
|
|
1262
1290
|
: null;
|
|
1263
|
-
|
|
1291
|
+
const stamped = {
|
|
1264
1292
|
/**
|
|
1265
1293
|
* SILENCE WHEN THE ENTRY WAS NOT READ. An unreadable entry gives an empty export
|
|
1266
1294
|
* set, and calling that "internal" would have marked every component internal at
|
|
@@ -1268,7 +1296,7 @@ export async function takeCensus(root, opts) {
|
|
|
1268
1296
|
*/
|
|
1269
1297
|
...(!api?.read
|
|
1270
1298
|
? {}
|
|
1271
|
-
: api.exports.has(
|
|
1299
|
+
: api.exports.has(name)
|
|
1272
1300
|
? { from: api.from }
|
|
1273
1301
|
: { exported: false }),
|
|
1274
1302
|
/**
|
|
@@ -1294,8 +1322,18 @@ export async function takeCensus(root, opts) {
|
|
|
1294
1322
|
: {}),
|
|
1295
1323
|
};
|
|
1296
1324
|
// An api with nothing in it is not a fact - it is an empty object on 36 components.
|
|
1297
|
-
|
|
1298
|
-
|
|
1325
|
+
/**
|
|
1326
|
+
* ONDE ELE MORA: no LOOK, que é por componente, e também na entrada do inventário quando
|
|
1327
|
+
* existe uma. A entrada é o que a plataforma sempre leu; o look é o que alcança as 242 que
|
|
1328
|
+
* o inventário não tem. Uma leitura, dois endereços, e a plataforma prefere o look.
|
|
1329
|
+
*/
|
|
1330
|
+
if (Object.keys(stamped).length === 0)
|
|
1331
|
+
continue;
|
|
1332
|
+
if (c)
|
|
1333
|
+
c.api = stamped;
|
|
1334
|
+
const look = looks[name];
|
|
1335
|
+
if (look)
|
|
1336
|
+
look.api = stamped;
|
|
1299
1337
|
}
|
|
1300
1338
|
const brokenRefs = findBrokenRefs(sources, declaredNames);
|
|
1301
1339
|
const conventions = detectConventions(sources);
|
package/package.json
CHANGED