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
│ └── ProjectE
assets
- Assets package,
svg
、img
、iconfont
etc - reviewCategories:
published
- Assets package,
cli
- Cli package build with
NodeJs
- Cli package build with
common
- Common project config
rush config
、git-hooks
etc
- Common project config
components
- Components package build with
vue2
andvue3
or other - Output
esm
andumd
format
- Components package build with
libraries
- Library package build with
es6
orts
- Only output
esm
format 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
、.stylelintrc
etc
- Shared config package,
tools
- A NodeJS build tool used to compile the other projects
apps
- A application build with
vue3
andvite
- 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-project
to make it happen.
- use
vite
to bundlecomponents
andlibraries
- 2022-1113 now
build
andtest
script useheft
,vite
just use as development server forlibraries
.components
no adjustment.
- 2022-1113 now
- use
vite
output.d.ts
forcomponents
- add
tools
template - add
components
template - add
libraries
template - add
assets
template - use
vitest
replace@heft/jest
- 2022-1113 switch back to
@heft/jest
inlibraries
project
- 2022-1113 switch back to
- enable
phase_build
- make project treat
js
asesm
instead ofcjs
- add
"type":"module"
inpackage.json
- add
- Integrate
vue-demi
- add integrate
vue-demi
project 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