For your workspace
Co-founder This is Learning
Co-host This is Tech Talks
A build tool with mono-repo support
- https://monorepo.tools/
https://monorepo.tools/
npx create-nx-workspacenx add @nx/remix --add Remix support
nx add @nx/next --add Next Support
nx add @nx/react-native -- Add react native supportnx add @nx/remix:application --name=<remix-app> --add Remix App
nx add @nx/next:application --name=<next-app> --add Next App
nx add @nx/react-native:application --name=<react-native-app> --add react native Appnx g @nx/next:lib --create a new next library
nx g @nx/remix:lib --create a new remix library
nx g @nx/react-native:lib --create a new react native librarynx add @nx/plugin
nx g @nx/plugin:plugin
nx-plugin
--directory libs/tools/react-overridesThe ultimate goal for all developers to write code and wait for your builds to complete on CI
App/Libs
Build and deployment
Build code on GitHub Action
Push the build artifact to DB
X = number of Apps
PR 1
PR 2
PR 3
PR 4
PR = Pull Request
P
I
P
E
L
I
N
E
Build workflow on CI
GitHub Actions
Build
Lint
E2E
Build workflow on CI
GitHub Actions
Build Done
Lint
Test
Build workflow on CI
GitHub Actions
Build Done
Lint Done
Test
PR 1
PR 2
PR 3
PR 4
PR = Pull Request
PR 5
PR 6
PR 7
Pipeline
Parallel builds using GitHub Actions using Matrix and large runners
Build
Lint
Test
M-1
M-2
M-3
M = Machine (can be linux/windows/mac)
Pipeline
PR 1
PR 2
PR 3
PR 4
PR = Pull Request
PR 5
PR 6..
PR 70
Pipeline
One problem we have with build tools is that we build the same code repeatedly, though we don't change it.
nx graphApp1
App2
App3
App4
App5
Lib1
Lib2
function newFeature() {
return true;
}Changes in your Pull Request
App1
App2
App3
App4
App5
Lib1
Lib2
nx affected --targets=build,lint,testNx Cloud
Push Nx Cache
Get Nx Cache
PR 1
PR 2
PR 3
PR 4
PR = Pull Request
P
I
P
E
L
I
N
E
Create a new npm/yarn workspace
Add Tooling of your choice
Add configuration to bundle your dependencies and style
Add scripts to publish
Keep your library up to date with latest release of framework
nx releasenx migrate latest