Monorepo
● A single repository containing multiple projects
○ Monorepo !== Monolith
● Used by
4
...
Slide 5
Slide 5 text
5
https://nx.dev/
Slide 6
Slide 6 text
Nx
● Developed by Nrwl
● Monorepo management tool
○ Modern web development
○ Effective change detection
○ Automated migration
6
“Develop like Google, Facebook and Microsoft”
Slide 7
Slide 7 text
Version histories
● v1.x〜(April, 2018)
○ Extensions for Angular CLI
● v6.x
○ Jest support
● v7.x
○ Cypress and Nest support
● v8.x
○ React, Next.js and Storybook support
● v9.x
○ Angular v9 support
7
Slide 8
Slide 8 text
$ npx create-nx-workspace
:
? Workspace name (e.g., org name) workspace
? What to create in the new workspace angular-nest
? Application name web
? Default stylesheet format SASS(.scss)
Creating a workspace
8
Slide 9
Slide 9 text
Nx workspace
● Similar to Angular workspace
● Single version policy
○ package.json is a single
source of truth
9
Slide 10
Slide 10 text
Scaffolding
● Applications
○ nx g @nrwl/angular:app
● Libraries
○ nx g @nrwl/angular:lib
● Schematics
○ nx g workspace-schematic
10
Slide 11
Slide 11 text
Testing
● Jest
○ nx test
● Cypress
○ nx e2e
11
Slide 12
Slide 12 text
$ npm i -D @nrwl/storybook
$ npm i -D @storybook/angular @storybook/addon-knobs
$ nx g @nrwl/angular:storybook-configuration
# Run storybook
$ nx run project-name:storybook
# E2E with Cypress
$ nx e2e project-name-e2e
Storybook
12