Compare commits

...

71 Commits

Author SHA1 Message Date
Jason Jean 9fde5ecc33 Release 9.7.1 2020-10-16 13:19:39 -04:00
x87 439d5d8d35 fix(core): fix resolving projects for imports to '..' (#3846)
* fix(core): fix resolving projects for imports to '..'

* fix(core): fix formatting

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2020-10-09 16:30:58 -04:00
Jason Jean 8c85bf9405 fix(core): fix resolving projects for imports to '.' (#3839) 2020-10-09 16:30:58 -04:00
Jason Jean 6377cef8ca fix(core): fix decorate angular-cli script to work for production installs 2020-10-09 16:30:58 -04:00
Isaac Mann 297ccc5865 docs(docs): fix copy paste typo 2020-10-09 16:30:58 -04:00
Isaac Mann afe720bac2 docs(docs): add missing schematics to map.json 2020-10-09 16:30:58 -04:00
German 507c1b6968 fix(core): add forwardAllArgs option to run-commands builder (#3559)
ISSUES CLOSED: #3335
2020-10-09 16:30:58 -04:00
Jason Jean 6eedf58f7c fix(core): enable intelligent tsconfig changes in tsconfig.base.json (#3768) 2020-10-09 16:30:57 -04:00
Victor Savkin 25c2ba0b39 fix(misc): increase buffer limit of run-commands 2020-10-09 16:30:57 -04:00
Victor Savkin 589a4808dc fix(repo): fix broken tests 2020-10-09 16:30:06 -04:00
Jason Jean 9c5c5fe74b fix(core): improve performance of analyzing npm dependencies (#3755) 2020-10-09 14:55:28 -04:00
Zachary DeRose 54c3d8d150 fix(docs): Misnamed link in sidebar (#3762) 2020-10-09 14:54:16 -04:00
Jason Jean 18ab78de32 Release 9.7.0 2020-09-17 17:26:10 -04:00
Jason Jean 3f3a58ff52 fix(core): update version of yargs-parser (#3754) 2020-09-17 17:19:10 -04:00
Jonathan Cammisuli eeaddf19b8 chore(docs): regenerate docs 2020-09-17 11:17:19 -04:00
Jonathan Cammisuli ea2a111be4 chore(docs): add node tutorial files (#3663)
(cherry picked from commit b49f0af610)
2020-09-17 11:17:19 -04:00
Jonathan Cammisuli 5904c3e1f1 feat(docs): add node document generation
(cherry picked from commit 0304516318)
2020-09-17 11:17:19 -04:00
Jonathan Cammisuli 0759213b30 feat(core): add nest preset
(cherry picked from commit 10d3d0de3b)
2020-09-17 11:17:19 -04:00
Tasos Bekos 156dd33901 fix(misc): upgrade version of yargs-parser (#3751)
ISSUES CLOSED: #3105
2020-09-17 10:39:59 -04:00
Jason Jean cbf12f0353 fix(core): read tsconfig.json instead of tsconfig.base.json (#3745) 2020-09-16 21:08:14 -04:00
Jason Jean 480c01d1c9 fix(repo): fix publish script 2020-09-11 18:25:53 -04:00
Victor Savkin f19c5df2d9 feat(core): add scan to list of supported flags 2020-09-11 14:14:26 -04:00
Victor Savkin 52c9bc71f2 feat(core): add a prompt when using --scan without nx-cloud 2020-09-11 14:04:15 -04:00
Victor Savkin ed5f3a6690 fix(core): git hasher should handle unstaged files with spaces 2020-09-11 14:04:15 -04:00
Jason Jean 46454aad6b feat(core): optimize project locator perf 2020-09-11 14:04:15 -04:00
Victor Savkin 4ea6ef86ca fix(core): update the version of yargs to fix npm audit 2020-09-11 14:04:11 -04:00
Martin Hochel ab943ae890 fix(core): remove invalid --plain flags from affected commands
ISSUES CLOSED: 2720
2020-09-11 12:39:38 -04:00
Jason Jean cfb9718a12 Release 9.6.0 2020-08-19 17:15:05 -04:00
Victor Savkin 17d78c0516 fix(core): explicitly store workspace files instead of deriving them from hashes 2020-08-19 15:20:06 -04:00
Victor Savkin 4f22832fff fix(core): dont override sigint 2020-08-19 14:46:30 -04:00
Victor Savkin 464d13e5dc fix(core): respect nxignore when using git hashing 2020-08-19 10:33:30 -04:00
Jason Jean a0d501b0db fix(web): remove duplicate copy webpack plugin (#3556) 2020-08-18 17:13:59 -04:00
Marvin Luchs 0351ade509 fix(core): update copy-webpack-plugin (#3514)
fixes security vulnerability caused by serialize-javascript < 3.1.0

closes #3506
2020-08-18 17:13:43 -04:00
Jason Jean 00de5d8235 fix(repo): fix e2e test 2020-08-18 17:11:59 -04:00
Victor Savkin fc1ba0adb5 fix(repo): fix unit test script 2020-08-18 17:11:58 -04:00
Jason Jean 1804b55da1 cleanup(repo): fix formatting 2020-08-18 17:11:58 -04:00
Mehrad Rafigh aa6ea72b83 feat(testing): pass reporter and reporterOptions to cypress builder (#3536) 2020-08-18 17:11:58 -04:00
Jeremy Forsythe 5abd0d11a1 fix(core): remove defaultProject in workspace when removing project
Fixes #3511
2020-08-18 17:11:58 -04:00
Devin Shoemaker c16c1614b5 fix(core): tests 2020-08-18 17:11:57 -04:00
Devin Shoemaker 8f62e8d37e fix(core): honor workspace layout with workspace move schematic 2020-08-18 17:11:57 -04:00
Victor Savkin 237d508e52 fix(core): add a workaround for potential bugs in git hasher (#3521) 2020-08-18 13:26:48 -04:00
Jason Jean 61fc7218ff cleanup(core): fix formatting 2020-08-18 13:26:48 -04:00
Mehrad Rafigh 34847aac0e feat(testing): pass ignoreTestFiles to cypress builder
ISSUES CLOSED: #3439
2020-08-18 13:26:48 -04:00
Jakub Koralewski be42a100c1 fix(core): git hasher should handle file that are both renamed and modified 2020-08-18 13:26:48 -04:00
Zachary DeRose 5f637f8b50 fix(testing): builder should let baseUrl option take precidence if present (#3487) 2020-08-18 13:26:48 -04:00
Fernando Montoya b170e8184c fix(react): remove empty space from describe name (#3504) 2020-08-18 13:26:47 -04:00
Victor Savkin 291a918a26 fix(core): remove an unnecessary npm install when connecting to cloud 2020-08-18 13:26:47 -04:00
Victor Savkin 1d8f901c71 fix(core): create-nx-workspace uses a unix-style path on windows 2020-08-18 13:26:47 -04:00
Bram Borggreve 74a61e7b5c fix(core): create-nx-workspace preset and cli params should work with spaces 2020-08-18 13:26:47 -04:00
Martin Hochel fdd90990a3 fix(core): generate proper cli command in lib readme 2020-08-18 13:26:47 -04:00
Jason Jean 34e6c1498f fix(core): do not print warnings for print-affected 2020-08-18 13:26:46 -04:00
Victor Savkin b0ada64d19 fix(core): sort files before creating project graph to make stable hashes 2020-08-18 13:26:46 -04:00
Philip Fulcher c8eb86d9ce fix(core): fix crosshair icon for dep-graph 2020-08-18 13:26:46 -04:00
Jason Jean 3f18eaba90 fix(misc): fix exit code for running nx outside of a workspace 2020-08-18 13:26:46 -04:00
Jo Hanna Pearce fa9c790b9d fix(misc): add regex pattern to schematics to prevent empty app/lib creation (#3396)
ISSUES CLOSED: #2924
2020-08-13 17:48:45 -04:00
Jason Jean 93fab2644f fix(core): properly resolve tsconfig when serving from project root (#3403) 2020-08-13 17:48:45 -04:00
Jo Hanna Pearce d074f45ed3 fix(angular): show a nicer error when running nx in an angular workspace 2020-08-13 17:48:45 -04:00
Jack Hsu 5927a5b7f8 fix(react): add babel plugin for styled-jsx for libs (#3441) 2020-08-13 17:48:45 -04:00
Jason Jean 9699214ef7 fix(core): override --prod with --configuration 2020-08-13 17:48:44 -04:00
Bucky Maler 5109068f9f feat(storybook): add docs mode option to dev server builder (#2882)
closes #3147
2020-08-13 17:48:44 -04:00
Victor Savkin 020d2e1088 fix(core): with-deps should handle circular dependencies 2020-08-13 17:48:44 -04:00
Victor Savkin 12ac1bc696 cleanup(core): add unit tests to verify edge cases of git hashing 2020-08-13 17:48:44 -04:00
Victor Savkin 7e9587f384 fix(core): handle git renames and spaces in filenames when doing git hashing 2020-08-13 17:48:44 -04:00
Victor Savkin 496534d7e5 fix(misc): workspace-lint should respect nested gitignores 2020-08-13 17:48:43 -04:00
Victor Savkin 1777f5bc79 fix(core): remove deleted files from git-hashers result 2020-08-13 17:48:43 -04:00
Jason Jean d021876f06 fix(core): fix dep-graph crosshair svg not available (#3362) 2020-08-13 17:48:43 -04:00
Brandon Roberts 6ee1dda6cd feat(core): use custom output logging for configuration out of sync errors 2020-08-13 17:48:43 -04:00
Jack Hsu d7f1a03f88 fix(react): move url-loader to the react package.json (#3356) 2020-08-13 17:48:42 -04:00
Victor Savkin 353a9d9f14 feat(core): add perf logging 2020-08-13 17:48:42 -04:00
Victor Savkin 2871bd10a2 fix(core): increase maxBuffer when invoking git to get file hashes 2020-08-13 17:48:42 -04:00
Victor Savkin 9a2341a8c1 feat(core): redesign workspace file hashing 2020-08-13 17:48:42 -04:00
243 changed files with 12709 additions and 1414 deletions
@@ -64,6 +64,12 @@ Type: `boolean`
Whether or not to open the Cypress application to run the tests. If set to 'true', will run in headless mode
### ignoreTestFiles
Type: `string`
A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: {dot: true, matchBase: true}. We suggest using https://globster.xyz to test what files would match.
### key
Type: `string`
@@ -86,6 +92,18 @@ Type: `boolean`
Whether or not Cypress should record the results of the tests
### reporter
Type: `string`
The reporter used during cypress run
### reporterOptions
Type: `string`
The reporter options used. Supported options depend on the reporter.
### spec
Type: `string`
@@ -6,6 +6,14 @@ Builder properties can be configured in angular.json when defining the builder,
## Properties
### docsMode
Default: `false`
Type: `boolean`
Build a documentation-only site using addon-docs.
### host
Default: `localhost`
@@ -66,6 +66,44 @@ or simply with:
nx run frontend:create-script --name=example
```
##### Arguments forwarding
When interpolation is not present in the command, all arguments are forwarded to the command by default.
This is useful when you need to pass raw argument strings to your command.
For example, when you run:
nx run frontend:webpack --args="--config=example.config.js"
```json
"webpack": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": "webpack"
}
}
```
The above command will execute: `webpack --config=example.config.js`
This functionality can be disabled by using `commands` and expanding each `command` into an object
that sets the `forwardAllArgs` option to `false` as shown below:
```json
"webpack": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "webpack",
"forwardAllArgs": false
}
]
}
}
```
##### Custom **done** conditions
Normally, `run-commands` considers the commands done when all of them have finished running. If you don't need to wait until they're all done, you can set a special string, that considers the command finished the moment the string appears in `stdout` or `stderr`:
@@ -74,9 +112,7 @@ Normally, `run-commands` considers the commands done when all of them have finis
"finish-when-ready": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": [
"echo 'READY' && sleep 5 && echo 'FINISHED'"
],
"command": "echo 'READY' && sleep 5 && echo 'FINISHED'",
"readyWhen": "READY"
}
}
-4
View File
@@ -110,10 +110,6 @@ Default: `false`
Parallelize the command
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
-4
View File
@@ -92,10 +92,6 @@ Default: `false`
Isolate projects which previously failed
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
-4
View File
@@ -98,10 +98,6 @@ Default: `false`
Parallelize the command
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
-4
View File
@@ -98,10 +98,6 @@ Default: `false`
Parallelize the command
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
-4
View File
@@ -98,10 +98,6 @@ Default: `false`
Parallelize the command
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
-4
View File
@@ -116,10 +116,6 @@ Default: `false`
Parallelize the command
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
-4
View File
@@ -50,10 +50,6 @@ Default: `false`
Isolate projects which previously failed
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
-4
View File
@@ -50,10 +50,6 @@ Default: `false`
Isolate projects which previously failed
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
-4
View File
@@ -86,10 +86,6 @@ Default: `false`
Isolate projects which previously failed
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
+2 -2
View File
@@ -14,5 +14,5 @@ In this tutorial you:
**Dive Deep:**
- [Nx CLI](/{{framework}}/cli/overview)
- [Computation Caching](/{{framework}}/guides/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/monorepo-affected)
- [Computation Caching](/{{framework}}/workspace/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/ci/monorepo-affected)
+1181 -3
View File
File diff suppressed because it is too large Load Diff
+36
View File
@@ -0,0 +1,36 @@
# package
Build an Angular library
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### project
Type: `string`
The file path for the ng-packagr configuration file, relative to the current workspace.
### tsConfig
Type: `string`
The full path for the TypeScript configuration file, relative to the current workspace.
### updateBuildableProjectDepsInPackageJson
Default: `true`
Type: `boolean`
Update buildable project dependencies in package.json
### watch
Default: `false`
Type: `boolean`
Run build when files change.
@@ -0,0 +1,171 @@
# application
Create an Angular application
## Usage
```bash
nx generate application ...
```
```bash
nx g app ... # same
```
By default, Nx will search for `application` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:application ...
```
Show what will be generated without writing to disk:
```bash
nx g application ... --dry-run
```
## Options
### backendProject
Type: `string`
Backend project that provides data to this application. This sets up proxy.config.json.
### directory
Type: `string`
The directory of the new application.
### e2eTestRunner
Default: `cypress`
Type: `string`
Possible values: `protractor`, `cypress`, `none`
Test runner to use for end to end (e2e) tests
### enableIvy
Default: `true`
Type: `boolean`
Create a new app that uses the Ivy rendering engine.
### inlineStyle
Alias(es): s
Default: `false`
Type: `boolean`
Specifies if the style will be in the ts file.
### inlineTemplate
Alias(es): t
Default: `false`
Type: `boolean`
Specifies if the template will be in the ts file.
### linter
Default: `tslint`
Type: `string`
Possible values: `tslint`
The tool to use for running lint checks.
### name
Type: `string`
The name of the application.
### prefix
Alias(es): p
Type: `string`
The prefix to apply to generated selectors.
### routing
Default: `false`
Type: `boolean`
Generates a routing module.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipPackageJson
Default: `false`
Type: `boolean`
Do not add dependencies to package.json.
### skipTests
Alias(es): S
Default: `false`
Type: `boolean`
Skip creating spec files.
### style
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`
The file extension to be used for style files.
### tags
Type: `string`
Add tags to the application (used for linting)
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `karma`, `jest`, `none`
Test runner to use for unit tests
### viewEncapsulation
Type: `string`
Possible values: `Emulated`, `Native`, `None`
Specifies the view encapsulation strategy.
@@ -0,0 +1,59 @@
# downgrade-module
Setup Downgrade Module
## Usage
```bash
nx generate downgrade-module ...
```
By default, Nx will search for `downgrade-module` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:downgrade-module ...
```
Show what will be generated without writing to disk:
```bash
nx g downgrade-module ... --dry-run
```
## Options
### angularJsImport
Type: `string`
Import expression of the AngularJS application (e.g., --angularJsImport=some_node_module/my_app).
### name
Type: `string`
The name of the main AngularJS module.
### project
Type: `string`
The name of the project
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipPackageJson
Default: `false`
Type: `boolean`
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson)
@@ -0,0 +1,31 @@
# karma-project
Add karma testing to a project
## Usage
```bash
nx generate karma-project ...
```
By default, Nx will search for `karma-project` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:karma-project ...
```
Show what will be generated without writing to disk:
```bash
nx g karma-project ... --dry-run
```
## Options
### project
Type: `string`
The name of the project.
+23
View File
@@ -0,0 +1,23 @@
# karma
Add karma configuration to a workspace
## Usage
```bash
nx generate karma ...
```
By default, Nx will search for `karma` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:karma ...
```
Show what will be generated without writing to disk:
```bash
nx g karma ... --dry-run
```
+147
View File
@@ -0,0 +1,147 @@
# library
Create an Angular library
## Usage
```bash
nx generate library ...
```
```bash
nx g lib ... # same
```
By default, Nx will search for `library` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:library ...
```
Show what will be generated without writing to disk:
```bash
nx g library ... --dry-run
```
## Options
### addModuleSpec
Default: `false`
Type: `boolean`
Add a module spec file.
### directory
Type: `string`
A directory where the lib is placed
### lazy
Default: `false`
Type: `boolean`
Add RouterModule.forChild when set to true, and a simple array of routes when set to false.
### name
Type: `string`
Library name
### parentModule
Type: `string`
Update the router configuration of the parent module using loadChildren or children, depending on what `lazy` is set to.
### prefix
Alias(es): p
Type: `string`
The prefix to apply to generated selectors.
### publishable
Alias(es): buildable
Default: `false`
Type: `boolean`
Generate a buildable library.
### routing
Default: `false`
Type: `boolean`
Add router configuration. See lazy for more information.
### simpleModuleName
Default: `false`
Type: `boolean`
Keep the module name simple (when using --directory)
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipPackageJson
Default: `false`
Type: `boolean`
Do not add dependencies to package.json.
### skipTsConfig
Default: `false`
Type: `boolean`
Do not update tsconfig.json for development experience.
### style
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`
The file extension to be used for style files.
### tags
Type: `string`
Add tags to the library (used for linting)
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `karma`, `jest`, `none`
Test runner to use for unit tests
+51
View File
@@ -0,0 +1,51 @@
# move
Move an Angular application or library to another folder
## Usage
```bash
nx generate move ...
```
```bash
nx g mv ... # same
```
By default, Nx will search for `move` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:move ...
```
Show what will be generated without writing to disk:
```bash
nx g move ... --dry-run
```
### Examples
Move libs/my-feature-lib to libs/shared/my-feature-lib:
```bash
nx g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib
```
## Options
### destination
Type: `string`
The folder to move the Angular project into
### projectName
Alias(es): project
Type: `string`
The name of the Angular project to move
+135
View File
@@ -0,0 +1,135 @@
# ngrx
Add an ngrx config to a project
## Usage
```bash
nx generate ngrx ...
```
By default, Nx will search for `ngrx` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:ngrx ...
```
Show what will be generated without writing to disk:
```bash
nx g ngrx ... --dry-run
```
## Options
### barrels
Default: `false`
Type: `boolean`
Use barrels to re-export actions, state, and selectors.
### directory
Default: `+state`
Type: `string`
The name of the folder used to contain/group the generated NgRx files.
### facade
Default: `false`
Type: `boolean`
Create a Facade class for the the Feature.
### minimal
Default: `true`
Type: `boolean`
Only register the root state management setup or feature state.
### module
Type: `string`
The path to NgModule where the feature state will be registered. The host directory will create/use the new state directory.
### name
Type: `string`
Name of the NgRx feature state, such as "products" or "users"). Recommended to use the plural form of the name.
### onlyAddFiles
Default: `false`
Type: `boolean`
**Deprecated**, use `skipImport`. Only add new NgRx files, without changing the module file (e.g., --onlyAddFiles).
### onlyEmptyRoot
Default: `false`
Type: `boolean`
**Deprecated**, use `minimal`. Do not generate any files. Only generate StoreModule.forRoot and EffectsModule.forRoot (e.g., --onlyEmptyRoot).
### root
Default: `false`
Type: `boolean`
Setup root or feature state management with NgRx.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting of generated files.
### skipImport
Default: `false`
Type: `boolean`
Generate NgRx feature files without registering the feature in the NgModule.
### skipPackageJson
Default: `false`
Type: `boolean`
Do not update the package.json with NgRx dependencies.
### syntax
Default: `creators`
Type: `string`
Possible values: `classes`, `creators`
Specifies whether to use class-based or creator functions for actions, reducers, and effects.
### useDataPersistence
Default: `false`
Type: `boolean`
Generate NgRx Effects with the DataPersistence helper service. Set to false to use plain effects data persistence operators.
@@ -0,0 +1,37 @@
# stories
Create stories/specs for all components declared in a library
## Usage
```bash
nx generate stories ...
```
By default, Nx will search for `stories` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:stories ...
```
Show what will be generated without writing to disk:
```bash
nx g stories ... --dry-run
```
## Options
### generateCypressSpecs
Type: `boolean`
Automatically generate \*.spec.ts files in the cypress e2e app generated by the cypress-configure schematic
### name
Type: `string`
Library name
@@ -0,0 +1,49 @@
# storybook-configuration
Create stories/specs for all components declared in a library
## Usage
```bash
nx generate storybook-configuration ...
```
By default, Nx will search for `storybook-configuration` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:storybook-configuration ...
```
Show what will be generated without writing to disk:
```bash
nx g storybook-configuration ... --dry-run
```
## Options
### configureCypress
Type: `boolean`
Run the cypress-configure schematic
### generateCypressSpecs
Type: `boolean`
Automatically generate \*.spec.ts files in the cypress e2e app generated by the cypress-configure schematic
### generateStories
Type: `boolean`
Automatically generate \*.stories.ts files for components declared in this library
### name
Type: `string`
Library name
@@ -0,0 +1,73 @@
# upgrade-module
Add an upgrade module
## Usage
```bash
nx generate upgrade-module ...
```
By default, Nx will search for `upgrade-module` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:upgrade-module ...
```
Show what will be generated without writing to disk:
```bash
nx g upgrade-module ... --dry-run
```
## Options
### angularJsCmpSelector
Type: `string`
The selector of an AngularJS component (e.g., --angularJsCmpSelector=myComponent)
### angularJsImport
Type: `string`
Import expression of the AngularJS application (e.g., --angularJsImport=some_node_module/my_app).
### name
Type: `string`
The name of the main AngularJS module.
### project
Type: `string`
The name of the project
### router
Default: `false`
Type: `boolean`
Sets up router synchronization (e.g., --router)
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipPackageJson
Default: `false`
Type: `boolean`
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson)
+126
View File
@@ -0,0 +1,126 @@
# cypress
Run Cypress e2e tests
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### baseUrl
Type: `string`
Use this to pass directly the address of your distant server address with the port running your application
### browser
Type: `string`
The browser to run tests in.
### ciBuildId
Type: `string`
A unique identifier for a run to enable grouping or parallelization.
### copyFiles
Type: `string`
DEPRECATED: A regex string that is used to choose what additional integration files to copy to the dist folder
### cypressConfig
Type: `string`
The path of the Cypress configuration json file.
### devServerTarget
Type: `string`
Dev server target to run tests against.
### exit
Default: `true`
Type: `boolean`
Whether or not the Cypress Test Runner will stay open after running tests in a spec file
### group
Type: `string`
A named group for recorded runs in the Cypress dashboard.
### headless
Default: `false`
Type: `boolean`
Whether or not to open the Cypress application to run the tests. If set to 'true', will run in headless mode
### ignoreTestFiles
Type: `string`
A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: {dot: true, matchBase: true}. We suggest using https://globster.xyz to test what files would match.
### key
Type: `string`
The key cypress should use to run tests in parallel/record the run (CI only)
### parallel
Default: `false`
Type: `boolean`
Whether or not Cypress should run its tests in parallel (CI only)
### record
Default: `false`
Type: `boolean`
Whether or not Cypress should record the results of the tests
### reporter
Type: `string`
The reporter used during cypress run
### reporterOptions
Type: `string`
The reporter options used. Supported options depend on the reporter.
### spec
Type: `string`
A comma delimited glob string that is provided to the Cypress runner to specify which spec files to run. i.e. '**examples/**,**actions.spec**
### tsConfig
Type: `string`
The path of the Cypress tsconfig configuration json file.
### watch
Default: `false`
Type: `boolean`
Recompile and run tests when files change.
@@ -0,0 +1,89 @@
# application
Create an express application
## Usage
```bash
nx generate application ...
```
```bash
nx g app ... # same
```
By default, Nx will search for `application` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/express:application ...
```
Show what will be generated without writing to disk:
```bash
nx g application ... --dry-run
```
## Options
### directory
Type: `string`
The directory of the new application.
### frontendProject
Type: `string`
Frontend project that needs to access this application. This sets up proxy configuration.
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
The name of the application.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipPackageJson
Default: `false`
Type: `boolean`
Do not add dependencies to package.json.
### tags
Type: `string`
Add tags to the application (used for linting)
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
+222
View File
@@ -0,0 +1,222 @@
# jest
Run Jest unit tests
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### bail
Alias(es): b
Type: `number | boolean`
Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/en/cli#bail)
### ci
Type: `boolean`
Whether to run Jest in continuous integration (CI) mode. This option is on by default in most popular CI environments. It will prevent snapshots from being written unless explicitly requested. (https://jestjs.io/docs/en/cli#ci)
### clearCache
Type: `boolean`
Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory. _Note: clearing the cache will reduce performance_.
### codeCoverage
Alias(es): coverage
Type: `boolean`
Indicates that test coverage information should be collected and reported in the output. (https://jestjs.io/docs/en/cli#coverage)
### color
Alias(es): colors
Type: `boolean`
Forces test results output color highlighting (even if stdout is not a TTY). Set to false if you would like to have no colors. (https://jestjs.io/docs/en/cli#colors)
### colors
Type: `boolean`
Forces test results output highlighting even if stdout is not a TTY. (https://jestjs.io/docs/en/cli#colors)
### config
Type: `string`
The path to a Jest config file specifying how to find and execute tests. If no rootDir is set in the config, the directory containing the config file is assumed to be the rootDir for the project. This can also be a JSON-encoded value which Jest will use as configuration
### coverageDirectory
Type: `string`
An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.
### coverageReporters
Type: `string`
A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter
### detectOpenHandles
Type: `boolean`
Attempt to collect and print open handles preventing Jest from exiting cleanly (https://jestjs.io/docs/en/cli.html#--detectopenhandles)
### findRelatedTests
Type: `string`
Find and run the tests that cover a comma separated list of source files that were passed in as arguments. (https://jestjs.io/docs/en/cli#findrelatedtests-spaceseparatedlistofsourcefiles)
### jestConfig
Type: `string`
The path of the Jest configuration. (https://jestjs.io/docs/en/configuration)
### json
Type: `boolean`
Prints the test results in JSON. This mode will send all other test output and user messages to stderr. (https://jestjs.io/docs/en/cli#json)
### maxWorkers
Alias(es): w
Type: `number | string`
Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. Useful for CI. (its usually best not to override this default) (https://jestjs.io/docs/en/cli#maxworkers-num)
### onlyChanged
Alias(es): o
Type: `boolean`
Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a git or hg repository at the moment. (https://jestjs.io/docs/en/cli#onlychanged)
### outputFile
Type: `string`
Write test results to a file when the --json option is also specified. (https://jestjs.io/docs/en/cli#outputfile-filename)
### passWithNoTests
Type: `boolean`
Will not fail if no tests are found (for example while using `--testPathPattern`.) (https://jestjs.io/docs/en/cli#passwithnotests)
### reporters
Type: `array`
Run tests with specified reporters. Reporter options are not available via CLI. Example with multiple reporters: jest --reporters="default" --reporters="jest-junit" (https://jestjs.io/docs/en/cli#reporters)
### runInBand
Alias(es): i
Type: `boolean`
Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI. (https://jestjs.io/docs/en/cli#runinband)
### setupFile
Type: `string`
The name of a setup file used by Jest. (https://jestjs.io/docs/en/configuration#setupfilesafterenv-array)
### showConfig
Type: `boolean`
Print your Jest config and then exits. (https://jestjs.io/docs/en/cli#--showconfig)
### silent
Type: `boolean`
Prevent tests from printing messages through the console. (https://jestjs.io/docs/en/cli#silent)
### testFile
Type: `string`
The name of the file to test.
### testLocationInResults
Type: `boolean`
Adds a location field to test results. Used to report location of a test in a reporter. { "column": 4, "line": 5 } (https://jestjs.io/docs/en/cli#testlocationinresults)
### testNamePattern
Alias(es): t
Type: `string`
Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/en/cli#testnamepattern-regex)
### testPathPattern
Type: `array`
An array of regexp pattern strings that is matched against all tests paths before executing the test. (https://jestjs.io/docs/en/cli#testpathpattern-regex)
### testResultsProcessor
Type: `string`
Node module that implements a custom results processor. (https://jestjs.io/docs/en/configuration#testresultsprocessor-string)
### tsConfig
Type: `string`
The name of the Typescript configuration file.
### updateSnapshot
Alias(es): u
Type: `boolean`
Use this flag to re-record snapshots. Can be used together with a test suite pattern or with `--testNamePattern` to re-record snapshot for test matching the pattern. (https://jestjs.io/docs/en/cli#updatesnapshot)
### useStderr
Type: `boolean`
Divert all output to stderr.
### verbose
Type: `boolean`
Display individual test results with the test suite hierarchy. (https://jestjs.io/docs/en/cli#verbose)
### watch
Type: `boolean`
Watch files for changes and rerun tests related to changed files. If you want to re-run all tests when a file has changed, use the `--watchAll` option. (https://jestjs.io/docs/en/cli#watch)
### watchAll
Type: `boolean`
Watch files for changes and rerun all tests when something changes. If you want to re-run only the tests that depend on the changed files, use the `--watch` option. (https://jestjs.io/docs/en/cli#watchall)
+110
View File
@@ -0,0 +1,110 @@
# lint
Lint a project
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### cache
Default: `false`
Type: `boolean`
Only check changed files.
### cacheLocation
Type: `string`
Path to the cache file or directory.
### config
Type: `string`
The name of the configuration file.
### exclude
Type: `array`
Files to exclude from linting.
### files
Type: `array`
Files to include in linting.
### fix
Default: `false`
Type: `boolean`
Fixes linting errors (may overwrite linted files).
### force
Default: `false`
Type: `boolean`
Succeeds even if there was linting errors.
### format
Default: `stylish`
Type: `string`
ESLint Output formatter (https://eslint.org/docs/user-guide/formatters).
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### maxWarnings
Default: `-1`
Type: `number`
Number of warnings to trigger nonzero exit code - default: -1
### outputFile
Type: `string`
File to write report to.
### quiet
Default: `false`
Type: `boolean`
Report errors only - default: false
### silent
Default: `false`
Type: `boolean`
Hide output text.
### tsConfig
Type: `string | string[]`
The name of the TypeScript configuration file.
@@ -0,0 +1,89 @@
# application
Create a nest application
## Usage
```bash
nx generate application ...
```
```bash
nx g app ... # same
```
By default, Nx will search for `application` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/nest:application ...
```
Show what will be generated without writing to disk:
```bash
nx g application ... --dry-run
```
## Options
### directory
Type: `string`
The directory of the new application.
### frontendProject
Type: `string`
Frontend project that needs to access this application. This sets up proxy configuration.
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
The name of the application.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipPackageJson
Default: `false`
Type: `boolean`
Do not add dependencies to package.json.
### tags
Type: `string`
Add tags to the application (used for linting)
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
+147
View File
@@ -0,0 +1,147 @@
# library
Create a new nest library
## Usage
```bash
nx generate library ...
```
```bash
nx g lib ... # same
```
By default, Nx will search for `library` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/nest:library ...
```
Show what will be generated without writing to disk:
```bash
nx g library ... --dry-run
```
### Examples
Generate libs/myapp/mylib:
```bash
nx g lib mylib --directory=myapp
```
## Options
### controller
Default: `false`
Type: `boolean`
Include a controller with the library
### directory
Alias(es): d
Type: `string`
A directory where the app is placed
### global
Default: `false`
Type: `boolean`
Add the Global decorator to the generated module.
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
Library name
### publishable
Alias(es): buildable
Type: `boolean`
Create a buildable library.
### service
Default: `false`
Type: `boolean`
Include a service with the library.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipTsConfig
Default: `false`
Type: `boolean`
Do not update tsconfig.json for development experience.
### tags
Alias(es): t
Type: `string`
Add tags to the library (used for linting)
### target
Default: `es6`
Type: `string`
Possible values: `es5`, `es6`, `esnext`, `es2015`, `es2016`, `es2017`, `es2018`, `es2019`, `es2020`
The es target, Nest suggest using es6 or higher.
### testEnvironment
Default: `node`
Type: `string`
Possible values: `jsdom`, `node`
The test environment for jest, for node applications this should stay as node unless doing DOM testing.
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
+38
View File
@@ -0,0 +1,38 @@
# build
Build a Next.js app
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### fileReplacements
Type: `object[]`
Replace files with other files in the build.
#### replace
Type: `string`
undefined
#### with
Type: `string`
undefined
### outputPath
Type: `string`
The output path of the generated files.
### root
Type: `string`
The source root
+28
View File
@@ -0,0 +1,28 @@
# export
Export a Next.js app. The exported application is located at dist/\$outputPath/exported.
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### buildTarget
Type: `string`
Target which builds the application
### silent
Default: `false`
Type: `boolean`
Hide progress or not (default is false)
### threads
Type: `number`
Number of worker threads to utilize (defaults to the number of CPUs)
+64
View File
@@ -0,0 +1,64 @@
# server
Serve a Next.js app
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### buildTarget
Type: `string`
Target which builds the application
### customServerPath
Type: `string`
Use a custom server script
### dev
Default: `true`
Type: `boolean`
Serve the application in the dev mode
### hostname
Type: `string`
Hostname on which the application is served.
### port
Default: `4200`
Type: `number`
Port to listen on.
### proxyConfig
Type: `string`
Path to the proxy configuration file.
### quiet
Default: `false`
Type: `boolean`
Hide error messages containing server information.
### staticMarkup
Default: `false`
Type: `boolean`
Static markup.
@@ -0,0 +1,123 @@
# application
Create a Next.js application
## Usage
```bash
nx generate application ...
```
```bash
nx g app ... # same
```
By default, Nx will search for `application` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/next:application ...
```
Show what will be generated without writing to disk:
```bash
nx g application ... --dry-run
```
### Examples
Generate apps/myorg/myapp and apps/myorg/myapp-e2e:
```bash
nx g app myapp --directory=myorg
```
## Options
### directory
Alias(es): d
Type: `string`
The directory of the new application.
### e2eTestRunner
Default: `cypress`
Type: `string`
Possible values: `cypress`, `none`
Test runner to use for end to end (e2e) tests
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
The name of the application.
### server
Type: `string`
The server script path to be used with next.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipWorkspaceJson
Default: `false`
Type: `boolean`
Skip updating workspace.json with default schematic options based on values provided to this app (e.g. babel, style)
### style
Alias(es): s
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`
The file extension to be used for style files.
### tags
Alias(es): t
Type: `string`
Add tags to the application (used for linting)
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
+107
View File
@@ -0,0 +1,107 @@
# component
Create a React component
## Usage
```bash
nx generate component ...
```
By default, Nx will search for `component` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/next:component ...
```
Show what will be generated without writing to disk:
```bash
nx g component ... --dry-run
```
### Examples
Generate a component in the mylib library:
```bash
nx g component my-component --project=mylib
```
Generate a class component in the mylib library:
```bash
nx g component my-component --project=mylib --classComponent
```
## Options
### directory
Alias(es): d
Type: `string`
Create the component under this directory (can be nested).
### export
Alias(es): e
Default: `false`
Type: `boolean`
When true, the component is exported from the project index.ts (if it exists).
### flat
Default: `false`
Type: `boolean`
Create component at the source root rather than its own directory.
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### name
Type: `string`
The name of the component.
### project
Alias(es): p
Type: `string`
The name of the project.
### skipTests
Default: `false`
Type: `boolean`
When true, does not create "spec.ts" test files for the new component.
### style
Alias(es): s
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`
The file extension to be used for style files.
+99
View File
@@ -0,0 +1,99 @@
# page
Create a Next.js page component
## Usage
```bash
nx generate page ...
```
By default, Nx will search for `page` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/next:page ...
```
Show what will be generated without writing to disk:
```bash
nx g page ... --dry-run
```
### Examples
Generate a component in the mylib library:
```bash
nx g component my-component --project=mylib
```
Generate a class component in the mylib library:
```bash
nx g component my-component --project=mylib --classComponent
```
## Options
### export
Alias(es): e
Default: `false`
Type: `boolean`
When true, the component is exported from the project index.ts (if it exists).
### flat
Default: `false`
Type: `boolean`
Create component at the source root rather than its own directory.
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### name
Type: `string`
The name of the component.
### project
Alias(es): p
Type: `string`
The name of the project.
### style
Alias(es): s
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`, `none`
The file extension to be used for style files.
### withTests
Default: `false`
Type: `boolean`
When true, creates a "spec.ts" test file for the new page.
+154
View File
@@ -0,0 +1,154 @@
# build
Build a Node application
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### assets
Type: `array`
List of static application assets.
### buildLibsFromSource
Default: `false`
Type: `boolean`
Read buildable libraries from source instead of building them separately.
### externalDependencies
Default: `all`
Type: `string | string[]`
Dependencies to keep external to the bundle. ("all" (default), "none", or an array of module names)
### extractLicenses
Default: `false`
Type: `boolean`
Extract all licenses in a separate file, in the case of production builds only.
### fileReplacements
Type: `object[]`
Replace files with other files in the build.
#### replace
Type: `string`
undefined
#### with
Type: `string`
undefined
### main
Type: `string`
The name of the main entry-point file.
### maxWorkers
Type: `number`
Number of workers to use for type checking. (defaults to # of CPUS - 2)
### memoryLimit
Type: `number`
Memory limit for type checking service process in MB. (defaults to 2048)
### optimization
Default: `false`
Type: `boolean`
Defines the optimization level of the build.
### outputPath
Type: `string`
The output path of the generated files.
### poll
Type: `number`
Frequency of file watcher in ms.
### progress
Default: `false`
Type: `boolean`
Log progress to the console while building.
### showCircularDependencies
Default: `true`
Type: `boolean`
Show circular dependency warnings on builds.
### sourceMap
Default: `true`
Type: `boolean`
Produce source maps.
### statsJson
Default: `false`
Type: `boolean`
Generates a 'stats.json' file which can be analyzed using tools such as: #webpack-bundle-analyzer' or https: //webpack.github.io/analyse.
### tsConfig
Type: `string`
The name of the Typescript configuration file.
### verbose
Default: `false`
Type: `boolean`
Emits verbose output
### watch
Default: `false`
Type: `boolean`
Run build when files change.
### webpackConfig
Type: `string`
Path to a function which takes a webpack config, context and returns the resulting webpack config
+64
View File
@@ -0,0 +1,64 @@
# execute
Execute a Node application
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### args
Type: `array`
Extra args when starting the app
### buildTarget
Type: `string`
The target to run to build you the app
### host
Default: `localhost`
Type: `string`
The host to inspect the process on
### inspect
Default: `inspect`
Type: `string | boolean`
Ensures the app is starting with debugging
### port
Default: `0`
Type: `number`
The port to inspect the process on. Setting port to 0 will assign random free ports to all forked processes.
### runtimeArgs
Type: `array`
Extra args passed to the node process
### waitUntilTargets
Type: `array`
The targets to run to before starting the node app
### watch
Default: `true`
Type: `boolean`
Run build when files change
+62
View File
@@ -0,0 +1,62 @@
# package
Package a Node library
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### assets
Type: `array`
List of static library assets.
### main
Type: `string`
The name of the main entry-point file.
### outputPath
Type: `string`
The output path of the generated files.
### packageJson
Type: `string`
The name of the package.json file
### sourceMap
Default: `true`
Type: `boolean`
Output sourcemaps.
### tsConfig
Type: `string`
The name of the Typescript configuration file.
### updateBuildableProjectDepsInPackageJson
Default: `true`
Type: `boolean`
Update buildable project dependencies in package.json
### watch
Default: `false`
Type: `boolean`
Enable re-building when files change.
@@ -0,0 +1,89 @@
# application
Create a node application
## Usage
```bash
nx generate application ...
```
```bash
nx g app ... # same
```
By default, Nx will search for `application` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/node:application ...
```
Show what will be generated without writing to disk:
```bash
nx g application ... --dry-run
```
## Options
### directory
Type: `string`
The directory of the new application.
### frontendProject
Type: `string`
Frontend project that needs to access this application. This sets up proxy configuration.
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
The name of the application.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipPackageJson
Default: `false`
Type: `boolean`
Do not add dependencies to package.json.
### tags
Type: `string`
Add tags to the application (used for linting)
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
+113
View File
@@ -0,0 +1,113 @@
# library
Create a library
## Usage
```bash
nx generate library ...
```
```bash
nx g lib ... # same
```
By default, Nx will search for `library` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/node:library ...
```
Show what will be generated without writing to disk:
```bash
nx g library ... --dry-run
```
### Examples
Generate libs/myapp/mylib:
```bash
nx g lib mylib --directory=myapp
```
## Options
### directory
Alias(es): d
Type: `string`
A directory where the lib is placed
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
Library name
### publishable
Alias(es): buildable
Type: `boolean`
Create a publishable library.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipTsConfig
Default: `false`
Type: `boolean`
Do not update tsconfig.json for development experience.
### tags
Alias(es): t
Type: `string`
Add tags to the library (used for linting)
### testEnvironment
Default: `jsdom`
Type: `string`
Possible values: `jsdom`, `node`
The test environment to use if unitTestRunner is set to jest
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
+26
View File
@@ -0,0 +1,26 @@
# e2e
Creates and runs an e2e for a Nx Plugin
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### jestConfig
Type: `string`
Jest config file
### target
Type: `string`
the target Nx Plugin project and build
### tsSpecConfig
Type: `string`
Spec tsconfig file
@@ -0,0 +1,65 @@
# builder
Create a builder for an Nx Plugin
## Usage
```bash
nx generate builder ...
```
By default, Nx will search for `builder` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/nx-plugin:builder ...
```
Show what will be generated without writing to disk:
```bash
nx g builder ... --dry-run
```
### Examples
Generate libs/my-plugin/src/builders/my-builder:
```bash
nx g builder my-builder --project=my-plugin
```
## Options
### description
Alias(es): d
Type: `string`
Builder description
### name
Type: `string`
Builder name
### project
Alias(es): p
Type: `string`
The name of the project.
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
@@ -0,0 +1,83 @@
# migration
Create a migration for an Nx Plugin
## Usage
```bash
nx generate migration ...
```
By default, Nx will search for `migration` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/nx-plugin:migration ...
```
Show what will be generated without writing to disk:
```bash
nx g migration ... --dry-run
```
### Examples
Generate libs/my-plugin/src/migrations/my-migration:
```bash
nx g migration my-migration --project=my-plugin --version=1.0.0
```
## Options
### description
Alias(es): d
Type: `string`
Migration description
### name
Type: `string`
Migration name
### packageJsonUpdates
Alias(es): p
Default: `false`
Type: `boolean`
Whether or not to include package.json updates
### project
Alias(es): p
Type: `string`
The name of the project.
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
### version
Alias(es): v
Type: `string`
Version to use for the migration
@@ -0,0 +1,91 @@
# plugin
Create a Nx Plugin
## Usage
```bash
nx generate plugin ...
```
By default, Nx will search for `plugin` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/nx-plugin:plugin ...
```
Show what will be generated without writing to disk:
```bash
nx g plugin ... --dry-run
```
### Examples
Generate libs/plugins/my-plugin:
```bash
nx g plugin my-plugin --directory=plugins
```
## Options
### directory
Alias(es): d
Type: `string`
A directory where the plugin is placed
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
Plugin name
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipTsConfig
Default: `false`
Type: `boolean`
Do not update tsconfig.json for development experience.
### tags
Alias(es): t
Type: `string`
Add tags to the library (used for linting)
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
@@ -0,0 +1,65 @@
# schematic
Create a schematic for an Nx Plugin
## Usage
```bash
nx generate schematic ...
```
By default, Nx will search for `schematic` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/nx-plugin:schematic ...
```
Show what will be generated without writing to disk:
```bash
nx g schematic ... --dry-run
```
### Examples
Generate libs/my-plugin/src/schematics/my-schematic:
```bash
nx g schematic my-schematic --project=my-plugin
```
## Options
### description
Alias(es): d
Type: `string`
Schematic description
### name
Type: `string`
Schematic name
### project
Alias(es): p
Type: `string`
The name of the project.
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
@@ -0,0 +1,165 @@
# application
Create an application
## Usage
```bash
nx generate application ...
```
```bash
nx g app ... # same
```
By default, Nx will search for `application` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/react:application ...
```
Show what will be generated without writing to disk:
```bash
nx g application ... --dry-run
```
### Examples
Generate apps/myorg/myapp and apps/myorg/myapp-e2e:
```bash
nx g app myapp --directory=myorg
```
Use class components instead of functional components:
```bash
nx g app myapp --classComponent
```
Set up React Router:
```bash
nx g app myapp --routing
```
## Options
### classComponent
Alias(es): C
Default: `false`
Type: `boolean`
Use class components instead of functional component.
### directory
Alias(es): d
Type: `string`
The directory of the new application.
### e2eTestRunner
Default: `cypress`
Type: `string`
Possible values: `cypress`, `none`
Test runner to use for end to end (e2e) tests.
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
The name of the application.
### pascalCaseFiles
Alias(es): P
Default: `false`
Type: `boolean`
Use pascal case component file name (e.g. App.tsx).
### routing
Default: `false`
Type: `boolean`
Generate application with routes.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files.
### skipWorkspaceJson
Default: `false`
Type: `boolean`
Skip updating workspace.json with default schematic options based on values provided to this app (e.g. babel, style).
### style
Alias(es): s
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`, `none`
The file extension to be used for style files.
### tags
Alias(es): t
Type: `string`
Add tags to the application (used for linting).
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests.
@@ -0,0 +1,45 @@
# component-cypress-spec
Create a cypress spec for a ui component that has a story
## Usage
```bash
nx generate component-cypress-spec ...
```
By default, Nx will search for `component-cypress-spec` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/react:component-cypress-spec ...
```
Show what will be generated without writing to disk:
```bash
nx g component-cypress-spec ... --dry-run
```
## Options
### componentPath
Type: `string`
Relative path to the component file from the library root?
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### project
Type: `string`
The project name for which to generate tests.
@@ -0,0 +1,37 @@
# component-story
Generate storybook story for a react component
## Usage
```bash
nx generate component-story ...
```
By default, Nx will search for `component-story` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/react:component-story ...
```
Show what will be generated without writing to disk:
```bash
nx g component-story ... --dry-run
```
## Options
### componentPath
Type: `string`
Relative path to the component file from the library root
### project
Type: `string`
The project name where to add the components.
+137
View File
@@ -0,0 +1,137 @@
# component
Create a component
## Usage
```bash
nx generate component ...
```
```bash
nx g c ... # same
```
By default, Nx will search for `component` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/react:component ...
```
Show what will be generated without writing to disk:
```bash
nx g component ... --dry-run
```
### Examples
Generate a component in the mylib library:
```bash
nx g component my-component --project=mylib
```
Generate a class component in the mylib library:
```bash
nx g component my-component --project=mylib --classComponent
```
## Options
### classComponent
Alias(es): C
Default: `false`
Type: `boolean`
Use class components instead of functional component.
### directory
Alias(es): d
Type: `string`
Create the component under this directory (can be nested).
### export
Alias(es): e
Default: `false`
Type: `boolean`
When true, the component is exported from the project index.ts (if it exists).
### flat
Default: `false`
Type: `boolean`
Create component at the source root rather than its own directory.
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### name
Type: `string`
The name of the component.
### pascalCaseFiles
Alias(es): P
Default: `false`
Type: `boolean`
Use pascal case component file name (e.g. App.tsx).
### project
Alias(es): p
Type: `string`
The name of the project.
### routing
Type: `boolean`
Generate a library with routes.
### skipTests
Default: `false`
Type: `boolean`
When true, does not create "spec.ts" test files for the new component.
### style
Alias(es): s
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`, `none`
The file extension to be used for style files.
+161
View File
@@ -0,0 +1,161 @@
# library
Create a library
## Usage
```bash
nx generate library ...
```
```bash
nx g lib ... # same
```
By default, Nx will search for `library` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/react:library ...
```
Show what will be generated without writing to disk:
```bash
nx g library ... --dry-run
```
### Examples
Generate libs/myapp/mylib:
```bash
nx g lib mylib --directory=myapp
```
Generate a library with routes and add them to myapp:
```bash
nx g lib mylib --appProject=myapp
```
## Options
### appProject
Alias(es): a
Type: `string`
The application project to add the library route to.
### component
Default: `true`
Type: `boolean`
Generate a default component.
### directory
Alias(es): d
Type: `string`
A directory where the lib is placed.
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
Library name
### pascalCaseFiles
Alias(es): P
Default: `false`
Type: `boolean`
Use pascal case component file name (e.g. App.tsx).
### publishable
Alias(es): buildable
Type: `boolean`
Create a buildable library.
### routing
Type: `boolean`
Generate library with routes.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files.
### skipTsConfig
Default: `false`
Type: `boolean`
Do not update tsconfig.json for development experience.
### style
Alias(es): s
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`, `styled-components`, `@emotion/styled`, `styled-jsx`, `none`
The file extension to be used for style files.
### tags
Alias(es): t
Type: `string`
Add tags to the library (used for linting).
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests.
+67
View File
@@ -0,0 +1,67 @@
# redux
Create a redux slice for a project
## Usage
```bash
nx generate redux ...
```
```bash
nx g slice ... # same
```
By default, Nx will search for `redux` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/react:redux ...
```
Show what will be generated without writing to disk:
```bash
nx g redux ... --dry-run
```
## Options
### appProject
Alias(es): a
Type: `string`
The application project to add the slice to.
### directory
Alias(es): d
Type: `string`
The name of the folder used to contain/group the generated Redux files.
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### name
Type: `string`
Redux slice name.
### project
Alias(es): p
Type: `string`
The name of the project to add the slice to. If it is an application, then the store configuration will be updated too.
+45
View File
@@ -0,0 +1,45 @@
# stories
Create stories/specs for all components declared in a library
## Usage
```bash
nx generate stories ...
```
By default, Nx will search for `stories` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/react:stories ...
```
Show what will be generated without writing to disk:
```bash
nx g stories ... --dry-run
```
## Options
### generateCypressSpecs
Type: `boolean`
Automatically generate \*.spec.ts files in the cypress e2e app generated by the cypress-configure schematic.
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### project
Type: `string`
The library project name.
@@ -0,0 +1,61 @@
# storybook-configuration
Set up storybook for a react library
## Usage
```bash
nx generate storybook-configuration ...
```
By default, Nx will search for `storybook-configuration` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/react:storybook-configuration ...
```
Show what will be generated without writing to disk:
```bash
nx g storybook-configuration ... --dry-run
```
## Options
### configureCypress
Type: `boolean`
Run the cypress-configure schematic.
### generateStories
Type: `boolean`
Automatically generate \*.stories.ts files for components declared in this library.
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files.
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
Library name
+38
View File
@@ -0,0 +1,38 @@
# build
Build Storybook
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### docsMode
Default: `false`
Type: `boolean`
Build a documentation-only site using addon-docs.
### outputPath
Type: `string`
The output path of the generated files.
### quiet
Default: `true`
Type: `boolean`
Suppress verbose build output.
### uiFramework (**hidden**)
Default: `@storybook/angular`
Type: `string`
Storybook framework npm package
@@ -0,0 +1,82 @@
# storybook
Serve Storybook
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### docsMode
Default: `false`
Type: `boolean`
Build a documentation-only site using addon-docs.
### host
Default: `localhost`
Type: `string`
Host to listen on.
### port
Default: `9009`
Type: `number`
Port to listen on.
### quiet
Default: `true`
Type: `boolean`
Suppress verbose build output.
### ssl
Default: `false`
Type: `boolean`
Serve using HTTPS.
### sslCert
Type: `string`
SSL certificate to use for serving HTTPS.
### sslKey
Type: `string`
SSL key to use for serving HTTPS.
### staticDir
Type: `array`
Directory where to load static files from, array of strings
### uiFramework (**hidden**)
Default: `@storybook/angular`
Type: `string`
Storybook framework npm package
### watch
Default: `true`
Type: `boolean`
Watches for changes and rebuilds application
@@ -0,0 +1,63 @@
# configuration
Add storybook configuration to a ui library
## Usage
```bash
nx generate configuration ...
```
By default, Nx will search for `configuration` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/storybook:configuration ...
```
Show what will be generated without writing to disk:
```bash
nx g configuration ... --dry-run
```
## Options
### configureCypress
Type: `boolean`
Run the cypress-configure schematic
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
Library name
### uiFramework
Type: `string`
Possible values: `@storybook/angular`, `@storybook/react`
Storybook UI Framework to use
@@ -0,0 +1,49 @@
# cypress-project
Add cypress e2e app to test a ui library that is set up for storybook
## Usage
```bash
nx generate cypress-project ...
```
By default, Nx will search for `cypress-project` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/storybook:cypress-project ...
```
Show what will be generated without writing to disk:
```bash
nx g cypress-project ... --dry-run
```
## Options
### js
Default: `false`
Type: `boolean`
Generate JavaScript files rather than TypeScript files
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
Library name
+244
View File
@@ -0,0 +1,244 @@
# build
Build a application
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### assets
Type: `array`
List of static application assets.
### baseHref
Default: `/`
Type: `string`
Base url for the application being built.
### budgets
Type: `array`
Budget thresholds to ensure parts of your application stay within boundaries which you set.
### buildLibsFromSource
Default: `false`
Type: `boolean`
Read buildable libraries from source instead of building them separately.
### commonChunk
Default: `true`
Type: `boolean`
Use a separate bundle containing code used across multiple bundles.
### crossOrigin
Type: `string`
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
### deployUrl
Type: `string`
URL where the application will be deployed.
### es2015Polyfills
Type: `string`
Conditional polyfills loaded in browsers which do not support ES2015.
### extractCss
Default: `false`
Type: `boolean`
Extract css into a .css file
### extractLicenses
Default: `false`
Type: `boolean`
Extract all licenses in a separate file, in the case of production builds only.
### fileReplacements
Type: `object[]`
Replace files with other files in the build.
#### replace
Type: `string`
undefined
#### with
Type: `string`
undefined
### index
Type: `string`
HTML File which will be contain the application
### main
Type: `string`
The name of the main entry-point file.
### maxWorkers
Type: `number`
Number of workers to use for type checking. (defaults to # of CPUS - 2)
### memoryLimit
Type: `number`
Memory limit for type checking service process in MB. (defaults to 2048)
### namedChunks
Default: `true`
Type: `boolean`
Names the produced bundles according to their entry file
### optimization
Type: `boolean`
Enables optimization of the build output.
### outputHashing
Default: `none`
Type: `string`
Possible values: `none`, `all`, `media`, `bundles`
Define the output filename cache-busting hashing mode.
### outputPath
Type: `string`
The output path of the generated files.
### polyfills
Type: `string`
Polyfills to load before application
### progress
Default: `false`
Type: `boolean`
Log progress to the console while building.
### scripts
Type: `array`
External Scripts which will be included before the main application entry
### showCircularDependencies
Default: `true`
Type: `boolean`
Show circular dependency warnings on builds.
### sourceMap
Default: `true`
Type: `boolean`
Output sourcemaps.
### statsJson
Default: `false`
Type: `boolean`
Generates a 'stats.json' file which can be analyzed using tools such as: #webpack-bundle-analyzer' or https://webpack.github.io/analyse.
### styles
Type: `array`
External Styles which will be included with the application
### subresourceIntegrity
Default: `false`
Type: `boolean`
Enables the use of subresource integrity validation.
### tsConfig
Type: `string`
The name of the Typescript configuration file.
### vendorChunk
Default: `true`
Type: `boolean`
Use a separate bundle containing only vendor libraries.
### verbose
Default: `false`
Type: `boolean`
Emits verbose output
### watch
Default: `false`
Type: `boolean`
Enable re-building when files change.
### webpackConfig
Type: `string`
Path to a function which takes a webpack config, some context and returns the resulting webpack config
+98
View File
@@ -0,0 +1,98 @@
# dev-server
Serve a web application
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### allowedHosts
Type: `string`
This option allows you to whitelist services that are allowed to access the dev server.
### buildTarget
Type: `string`
Target which builds the application
### host
Default: `localhost`
Type: `string`
Host to listen on.
### liveReload
Default: `true`
Type: `boolean`
Whether to reload the page on change, using live-reload.
### maxWorkers
Type: `number`
Number of workers to use for type checking.
### memoryLimit
Type: `number`
Memory limit for type checking service process in MB.
### open
Default: `false`
Type: `boolean`
Open the application in the browser.
### port
Default: `4200`
Type: `number`
Port to listen on.
### publicHost
Type: `string`
Public URL where the application will be served
### ssl
Default: `false`
Type: `boolean`
Serve using HTTPS.
### sslCert
Type: `string`
SSL certificate to use for serving HTTPS.
### sslKey
Type: `string`
SSL key to use for serving HTTPS.
### watch
Default: `true`
Type: `boolean`
Watches for changes and rebuilds application
+104
View File
@@ -0,0 +1,104 @@
# package
Package a library
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Properties
### assets
Type: `array`
List of static assets.
### babelConfig
Type: `string`
(deprecated) Path to a function which takes a babel config and returns an updated babel config
### entryFile
Type: `string`
The path to the entry file, relative to project.
### external
Type: `array`
A list of external modules that will not be bundled (react, react-dom, etc.).
### extractCss
Default: `true`
Type: `boolean`
CSS files will be extracted to the output folder.
### globals
Type: `object[]`
A mapping of node modules to their UMD global names. Used by the UMD bundle
#### moduleId
Type: `string`
The node module to map from (e.g. `react-dom`).
#### global
Type: `string`
The global name to map to (e.g. `ReactDOM`).
### outputPath
Type: `string`
The output path of the generated files.
### project
Type: `string`
The path to package.json file.
### rollupConfig
Type: `string`
Path to a function which takes a rollup config and returns an updated rollup config
### tsConfig
Type: `string`
The path to tsconfig file.
### umdName
Type: `string`
The name of your module in UMD format. Defaulted to your project name.
### updateBuildableProjectDepsInPackageJson
Default: `true`
Type: `boolean`
Update buildable project dependencies in package.json
### watch
Default: `false`
Type: `boolean`
Enable re-building when files change.
@@ -0,0 +1,95 @@
# application
Create an application
## Usage
```bash
nx generate application ...
```
```bash
nx g app ... # same
```
By default, Nx will search for `application` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/web:application ...
```
Show what will be generated without writing to disk:
```bash
nx g application ... --dry-run
```
## Options
### directory
Type: `string`
The directory of the new application.
### e2eTestRunner
Default: `cypress`
Type: `string`
Possible values: `cypress`, `none`
Test runner to use for end to end (e2e) tests
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
The name of the application.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### style
Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`
The file extension to be used for style files.
### tags
Type: `string`
Add tags to the application (used for linting)
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
@@ -0,0 +1,220 @@
# run-commands
Run any custom commands with Nx
Builder properties can be configured in workspace.json when defining the builder, or when invoking it.
Read more about how to use builders and the CLI here: https://nx.dev/node/guides/cli.
## Examples
`workspace.json`:
```json
//...
"frontend": {
"architect": {
//...
"ls-project-root": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": "ls apps/frontend/src"
}
}
}
}
```
```bash
nx run frontend:ls-project-root
```
##### Chaining commands, interpolating args and setting the cwd
Let's say each of our workspace projects has some custom bash scripts in a `scripts` folder.
We want a simple way to create empty bash script files for a given project, that have the execute permissions already set.
Given that Nx knows our workspace structure, we should be able to give it a project and the name of our script, and it should take care of the rest.
The `commands` option accepts as many commands as you want. By default, they all run in parallel.
You can run them sequentially by setting `parallel: false`:
```json
"create-script": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"mkdir -p scripts",
"touch scripts/{args.name}.sh",
"chmod +x scripts/{args.name}.sh"
],
"cwd": "apps/frontend",
"parallel": false
}
}
```
By setting the `cwd` option, each command will run in the `apps/frontend` folder.
We run the above with:
```bash
nx run frontend:create-script --args="--name=example"
```
or simply with:
```bash
nx run frontend:create-script --name=example
```
##### Arguments forwarding
When interpolation is not present in the command, all arguments are forwarded to the command by default.
This is useful when you need to pass raw argument strings to your command.
For example, when you run:
nx run frontend:webpack --args="--config=example.config.js"
```json
"webpack": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": "webpack"
}
}
```
The above command will execute: `webpack --config=example.config.js`
This functionality can be disabled by using `commands` and expanding each `command` into an object
that sets the `forwardAllArgs` option to `false` as shown below:
```json
"webpack": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "webpack",
"forwardAllArgs": false
}
]
}
}
```
##### Custom **done** conditions
Normally, `run-commands` considers the commands done when all of them have finished running. If you don't need to wait until they're all done, you can set a special string, that considers the command finished the moment the string appears in `stdout` or `stderr`:
```json
"finish-when-ready": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": "echo 'READY' && sleep 5 && echo 'FINISHED'",
"readyWhen": "READY"
}
}
```
```bash
nx run frontend:finish-when-ready
```
The above command will finish immediately, instead of waiting for 5 seconds.
##### Nx Affected
The true power of `run-commands` comes from the fact that it runs through `nx`, which knows about your dependency graph. So you can run **custom commands** only for the projects that have been affected by a change.
We can create some configurations to generate docs, and if run using `nx affected`, it will only generate documentation for the projects that have been changed:
```bash
nx affected --target=generate-docs
```
```json
//...
"frontend": {
"architect": {
//...
"generate-docs": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": "npx compodoc -p apps/frontend/tsconfig.app.json"
}
}
}
},
"api": {
"architect": {
//...
"generate-docs": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": "npx compodoc -p apps/api/tsconfig.app.json"
}
}
}
}
```
## Properties
### args
Type: `string`
Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd)
### color
Default: `false`
Type: `boolean`
Use colors when showing output of command
### command
Type: `string`
Command to run in child process
### commands
Type: `array`
### cwd
Type: `string`
Current working directory of the commands.
### envFile
Type: `string`
You may specify a custom .env file path
### outputPath
Type: `string | string[]`
Tells Nx where the files will be created
### parallel
Default: `true`
Type: `boolean`
Run commands in parallel
### readyWhen
Type: `string`
String to appear in stdout or stderr that indicates that the task is done. This option can only be used when parallel is set to true. If not specified, the task is done when all the child processes complete.
@@ -0,0 +1,101 @@
# library
Create a library
## Usage
```bash
nx generate library ...
```
```bash
nx g lib ... # same
```
By default, Nx will search for `library` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/workspace:library ...
```
Show what will be generated without writing to disk:
```bash
nx g library ... --dry-run
```
### Examples
Generate libs/myapp/mylib:
```bash
nx g lib mylib --directory=myapp
```
## Options
### directory
Type: `string`
A directory where the lib is placed
### linter
Default: `tslint`
Type: `string`
Possible values: `eslint`, `tslint`
The tool to use for running lint checks.
### name
Type: `string`
Library name
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
### skipTsConfig
Default: `false`
Type: `boolean`
Do not update tsconfig.json for development experience.
### tags
Type: `string`
Add tags to the library (used for linting)
### testEnvironment
Default: `jsdom`
Type: `string`
Possible values: `jsdom`, `node`
The test environment to use if unitTestRunner is set to jest
### unitTestRunner
Default: `jest`
Type: `string`
Possible values: `jest`, `none`
Test runner to use for unit tests
@@ -0,0 +1,51 @@
# move
Move an application or library to another folder
## Usage
```bash
nx generate move ...
```
```bash
nx g mv ... # same
```
By default, Nx will search for `move` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/workspace:move ...
```
Show what will be generated without writing to disk:
```bash
nx g move ... --dry-run
```
### Examples
Move libs/my-feature-lib to libs/shared/my-feature-lib:
```bash
nx g @nrwl/workspace:move --project my-feature-lib shared/my-feature-lib
```
## Options
### destination
Type: `string`
The folder to move the project into
### projectName
Alias(es): project
Type: `string`
The name of the project to move
@@ -0,0 +1,71 @@
# remove
Remove an application or library
## Usage
```bash
nx generate remove ...
```
```bash
nx g rm ... # same
```
By default, Nx will search for `remove` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/workspace:remove ...
```
Show what will be generated without writing to disk:
```bash
nx g remove ... --dry-run
```
### Examples
Remove my-feature-lib from the workspace:
```bash
nx g @nrwl/workspace:remove my-feature-lib
```
Force removal of my-feature-lib from the workspace:
```bash
nx g @nrwl/workspace:remove my-feature-lib --forceRemove
```
## Options
### forceRemove
Alias(es): force-remove
Default: `false`
Type: `boolean`
When true, forces removal even if the project is still in use.
### projectName
Alias(es): project
Type: `string`
The name of the project to remove
### skipFormat
Alias(es): skip-format
Default: `false`
Type: `boolean`
Skip formatting files.
@@ -0,0 +1,55 @@
# run-commands
Generates a target to run any command in the terminal
## Usage
```bash
nx generate run-commands ...
```
```bash
nx g run-command ... # same
```
By default, Nx will search for `run-commands` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/workspace:run-commands ...
```
Show what will be generated without writing to disk:
```bash
nx g run-commands ... --dry-run
```
### Examples
Add the printhello target to my-feature-lib:
```bash
nx g @nrwl/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'
```
## Options
### command
Type: `string`
Command to run
### name
Type: `string`
Target name
### project
Type: `string`
Project name
@@ -0,0 +1,39 @@
# workspace-schematic
Generates a workspace schematic
## Usage
```bash
nx generate workspace-schematic ...
```
By default, Nx will search for `workspace-schematic` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/workspace:workspace-schematic ...
```
Show what will be generated without writing to disk:
```bash
nx g workspace-schematic ... --dry-run
```
## Options
### name
Type: `string`
Schematic name
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files
+14
View File
@@ -0,0 +1,14 @@
[
"angular",
"cypress",
"express",
"jest",
"linter",
"nest",
"next",
"node",
"nx-plugin",
"storybook",
"web",
"workspace"
]
+99
View File
@@ -0,0 +1,99 @@
# affected:apps
Print applications affected by changes
## Usage
```bash
nx affected:apps
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Print the names of all the apps affected by changing the index.ts file:
```bash
nx affected:apps --files=libs/mylib/src/index.ts
```
Print the names of all the apps affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:apps --base=master --head=HEAD
```
Print the names of all the apps affected by the last commit on master:
```bash
nx affected:apps --base=master~1 --head=master
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### only-failed
Default: `false`
Isolate projects which previously failed
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+137
View File
@@ -0,0 +1,137 @@
# affected:build
Build applications and publishable libraries affected by changes
## Usage
```bash
nx affected:build
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run build in parallel:
```bash
nx affected:build --parallel --maxParallel=5
```
Rerun the build target only for the projects that failed last time:
```bash
nx affected:build --only-failed
```
Run the build target for all projects:
```bash
nx affected:build --all
```
Run the build target for the affected projects and also all the projects the affected projects depend on.:
```bash
nx affected:build --with-deps
```
Run build for all the projects affected by changing the index.ts file:
```bash
nx affected:build --files=libs/mylib/src/index.ts
```
Run build for all the projects affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:build --base=master --head=HEAD
```
Run build for all the projects affected by the last commit on master:
```bash
nx affected:build --base=master~1 --head=master
```
Run build for all the projects affected by the last commit on master and their dependencies:
```bash
nx affected:build --base=master~1 --head=master --with-deps
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### maxParallel
Default: `3`
Max number of parallel processes. This flag is ignored if the parallel option is set to `false`.
### only-failed
Default: `false`
Isolate projects which previously failed
### parallel
Default: `false`
Parallelize the command
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+119
View File
@@ -0,0 +1,119 @@
# affected:dep-graph
Graph dependencies affected by changes
## Usage
```bash
nx affected:dep-graph
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Open the dep graph of the workspace in the browser, and highlight the projects affected by changing the index.ts file:
```bash
nx affected:dep-graph --files=libs/mylib/src/index.ts
```
Open the dep graph of the workspace in the browser, and highlight the projects affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:dep-graph --base=master --head=HEAD
```
Save the dep graph of the workspace in a json file, and highlight the projects affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:dep-graph --base=master --head=HEAD --file=output.json
```
Generate a static website with dep graph data in an html file, highlighting the projects affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:dep-graph --base=master --head=HEAD --file=output.html
```
Open the dep graph of the workspace in the browser, and highlight the projects affected by the last commit on master:
```bash
nx affected:dep-graph --base=master~1 --head=master
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### file
output file (e.g. --file=output.json or --file=dep-graph.html)
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### filter
Use to limit the dependency graph to only show specific projects, list of projects delimited by commas.
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### host
Bind the dep graph server to a specific ip address.
### only-failed
Default: `false`
Isolate projects which previously failed
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+125
View File
@@ -0,0 +1,125 @@
# affected:e2e
Run e2e tests for the applications affected by changes
## Usage
```bash
nx affected:e2e
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run tests in parallel:
```bash
nx affected:e2e --parallel --maxParallel=5
```
Rerun the test target only for the projects that failed last time:
```bash
nx affected:e2e --only-failed
```
Run the test target for all projects:
```bash
nx affected:e2e --all
```
Run tests for all the projects affected by changing the index.ts file:
```bash
nx affected:e2e --files=libs/mylib/src/index.ts
```
Run tests for all the projects affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:e2e --base=master --head=HEAD
```
Run tests for all the projects affected by the last commit on master:
```bash
nx affected:e2e --base=master~1 --head=master
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### maxParallel
Default: `3`
Max number of parallel processes. This flag is ignored if the parallel option is set to `false`.
### only-failed
Default: `false`
Isolate projects which previously failed
### parallel
Default: `false`
Parallelize the command
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+99
View File
@@ -0,0 +1,99 @@
# affected:libs
Print libraries affected by changes
## Usage
```bash
nx affected:libs
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Print the names of all the libs affected by changing the index.ts file:
```bash
nx affected:libs --files=libs/mylib/src/index.ts
```
Print the names of all the libs affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:libs --base=master --head=HEAD
```
Print the names of all the libs affected by the last commit on master:
```bash
nx affected:libs --base=master~1 --head=master
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### only-failed
Default: `false`
Isolate projects which previously failed
### plain
Produces a plain output for affected:apps and affected:libs
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+125
View File
@@ -0,0 +1,125 @@
# affected:lint
Lint projects affected by changes
## Usage
```bash
nx affected:lint
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run lint in parallel:
```bash
nx affected:lint --parallel --maxParallel=5
```
Rerun the lint target only for the projects that failed last time:
```bash
nx affected:lint --only-failed
```
Run the lint target for all projects:
```bash
nx affected:lint --all
```
Run lint for all the projects affected by changing the index.ts file:
```bash
nx affected:lint --files=libs/mylib/src/index.ts
```
Run lint for all the projects affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:lint --base=master --head=HEAD
```
Run lint for all the projects affected by the last commit on master:
```bash
nx affected:lint --base=master~1 --head=master
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### maxParallel
Default: `3`
Max number of parallel processes. This flag is ignored if the parallel option is set to `false`.
### only-failed
Default: `false`
Isolate projects which previously failed
### parallel
Default: `false`
Parallelize the command
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+125
View File
@@ -0,0 +1,125 @@
# affected:test
Test projects affected by changes
## Usage
```bash
nx affected:test
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run tests in parallel:
```bash
nx affected:test --parallel --maxParallel=5
```
Rerun the test target only for the projects that failed last time:
```bash
nx affected:test --only-failed
```
Run the test target for all projects:
```bash
nx affected:test --all
```
Run tests for all the projects affected by changing the index.ts file:
```bash
nx affected:test --files=libs/mylib/src/index.ts
```
Run tests for all the projects affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected:test --base=master --head=HEAD
```
Run tests for all the projects affected by the last commit on master:
```bash
nx affected:test --base=master~1 --head=master
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### maxParallel
Default: `3`
Max number of parallel processes. This flag is ignored if the parallel option is set to `false`.
### only-failed
Default: `false`
Isolate projects which previously failed
### parallel
Default: `false`
Parallelize the command
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+147
View File
@@ -0,0 +1,147 @@
# affected
Run task for affected projects
## Usage
```bash
nx affected
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run custom target for all affected projects:
```bash
nx affected --target=custom-target
```
Run tests in parallel:
```bash
nx affected --target=test --parallel --maxParallel=5
```
Rerun the test target only for the projects that failed last time:
```bash
nx affected --target=test --only-failed
```
Run the test target for all projects:
```bash
nx affected --target=test --all
```
Run the test target for the affected projects and also all the projects the affected projects depend on.:
```bash
nx affected --target=test --with-deps
```
Run tests for all the projects affected by changing the index.ts file:
```bash
nx affected --target=test --files=libs/mylib/src/index.ts
```
Run tests for all the projects affected by the changes between master and HEAD (e.g., PR):
```bash
nx affected --target=test --base=master --head=HEAD
```
Run tests for all the projects affected by the last commit on master:
```bash
nx affected --target=test --base=master~1 --head=master
```
Run build for all the projects affected by the last commit on master and their dependencies:
```bash
nx affected --target=build --base=master~1 --head=master --with-deps
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### maxParallel
Default: `3`
Max number of parallel processes. This flag is ignored if the parallel option is set to `false`.
### only-failed
Default: `false`
Isolate projects which previously failed
### parallel
Default: `false`
Parallelize the command
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### target
Task to run for affected projects
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+294
View File
@@ -0,0 +1,294 @@
# build
Compiles an application into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.
## Usage
The `build` command is a built-in alias to the [run command](/{{framework}}/cli/run).
These two commands are equivalent:
```bash
nx build <project> [options]
```
```bash
nx run <project>:build [options]
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Compile a `production` build of the `myapp` project:
```bash
nx build myapp --prod
```
## Options
The options below are common to the `build` command used within an Nx workspace. The Web and Angular-specifc build options are listed after these options.
### baseHref
Default: `/`
Base url for the application being built.
### commonChunk
Use a separate bundle containing code used across multiple bundles.
Default: `true`
### budgets
Budget thresholds to ensure parts of your application stay within boundaries which you set.
### namedChunks
Default: `true`
Names the produced bundles according to their entry file
### deployUrl
URL where the application will be deployed.
### es2015Polyfills
Conditional polyfills loaded in browsers which do not support ES2015.
### extractCss
Extract css into a .css file
### extractLicenses
Extract all licenses in a separate file, in the case of production builds only.
### index
HTML File which will be contain the application
### main
The name of the main entry-point file.
### tsConfig
The name of the Typescript configuration file.
### outputPath
The output path of the generated files.
### progress
Log progress to the console while building.
### optimization
Enables optimization of the build output.
### outputHashing
Default: `none`
Define the output filename cache-busting hashing mode.
### scripts
External Scripts which will be included before the main application entry.
### showCircularDependencies
Default: `true`
Show circular dependency warnings on builds.
### sourceMap
Default: `true`
Output sourcemaps.
### statsJson
Generates a 'stats.json' file which can be analyzed using tools such as: #webpack-bundle-analyzer' or https://webpack.github.io/
analyse.
### styles
External Styles which will be included with the application
### subresourceIntegrity
Enables the use of subresource integrity validation.
### vendorChunk
Default: `true`
Use a separate bundle containing only vendor libraries.
### verbose
Emits verbose output
### watch
Enable re-building when files change.
### help
Show help information
### version
Show version number
## Web-Build Options
### assets
List of static application assets.
### fileReplacements
Replace files with other files in the build.
### maxWorkers
Number of workers to use for type checking.
Default: `# of CPUS - 2`
### memoryLimit
Memory limit for type checking service process in MB.
Default: `2048`
### polyfills
Polyfills to load before application
### stylePreprocessorOptions
Options to pass to style preprocessors.
### webpackConfig
Path to a function which takes a webpack config, some context and returns the resulting webpack config
## Angular Options
### aot
Build using Ahead of Time compilation.
### buildEventLog
**EXPERIMENTAL** Output file path for Build Event Protocol events
### buildOptimizer
Enables `@angular-devkit/build-optimizer` optimizations when using the `--aot` option.
### configuration (-c)
A named build target, as specified in the "configurations" section of angular.json.
Each named target is accompanied by a configuration of option defaults for that target.
Setting this explicitly overrides the "--prod" flag
### crossOrigin
Define the crossorigin attribute setting of elements that provide CORS support.
### deleteOutputPath
Delete the output path before building.
### deployUrl
URL where files will be deployed.
### es5BrowserSupport
Enables conditionally loaded ES2015 polyfills.
### evalSourceMap
Output in-file eval sourcemaps.
### experimentalRollupPass
Concatenate modules with Rollup before bundling them with Webpack.
### forkTypeChecker
Run the TypeScript type checker in a forked process.
### i18nFile
Localization file to use for i18n.
### i18nFormat
Format of the localization file specified with --i18n-file.
### i18nLocale
Locale to use for i18n.
### i18nMissingTranslation
How to handle missing translations for i18n.
### localize
### ngswConfigPath
Path to ngsw-config.json.
### poll
Enable and define the file watching poll time period in milliseconds.
### polyfills
The full path for the polyfills file, relative to the current workspace.
### preserveSymlinks
Do not use the real path when resolving modules.
### rebaseRootRelativeCssUrls
Change root relative URLs in stylesheets to include base HREF and deploy URL. Use only for compatibility and transition. The behavior of this option is non-standard and will be removed in the next major release.
### resourcesOutputPath
The path where style resources will be placed, relative to outputPath.
### serviceWorker
Generates a service worker config for production builds.
### skipAppShell
Flag to prevent building an app shell.
### vendorSourceMap
Resolve vendor packages sourcemaps.
### verbose
Adds more details to output logging.
### webWorkerTsConfig
TypeScript configuration for Web Worker modules.
+69
View File
@@ -0,0 +1,69 @@
# dep-graph
Graph dependencies within workspace
## Usage
```bash
nx dep-graph
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Open the dep graph of the workspace in the browser:
```bash
nx dep-graph
```
Save the dep graph into a json file:
```bash
nx dep-graph --file=output.json
```
Generate a static website with dep graph into an html file, accompanied by an asset folder called static:
```bash
nx dep-graph --file=output.html
```
Show the graph where every node is either an ancestor or a descendant of todos-feature-main.:
```bash
nx dep-graph --filter=todos-feature-main
```
Exclude project-one and project-two from the dep graph.:
```bash
nx dep-graph --exclude=project-one,project-two
```
## Options
### exclude
List of projects delimited by commas to exclude from the dependency graph.
### file
output file (e.g. --file=output.json or --file=dep-graph.html)
### filter
Use to limit the dependency graph to only show specific projects, list of projects delimited by commas.
### help
Show help
### host
Bind the dep graph server to a specific ip address.
### version
Show version number
+141
View File
@@ -0,0 +1,141 @@
# e2e
Builds and serves an app, then runs end-to-end tests using the configured E2E test runner.
## Usage
The `e2e` command is a built-in alias to the [run command](/{{framework}}/cli/run).
These two commands are equivalent:
```bash
nx e2e <project>
```
```bash
nx run <project>:e2e
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run E2E test with a custom base url:
```bash
nx e2e myapp-e2e --base-url http://localhost:4201
```
Run E2E test with a specific target:
```bash
nx e2e myapp-e2e --configuration smoke
```
## Common Options
The options below are common to the E2E commands used within an Nx workspace. Cypress and Protractor-specifc options are listed below.
### baseUrl
Use this to pass directly the address of your distant server address with the port running your application.
### configuration (-c)
A named build target, as specified in the "configurations" section of angular.json. Each named target is accompanied by a configuration of option defaults for that target. Setting this explicitly overrides the `--prod` option.
### devServerTarget
Dev server target to run tests against.
### prod
Shorthand for `--configuration=production`. When true, sets the build configuration to the production target. By default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
### version
Show version number
## Cypress Options
### browser
The browser to run tests in.
### ci-build-id
A unique identifier for a run to enable grouping or parallelization.
### ci-build-id
A unique identifier for a run to enable grouping or parallelization.
### cypress-config
The path of the Cypress configuration json file.
### exit
Whether or not the Cypress Test Runner will stay open after running tests in a spec file
### group
A named group for recorded runs in the Cypress dashboard.
### headless
Whether or not to open the Cypress application to run the tests. If set to 'true', will run in headless mode.
### help
Shows a help message for this command in the console.
### key
The key cypress should use to run tests in parallel/record the run (CI only).
### parallel
Whether or not Cypress should run its tests in parallel (CI only).
### record
Whether or not Cypress should record the results of the tests
### spec
A comma delimited glob string that is provided to the Cypress runner to specify which spec files to run. For example: '**examples/**,**actions.spec**
### ts-config
The path of the Cypress tsconfig configuration json file.
## Protractor Options
### element-explorer
Start Protractor's Element Explorer for debugging.
### host
Host to listen on.
### port
The port to use to serve the application.
### protractor-config
The name of the Protractor configuration file.
### specs
Override specs in the protractor config.
### suite
Override suite in the protractor config.
### webdriver-update
Try to update webdriver.
+77
View File
@@ -0,0 +1,77 @@
# format:check
Check for un-formatted files
## Usage
```bash
nx format:check
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
## Options
### all
All projects
### apps-and-libs
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### only-failed
Default: `false`
Isolate projects which previously failed
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+77
View File
@@ -0,0 +1,77 @@
# format:write
Overwrite un-formatted files
## Usage
```bash
nx format:write
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
## Options
### all
All projects
### apps-and-libs
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### only-failed
Default: `false`
Isolate projects which previously failed
### runner
This is the name of the tasks runner configured in nx.json
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+93
View File
@@ -0,0 +1,93 @@
# generate
Runs a schematic that generates and/or modifies files based on a schematic from a collection.
## Usage
```bash
nx generate <collection:schematic>
```
```bash
nx g <schematic>
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Generate a new Angular application:
```bash
nx generate @nrwl/angular:app myapp
```
Generate a new React application:
```bash
nx generate @nrwl/react:app myapp
```
Generate a new web component application:
```bash
nx generate @nrwl/web:app myapp
```
Generate a new Node application:
```bash
nx generate @nrwl/node:app myapp
```
Generate a new Angular library application:
```bash
nx generate @nrwl/angular:library mylibrary
```
Generate a new React library application:
```bash
nx generate @nrwl/react:library mylibrary
```
Generate a new Node library application:
```bash
nx generate @nrwl/node:library mylibrary
```
## Options
### defaults
Default: `false`
When true, disables interactive input prompts for options with a default.
### dryRun
Default: `false`
When true, disables interactive input prompts for options with a default.
### force
Default: `false`
When true, forces overwriting of existing files.
### interactive
Default: `true`
When false, disables interactive input prompts.
### help
Show help and display available schematics in the default collection.
### version
Show version number
+105
View File
@@ -0,0 +1,105 @@
# lint
Runs linting tools on application code in a given project folder using the configured linter.
## Usage
The `lint` command is a built-in alias to the [run command](/{{framework}}/cli/run).
These two commands are equivalent:
```bash
nx lint <project> [options]
```
```bash
nx run <project>:lint [options]
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run lint checks for the `myapp` project and fix linter errors:
```bash
nx lint myapp --fix
```
## Common Options
The options below are common to the `lint` command used within an Nx workspace. The ESLint and Angular-specifc lint options are listed after these options.
### exclude
Files to exclude from linting.
### files
Files to include in linting.
### fix
Fixes linting errors (may overwrite linted files).
### force
Succeeds even if there was linting errors.
### format
ESLint Output formatter (https://eslint.org/docs/user-guide/formatters). (default: stylish)
### silent
Hide output text.
### tsConfig
The name of the TypeScript configuration file.
### help
Show help information
### version
Show version number
## ESLint Options
### cache
Only check changed files.
### cacheLocation
Path to the cache file or directory.
### config
The name of the configuration file.
### linter
The tool to use for running lint checks.
Default: `tslint`
### outputFile
File to write report to.
## Angular-TSLint Options
### configuration (-c)
The linting configuration to use.
### tslint-config
The name of the TSLint configuration file.
### type-check
Controls the type check for linting.
+41
View File
@@ -0,0 +1,41 @@
# list
Lists installed plugins, capabilities of installed plugins and other available plugins.
## Usage
```bash
nx list
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
List the plugins installed in the current workspace:
```bash
nx list
```
List the schematics and builders available in the `@nrwl/web` plugin if it is installed (If the plugin is not installed `nx` will show advice on how to add it to your workspace):
```bash
nx list @nrwl/web
```
## Options
### help
Show help
### plugin
Default: `null`
The name of an installed plugin to query
### version
Show version number
+61
View File
@@ -0,0 +1,61 @@
# migrate
Creates a migrations file or runs migrations from the migrations file.
- Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest)
- Run migrations (e.g., nx migrate --run-migrations=migrations.json)
## Usage
```bash
nx migrate
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Update @nrwl/workspace to "next". This will update other packages and will generate migrations.json.:
```bash
nx migrate next
```
Update @nrwl/workspace to "9.0.0". This will update other packages and will generate migrations.json.:
```bash
nx migrate 9.0.0
```
Update @nrwl/workspace and generate the list of migrations starting with version 8.0.0 of @nrwl/workspace and @nrwl/node, regardless of what installed locally.:
```bash
nx migrate @nrwl/workspace@9.0.0 --from="@nrwl/workspace@8.0.0,@nrwl/node@8.0.0"
```
Update @nrwl/workspace to "9.0.0". If it tries to update @nrwl/react or @nrwl/angular, use version "9.0.1".:
```bash
nx migrate @nrwl/workspace@9.0.0 --to="@nrwl/react@9.0.1,@nrwl/angular@9.0.1"
```
Update another-package to "12.0.0". This will update other packages and will generate migrations.json file.:
```bash
nx migrate another-package@12.0.0
```
Run migrations from the migrations.json file. You can modify migrations.json and run this command many times.:
```bash
nx migrate --run-migrations=migrations.json
```
## Options
### help
Show help
### version
Show version number
+115
View File
@@ -0,0 +1,115 @@
# print-affected
Graph execution plan
## Usage
```bash
nx print-affected
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Print information about affected projects and the dependency graph.:
```bash
nx print-affected
```
Print information about the projects affected by the changes between master and HEAD (e.g,. PR).:
```bash
nx print-affected --base=master --head=HEAD
```
Prints information about the affected projects and a list of tasks to test them.:
```bash
nx print-affected --target=test
```
Prints information about the affected projects and a list of tasks to build them and their dependencies.:
```bash
nx print-affected --target=build --with-deps
```
Prints the projects property from the print-affected output.:
```bash
nx print-affected --target=build --select=projects
```
Prints the tasks.target.project property from the print-affected output.:
```bash
nx print-affected --target=build --select=tasks.target.project
```
## Options
### all
All projects
### base
Base of the current branch (usually master)
### configuration
This is the configuration to use when performing tasks on projects
### exclude
Default: ``
Exclude certain projects from being processed
### files
Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas
### head
Latest commit of the current branch (usually HEAD)
### help
Show help
### only-failed
Default: `false`
Isolate projects which previously failed
### runner
This is the name of the tasks runner configured in nx.json
### select
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### uncommitted
Uncommitted changes
### untracked
Untracked changes
### verbose
Print additional error stack trace on failure
### version
Show version number
+21
View File
@@ -0,0 +1,21 @@
# report
Reports useful version numbers to copy into the Nx issue template
## Usage
```bash
nx report
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
## Options
### help
Show help
### version
Show version number
+101
View File
@@ -0,0 +1,101 @@
# run-many
Run task for multiple projects
## Usage
```bash
nx run-many
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Test all projects.:
```bash
nx run-many --target=test --all
```
Test proj1 and proj2.:
```bash
nx run-many --target=test --projects=proj1,proj2
```
Test proj1 and proj2 in parallel.:
```bash
nx run-many --target=test --projects=proj1,proj2 --parallel --maxParallel=2
```
Build proj1 and proj2 and all their dependencies.:
```bash
nx run-many --target=test --projects=proj1,proj2 --with-deps
```
## Options
### all
Run the target on all projects in the workspace
### configuration
This is the configuration to use when performing tasks on projects
### help
Show help
### maxParallel
Default: `3`
Max number of parallel processes. This flag is ignored if the parallel option is set to `false`.
### only-failed
Default: `false`
Only run the target on projects which previously failed
### parallel
Default: `false`
Parallelize the command
### projects
Projects to run (comma delimited)
### runner
Override the tasks runner in `nx.json`
### skip-nx-cache
Default: `false`
Rerun the tasks even when the results are available in the cache
### target
Task to run for affected projects
### verbose
Print additional error stack trace on failure
### version
Show version number
### with-deps
Default: `false`
Include dependencies of specified projects when computing what to run
+39
View File
@@ -0,0 +1,39 @@
# run
Runs an Architect target with an optional custom builder configuration defined in your project.
## Usage
```bash
nx run <target> [options]
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run the `build` target for the `myapp` :
```bash
nx run myapp:build
```
Run the `build` target for the `myapp` project with a `production` configuration:
```bash
nx run myapp:build:production
```
## Options
### configuration (-c)
A named builder configuration, defined in the "configurations" section of the workspace configuration file. The builder uses the named configuration to run the given target.
### help
Show help
### version
Show version number
+199
View File
@@ -0,0 +1,199 @@
# serve
Builds and serves an application, rebuilding on file changes.
## Usage
The `serve` command is a built-in alias to the [run command](/{{framework}}/cli/run).
These two commands are equivalent:
```bash
nx serve <project> [options]
```
```bash
nx run <project>:serve [options]
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Serve the `myapp` project:
```bash
nx serve myapp
```
## Common Options
The options below are common to the `serve` command used within an Nx workspace. The Web and Angular-specifc serve options are listed after these options.
### allowedHosts
This option allows you to whitelist services that are allowed to access the dev server.
### host
Host to listen on.
Default: `localhost`
### liveReload
Whether to reload the page on change, using live-reload.
Default: `true`
### open (-o)
Open the application in the browser.
### port
Port to listen on.
Default: `4200`
### publicHost
Public URL where the application will be served
### ssl
Serve using HTTPS.
### sslKey
SSL key to use for serving HTTPS.
### sslCert
SSL certificate to use for serving HTTPS.
### watch
Watches for changes and rebuilds application
Default: `true`
### help
Show help
### version
Show version number
## Web-Serve Options
### buildTarget
Target which builds the application
### memoryLimit
Memory limit for type checking service process in MB.
### maxWorkers
Number of workers to use for type checking.
## Angular-Serve Options
### aot
Build using Ahead of Time compilation.
### base-href
Base url for the application being built.
### browser-target
Target to serve.
### build-event-log
**EXPERIMENTAL** Output file path for Build Event Protocol events.
### common-chunk
Use a separate bundle containing code used across multiple bundles.
### configuration (-c)
A named build target, as specified in the "configurations" section of the workspace configuration.
Each named target is accompanied by a configuration of option defaults for that target.
Setting this explicitly overrides the `--prod` flag
### deploy-url
URL where files will be deployed.
### disable-host-check
Don't verify connected clients are part of allowed hosts.
### eval-source-map
Output in-file eval sourcemaps.
### hmr
Enable hot module replacement.
### hmr-warning
Show a warning when the `--hmr` option is enabled.
### optimization
Enables optimization of the build output.
### poll
Enable and define the file watching poll time period in milliseconds.
### prod
Shorthand for `--configuration=production`.
When true, sets the build configuration to the production target.
By default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
### progress
Log progress to the console while building.
### proxy-config
Proxy configuration file.
### public-host
The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies.
### serve-path
The pathname where the app will be served.
### serve-path-default-warning
Show a warning when deploy-url/base-href use unsupported serve path values.
### source-map
Output sourcemaps.
### vendor-chunk
Use a separate bundle containing only vendor libraries.
### vendor-source-map
Resolve vendor packages sourcemaps.
### verbose
Adds more details to output logging.
+258
View File
@@ -0,0 +1,258 @@
# test
Runs unit tests in a project using the configured unit test runner.
## Usage
The `test` command is a built-in alias to the [run command](/{{framework}}/cli/run).
These two commands are equivalent:
```bash
nx test <project> [options]
```
```bash
nx run <project>:test [options]
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
Run unit tests:
```bash
nx test myapp
```
## Common Options
The options below are common to the `test` command used within an Nx workspace. The Jest and Karma-specifc test options are listed after these options.
### codeCoverage
Indicates that test coverage information should be collected and reported in the output. (https://jestjs.io/docs/en/cli#coverage)
### tsConfig
The path to the Typescript configuration file.
### watch
Watch files for changes and rerun tests.
### help
Show help information.
### version
Show version number
## Jest Options
### bail
Exit the test suite immediately after `n` number of failing tests. (https://jestjs.io/docs/en/cli#bail)
### ci
Whether to run Jest in continuous integration (CI) mode. This option is on by default in most popular CI environments. It will prevent snapshots from being written unless explicitly requested. (https://jestjs.io/docs/en/cli#ci)
### color
Forces test results output color highlighting (even if stdout is not a TTY). Set to false if you would like to have no colors. (https://jestjs.io/docs/en/cli#colors)
### colors
Forces test results output highlighting even if stdout is not a TTY. (https://jestjs.io/docs/en/cli#colors)
### coverageReporters
A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter
### coverageDirectory
An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.
### config
The path to a Jest config file specifying how to find and execute tests. If no rootDir is set in the config, the directory containing the config file is assumed to be the rootDir for the project. This can also be a JSON-encoded value which Jest will use as configuration
### clearCache
Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory. _Note: clearing the cache will reduce performance_.
### findRelatedTests
Find and run the tests that cover a comma separated list of source files that were passed in as arguments. (https://jestjs.io/docs/en/cli#findrelatedtests-spaceseparatedlistofsourcefiles)
### jestConfig
The path of the Jest configuration. (https://jestjs.io/docs/en/configuration)
### json
Prints the test results in JSON. This mode will send all other test output and user messages to stderr. (https://jestjs.io/docs/en/cli#json)
### maxWorkers
Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. Useful for CI. (its usually best not to override this default) (https://jestjs.io/docs/en/cli#maxworkers-num)
### onlyChanged
Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a git or hg repository at the moment. (https://jestjs.io/docs/en/cli#onlychanged)
### outputFile
Write test results to a file when the --json option is also specified. (https://jestjs.io/docs/en/cli#outputfile-filename)
### passWithNoTests
Will not fail if no tests are found (for example while using `--testPathPattern`.) (https://jestjs.io/docs/en/cli#passwithnotests)
### reporters
Run tests with specified reporters. Reporter options are not available via CLI. Example with multiple reporters: jest --reporters="default" --reporters="jest-junit" (https://jestjs.io/docs/en/cli#reporters)
### runInBand
Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI. (https://jestjs.io/docs/en/cli#runinband)
### setupFile
The name of a setup file used by Jest. (https://jestjs.io/docs/en/configuration#setupfilesafterenv-array)
### silent
Prevent tests from printing messages through the console. (https://jestjs.io/docs/en/cli#silent)
### testFile
The name of the file to test.
### testNamePattern
Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/en/cli#testnamepattern-regex)
### testPathPattern
An array of regexp pattern strings that is matched against all tests paths before executing the test. (https://jestjs.io/docs/en/cli#testpathpattern-regex)
### testLocationInResults
Adds a location field to test results. Used to report location of a test in a reporter. { "column": 4, "line": 5 } (https://jestjs.io/docs/en/cli#testlocationinresults)
### testResultsProcessor
Node module that implements a custom results processor. (https://jestjs.io/docs/en/configuration#testresultsprocessor-string)
### updateSnapshot
Use this flag to re-record snapshots. Can be used together with a test suite pattern or with `--testNamePattern` to re-record snapshot for test matching the pattern. (https://jestjs.io/docs/en/cli#updatesnapshot)
### useStderr
Divert all output to stderr.
### verbose
Display individual test results with the test suite hierarchy. (https://jestjs.io/docs/en/cli#verbose)
### watchAll
Watch files for changes and rerun all tests when something changes. If you want to re-run only the tests that depend on the changed files, use the `--watch` option. (https://jestjs.io/docs/en/cli#watchall)
## Karma Options
### browsers
Override which browsers tests are run against.
### codeCoverage
Output a code coverage report.
### codeCoverageExclude
Globs to exclude from code coverage.
### configuration (-c)
A named build target, as specified in the "configurations" section of angular.json.
Each named target is accompanied by a configuration of option defaults for that target.
Setting this explicitly overrides the `--prod` flag.
### environment
Defines the build environment.
### evalSourceMap
Output in-file eval sourcemaps.
### help
Shows a help message for this command in the console.
### include
Globs of files to include, relative to workspace or project root.
There are 2 special cases:
- when a path to directory is provided, all spec files ending ".spec.@(ts|tsx)" will be included
- when a path to a file is provided, and a matching spec file exists it will be included instead
### karmaConfig
The name of the Karma configuration file.
### main
The name of the main entry-point file.
### poll
Enable and define the file watching poll time period in milliseconds.
### polyfills
The name of the polyfills file.
### preserveSymlinks
Do not use the real path when resolving modules.
### prod
Shorthand for "--configuration=production". When true, sets the build configuration to the production target. By default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.
### progress
Log progress to the console while building.
### reporters
Karma reporters to use. Directly passed to the karma runner.
### sourceMap
Output sourcemaps.
### tsCconfig
The name of the TypeScript configuration file.
### vendorSourceMap
Resolve vendor packages sourcemaps.
### watch
Run build when files change.
### webWorkerTsConfig
TypeScript configuration for Web Worker modules.
+21
View File
@@ -0,0 +1,21 @@
# workspace-lint
Lint workspace or list of files. Note: To exclude files from this lint rule, you can add them to the ".nxignore" file
## Usage
```bash
nx workspace-lint
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
## Options
### help
Show help
### version
Show version number
+29
View File
@@ -0,0 +1,29 @@
# workspace-schematic
Runs a workspace schematic from the tools/schematics directory
## Usage
```bash
nx workspace-schematic
```
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
## Options
### help
Show help
### list-schematics
List the available workspace-schematics
### name
The name of your schematic`
### version
Show version number
Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

+118
View File
@@ -0,0 +1,118 @@
# Resources
## 45-Minute Walkthrough
<iframe width="560" height="315" src="https://www.youtube.com/embed/jCf92IyR-GE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Quick Introductions (10 minutes)
<iframe width="560" height="315" src="https://www.youtube.com/embed/E188J7E_MDU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Nx Workspace (free)
<iframe width="560" height="315" src="https://www.youtube.com/embed/2mYLe9Kp9VM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Advanced Nx Workspace (premium)
[![Advanced Nx Workspace](./advanced-nx-workspace-course.png)](https://nxplaybook.com/p/advanced-nx-workspaces)
## Resources
### Talks
- [React Development At Scale (React Vancouver Virtual Meetup)](https://youtu.be/ZGXuzVipe1U?t=3721), Jack Hsu (May 27, 2020)
- [Scalable React Development (React Summit Remote Edition)](https://www.youtube.com/watch?v=Lr-u2ALSEQg), Jason Jean (April 17, 2020)
Slides: [https://prezi.com/view/fm9sUbR7vbr5fZlO9C8D/](https://prezi.com/view/fm9sUbR7vbr5fZlO9C8D/)
- [Beyond Basics: Scaling Development across Large Teams (Angular Rome Meetup online)](https://docs.google.com/presentation/d/1zEgeppole9avhrvV6Zmpmk-L1W9-6JsHbnjaJwBigtQ/edit?usp=sharing), Juri Strumpflohner (April 2, 2020)
- [Develop like Google, Microsoft, and Facebook with Nx - Dev Nexus](https://prezi.com/view/BVhl92reqg7cnhvv6hhH/), Jason Jean (February 18, 2020)
- [Enhancing the workspace with Custom Builders - AngularToronto](https://www.youtube.com/watch?v=M1Bk_O49n94), Benjamin Cabanes (February 18, 2020)
- [Advanced Nx - Angular Air](https://www.youtube.com/watch?v=pcTSDMid-aE), Isaac Mann (February 5th, 2020)
- [Teach Me Anything - HackFlix](https://www.youtube.com/watch?v=WRmj4JwfoMs) - Isaac Mann (January 9th, 2020)
* [E2E Testing at Half the Cost - NG-BE 2019](https://www.youtube.com/watch?v=C88th0SbepE), Isaac Mann (Dev 10, 2019)
* [Sneak Peek of New Nx Workspace Course - ngHouston](https://www.youtube.com/watch?v=uLbA4f2SINE&feature=youtu.be), Isaac Mann (Nov 27, 2019)
* [Building Large Angular Apps - ngBucharest](https://www.youtube.com/watch?v=bKhyTeTCf7M), Isaac Mann (March 30, 2019)
- Slides: [https://prezi.com/view/jglXvEfeqnjEr4l2L11h/](https://prezi.com/view/jglXvEfeqnjEr4l2L11h/)
* [Modern Development with Angular CLI & Nrwl Nx](https://www.youtube.com/watch?v=tE8sUAfKI3g), Victor Savkin at ngAtlanta (Feb 5, 2019)
* [Supercharging the Angular CLI](https://www.youtube.com/watch?v=bMkKz8AedHc) - ngVikings, James Henry (March 10, 2018)
* [Hands on Full Stack development with Nx and Bazel](https://www.youtube.com/watch?v=1KDDIhcQORM) - ngConf, Alex Eagle, Torgeir Helgevold (April 19, 2018)
* [Angular at Large Organizations](https://www.youtube.com/watch?v=piQ0EZhtus0) - ngConf, Victor Savkin(April 20, 2018)
* [Building Large Angular Apps Successfully with Nx - AngularNYC Meetup](https://youtu.be/Jwv3wRZ3BTM), Jason Jean (December 19, 2018)
- [Nx: The New Way to Build Enterprise Angular Apps](https://www.youtube.com/watch?v=xo-1SDmvM8Y) - Angular Mix, Jeff Cross & Victor Savkin (October 11, 2017)
### Podcasts and Shows
- [Nx Plugins - ngHouston](https://youtu.be/bydqr-Yxsu8), Wes Grimes and Jon Cammisuli (April 8 2020)
- [Apollo GQL, Angular & Nx - ngHouston](https://youtu.be/bydqr-Yxsu8), Philip Fulcher (Feb 26, 2020)
- [Teach Me Anything - With Isaac Mann from Nrwl](https://youtu.be/WRmj4JwfoMs), Isaac Mann (Jan 9, 2020)
- [Sneak Peek of New Nx Workspace Course - ngHouston](https://www.youtube.com/watch?v=uLbA4f2SINE&feature=youtu.be), Isaac Mann (Nov 27, 2019)
- [React Roundup: Nx and Monorepos](https://player.fm/series/react-round-up/rru-081-nx-and-monorepos-with-jeffrey-cross-and-victor-savkin), Victor Savkin (Oct 1, 2019)
- [Nx and Angular CLI - Adventures in Angular](https://devchat.tv/adv-in-angular/aia-254-nx-and-angular-cli-with-brandon-roberts/), Brandon Roberts (Aug 27th 2019)
- [ngHouston: NX Demo](https://www.youtube.com/watch?v=E_UlU2Yv4G0) (Dec 7, 2017)
- [ngAir 140: Nx for Enterprise Angular Development](https://www.youtube.com/watch?v=qYNiOKDno_I), Victor Savkin (Dec 12, 2017)
### Nx Demo & Tutorial Videos
- [Nx Dev Tools for Monorepos, In-Depth Explainer (React)](https://www.youtube.com/watch?v=jCf92IyR-GE)
- [Nx Dev Tools for Monorepos, In-Depth Explainer (Angular)](https://youtu.be/h5FIGDn5YM0)
- [Storybook Integration with Nx](https://youtu.be/sFpqyjT7u4s)
- [Building Custom Plugins for Nx](https://youtu.be/XYO689PAhow)
- [Improved Dependency Graph Visualization for Nx](https://youtu.be/cMZ-ReC-jWU)
- [Group all your stories into a single viewable Storybook with Nx](https://youtu.be/c323HOuFKkA)
- [Debug Nx with Node and VSCode](https://youtu.be/OGV4R0cPRPc)
- [Debug your Jest tests in Nx with VSCode](https://youtu.be/9_lgM2nokLg)
- [Nx Console - A Must-Have Visual Studio Code Extension for Angular Developers](https://youtu.be/IIetmfgozgI)
- [Introducing Nx Cloud](https://youtu.be/pwG20nNTEQc)
- [Setting up distributed caching using Nx Cloud, @nrwl/nx-cloud](https://youtu.be/w1-GiB74ddc)
- [High Quality React apps with Nx & Cypress](https://youtu.be/mfJBLhjYMdo)
### Books amd Blogs
- [Nx blog posts](https://blog.nrwl.io/nx/home)
- [Angular Enterprise Monorepo Patterns Book (free)](https://go.nrwl.io/angular-enterprise-monorepo-patterns-new-book?utm_campaign=Book%3A%20Monorepo%20Patterns%2C%20Jan%202019&utm_source=Github&utm_medium=Banner%20Ad)
* [High Quality React apps with Nx & Cypress](https://cypress.io/blog/2020/04/14/high-quality-react-apps-with-nx-cypress/) (April 2020)
* [Shell Library patterns with Nx and Monorepo Architectures](https://indepth.dev/the-shell-library-patterns-with-nx-and-monorepo-architectures/) (March 2020)
- [Tiny Angular application projects in Nx workspaces](https://indepth.dev/tiny-angular-application-projects-in-nx-workspaces/#peer-reviewers--30/) (March 2020)
### Misc
- [nx-examples](https://github.com/nrwl/nx-examples) repo has branches for different nx comments to display expected behavior and example app and libraries. Check out the branch (workspace, ngrx...) to see what gets created for you. More info on readme.
- [xplat - Cross-platform tools for Nx workspaces](https://nstudio.io/xplat/)
+61
View File
@@ -0,0 +1,61 @@
# Why Nx?
Nx is the preeminent toolkit for Monorepo development, which helps you to build software smarter and faster. With Nx you can build full-stack applications with your preferred framework, integrate with modern tools youre probably already using, and reinforce best practices for your entire development team or enterprise. Use Nx to build software at scale, the better way.
- Out of the box integration with Cypress, Jest, Typescript, Prettier + more
- Has a growing ecosystem, and a community plugin market
- Many leading enterprises are already using Nx to build the software you know and love
## 10-Minute Nx Overview
<iframe width="560" height="315" src="https://www.youtube.com/embed/E188J7E_MDU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Why Monorepos?
A monorepo is a single git repository that holds the source code for multiple applications and libraries, along with the tooling for them.
### What are the benefits of a monorepo?
- **Shared code** - Keep your code DRY across your entire organization. Reuse validation code, UI components and types across the code base. Reuse code between the backend and the frontend.
- **Atomic changes** - Change a server API and modify the clients that consume that API in the same commit. You can change a button component in a shared library and the applications that use that component in the same commit. This saves the pain of trying to coordinate commits across multiple repositories.
- **Developer mobility** - Get a consistent way of building and testing applications written using different tools and technologies. Developers can confidently contribute to other teams applications and verify that their changes are safe.
- **Single set of dependencies** - Use a single version of third party dependencies for all your apps. Less frequently used applications dont get left behind with a 3 year old version of a framework library or an old version of webpack.
## Why Not Code Collocation?
A naive implementation of a monorepo is simply code collocation - placing all the code from multiple repositories into the same repo without adequate tooling to coordinate everything. What problems arise from code collocation?
- **Running unnecessary tests** - In order to ensure nothing was broken by a change, all tests in the entire repository need to be run - even code in projects that are unrelated to the actual change.
- **No code boundaries** - A developer from another team can change code in your project, causing bugs or inconsistencies. Or worse, another team can use code that you intended for private use - forcing you to never change that code for fear of breaking their application.
- **Inconsistent tooling** - Each project uses its own set of commands for running tests, building, serving, etc. This makes it very difficult to move from project to project.
Tools like Lerna and Yarn Workspaces help optimize the installation of node modules, but they **do not** enable Monorepo-style development. In other words, they solve an orthogonal problem and sometimes can be used in combination with Nx. Read more on it [here](https://blog.nrwl.io/why-you-should-switch-from-lerna-to-nx-463bcaf6821).
## Nx Can Help
Nx provides tools to give you the benefits of a monorepo without the drawbacks of simple code collocation.
### Scaling Your Repo
- **Faster Command Execution** - Builders allow for consistent commands to test, serve, build, lint, etc, each project. [Nxs affected command]() helps run commands only on code that is affected by the current change. Nx provides local and distributed caching of builder commands so when someone on your team runs a command, everyone else will use their artifacts to speed up their own command executions, often bringing them down from minutes to seconds. This, in combination with support for distributed and incremental builds helps you scale your development to massive applications and repositories.
### Scaling Your Organization
- **Controlled Code Sharing** - You can define libraries with specific enforced APIs and put rules in place to define how those libraries can depend on each other. A CODEOWNERS file can be used to restrict who is allowed to change files in each project.
- **Consistent Code Generation** - Schematics allow you to automate code creation and modification tasks. Instead of writing a 7 step guide in a readme file, you can create a schematic to prompt the developer for inputs and then modify the code directly. Nrwl provides plugins which contain useful builders and schematics for a lot of popular tools. Also, there is a growing number of community provided plugins.
- **Accurate Architecture Diagram** - Most architecture diagrams are wrong the moment they are written down. And every diagram becomes out of date as soon as the code changes. Since Nx understands your code, it can generate an up-to-date and accurate diagram of how projects depend on each other. And for cases where dependencies are not explicit in the code, you can manually tell Nx about project dependencies.
## Next Steps
**Learn Nx Fundamentals:**
- [Interactive Nx Tutorial](/{{framework}}/tutorial/01-create-application)
- [Free Nx Course on YouTube](https://www.youtube.com/watch?time_continue=49&v=2mYLe9Kp9VM&feature=emb_logo)
- [45-Minute Walkthrough](https://www.youtube.com/watch?v=jCf92IyR-GE)
**Dive Deep:**
- [Nx CLI](/{{framework}}/cli/overview)
- [Configuration Files](/{{framework}}/workspace/configuration)
- [Computation Caching](/{{framework}}/workspace/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/ci/monorepo-affected)
+267
View File
@@ -0,0 +1,267 @@
# Nx CLI
The Nx CLI is a command-line interface tool that helps you setup, develop, build, and maintain applications. It provides commands for:
- Generating new applications, and libraries with recommended defaults.
- Running a development webserver that rebuilds your app on changes.
- Generating a dependency graph for your application.
- Building, and running unit and E2E test for apps, and libraries affected by your changes.
- Formatting your source code to modern standards.
- ...
## Installing the CLI
Install the Nx CLI globally on your system using your preferred package manager:
Using npm:
```bash
npm install -g nx
```
Using yarn:
```bash
yarn global add nx
```
After that, you will have an `nx` executable you can use to run commands in your workspace.
If you don't have the Nx CLI installed globally, you can invoke `nx` using `yarn nx` and `npm run nx`.
## Help and List
`nx help` will print a short description of every command. You can also pass `--help` to a command to see the available options (e.g., `nx affected --help`).
[`nx list`](/{{framework}}/cli/list) will print the list of installed plugins and the list of plugins you can install. You can also pass a plugin name to it (e.g., `nx list @nrwl/node`) to learn more about what the capabilities of that plugin.
## Generating Code
The Nx CLI has an advanced code generator. With it, you can generate new applications, libraries, components, state management utilities. You can change existing applications. And, because the Nx CLI comes with an implementation of a virtual file system, you can preview the changes without affecting anything on disk.
The code generation recipes are called schematics. Schematics provide the underlying APIs for scaffolding, and utilities to automate changes to your filesystem. The example below is the command to generate a new application.
```sh
nx generate @nrwl/node:application myapp
```
The `@nrwl/node` package contains a collection of schematics, with `application` being the one used in this example. The Nx CLI applies the schematic to your workspace, verifying that the provided options are valid, and the destination files don't already exist. Once the validations are passed, the new files are generated, or existing files are updated. You can also customize the output of the generated application, by passing options to the schematic.
```sh
nx generate @nrwl/node:application myapp --style=scss
```
You can preview the changes a schematic makes by using the `--dry-run` option. It will output the potential files created, and/or updated during the execution of the schematic.
**Generate command:**
`nx generate` runs schematics to create or modify code given some inputs from the developer.
- [nx generate](/{{framework}}/cli/generate)
Syntax: `nx generate [plugin]:[schematic-name] [options]`
Example: `nx generate @nrwl/node:library my-node-lib`
## Running Tasks
The Nx CLI uses builders to perform tasks, such as building and bundling your application, running unit tests, or running E2E tests against a specific target, whether that be an application or workspace.
A builder is a function that uses the Architect API to perform a complex process such as "build", "test", or "lint".
You can configure the builders in `workspace.json`.
```json
{
"projects": {
"todos": {
"root": "apps/todos/",
"sourceRoot": "apps/todos/src",
"projectType": "application",
"architect": {
"serve": {
"builder": "@nrwl/web:dev-server",
"options": {
"buildTarget": "todos:build",
"proxyConfig": "apps/todos/proxy.conf.json"
},
"configurations": {
"production": {
"buildTarget": "todos:build:production"
}
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/todos/jest.config.js",
"tsConfig": "apps/todos/tsconfig.spec.json",
"setupFile": "apps/todos/src/test-setup.ts"
}
}
}
}
}
}
```
In the example above, the `todos` application has two targets: `serve` and `test`. The `serve` target uses the `@nrwl/web:dev-server` builder, and the `test` target uses `@nrwl/jest:jest`. Every target uses a builder which actually runs this target. So targets are analogous to typed npm scripts, and builders are analogous to typed shell scripts.
You can run the target as follows:
```bash
nx run todos:serve
nx run todos:test
```
A target can have multiple configuration. In the example above the serve target has two configurations: default and production.
```bash
nx run todos:serve # default configuration
nx run todos:serve:production # producttion configuration
```
Because running target is such a common operation, you can also use the following syntax to do it:
```bash
nx serve todos
nx serve todos --configuration=production
nx serve todos --prod
```
You can name your targets any way you want, define as many of them as you want, and use any builders you want to implement them.
**These are some common targets:**
- [nx build](/{{framework}}/cli/build)
Syntax: `nx build [project]`
Long form: `nx run [project]:build`
Example: `nx build my-app`
- [nx lint](/{{framework}}/cli/lint)
Syntax: `nx lint [project]`
Long form: `nx run [project]:lint`
Example: `nx lint my-app`
- [nx serve](/{{framework}}/cli/serve)
Syntax: `nx serve [project]`
Long form: `nx run [project]:serve`
Example: `nx serve my-app`
- [nx e2e](/{{framework}}/cli/e2e)
Syntax: `nx e2e [project]`
Long form: `nx run [project]:e2e`
Example: `nx e2e my-app`
- [nx test](/{{framework}}/cli/test)
Syntax: `nx test [project]`
Long form: `nx run [project]:test`
Example: `nx test my-app`
## Running Tasks for Multiple Projects
Nx allows you to run tasks across multiple projects.
### Run-Many
Run the same target for all projects.
```sh
nx run-many --target=build --all
```
Run the same target for all projects in parallel.
```sh
nx run-many --target=build --all --parallel --maxParallel=8
```
Run the same target for selected projects.
```sh
nx run-many --target=build --projects=app1,app2
```
Run the same target for selected projects and their deps.
```sh
nx run-many --target=build --projects=app1,app2 --with-deps
```
Run the same target for the projects that failed last time.
```sh
nx run-many --target=build --all --only-failed
```
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the builder.
```sh
nx run-many --target=build --all --prod
```
### Affected
Run the same target for all the projects by the current code change (e.g., current Git branch).
```sh
nx affected --target=build
```
Same but in parallel.
```sh
nx affected --target=build --parallel --maxParallel=8
```
By default, the current code change is defined as a diff between master and HEAD. You can change it as follows:
```sh
nx affected --target=build --parallel --maxParallel=8 --base=origin/development --head=$CI_BRANCH_NAME
```
Running `affected` commands is very common, so Nx comes with a few shortcuts.
```sh
nx affected:build
nx affected:test
nx affected:lint
nx affected:e2e
```
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the builder.
```sh
nx affected --target=build --prod
```
## Other Commands
`nx print-affected` prints information about affected projects in the workspace.
- [nx print-affected](/{{framework}}/cli/print-affected)
Syntax: `nx print-affected`
`nx dep-graph` launches a visual graph of the dependencies between your projects.
- [nx dep-graph](/{{framework}}/cli/dep-graph)
Syntax: `nx dep-graph`
`nx affected:dep-graph` launches the dependency graph with all affected projects highlighted.
- [nx affected:dep-graph](/{{framework}}/cli/affected-dep-graph)
Syntax: `nx affected:dep-graph`
`nx list` lists all installed and available plugins.
- [nx list](/{{framework}}/cli/list)
Syntax: `nx list`
`nx report` prints basic information about the plugins used
- [nx report](/{{framework}}/cli/report)
Syntax: `nx report`
`nx format:write` formats your code
- [nx format:write](/{{framework}}/cli/format-write)
Syntax: `nx format:write`
`nx format:check` checks that your code is formatted
- [nx format:check](/{{framework}}/cli/format-check)
Syntax: `nx format:check`
+15
View File
@@ -0,0 +1,15 @@
[
"angular",
"bazel",
"cypress",
"express",
"jest",
"nest",
"next",
"node",
"nx-plugin",
"react",
"storybook",
"web",
"workspace"
]

Some files were not shown because too many files have changed in this diff Show More