This project was generated using Nx.
🔎 Smart, Fast and Extensible Build System
- Mrlonis - Nx - Monorepo
- Table of Contents
- Quick Start & Documentation
- Adding capabilities to your workspace
- Generate an application
- Generate a library
- Development server
- Code scaffolding
- Build
- Running unit tests
- Running end-to-end tests
- Understand your workspace
- Further help
- ☁ Nx Cloud
- Project Ports
- Running the gauntlet
- Updating
- pre-commitGitHub Desktop Fix
10-minute video showing all Nx features
Nx supports many plugins which add capabilities for developing different types of applications and different tools.
These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.
Below are our core plugins:
- Angular
ng add @nx/angular
- React
ng add @nx/react
- Web (no framework frontends)
ng add @nx/web
- Nest
ng add @nx/nest
- Express
ng add @nx/express
- Node
ng add @nx/node
There are also many community plugins you could add.
Run ng g @nx/angular:app my-app
to generate an application.
You can use any of the plugins above to generate applications as well.
When using Nx, you can create multiple applications and libraries in the same workspace.
Run the command nx g @nx/angular:application my-app-name
Run the command nx g @nx/angular:application my-app-name --unitTestRunner=karma
Run the command: nx g @angular/material:ng-add --project=my-app-name
Run ng g @nx/angular:lib my-lib
to generate a library.
You can also use any of the plugins above to generate libraries as well.
Libraries are shareable across libraries and applications. They can be imported from @mrlonis/mylib
.
Run the command nx g @nx/workspace:library my-lib-name
Run the command nx g @nx/workspace:library my-lib-name --buildable
Run the command nx g @nx/angular:library my-lib-name
Run the command nx g @nx/angular:library my-lib-name --unitTestRunner=karma
Run the command nx g @nx/angular:library my-lib-name --buildable
Run the command nx g @nx/angular:library my-lib-name --publishable --importPath='some-path-to-import or like this @some/path-to-import'
Note: A Publishable library is also a buildable library, it is just built using partial compilation. Generating a "buildable / publishable" library likw nx g @nx/angular:library my-lib-name --buildable --publishable --importPath='some-path-to-import or like this @some/path-to-import'
is ultimately redundant. It will not cause an error but there is no reason to pass the buildable flag.
Run ng serve my-app
for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Run ng g component my-component --project=my-app
to generate a new component.
Run the command nx g @nx/angular:component my-component-name --project=my-app-name
Example: nx g @nx/angular:component --name=my-component-name --path='apps/ngx-test-application/src/app/features' --project=my-app-name --module=my-module --style=scss
nx g @nx/angular:component --name=anime-grid --path='apps/ngx-test-application/src/app/features' --project=ngx-test-application --module=app --style=scss
Run ng build my-app
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Run ng test my-app
to execute the unit tests via Jest.
Run nx affected:test
to execute the unit tests affected by a change.
sudo apt-get update
sudo apt-get install libgbm-dev
sudo apt-get install -y curl unzip xvfb libxi6 libgconf-2-4
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
npm i -g cobertura-merge
Run ng e2e my-app
to execute the end-to-end tests via Cypress.
Run nx affected:e2e
to execute the end-to-end tests affected by a change.
Run nx graph
to see a diagram of the dependencies of your projects.
Visit the Nx Documentation to learn more.
Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly.
Teams using Nx gain the advantage of building full-stack applications with their preferred framework alongside Nx’s advanced code generation and project dependency graph, plus a unified experience for both frontend and backend developers.
Visit Nx Cloud to learn more.
- 4203 - ngx-ui-personal-website
- 4207 - ngx-table-virtual-scroll-sticky-headers
- 4208 - ngx-virtual-scroll-cdk-table-example
- 4209 - ngx-table-virtual-scroll-example
- 4210 - ngx-test-application
As part of the gauntlet, we run the Cypress e2e tests. This requires some backend APIs running. In 2 other shells, run the following commands:
npx nx migrate latest
npm install
npx nx migrate --run-migrations
Check https://github.com/nrwl/ci/releases for GitHub Actions workflow updates.
The GitHub Desktop app uses a different env than the OS. To fix missing npx
commands, we can edit the pre-commit
file in the .husky
directory:
#!/bin/bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 20
...