11th Practical Class:
Monorepo with Nx
Nx π
- π οΈ monorepo tooling: β‘οΈ https://nx.dev/
- π plugins
- JS: React, Vue, Angular, Svelte, Express, Vite, Rollup, Jest, Cypress, ...
- Go, .Net, Docker, ...
- β community plugins: Rust, Java, ...
- β std commands for: build, test, lint, format
- ποΈ generators
- πΈοΈ dependency graph
- π distributed cache
- π IDE plugins (VS Code, WebStorm)
πͺ Step 1. - generate empty Nx workspace
Prompts:
- Where would you like to create your workspace? βΊ
- Which stack do you want to use? βΊ
- Package-based monorepo, integrated monorepo, or standalone project? βΊ
- Enable distributed caching to make your CI faster βΊ
πͺ Step 2. add Nx plugins
πͺ Step 3. - Generate Frontend App βοΈ
generate React app:
πͺ Step 4. - add
Run task on project
- run tasks on all projects
- run tusks only on projects affected by change
Nx Graph
Open http://localhost:8888/projects
Add More
Enforce Module Boundaries
https://nx.dev/core-features/enforce-module-boundaries