Common building block(CBB) monorepo powered by RushStack
- minimizing "boilerplate" files. In other words, consolidating files and settings that would otherwise get copy+pasted into every single project folder in the monorepo. Boilerplate is a nuisance because it's difficult to keep in sync. When a fix is needed, if you have hundreds of projects, you would need to reapply the same fix hundreds of times.
- 尽量减少 "模板 "文件。换句话说,合并那些在
monorepo中需要复制粘贴到每个项目下的配置文件。让模板保持同步是个麻烦事。一旦需要变动,如果你有百个项目,你需要数百次重复操作。
- 尽量减少 "模板 "文件。换句话说,合并那些在
- principle of project isolation: Each project should build independently and should not become entangled with other projects (for example, by referencing files using relative paths like ../../other-project). This discipline facilitates Rush features like subset builds and incremental builds. It also makes it very easy to move Rush project folders around, to migrate projects between monorepos, and even to stop using Rush later if you change your mind. For this reason, we discourage practices such as putting a centralized .eslintrc.js file in the root of the monorepo and invoking ESLint globally for all projects.
- 项目隔离原则。每个项目都应该独立构建,而不应该与其他项目纠缠在一起(例如,通过使用诸如
.../.../other-project的相对路径引用文件)。这条原则有助于实现Rush的子集构建和增量构建功能,甚至当你不想使用Rush后,它也可以非常轻易地在monorepo间迁移项目。出于这个原因,我们不鼓励在monorepo仓库的根目录下放一个.eslintrc.js文件并让所有项目都借此调用ESLint.
- 项目隔离原则。每个项目都应该独立构建,而不应该与其他项目纠缠在一起(例如,通过使用诸如
- organized with two level, like
Categary/Project
# good
.
├── rush.json
├── Categary1
│ ├── ProjectA
│ └── ProjectB
├── Categary2
│ └── ProjectC
├── Categary3
│ ├── ProjectD
│ └── ProjectEassets- Assets package,
svg、img、iconfontetc - reviewCategories:
published
- Assets package,
cli- Cli package build with
NodeJs
- Cli package build with
common- Common project config
rush config、git-hooksetc
- Common project config
components- Components package build with
vue2andvue3or other - Output
esmandumdformat
- Components package build with
libraries- Library package build with
es6orts - Only output
esmformat and do not any degrade,so you need transform it to other format and polyfill for other browser
- Library package build with
run-control- Shared config package,
.prettierrc、.eslintrc、.stylelintrcetc
- Shared config package,
tools- A NodeJS build tool used to compile the other projects
apps- A application build with
vue3andvite
- A application build with
production- need deploy to production environment
published- need published to npm registry
internal- no need to publish,just use in internal
- Just run
rush init-projectto make it happen.
- use
viteto bundlecomponentsandlibraries- 2022-1113 now
buildandtestscript useheft,vitejust use as development server forlibraries.componentsno adjustment.
- 2022-1113 now
- use
viteoutput.d.tsforcomponents - add
toolstemplate - add
componentstemplate - add
librariestemplate - add
assetstemplate - use
vitestreplace@heft/jest- 2022-1113 switch back to
@heft/jestinlibrariesproject
- 2022-1113 switch back to
- enable
phase_build - make project treat
jsasesminstead ofcjs- add
"type":"module"inpackage.json
- add
- Integrate
vue-demi- add integrate
vue-demiproject template
- add integrate
rush change- first publish
rush publish --apply --publish --include-all --target-branch main --add-commit-details --set-access-level public
- other publish
rush publish --apply --target-branch main --publish --set-access-level public
- Reference