-
Notifications
You must be signed in to change notification settings - Fork 14
Monorepo 改造与 CI/CD 改进 - 同步到上游仓库 #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
- completed monorepo install via pnpm recursive - unified node versions and build flow for ts-vue2 / legacy-yaml - temporarily skip 5 non-critical packages (cw_oa_sdk, cw_office_sdk, cw_swiper_library, popo_sdk, lcap_popo_location) - verified 67/72 packages build successfully - prepared for Turborepo integration
- completed monorepo install via pnpm recursive - unified node versions and build flow for ts-vue2 / legacy-yaml - temporarily skip 5 non-critical packages (cw_oa_sdk, cw_office_sdk, cw_swiper_library, popo_sdk, lcap_popo_location) - verified 67/72 packages build successfully - prepared for Turborepo integration
…dules and build artifacts
…ot detection and component scanning
…kages script for clarity
…ibrary and print_block_sdk to workspaces
…and change push branch to test-ci-branch
…norepo/turporepo-plan
…in and enable manual triggering
…nce batch processing, and synchronize AI documentation
…ut for full build option, and enhance batch processing with improved error handling
Monorepo/turporepo plan
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.
📋 变更概览
本 PR 将 fork 仓库中的 Monorepo 改造 和 CI/CD 改进 同步到上游仓库
vusion/cloud-ui-materials,主要包括:🏗️ Monorepo 架构改造
1. 目录结构重构
从扁平结构迁移到 workspaces 组织:
迁移详情:
packages/下的组件迁移到workspaces/legacy-yaml/packages/workspaces/ts-vue2/packages/(TypeScript 化)2. 引入 Turborepo
文件:
turbo.json(新增)功能: 统一构建管道,支持增量构建和并行执行
特性:
配置示例:
{ "pipeline": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] } } }3. 引入 pnpm Workspace
文件:
pnpm-workspace.yaml(新增)功能: 优化依赖管理,支持工作区依赖共享
配置:
优势:
4. 根目录 package.json 更新
主要变更:
packageManager: "[email protected]"postinstall钩子,自动安装所有工作区依赖新增脚本:
{ "build": "turbo run build --parallel", "postinstall": "node scripts/mono/install-all-workspaces.mjs", "install:workspaces": "node scripts/mono/install-all-workspaces.mjs --verbose" }🎯 CI/CD 改进内容
1. 新增 PR 描述自动生成工作流
文件:
.github/workflows/pr-description.yml(新增)功能: 在 PR 创建或更新时自动生成详细的 PR 描述
特性:
2. 增强发布工作流
文件:
.github/workflows/release.yml主要改进:
3. 重构 Scripts 目录结构
新增目录结构:
新增工具函数:
scripts/utils/git.js- Git 操作工具(统一封装)scripts/utils/fs.js- 文件系统操作工具(统一封装)4. 新增 CI 脚本功能
generate-pr-body.mjsgenerate-diff-docs.mjsgenerate-changelog.mjscreate-tags.mjscreate-release.jsbuild-and-package.mjsplan-changed-packages.mjsinstall-all-workspaces.mjs📊 变更统计
总体变更
Monorepo 改造相关
新增文件:
turbo.json- Turborepo 配置pnpm-workspace.yaml- pnpm workspace 配置.npmrc- npm/pnpm 配置workspaces/目录结构(包含所有迁移的组件)修改文件:
package.json- 添加 Turborepo 和 pnpm workspace 支持.gitignore- 更新忽略规则迁移的组件:
packages/迁移到workspaces/legacy-yaml/packages/workspaces/ts-vue2/packages/CI/CD 相关文件变更
新增文件 (18 个):
.github/workflows/pr-description.ymlscripts/README.mdscripts/ci/build-and-package.mjsscripts/ci/call-coreagent.mjsscripts/ci/configure-turbo.mjsscripts/ci/create-release.jsscripts/ci/create-tags.mjsscripts/ci/generate-changelog.mjsscripts/ci/generate-diff-docs.mjsscripts/ci/generate-pr-body.mjsscripts/ci/setup-dependencies.mjsscripts/legacy/README.mdscripts/legacy/changelog.jsscripts/mono/clean-all.mjsscripts/mono/install-all-workspaces.mjsscripts/mono/migrate-components.mjsscripts/utils/fs.jsscripts/utils/git.js修改文件 (2 个):
.github/workflows/release.yml(大幅改进,适配 workspaces)scripts/ci/plan-changed-packages.mjs(增强功能,支持 workspaces 检测)🔍 技术亮点
Monorepo 架构优势
CI/CD 改进优势
🧪 测试建议
Monorepo 功能测试
验证 pnpm workspace 安装:
验证 Turborepo 构建:
验证增量构建:
pnpm buildCI/CD 功能测试
📝 注意事项
迁移影响
packages/迁移到workspaces/迁移指南
如果上游仓库需要迁移,建议步骤:
npm install -g [email protected]pnpm installpnpm build