synthesisui 0.16.210 → 0.16.211
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/sync.js +2 -0
- package/dist/last-sync.js +27 -0
- package/package.json +1 -1
package/dist/commands/sync.js
CHANGED
|
@@ -363,6 +363,8 @@ export async function remeasure(args) {
|
|
|
363
363
|
?.declarations ?? 0,
|
|
364
364
|
seen: sum(led?.counted),
|
|
365
365
|
interpreted: sum(led?.interpreted),
|
|
366
|
+
/** O que não foi lido, por MOTIVO - ver `unread` em `SyncMark`. */
|
|
367
|
+
unread: Object.fromEntries((led?.unread ?? []).map((g) => [g.reason ?? "unknown", g.uses ?? 0])),
|
|
366
368
|
/** O que cada componente LÊ - ver `readings` em `SyncMark`, e o defeito que ele conserta. */
|
|
367
369
|
...(args.cli ? { cli: args.cli } : {}),
|
|
368
370
|
readings: fingerprintReadings(census.components),
|
package/dist/last-sync.js
CHANGED
|
@@ -66,6 +66,29 @@ export async function writeSyncMark(root, mark) {
|
|
|
66
66
|
* parecer um salto enorme. E quando nada mudou ela DIZ que nada mudou: é a resposta mais útil que uma
|
|
67
67
|
* re-medição pode dar, e é a que o relatório longo nunca conseguiu dar em seis execuções.
|
|
68
68
|
*/
|
|
69
|
+
/**
|
|
70
|
+
* OS MOTIVOS QUE MUDARAM DE TAMANHO, nomeados - ver `unread` em `SyncMark`.
|
|
71
|
+
*
|
|
72
|
+
* `undefined` de um lado é marca anterior a este campo, e ali silêncio é a resposta: comparar contra
|
|
73
|
+
* ausência produziria "tudo é novo" na primeira vez, para todo mundo.
|
|
74
|
+
*/
|
|
75
|
+
function unreadDelta(now, before) {
|
|
76
|
+
if (!now.unread || !before.unread)
|
|
77
|
+
return null;
|
|
78
|
+
const keys = [
|
|
79
|
+
...new Set([...Object.keys(before.unread), ...Object.keys(now.unread)]),
|
|
80
|
+
].sort();
|
|
81
|
+
const moved = keys
|
|
82
|
+
.map((k) => ({
|
|
83
|
+
k,
|
|
84
|
+
from: before.unread?.[k] ?? 0,
|
|
85
|
+
to: now.unread?.[k] ?? 0,
|
|
86
|
+
}))
|
|
87
|
+
.filter((m) => m.from !== m.to);
|
|
88
|
+
if (moved.length === 0)
|
|
89
|
+
return null;
|
|
90
|
+
return moved.map((m) => `${m.k} ${m.from} → ${m.to}`).join(", ");
|
|
91
|
+
}
|
|
69
92
|
export function describeDelta(now, before) {
|
|
70
93
|
if (!before)
|
|
71
94
|
return "first measurement recorded here - the next one compares against it";
|
|
@@ -89,6 +112,10 @@ export function describeDelta(now, before) {
|
|
|
89
112
|
const read = readingDelta(now, before);
|
|
90
113
|
if (read)
|
|
91
114
|
parts.push(read);
|
|
115
|
+
/** E o que não foi lido, por motivo - ver `unread` em `SyncMark`. */
|
|
116
|
+
const reasons = unreadDelta(now, before);
|
|
117
|
+
if (reasons)
|
|
118
|
+
parts.push(reasons);
|
|
92
119
|
const when = ago(before.at);
|
|
93
120
|
/**
|
|
94
121
|
* O INSTRUMENTO ANDOU, e isso vem junto do número em vez de depois dele. Ver `cli`.
|
package/package.json
CHANGED