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

Breaking the repo down into the Monorepo architecture. #706

Open
wewoor opened this issue Mar 10, 2022 Discussed in #681 · 3 comments · May be fixed by #713
Open

Breaking the repo down into the Monorepo architecture. #706

wewoor opened this issue Mar 10, 2022 Discussed in #681 · 3 comments · May be fixed by #713
Assignees
Labels
refactoring Refactor
Milestone

Comments

@wewoor
Copy link
Collaborator

wewoor commented Mar 10, 2022

Discussed in #681

Originally posted by wewoor November 24, 2021
拆分 src 源码为多个子包,后期可单独发布 ui、react 等不同的包,目录结构类似:

├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README-koKR.md
├── README-zhCN.md
├── README.md
├── babel.config.json
├── build
├── codecov.yml
├── commitlint.config.js
├── coverage
├── docs
├── jest.config.js
├── mock
├── node_modules
├── package.json
├── packages
         ├── common
         ├── react
         ├── ui
         ├── ide
├── stories
├── test
├── tsconfig.base.json
├── tsconfig.build.json
├── tsconfig.json
├── website
└── yarn.lock
@wewoor wewoor added the refactoring Refactor label Mar 10, 2022
@wewoor wewoor added this to the 0.9.0-beta.5 milestone Mar 10, 2022
@mortalYoung
Copy link
Collaborator

mortalYoung commented Mar 11, 2022

技术选型:pnpm + turbo
拆依赖包如下:

  • @dtinsight/molecule - 用户主要引入的包
  • @dtinsight/molecule/glue - 抽象出 molecule 的开发范式,主要为 ide 服务
  • @dtinsight/molecule/ide - Molecule 用到的大部分业务组件以及 services controllers
  • @dtinsight/molecule/ui - Molecule 抽象出来的组件
  • @dtinsight/molecule/website - Molecule 的文档
  • @dtinsight/molecule/common - 包含通用的 common 和 utils
  • @dtinsight/molecule/extensions - 包含常用的 extensions

对应目录结构如下

├── ...
├── packages
         ├── molecule  # 对应依赖包为 `@dtinsight/molecule` 
         ├── glue # `@dtinsight/molecule/glue`
         ├── ui # `@dtinsight/molecule/ui`
         ├── ide # `@dtinsight/molecule/ide`
         ├── common # `@dtinsight/molecule/common`
├── ...

对用户侧的影响: 期望用户依然通过 import xxx from '@dtinsight/molecule',故无影响
对开发侧的影响:

  • dev 阶段:需要先把各个依赖包编译之后,然后才能启动项目投入开发,即 start 命令的前置条件是 build
  • test 阶段:每个依赖包仅仅测试自己包的内容,所以期望是无影响
  • release 阶段:通过命令一键发布上面的提到的包,期望是无影响

@wewoor
Copy link
Collaborator Author

wewoor commented Mar 11, 2022

@mortalYoung webiste 应该不用做 package 的抽象。拆包更多还是为了后面需要独立发包来考虑。 extensions 我觉得可以多考虑下。

@mortalYoung
Copy link
Collaborator

@mortalYoung webiste 应该不用做 package 的抽象。拆包更多还是为了后面需要独立发包来考虑。 extensions 我觉得可以多考虑下。

那我再改下

@mortalYoung mortalYoung linked a pull request Mar 16, 2022 that will close this issue
8 tasks
@mortalYoung mortalYoung linked a pull request Mar 17, 2022 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants