Repository navigation
feat(ui-plugins): add Design To Components (design-to-components) - #245
Open
ppppp2005-p wants to merge 10 commits into
Open
ppppp2005-p wants to merge 10 commits into
ppppp2005-p wants to merge 10 commits into
Conversation
Author
|
ZCode desktop demo (ZCode 4.0.0, macOS arm64) design-to-components-demo.mp4Flow shown:
演示流程:本地 marketplace 安装 → |
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin type (required) / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
design-to-components(UI Plugin, new)What / 改动内容
New community UI plugin Design To Components / 设计稿转组件库: design → design tokens + a component checklist → React TSX components written by the agent → type-checked, rendered per state next to the design, and bundled into an interactive catalog.
Tools:
dc_new,dc_tokens,dc_plan,dc_write,dc_build.dc_state,dc_file,dc_design,workspace_images.Pipeline (run on every write):
typescript6, bundled): runs in memory with strict mode,react-jsxand bundler resolution. React 19 types (@types/react+ csstype) and TS lib.d.tsfiles are shipped indist/types.*.cssimports are declared.dist/node_modules, marked external) does two bundles from a virtual file system:vendor/react.js(production) viaglobalThis.__dc, and CSS imports are bundled.node:vmwith timeouts, and everyexamples[i].render()goes throughrenderToStaticMarkup. Render errors are reported per example.src/<Name>.tsxmust export<Name>, andexamplesshould exist.var()is ignored).tokens.css/tokens.ts(fromtokens.json, validated: names, colours, lengths),index.tsbarrel, and a self-containedcatalog/index.htmlthat works fromfile://, with a dark-background toggle.Panel:
Size: the server bundle is ~12.6 MB (TypeScript), plus esbuild-wasm (~14 MB, mostly the wasm), React types / TS libs (~4 MB) and the React vendor bundle (220 KB).
Network / API / side effects: none. No API keys. Writes
ui-kit/<name>/and.design-to-components/project.json. No hooks.Third-party: react, react-dom, @types/react, csstype, typescript (Apache-2.0), esbuild-wasm, MCP SDK / ext-apps, zod (all MIT unless noted).
Tests: the sample is a fictional "Fieldnote UI" design (HTML mock → PNG) with agent files for tokens, Button / TextField / Badge / Card, and a first-draft Button with planted errors.
onClikand the wrong prop type with line numbers.file://is interactive (typing, dark toggle) with no errors.validate.py,build_dist.py,git diff --checkandtscpass.A ZCode Desktop demo recording is attached in the comments. / ZCode 桌面版演示录屏见评论。
Self-check / 自查清单
external_plugins/<name>/categoryis set (productivity)version0.1.0 in bothplugin.jsonandmarketplace.jsonREADME.md(EN) andREADME_CN.md(中文) both provided and equivalentdescription_i18nhas bothenandzh-CNpython3 scripts/validate.pyandpython3 scripts/build_dist.pypass locally