synthesisui 0.16.187 → 0.16.188

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.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * QUEM ESTÁ ATRÁS DE QUEM, e só isso.
3
+ *
4
+ * O aviso "a newer reader is published" disparava por DIFERENÇA, nos dois sentidos. Em 08/08 o dono
5
+ * rodou `sync` com 0.16.187 recém-publicada, e a plataforma - que ainda não tinha feito deploy -
6
+ * respondia 0.16.186. A tela dele disse *"You are running 0.16.187 and 0.16.186 is published"* debaixo
7
+ * de um título que promete o contrário, e mandou rodar `connect` para "atualizar" para uma versão
8
+ * mais velha que a dele.
9
+ *
10
+ * Esse estado não é raro, é a regra: publicar no npm e fazer deploy da plataforma não são o mesmo
11
+ * instante, então entre um e outro quem instala do npm fica na frente. Um alarme que toca quando está
12
+ * tudo certo é um alarme que a pessoa aprende a ignorar - e é o mesmo alarme que precisa ser lido no
13
+ * dia em que ela estiver de verdade para trás.
14
+ *
15
+ * Espelha `isOlderCli` de `apps/web/src/lib/ds/reinterpret.ts`. Não é um gêmeo por spec como
16
+ * `frontier-kind.ts`: aqui não há contrato compartilhado, só a mesma aritmética de três números.
17
+ */
18
+ export function isOlderCli(mine, published) {
19
+ const parts = (v) => v.split(".").map((p) => Number.parseInt(p, 10));
20
+ const a = parts(mine);
21
+ const b = parts(published);
22
+ for (let i = 0; i < Math.max(a.length, b.length); i += 1) {
23
+ const left = a[i];
24
+ const right = b[i];
25
+ /** Versão que não é numérica não se compara - e acusar o que não se sabe ler é pior que calar. */
26
+ if (!Number.isFinite(left) || !Number.isFinite(right))
27
+ return false;
28
+ if (left !== right)
29
+ return left < right;
30
+ }
31
+ return false;
32
+ }
@@ -1,5 +1,6 @@
1
1
  import { readdir, readFile } from "node:fs/promises";
2
2
  import { join, resolve } from "node:path";
3
+ import { isOlderCli } from "../cli-version.js";
3
4
  import { readToken, resolveRegistry } from "../config.js";
4
5
  import { readEvents } from "../doctor/ledger.js";
5
6
  import { readRequests } from "../doctor/requests.js";
@@ -150,7 +151,7 @@ export async function status(opts) {
150
151
  * Não vira um item do `align`: o CLI subiu seis vezes num dia e nenhuma delas mudou um leitor, e a
151
152
  * verificação de abertura tem que ficar muda nesses casos. Aqui é diferente - a pessoa PERGUNTOU.
152
153
  */
153
- const behindCli = remote.publishedCli && opts.cli && remote.publishedCli !== opts.cli
154
+ const behindCli = remote.publishedCli && opts.cli && isOlderCli(opts.cli, remote.publishedCli)
154
155
  ? {
155
156
  says: `your CLI is ${opts.cli} and ${remote.publishedCli} is published - a newer reader sees styles this one cannot.`,
156
157
  run: "npx synthesisui@latest upgrade",
@@ -1,5 +1,6 @@
1
1
  import { readdir, readFile, writeFile } from "node:fs/promises";
2
2
  import { join, resolve } from "node:path";
3
+ import { isOlderCli } from "../cli-version.js";
3
4
  import { readToken, resolveRegistry } from "../config.js";
4
5
  import { markSent, readEvents } from "../doctor/ledger.js";
5
6
  import { checkableName, closeRequest, readRequests, verifyAndCloseRequests, } from "../doctor/requests.js";
@@ -201,7 +202,9 @@ export async function remeasure(args) {
201
202
  * pode movê-lo é quem roda o comando. Então o número é dito aqui, com o comando ao lado, em vez de
202
203
  * viver numa tela que alguém precisa lembrar de abrir.
203
204
  */
204
- if (stored.publishedCli && args.cli && stored.publishedCli !== args.cli) {
205
+ if (stored.publishedCli &&
206
+ args.cli &&
207
+ isOlderCli(args.cli, stored.publishedCli)) {
205
208
  console.log(section("A newer reader is published"));
206
209
  console.log(body(`You are running ${args.cli} and ${stored.publishedCli} is published. The measurement below uses ${args.cli}.`));
207
210
  console.log(paint.blue(snippet(["npx synthesisui@latest connect"])));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.187",
3
+ "version": "0.16.188",
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": {