Cake (C# Make) is a cross-platform build automation system with a C# DSL for tasks such as compiling code, copying files and folders, running unit tests, compressing files and building NuGet packages.
First lets try to clear the picture about NrwlÂ and Nx specially for those who have worked with Angular 2+ using CLI or planning to work with Angular on enterprise level applications.
Nx from Nrwl isÂ an extension for the the Angular CLI implementing the monorepo-style development. It is alsoÂ a collection of run-time libraries, linters, and code generatorsÂ helping large teams build better with Angular.
For more details about Nx (the company) and Nrwl (the set of extensions), please visit their documentation page blood relation.
This post is a collection of various commands used to achieve different tasks, other than regular Angular CLI commands which are supported by Nx. The cheat sheet helped me a lot when I started working with Nx extension as one point of reference as I tend to forget the commands initially. I am hopeful that it will help others as well.
|Install Nx Schematics||$ npm i -gÂ @nrwl/schematics|
|Install Angular CLI||$Â npm i -g @angular/cli|
|Create a Nx powered Angular work space||$ create-nx-workspace <work-space-name>|
|Add an Angular application to the work space||$ ng generate(g) application(app) <app-name>|
|Add an Angular library to the work space||$ ng generate(g) library(lib) <library-name>Â –routing|
|Add Ngrx module to any application as root||$ ng g ngrx <project-name> –module=<target-module-path> –root|
|Add Ngrx module to any lib/ app as feature||$ ng g ngrx <project-name> –module=<target-module-path>|
|Serve any application from the work space||$ ng s –project=<project-name> –p=<port-number>|
|Generate dependency graph of the work space||$ npm run dep-graph|
|Create Angular components/ services etc||$ ng generate(g) component <name> –project=<app/lib-name>|