Skip to content

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

Open

Description

@mattwinick-805

`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/bridge-ds@7.1.3`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions