ci: automate Figma Code Connect publish + validate - #794
Conversation
✅ Deploy Preview for pine-design-system ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Addressed the Bugbot finding in 17f071d: added |
|
Good catch — addressed in 1ca1f25. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1ca1f25. Configure here.
| # .figma.js templates (our parser is `html`) from 1.4.4 onward. Below that the | ||
| # flag is a no-op and an unparseable mapping is silently skipped — the exact | ||
| # green-but-stale failure this workflow guards against. | ||
| CODE_CONNECT_VERSION: '1.5.3' |
There was a problem hiding this comment.
Nonexistent CLI version pin
High Severity
CODE_CONNECT_VERSION is pinned to @figma/code-connect@1.5.3, but that release is not on npm — latest is 1.5.2. Both npx steps resolve that package, so validate and publish fail on every run instead of parsing or publishing mappings.
Reviewed by Cursor Bugbot for commit 1ca1f25. Configure here.
There was a problem hiding this comment.
False positive — 1.5.3 is live on npm. npm view @figma/code-connect@1.5.3 resolves (published 2026-08-12, tarball present) and dist-tags.latest → 1.5.3. The "latest is 1.5.2" appears to be a stale index; 1.5.2 shipped 2026-08-03, 1.5.3 nine days later. Keeping the pin at 1.5.3 (also comfortably ≥ the 1.4.4 required for --exit-on-unreadable-files to apply to .figma.ts).


Description
Adds
.github/workflows/code-connect.ymlto keep the Figma Code Connect mappings(
libs/figma/*.figma.ts) in sync with Figma automatically.Motivation / context: publishing was previously a manual, undocumented
local step —
@figma/code-connectisn't even a declared dependency, so DevMode was only ever as fresh as the last person who remembered to run
figma connect publishwith a personal token. This closes that drift.libs/figma/**orfigma.config.json→figma connect parse(local validation only; no token, fork-safe) so a broken mapping fails the PR
instead of silently shipping stale snippets.
main/ manual dispatch →figma connect publish, gated on theFIGMA_ACCESS_TOKENsecret with an explicit guard step that fails loudly ifit's missing.
Also reclassifies
pds-boxandpds-textinCODE_CONNECT_COVERAGE.md: theyare not Code-Connectable (Code Connect attaches to a component node, and in
the Pine Figma file text is text styles and layout is auto-layout +
variables — neither is a component). Their code relationship is carried by the
pine-figmaauthoring skill's style/variable→code map instead. This stops thembeing tracked as perpetual "todo" mappings.
New dependency / action required (admin): the
publishjob needs aFIGMA_ACCESS_TOKENrepo secret — a Figma personal access token with CodeConnect write scope. Until it's added,
publishfails with a clear error; theparsePR gate needs nothing. The CLI is pinned via npx (CODE_CONNECT_VERSION)rather than added to
package.json, matching how it's run today; promoting it toa pinned devDependency is a reasonable follow-up.
Fixes #(no issue)
Type of change
CODE_CONNECT_COVERAGE.mdupdatedHow Has This Been Tested?
js-yaml(parses; two jobs gate correctly ongithub.event_name).figma connect parseis a local no-network validation, so the PR gate is self-contained. Thepublishpath is exercised on merge tomainonce the secret exists.Test Configuration:
Checklist:
Note
Low Risk
CI and documentation only; publish depends on a repo secret and fails loudly if missing, with no application runtime impact.
Overview
Adds
.github/workflows/code-connect.ymlsolibs/figma/*.figma.tsmappings stay validated and published without manualfigma connect publishruns.PRs that touch
libs/figma/**,figma.config.json, or the workflow runfigma connect parsevia pinnednpx @figma/code-connect@1.5.3with--exit-on-unreadable-files— local, no Figma token, fork-safe. Push tomainand workflow_dispatch runpublish, gated on aFIGMA_ACCESS_TOKENguard step.CODE_CONNECT_COVERAGE.mddocuments this pipeline and movespds-box/pds-textout of the “not yet mapped” backlog into a primitives — not Code-Connectable section (no Figma component node; covered by thepine-figmastyle/variable map instead).Reviewed by Cursor Bugbot for commit 1ca1f25. Bugbot is set up for automated code reviews on this repo. Configure here.