synthesisui 0.16.316 → 0.16.318

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.
@@ -581,7 +581,7 @@ export async function add(slug, opts) {
581
581
  const families = payload.document.foundations.typography.families;
582
582
  const fontsHref = googleFontsHref(families);
583
583
  const nextFonts = projectConfig.target === "next"
584
- ? nextFontSnippet(families, payload.slug, appDir)
584
+ ? nextFontSnippet(families, payload.slug, appDir, payload.fontSeam)
585
585
  : null;
586
586
  if (nextFonts) {
587
587
  /**
@@ -603,7 +603,7 @@ export async function add(slug, opts) {
603
603
  continue;
604
604
  if (!(await exists(join(projectRoot, ...dir.split("/")))))
605
605
  continue;
606
- const snippet = nextFontSnippet(families, payload.slug, dir);
606
+ const snippet = nextFontSnippet(families, payload.slug, dir, payload.fontSeam);
607
607
  if (!snippet)
608
608
  continue;
609
609
  const header = [
@@ -16,6 +16,7 @@ import { diagnose, nameToWrite, scanSource, siblingTokens, } from "../doctor/sca
16
16
  import { findSelfConflicts, forbiddenProps, isReset, propMatchesLabel, } from "../doctor/self-conflict.js";
17
17
  import { withTheirNames } from "../doctor/their-names.js";
18
18
  import { buildTable, EMPTY_TABLE, nearestToken, } from "../doctor/tokens.js";
19
+ import { FAMILY_SEAM_PREFIX } from "../fonts.js";
19
20
  import { groupRole } from "../group-role.js";
20
21
  import { actingSlug, describeScope, measuredScope, scopePaths, } from "../measured-scope.js";
21
22
  import { body, paint, section, snippet } from "../output.js";
@@ -554,7 +555,8 @@ async function readWiring(root, slug) {
554
555
  // default face (my-test2, 27/07). What the checker checks is what gets done.
555
556
  if (src.includes("--font-ds-") && /next\/font/.test(src))
556
557
  w.fontsWritten = true;
557
- if (/--ds-typography-families-\w+\s*:\s*var\(\s*--font-ds-/.test(src))
558
+ /** O prefixo vem da const única da costura - um literal aqui divergiria em silêncio (26/08). */
559
+ if (new RegExp(`${FAMILY_SEAM_PREFIX}\\w+\\s*:\\s*var\\(\\s*--font-ds-`).test(src))
558
560
  w.fontsMapped = true;
559
561
  // The bridge joins the early exit, otherwise the walk can stop before the
560
562
  // stylesheet that imports it and report a wired project as unbridged.
@@ -3,7 +3,7 @@ import { join } from "node:path";
3
3
  import { pinnedHookVersion, wireAgent } from "../agent-wiring.js";
4
4
  import { isOlderCli } from "../cli-version.js";
5
5
  import { generateComponentFiles } from "../component-codegen.js";
6
- import { readProjectConfig, resolveRegistry } from "../config.js";
6
+ import { readProjectConfig, readToken, resolveRegistry } from "../config.js";
7
7
  import { diffLocalDocuments, localChangelogMarkdown, } from "../document-diff.js";
8
8
  import { installedBehind, MATERIALISER_SINCE } from "../install-marks.js";
9
9
  import { body, section, snippet } from "../output.js";
@@ -107,7 +107,15 @@ async function staleInstall(root, slug, version, base, cli) {
107
107
  .catch(() => null);
108
108
  if (!lock)
109
109
  return null;
110
- const res = await fetch(`${base}/api/registry/ds/${slug}?version=${version}&meta=1`).catch(() => null);
110
+ /**
111
+ * A MESMA CREDENCIAL DO AVISO (T19, dono, 26/08). O rodapé do align pergunta o `?meta=1`
112
+ * AUTENTICADO; esta pergunta ia sem token - num sistema PRIVADO a rota devolve 404, a meta vem
113
+ * nula, e o upgrade dizia "already at the latest version" enquanto o aviso ao lado recomendava
114
+ * rodá-lo: um loop em que o comando recomendado não faz a coisa. Medido em produção no primeiro
115
+ * disparo real do gatilho do compilador (codelevel, lock=2 vs servidor=3).
116
+ */
117
+ const token = await readToken();
118
+ const res = await fetch(`${base}/api/registry/ds/${slug}?version=${version}&meta=1`, token ? { headers: { Authorization: `Bearer ${token}` } } : undefined).catch(() => null);
111
119
  const meta = res?.ok
112
120
  ? (await res.json().catch(() => null))
113
121
  : null;
package/dist/fonts.js CHANGED
@@ -81,7 +81,19 @@ export function googleFontsHref(families) {
81
81
  * `<link href="fonts.googleapis.com...">` stays as the framework-agnostic
82
82
  * fallback - it works everywhere but swaps visibly on cold loads.
83
83
  */
84
- export function nextFontSnippet(families, slug, appDir = "app") {
84
+ /**
85
+ * O PREFIXO DO FALLBACK, exportado para o twin: quando o payload não traz a costura (`fontSeam`),
86
+ * o bloco é composto com este prefixo - e o twin-drift assere que ele é o MESMO que a plataforma
87
+ * batiza em `fontSeamOf`. Payload novo dispensa a convenção: o dado vence.
88
+ */
89
+ export const FAMILY_SEAM_PREFIX = "--ds-typography-families-";
90
+ export function nextFontSnippet(families, slug, appDir = "app",
91
+ /**
92
+ * A COSTURA SERVIDA PELO PAYLOAD (papel → nome do token no tokens.css) - ver `fontSeam` em
93
+ * `types.ts`. Presente, o bloco de mapa fala os nomes que o ARTEFATO declara, por construção;
94
+ * ausente (payload antigo), a composição por convenção continua valendo.
95
+ */
96
+ seam) {
85
97
  /** Toda vaga que o documento tem, não só as nossas três - ver `customFontFamilies`. */
86
98
  const roles = familySlots(families).filter((role) => {
87
99
  const name = firstFamily(families[role] ?? "");
@@ -128,7 +140,7 @@ export function nextFontSnippet(families, slug, appDir = "app") {
128
140
  const css = [
129
141
  `/* ${appDir}/globals.css - AFTER the tokens.css import */`,
130
142
  `[data-ds="${slug}"] {`,
131
- ...roles.map((role) => ` --ds-typography-families-${role}: var(${roleVar(role)});`),
143
+ ...roles.map((role) => ` ${seam?.[role] ?? `${FAMILY_SEAM_PREFIX}${role}`}: var(${roleVar(role)});`),
132
144
  `}`,
133
145
  ];
134
146
  return { fontsFile, layout, css };
package/dist/guide.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * famílias que o código dele declara, as três deixaram de carregar a fonte ao mesmo tempo. Este
7
7
  * arquivo já importava `nextFontSnippet` do mesmo módulo; a cópia não tinha razão de existir.
8
8
  */
9
- import { customFontFamilies, familySlots, nextFontSnippet } from "./fonts.js";
9
+ import { customFontFamilies, FAMILY_SEAM_PREFIX, familySlots, nextFontSnippet, } from "./fonts.js";
10
10
  import { animationShorthand, classifyKeyframe, describeKeyframe, isFullRotation, } from "./motion.js";
11
11
  const kebab = (v) => v.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
12
12
  /**
@@ -280,7 +280,8 @@ export function buildGuide(payload) {
280
280
  .map((n) => `family=${n.replace(/ /g, "+")}:wght@400;500;600;700`)
281
281
  .join("&")}&display=swap`
282
282
  : null;
283
- const nextFonts = nextFontSnippet(foundations.typography.families, slug);
283
+ /** A costura vem do payload quando o servidor a fala - o dado vence a convenção (T18-par). */
284
+ const nextFonts = nextFontSnippet(foundations.typography.families, slug, undefined, payload.fontSeam);
284
285
  const fontsSection = fontsHref
285
286
  ? `
286
287
  ## Fonts
@@ -696,7 +697,7 @@ ${hasTailwind
696
697
  - Radius → \`var(--ds-radius-<key>)\`: ${list(Object.keys(foundations.radius))}.
697
698
  - Shadow → \`var(--ds-shadow-<key>)\`: ${list(Object.keys(foundations.shadow))}.
698
699
  - Typography: families ${familySlots(foundations.typography.families)
699
- .map((slot) => `\`--ds-typography-families-${slot}\` (${foundations.typography.families[slot]})`)
700
+ .map((slot) => `\`${payload.fontSeam?.[slot] ?? `${FAMILY_SEAM_PREFIX}${slot}`}\` (${foundations.typography.families[slot]})`)
700
701
  .join(", ")};
701
702
  weights${hasTailwind ? " (utility: `font-<key>`)" : ""}: ${list(weights)};
702
703
  scale \`--ds-typography-scale-<key>-font-size\`${hasTailwind ? " (utility: `text-<key>`)" : ""}: ${list(Object.keys(foundations.typography.scale))}.
@@ -2,6 +2,7 @@ import { readdir, readFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { theirNames } from "./doctor/their-names.js";
4
4
  import { buildTable, normalizeValue, } from "./doctor/tokens.js";
5
+ import { FAMILY_SEAM_PREFIX } from "./fonts.js";
5
6
  /**
6
7
  * A FOLHA APONTA PARA O NOME QUE O CÓDIGO DELE JÁ DÁ AO VALOR.
7
8
  *
@@ -136,7 +137,8 @@ export function pointAtTheirNames(css, theirs, resolvable) {
136
137
  const FAMILY_KIND = {
137
138
  "--ds-color-": "color",
138
139
  "--ds-shadow-": "shadow",
139
- "--ds-typography-families-": "font",
140
+ /** A const única da costura - um literal aqui seria o stray que a varredura de 26/08 caçou. */
141
+ [FAMILY_SEAM_PREFIX]: "font",
140
142
  "--ds-motion-durations-": "motion",
141
143
  "--ds-motion-easings-": "motion",
142
144
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.316",
3
+ "version": "0.16.318",
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": {