synthesisui 0.16.427 → 0.16.428

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.
@@ -51,7 +51,7 @@ import { claimName } from "../name-claim.js";
51
51
  import { mergeNamespacePairs } from "../namespace-pairs.js";
52
52
  import { namingQueue } from "../naming-queue.js";
53
53
  import { notExpressed } from "../not-expressed.js";
54
- import { body, paint, section } from "../output.js";
54
+ import { body, bodyWrapped, paint, section } from "../output.js";
55
55
  import { consumersOf, outsideScope, } from "../outside-scope.js";
56
56
  import { phase, startProgress } from "../progress.js";
57
57
  import { repoStateOf } from "../repo-state.js";
@@ -4591,12 +4591,13 @@ export async function runImport(opts) {
4591
4591
  }),
4592
4592
  }).catch(() => null);
4593
4593
  if (!res || !res.ok) {
4594
- const detail = res
4594
+ const refusal = res
4595
4595
  ? await res
4596
4596
  .json()
4597
- .then((b) => b?.message ?? null)
4597
+ .then((b) => b)
4598
4598
  .catch(() => null)
4599
4599
  : null;
4600
+ const detail = refusal?.message ?? null;
4600
4601
  console.log("");
4601
4602
  // A 401 is not a refusal of the census, it is an expired session - and
4602
4603
  // saying "HTTP 401" at the end of a long read leaves the person guessing at
@@ -4610,6 +4611,33 @@ export async function runImport(opts) {
4610
4611
  console.log("");
4611
4612
  return;
4612
4613
  }
4614
+ /**
4615
+ * 402 NÃO É UMA RECUSA DO CENSO - é o plano dele que não cabe mais um projeto.
4616
+ *
4617
+ * Dizer "the registry refused it (HTTP 402)" no fim de uma leitura longa faz uma resposta
4618
+ * perfeitamente normal parecer uma falha da medição dele. A leitura está salva, e o que falta
4619
+ * não é tentar de novo: é escolher um plano. O texto vem pronto do servidor, no mesmo idioma
4620
+ * que a tela usa.
4621
+ */
4622
+ if (res?.status === 402) {
4623
+ /**
4624
+ * `bodyWrapped` e não `body`: esta frase vem do servidor e tem o tamanho que tiver. Foi
4625
+ * exatamente por prosa vinda de dado que a quebra em 66 colunas passou a existir, em 03/09.
4626
+ */
4627
+ for (const line of bodyWrapped(detail ?? "Your plan does not cover another project."))
4628
+ console.log(line);
4629
+ if (refusal?.upgradeUrl) {
4630
+ console.log("");
4631
+ console.log(body(` ${paint.strong(refusal.upgradeUrl)}`));
4632
+ }
4633
+ console.log("");
4634
+ /** O caminho do censo também é dado, e também estoura a largura sozinho. */
4635
+ for (const line of bodyWrapped(`Your measurement is saved at ${out} - when the plan covers it, this brings it in without measuring again:`))
4636
+ console.log(line);
4637
+ console.log(body(` synthesisui import --census ${out}${chosen ? ` --name "${chosen}"` : ""}`));
4638
+ console.log("");
4639
+ return;
4640
+ }
4613
4641
  console.log(body(res
4614
4642
  ? `The registry refused it (HTTP ${res.status})${detail ? `: ${detail}` : "."}`
4615
4643
  : `Could not reach the registry. Your measurement is saved at ${out} - try again later.`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.427",
3
+ "version": "0.16.428",
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": {