Repository navigation
feat(ui-plugins): add Theme From Design (theme-from-design) - #241
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) theme-from-design-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) / 涉及的插件名称:
theme-from-design(UI Plugin, new)What / 改动内容
New community UI plugin Theme From Design / 设计稿转店铺主题: a store design → a Shopify Online Store 2.0 theme (Liquid sections + JSON templates), checked with Shopify's theme-check, previewed next to the design, and zipped for upload.
Defaults (stated in the READMEs):
Platform: Shopify OS 2.0 only.
Validation: built-in checks + Shopify theme-check (
@shopify/theme-check-node4.0.2, bundled, offline, recommended config).Preview: an approximation with liquidjs and fictional data.
Upload: none (the zip is uploaded by the merchant in Shopify admin).
Tools:
theme_new(name, design images, colours, Shopify font handles, radius, width),theme_write(files / delete inside the theme folders + built-in checks),theme_check(built-in + theme-check, file:line),theme_preview(template, locale → HTML + render errors),theme_package(zip; refuses on errors unless forced). App-only:theme_state,theme_file,theme_design,workspace_images.Skeleton:
content_for_header/content_for_layout, header/footer section groups, and 7 JSON templates.Built-in checks:
liquid/htmlsettings).section.settings.X/block.settings.Xreferences against the schema.order/block_order.theme-check bundling:
dist/dataanddist/configsviazcode.dirs, andWEBPACK_MODEis set only when running from the bundle.node-fetchis stubbed, so the online docs update fails fast and the bundled fallback data is used. No network access.mainFields: ["module","main"]avoids jsonc-parser's UMD entry.__dirname/__filenamefor the bundled CommonJS code.Preview:
t(locale + fallback), money*, asset_url + stylesheet_tag (CSS inlined), image_url / image_tag, placeholder_svg_tag, link_to, font helpers,form/paginate/style/section(s).rendered snippets.Panel: create from design images, design and preview side by side (desktop 1280 / mobile 390, sandboxed srcdoc iframe without scripts), template switcher, problems list with source badges (built-in / theme-check), file viewer, full check, package.
Network / API / side effects: none. No API keys and no Shopify login or upload. Writes
themes/<name>/,themes/<name>.zipand.theme-from-design/. theme-check's docs manager creates an empty cache folder in the user cache dir. No hooks.Third-party: liquidjs (MIT), @shopify/theme-check-node and dependencies (MIT, including theme docs data), fflate (MIT), MCP SDK / ext-apps (MIT), zod (MIT).
Tests:
validate.py,build_dist.py,git diff --checkandtscpass. Shopify's theme-check is bundled, so no Ruby gem or CLI install is needed.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