bridge icon indicating copy to clipboard operation
bridge copied to clipboard

Cron REST extractor hardcodes placeholder font data in text-styles.json

Open mattwinick-805 opened this issue 5 months ago • 0 comments

`extractTextStylesFromFigma` (`lib/extractors/figma-rest.ts`) writes hardcoded constants for every text style instead of real font data:

```js const textStyles = textStylesOnly.map((s) => ({ key: s.key, name: s.name, fontFamily: "Inter", fontStyle: "Regular", fontSize: 14, lineHeight: 20, })); ```

Only `key`/`name` come from the real Figma response. The other four fields are literal constants, identical across every style regardless of the file's actual content.

Root cause: `GET /v1/files/:key/styles` only returns metadata (key, name, description) — not resolved font properties. Getting real values needs a follow-up `/nodes` fetch (as done in `extractComponentsFromFigma`), which was never implemented here.

Impact: every `bridge-ds cron` run silently overwrites `text-styles.json` with fake data, discarding accurate values from the MCP/Desktop Bridge path. Easy to miss in review since the placeholders (Inter/Regular/14/20) look like plausible real values.

Suggested fix: implement the `/nodes` resolution step, or at least stop writing plausible-looking fake values — omit the fields instead.

Env: `@noemuch/[email protected]`

mattwinick-805 avatar Jul 01 '26 03:07 mattwinick-805