Skip to content

feat(design): integrate Figma Code Connect and stub generation tooling#1472

Open
zhichenghouse wants to merge 13 commits into
oceanbase:masterfrom
zhichenghouse:feature/add-figma-code-connect
Open

feat(design): integrate Figma Code Connect and stub generation tooling#1472
zhichenghouse wants to merge 13 commits into
oceanbase:masterfrom
zhichenghouse:feature/add-figma-code-connect

Conversation

@zhichenghouse
Copy link
Copy Markdown

fix(https://github.com/oceanbase/oceanbase-design/issues/1471)

📦 Modified package

  • @oceanbase/design
  • @oceanbase/ui
  • @oceanbase/icons
  • @oceanbase/charts
  • @oceanbase/util
  • @oceanbase/codemod
  • Other (about what?)
    • Root package.json, ESLint, tsconfig.eslint.json
    • figma/ (figma.config.json, .env.example, Code Connect CLI bundle)
    • scripts/figma/ (stub generation, icon sync, batch helpers)
    • skills/figma-code-connect/

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

  1. Problem: We need Figma Code Connect mappings between design and code, plus a repeatable workflow to generate and maintain them (component *.figma.tsx files, icons, and scripts).
  2. Approach:
    • Add Code Connect mapping files under packages/design/src/figma/ for design system components.
    • Add/update figma/ configuration and local Code Connect CLI integration so mappings can be validated and published from the repo.
    • Use scripts/figma/code-connect/gen-figma-stubs.ts and related scripts/figma/icons tooling (with icons.json) to keep stubs and icon metadata in sync; add skills/figma-code-connect/ for batch workflows.
  3. How to use: Configure figma/.env from .env.example, then run the Code Connect / generation scripts defined in root package.json (adjust if your docs differ).
    | Before | After |
    | :--- | :--- |
    | No unified Figma Code Connect mappings or generation pipeline | Config, *.figma.tsx mappings, icon updates, and scripts for design–code alignment |

📝 Changelog

Language Changelog
🇺🇸 English Add Figma Code Connect mappings for @oceanbase/design (packages/design/src/figma). Add figma workspace config, codegen and icon sync scripts, and updated icon assets/metadata to support design–code alignment.

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Tests is updated/provided or not needed
  • Changelog is provided or not needed

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 13, 2026

@qing-zhen is attempting to deploy a commit to the dengfuping's projects Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 13, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ zhichenghouse
❌ qing-zhen
You have signed the CLA already but the status is still pending? Let us recheck it.

@dengfuping
Copy link
Copy Markdown
Collaborator

不能提交 figma/figma-code-connect-cli.tgz 压缩包,可以将其发布为 npm 包,然后引入到项目里

* from packages/design/src/figma/<Name>/index.figma.tsx — one user story per stub file (Code Connect only), plus US-001 for stub generation.
*
* Also: US-002+ acceptance criteria include skills/figma-code-connect/gen-playground.md (Figma Playground demos).
* Playground 交付物须包含本页 figma 目录下的 demo/ 与 index.md(例:packages/design/src/figma/Alert/demo、packages/design/src/figma/Alert/index.md)。
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ralph 和 skills 放一起

@@ -0,0 +1,7 @@
// This icon file is generated automatically.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

设计侧有这么多图标吗,看了下有几百个

* 根据 embed 定位 figma 目录下全部 *.figma.tsx,提取每条 figma.connect 的第二个参数(Code Connect 链接键),
* 映射到文档站「组件映射」Tab:{origin}/components/{slug}?tab=playground
*
* slug 取自 $tab-playground.md 所在目录名(与 gen-link.md 一致)。
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个脚本是一次性的吧,是否没有必要提交到仓库

* Fetches a Figma file, groups COMPONENT / COMPONENT_SET by page (CANVAS), and writes
* one `index.figma.tsx` per page folder with `figma.connect` blocks and props mapped from
* `componentPropertyDefinitions`, merged with COMPONENT_SET variant axes inferred from
* child components (`variantProperties`).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个脚本是一次性的吧,是否没有必要提交到仓库

* @param {Record<string, { localName: string, urlId: string, codeConnectVariant?: Record<string, string>, categoryKebab: string, svgFileBase: string, themeKebab: string | null }>} idsMap
* @returns {Map<string, string>}
*/
function buildOceanbaseLocalNameByExportId(idsMap) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个脚本是一次性的吧,是否没有必要提交到仓库

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oceanbase-design Error Error Apr 17, 2026 1:13am

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants