synthesisui 0.16.256 → 0.16.257
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 +25 -0
- package/dist/merge-census.js +32 -0
- package/package.json +1 -1
package/dist/commands/import.js
CHANGED
|
@@ -2155,6 +2155,31 @@ function sayScopes(c) {
|
|
|
2155
2155
|
console.log("");
|
|
2156
2156
|
console.log(section("Two folders, one system"));
|
|
2157
2157
|
console.log(body(`Measured ${scopes.length} scopes and fused them: ${scopes.map((x, i) => (i === 0 ? paint.strong(x) : x)).join(" · ")}. The first one is the authority - it wins a tie, and nothing from the others is dropped without a line.`));
|
|
2158
|
+
/**
|
|
2159
|
+
* A CONVERGÊNCIA VEM ANTES DOS CONFLITOS, porque ela decide se a lista de
|
|
2160
|
+
* conflitos é o assunto.
|
|
2161
|
+
*
|
|
2162
|
+
* Com 60% compartilhado, três divergências são o trabalho. Com 0%, elas são um
|
|
2163
|
+
* detalhe de dois vocabulários que não se encontram - e a conversa que precisa
|
|
2164
|
+
* acontecer é outra: isto é um sistema ou são dois? Medido no monorepo do dono,
|
|
2165
|
+
* `packages/ui` e `apps/web-dashboard` dão exatamente 0%.
|
|
2166
|
+
*/
|
|
2167
|
+
const conv = c.scopeConvergence;
|
|
2168
|
+
if (conv) {
|
|
2169
|
+
console.log("");
|
|
2170
|
+
console.log(body(conv.shared === 0
|
|
2171
|
+
? `${paint.strong("These scopes share no token names at all")} - ${conv.union} names between them, and not one is declared in more than one. They are not drifting apart; they are different vocabularies.`
|
|
2172
|
+
: `${paint.strong(`${conv.percent}% convergence`)} - of the ${conv.union} names between them, ${conv.shared} ${conv.shared === 1 ? "is" : "are"} declared in more than one scope and ${conv.agree} of those already resolve to the same value.`));
|
|
2173
|
+
/**
|
|
2174
|
+
* E A PERGUNTA, dita em voz alta em vez de assumida.
|
|
2175
|
+
*
|
|
2176
|
+
* A fusão presume que os escopos são um sistema só. Abaixo de um terço de
|
|
2177
|
+
* convergência essa premissa deixa de se sustentar sozinha, e quem decide não
|
|
2178
|
+
* é a esteira - é quem conhece os dois produtos.
|
|
2179
|
+
*/
|
|
2180
|
+
if (conv.percent < 34)
|
|
2181
|
+
console.log(body(paint.faint("Worth answering before this becomes one system: are these two ONE vocabulary, or two that live in the same repo? Two is a legitimate answer - import each scope on its own, and name which of them is the reference on the group's screen.")));
|
|
2182
|
+
}
|
|
2158
2183
|
if (conflicts.length === 0)
|
|
2159
2184
|
return;
|
|
2160
2185
|
console.log("");
|
package/dist/merge-census.js
CHANGED
|
@@ -227,5 +227,37 @@ export function mergeCensus(list) {
|
|
|
227
227
|
out.collisions = collisions;
|
|
228
228
|
if (conflicts.length > 0)
|
|
229
229
|
out.scopeConflicts = conflicts;
|
|
230
|
+
/**
|
|
231
|
+
* A CONVERGÊNCIA ENTRE OS ESCOPOS, calculada aqui porque é aqui que os
|
|
232
|
+
* vocabulários separados ainda existem - depois da fusão eles são um só.
|
|
233
|
+
*
|
|
234
|
+
* `shared` conta os nomes que mais de um escopo declara; `agree` são os que
|
|
235
|
+
* resolvem igual. Zero compartilhado não é "quase lá": é a informação de que
|
|
236
|
+
* não há design em comum, e que fundir produziria a média de dois sistemas que
|
|
237
|
+
* não se parecem.
|
|
238
|
+
*/
|
|
239
|
+
{
|
|
240
|
+
const seen = new Map();
|
|
241
|
+
let shared = 0;
|
|
242
|
+
let agree = 0;
|
|
243
|
+
for (const c of list) {
|
|
244
|
+
for (const [name, value] of Object.entries(asRecord(c.declared))) {
|
|
245
|
+
const held = seen.get(name);
|
|
246
|
+
if (held === undefined) {
|
|
247
|
+
seen.set(name, value);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
shared += 1;
|
|
251
|
+
if (held === value)
|
|
252
|
+
agree += 1;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
out.scopeConvergence = {
|
|
256
|
+
shared,
|
|
257
|
+
agree,
|
|
258
|
+
union: seen.size,
|
|
259
|
+
percent: seen.size === 0 ? 0 : Math.round((agree / seen.size) * 100),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
230
262
|
return out;
|
|
231
263
|
}
|
package/package.json
CHANGED