Skip to content
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

WIP: feat: migrate to turbo and pnpm #713

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

mortalYoung
Copy link
Collaborator

@mortalYoung mortalYoung commented Mar 16, 2022

简介

  • 本 PR 主要负责仓库迁移至 monorepo 架构

功能点

  • dev
  • build
  • precommit(包含 eslint prettier stylelint 等)
  • test
  • release
  • web

主要变更

  • 基于 Breaking the repo down into the Monorepo architecture. #706 讲仓库架构拆分
  • 拆分 gulpfile.js 的功能,每个包都有自己的 gulpfile.js,简单的包直接用 tsc 编译
  • 删除无用的 webpack 配置,以及相关 scripts
  • 修改 alias,由于目录结构改变,之前的 mo/* 以及 mo 都无效了,修改成对应的依赖包。尽在 ide 中保留 mo 的别名
  • 优化 jest 的 alias,防止 workspace 的包找不到
  • 优化 README,主仓库的 README 是 molecule 这个项目的 README 的 symlink,确保 github 仓库的首页和 npm 首页的 README 保持一致。
  • 修复 symlink README 中相对路径引用的问题
  • 优化 common 的 logger 的 __DEVELOPMENT__ 问题,通过 process.env.__DEVELOPMENT__ 来判断
  • 修复 eslintstylelint 等路径问题
  • src/components/monaco 迁移至 packages/ide/components/monaco 而不是 packages/ui/src/monaco

遗留问题

  • 目前 changelog 是输出在主仓库下的,参照 vite 的话应该是每一个包生成独立的 changelog,这个后续再看如何迁移
  • 目前自动生成的 API 文档的 define 都是 xxx/esm/xxx 文件,导致无法关联到 github 对应路径,暂时没想到解决办法

Breaking changes

  • 用户侧
    • UI 组件不再通过 @dtinsight/molecule/esm/components 导出改为 @dtinsight/molecule/ui
    • monaco-editor 中导出不再通过 @dtinsight/molecule/esm/monaco,改为 @dtinsight/molecule/monaco
    • 其余导出不再通过 @dtinsight/molecule/esm/xxx,改为 @dtinsight/molecule
    • API 文档结构有所改动,查阅文档方式有所变化

@mortalYoung mortalYoung added the refactoring Refactor label Mar 16, 2022
@mortalYoung mortalYoung requested review from wewoor and mumiao March 16, 2022 03:00
@mortalYoung mortalYoung self-assigned this Mar 16, 2022
@mortalYoung mortalYoung requested review from kiwiwong and Zaoei March 16, 2022 03:00
@mortalYoung mortalYoung force-pushed the refactor/workspaces branch from 274f12d to 431610e Compare March 16, 2022 03:03
@mortalYoung mortalYoung changed the title refactor: migrate to turbo and pnpm feat: migrate to turbo and pnpm Mar 16, 2022
@codecov
Copy link

codecov bot commented Mar 16, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (05ad264) 91.34% compared to head (e4174e5) 91.14%.
Report is 78 commits behind head on main.

❗ Current head e4174e5 differs from pull request most recent head 8b565b7. Consider uploading reports for the commit 8b565b7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #713      +/-   ##
==========================================
- Coverage   91.34%   91.14%   -0.20%     
==========================================
  Files         189      178      -11     
  Lines        5947     5827     -120     
  Branches     1426     1407      -19     
==========================================
- Hits         5432     5311     -121     
- Misses        508      509       +1     
  Partials        7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mortalYoung
Copy link
Collaborator Author

mortalYoung commented Mar 16, 2022

We need a release script to do the following things:

  1. 检查 git 状态(确保暂存区没有更改)
  2. 检查分支状态(确保 release 的命令仅在 main 分支执行)
  3. 检查 remote 状态(确保当前仓库是最新的)
  4. 检查 npm publish 的地方(确保是 https://registry.npmjs.org/
  5. 运行 npm run build(确保 esm 是最新的)
  6. 生成 changelog(目前依靠 standard-version 的能力,或者直接依靠 conventional-changelog 的 CLI)
  7. 升级主仓库的版本
  8. 升级子仓库的版本,与主仓库保持一致
  9. 升级子仓库中的依赖版本,确保子仓库之间的依赖版本是最新的
  10. 更新 pnpm-lock.yml
  11. git add git commit git tag
  12. publish
  13. push

@mortalYoung mortalYoung linked an issue Mar 17, 2022 that may be closed by this pull request
Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

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

image

测试文件的路径错了

@mortalYoung mortalYoung requested a review from wewoor March 18, 2022 02:15
@mumiao
Copy link
Collaborator

mumiao commented Mar 21, 2022

+1

Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

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

补充 API 文档生成测试

Copy link
Collaborator

@kiwiwong kiwiwong left a comment

Choose a reason for hiding this comment

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

+1

@mortalYoung mortalYoung force-pushed the refactor/workspaces branch from 062fb4a to 9fd7f46 Compare April 7, 2022 06:05
@wewoor wewoor added this to the 0.9.0-beta.5 milestone Apr 26, 2022
@wewoor wewoor mentioned this pull request Apr 26, 2022
13 tasks
@wewoor wewoor changed the title feat: migrate to turbo and pnpm WIP: feat: migrate to turbo and pnpm May 11, 2022
@mortalYoung mortalYoung added the wontfix This will not be worked on label Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactor wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breaking the repo down into the Monorepo architecture.
4 participants