Conversation
将 examples/config_helper(可视化配置生成器)从纯 HTML 迁移为 React 18 + TypeScript + Vite(vite-plus)工程, 并接入 GitHub Pages 与 PR playground 的构建 / 产物复制流程,线上访问地址保持不变。 工程化 - 新增 @cherry-markdown/config_helper workspace,对齐 examples/react_demo 的脚手架约定 - 根 package.json:注册 workspace,build 链纳入 config_helper,新增 build:configHelper / example:configHelper - Tailwind v4(@tailwindcss/postcss)与 FontAwesome 改为 npm 依赖,替代 CDN - vite base 设为 './',产物使用相对路径,可部署到任意子目录 - config-data.js / style.css / logo 通过 git mv 迁移并补充类型标注 CI - deploy-pages.yml:复制 examples/config_helper/dist 到 gh-pages-out/examples/config_helper,产物缺失时直接失败 - reusable-playground-build.yml:复制 dist 到 playground/config_helper,sed 仅处理顶层 HTML 功能 / 修复 - 语法类对象配置(engine.syntax.*)关闭时正确输出 false 并禁用对应语法(原逻辑被直接跳过) - 布尔类配置开关以实际 value 为准(原数据中 enabled 与 value 不一致) - 左侧分类改为手风琴互斥展开,默认全部收起;搜索时仅显示命中分类并展示命中数 - 快捷预设移至搜索框下方;右侧面板撑满剩余视口高度,三个标签页各自内部滚动 - 「源码参考」改名「配置参考」,面板内链接指向 Cherry.config.js;顶部新增项目 GitHub 链接 - 搜索框聚焦样式改为浅红边框 + 柔和光晕 验证 - yarn build:core && yarn build:configHelper(tsc -b + vp build) - yarn lint(vp check)0 错误;examples/config_helper 下 eslint . 0 问题 - 无头浏览器冒烟:渲染、预设、搜索、开关联动预览与代码、导出弹窗,控制台 0 错误
🦋 Changeset detectedLatest commit: 0540e7b The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
cherry-markdown
@cherry-markdown/miniprogram
commit: |
Collaborator
🌐 Playground 预览 |
Contributor
|
Size Change: 0 B Total Size: 6.9 MB ℹ️ View Unchanged
|
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.
背景
examples/config_helper(可视化配置生成器)原本是一个纯 HTML + 原生 JS 页面(Tailwind Play CDN、innerHTML拼接)。本 PR 将其迁移为 React 18 + TypeScript + Vite(vite-plus) 工程,并接入现有 CI 的构建 / 产物复制流程,使线上访问地址保持不变:https://tencent.github.io/cherry-markdown/examples/config_helper/(index.html可省略)https://preview-pr-<id>-cherry-markdown.surge.sh/config_helper/修改范围
工程化
@cherry-markdown/config_helper,脚手架完全对齐examples/react_demo(tsc -b && vp build、vite-plus的defineConfig、tsconfig.base.json继承)package.json:注册 workspace;build链加入vp run -F @cherry-markdown/config_helper build;新增build:configHelper/example:configHelper@tailwindcss/postcss)与 FontAwesome 改为 npm 依赖,替代 CDN;cherry-markdown: "*"直接引用 monorepo 核心包vite.config.ts设置base: './',产物全部使用相对路径,任意子目录部署均可用config-data.js/style.css/logo_icon.png通过git mv迁移保留历史,仅补充类型标注CI
deploy-pages.yml:复制examples/config_helper/dist/.到gh-pages-out/examples/config_helper/;产物缺失时直接失败(原逻辑为|| true静默)reusable-playground-build.yml:复制dist到playground/config_helper/;sed改为仅处理顶层 HTML(config_helper 产物自带 cherry-markdown,不受影响)pr-preview-deploy.yml评论中的config_helper/index.html链接无需改动功能 / 修复(迁移过程中发现的原有问题)
engine.syntax.*)关闭不生效:原generateConfig对关闭的对象类 toggle 直接return,后续else → false分支不可达,导致 key 被省略而非输出false。现在输出xxx: false,Cherry 的HookCenter据此禁用对应语法钩子enabled: true, value: false的项(isPreviewOnly、classicBr等),开关显示"开"但实际值为false。现在开关以value为准并在初始化时归一化Cherry.config.js;顶部新增项目 GitHub 链接ring-2 ring-red-400过于突兀)Changeset
本 PR 不涉及任何发布包代码,新增空 changeset
.changeset/react-config-helper.md以通过pr-changeset-check,不触发版本变更。验证
无头浏览器(Chromium)冒烟:
'underline'engine.syntax.codeBlock→ 代码出现codeBlock: false,预览代码块 2 → 0isPreviewOnly→ 代码出现isPreviewOnly: true,预览切换为纯预览模式已知限制
yarn build:core生成核心包dist与类型声明(与react_demo相同约束,已写入examples/config_helper/README.md)cherry-markdownESM 本身(约 5 MB,与原页面加载的 UMD 同量级),仅为提示