JS Monorepos¶
What a monorepo looks like¶
- clients
- client1
- client2
- packages
- ESLint
- frontend-core
- TSConfig
- storybook
- tests
Why monorepos¶
- Consistency
- share config files
- ESLint
- docs
- utils
- align & share node_modules
- share
node_modules
- share
- share config files
- CI/CD is easier to test/build/deploy together
- need to make a change to core & client
- just one PR now!
Problem with monorepos?¶
- They're huge
- Big tech companies have their own massive solutions
Options¶
- npm/yarn/pnpm workspaces
- npm link 🐢
- Smart build systems
- Turborepo
- NX
- Lerna: open source multi-package repos
Smart build systems¶
built on top of workspaces
Turborepo vs pnpm workspaces¶
- Create a dependency tree between all the apps
- smart caching
- run the same thing twice -> get from the cache
- run jobs in parallel
- remote caching
- cache can be downloaded remotely
Turborepo vs NX¶
????
How does a client/app know that a local package updated?¶
- is the
*
thing a workspace specific thing? - is it the workspace that links it??????
Last update:
2023-04-24