feat(web): add file-server builder
This commit is contained in:
parent
c8259074ac
commit
4511ec65fb
55
docs/angular/api-web/builders/file-server.md
Normal file
55
docs/angular/api-web/builders/file-server.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# file-server
|
||||||
|
|
||||||
|
Serve a web application from a folder
|
||||||
|
|
||||||
|
Builder properties can be configured in angular.json when defining the builder, or when invoking it.
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### buildTarget
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Target which builds the application
|
||||||
|
|
||||||
|
### host
|
||||||
|
|
||||||
|
Default: `localhost`
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Host to listen on.
|
||||||
|
|
||||||
|
### port
|
||||||
|
|
||||||
|
Default: `4200`
|
||||||
|
|
||||||
|
Type: `number`
|
||||||
|
|
||||||
|
Port to listen on.
|
||||||
|
|
||||||
|
### proxyUrl
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
URL to proxy unhandled requests to.
|
||||||
|
|
||||||
|
### 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.
|
||||||
65
docs/angular/api-workspace/schematics/move.md
Normal file
65
docs/angular/api-workspace/schematics/move.md
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
# 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 `angular.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
|
||||||
|
|
||||||
|
### importPath
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
The new import path to use in the tsconfig.base.json
|
||||||
|
|
||||||
|
### projectName
|
||||||
|
|
||||||
|
Alias(es): project
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
The name of the project to move
|
||||||
|
|
||||||
|
### updateImportPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Should the schematic update the import path to reflect the new location?
|
||||||
71
docs/angular/api-workspace/schematics/remove.md
Normal file
71
docs/angular/api-workspace/schematics/remove.md
Normal file
@ -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 `angular.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.
|
||||||
73
docs/angular/api-workspace/schematics/run-commands.md
Normal file
73
docs/angular/api-workspace/schematics/run-commands.md
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# 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 `angular.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
|
||||||
|
|
||||||
|
### cwd
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Current working directory of the command
|
||||||
|
|
||||||
|
### envFile
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Env files to be loaded before executing the commands
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Target name
|
||||||
|
|
||||||
|
### outputs
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder.
|
||||||
|
|
||||||
|
### project
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Project name
|
||||||
39
docs/angular/api-workspace/schematics/workspace-schematic.md
Normal file
39
docs/angular/api-workspace/schematics/workspace-schematic.md
Normal file
@ -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 `angular.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
|
||||||
@ -341,6 +341,11 @@
|
|||||||
"id": "dev-server",
|
"id": "dev-server",
|
||||||
"file": "angular/api-web/builders/dev-server"
|
"file": "angular/api-web/builders/dev-server"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "file-server",
|
||||||
|
"id": "file-server",
|
||||||
|
"file": "angular/api-web/builders/file-server"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "package",
|
"name": "package",
|
||||||
"id": "package",
|
"id": "package",
|
||||||
@ -1429,6 +1434,11 @@
|
|||||||
"id": "dev-server",
|
"id": "dev-server",
|
||||||
"file": "react/api-web/builders/dev-server"
|
"file": "react/api-web/builders/dev-server"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "file-server",
|
||||||
|
"id": "file-server",
|
||||||
|
"file": "react/api-web/builders/file-server"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "package",
|
"name": "package",
|
||||||
"id": "package",
|
"id": "package",
|
||||||
@ -2470,6 +2480,11 @@
|
|||||||
"id": "dev-server",
|
"id": "dev-server",
|
||||||
"file": "node/api-web/builders/dev-server"
|
"file": "node/api-web/builders/dev-server"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "file-server",
|
||||||
|
"id": "file-server",
|
||||||
|
"file": "node/api-web/builders/file-server"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "package",
|
"name": "package",
|
||||||
"id": "package",
|
"id": "package",
|
||||||
|
|||||||
56
docs/node/api-web/builders/file-server.md
Normal file
56
docs/node/api-web/builders/file-server.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# file-server
|
||||||
|
|
||||||
|
Serve a web application from a folder
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
### host
|
||||||
|
|
||||||
|
Default: `localhost`
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Host to listen on.
|
||||||
|
|
||||||
|
### port
|
||||||
|
|
||||||
|
Default: `4200`
|
||||||
|
|
||||||
|
Type: `number`
|
||||||
|
|
||||||
|
Port to listen on.
|
||||||
|
|
||||||
|
### proxyUrl
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
URL to proxy unhandled requests to.
|
||||||
|
|
||||||
|
### 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.
|
||||||
65
docs/node/api-workspace/schematics/move.md
Normal file
65
docs/node/api-workspace/schematics/move.md
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
### importPath
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
The new import path to use in the tsconfig.base.json
|
||||||
|
|
||||||
|
### projectName
|
||||||
|
|
||||||
|
Alias(es): project
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
The name of the project to move
|
||||||
|
|
||||||
|
### updateImportPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Should the schematic update the import path to reflect the new location?
|
||||||
71
docs/node/api-workspace/schematics/remove.md
Normal file
71
docs/node/api-workspace/schematics/remove.md
Normal file
@ -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.
|
||||||
73
docs/node/api-workspace/schematics/run-commands.md
Normal file
73
docs/node/api-workspace/schematics/run-commands.md
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
### cwd
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Current working directory of the command
|
||||||
|
|
||||||
|
### envFile
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Env files to be loaded before executing the commands
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Target name
|
||||||
|
|
||||||
|
### outputs
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder.
|
||||||
|
|
||||||
|
### project
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Project name
|
||||||
39
docs/node/api-workspace/schematics/workspace-schematic.md
Normal file
39
docs/node/api-workspace/schematics/workspace-schematic.md
Normal file
@ -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
|
||||||
56
docs/react/api-web/builders/file-server.md
Normal file
56
docs/react/api-web/builders/file-server.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# file-server
|
||||||
|
|
||||||
|
Serve a web application from a folder
|
||||||
|
|
||||||
|
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/react/guides/cli.
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### buildTarget
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Target which builds the application
|
||||||
|
|
||||||
|
### host
|
||||||
|
|
||||||
|
Default: `localhost`
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Host to listen on.
|
||||||
|
|
||||||
|
### port
|
||||||
|
|
||||||
|
Default: `4200`
|
||||||
|
|
||||||
|
Type: `number`
|
||||||
|
|
||||||
|
Port to listen on.
|
||||||
|
|
||||||
|
### proxyUrl
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
URL to proxy unhandled requests to.
|
||||||
|
|
||||||
|
### 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.
|
||||||
65
docs/react/api-workspace/schematics/move.md
Normal file
65
docs/react/api-workspace/schematics/move.md
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
### importPath
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
The new import path to use in the tsconfig.base.json
|
||||||
|
|
||||||
|
### projectName
|
||||||
|
|
||||||
|
Alias(es): project
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
The name of the project to move
|
||||||
|
|
||||||
|
### updateImportPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Should the schematic update the import path to reflect the new location?
|
||||||
71
docs/react/api-workspace/schematics/remove.md
Normal file
71
docs/react/api-workspace/schematics/remove.md
Normal file
@ -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.
|
||||||
73
docs/react/api-workspace/schematics/run-commands.md
Normal file
73
docs/react/api-workspace/schematics/run-commands.md
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
### cwd
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Current working directory of the command
|
||||||
|
|
||||||
|
### envFile
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Env files to be loaded before executing the commands
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Target name
|
||||||
|
|
||||||
|
### outputs
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder.
|
||||||
|
|
||||||
|
### project
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
Project name
|
||||||
39
docs/react/api-workspace/schematics/workspace-schematic.md
Normal file
39
docs/react/api-workspace/schematics/workspace-schematic.md
Normal file
@ -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
|
||||||
@ -1,23 +1,21 @@
|
|||||||
import {
|
import {
|
||||||
ensureProject,
|
checkFilesExist,
|
||||||
exists,
|
|
||||||
expectTestsPass,
|
expectTestsPass,
|
||||||
|
forEachCli,
|
||||||
getSize,
|
getSize,
|
||||||
|
newProject,
|
||||||
runCLI,
|
runCLI,
|
||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
|
tmpProjPath,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
forEachCli,
|
|
||||||
checkFilesExist,
|
|
||||||
tmpProjPath,
|
|
||||||
supportUi,
|
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
import { toClassName } from '@nrwl/workspace';
|
import { toClassName } from '@nrwl/workspace';
|
||||||
|
|
||||||
forEachCli(() => {
|
forEachCli(() => {
|
||||||
describe('Angular Package', () => {
|
describe('Angular Package', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ensureProject();
|
newProject();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work', async () => {
|
it('should work', async () => {
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
import {
|
import {
|
||||||
ensureProject,
|
forEachCli,
|
||||||
|
newProject,
|
||||||
|
patchKarmaToWorkOnWSL,
|
||||||
runCLI,
|
runCLI,
|
||||||
|
runCommand,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
forEachCli,
|
|
||||||
patchKarmaToWorkOnWSL,
|
|
||||||
runCommand,
|
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli('angular', () => {
|
forEachCli('angular', () => {
|
||||||
// TODO: This test is super flaky, investigate and re-enable.
|
// TODO: This test is super flaky, investigate and re-enable.
|
||||||
describe('AngularJS Schematics', () => {
|
describe('AngularJS Schematics', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ensureProject();
|
newProject();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('DowngradeModule', () => {
|
describe('DowngradeModule', () => {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
ensureProject,
|
|
||||||
forEachCli,
|
forEachCli,
|
||||||
|
newProject,
|
||||||
patchKarmaToWorkOnWSL,
|
patchKarmaToWorkOnWSL,
|
||||||
runCLI,
|
runCLI,
|
||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
@ -11,7 +11,7 @@ forEachCli(() => {
|
|||||||
// TODO: This test is super flaky, investigate and re-enable.
|
// TODO: This test is super flaky, investigate and re-enable.
|
||||||
xdescribe('Karma', () => {
|
xdescribe('Karma', () => {
|
||||||
it('should be able to generate a testable library using karma', async (done) => {
|
it('should be able to generate a testable library using karma', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
// run an app
|
// run an app
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import {
|
import {
|
||||||
runCLI,
|
|
||||||
expectTestsPass,
|
expectTestsPass,
|
||||||
|
forEachCli,
|
||||||
|
newProject,
|
||||||
|
readJson,
|
||||||
|
runCLI,
|
||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
uniq,
|
uniq,
|
||||||
ensureProject,
|
|
||||||
readJson,
|
|
||||||
forEachCli,
|
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli(() => {
|
forEachCli(() => {
|
||||||
describe('ngrx', () => {
|
describe('ngrx', () => {
|
||||||
it('should work', async () => {
|
it('should work', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --no-interactive`);
|
runCLI(`generate @nrwl/angular:app ${myapp} --no-interactive`);
|
||||||
@ -39,7 +39,7 @@ forEachCli(() => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
|
||||||
it('should work with creators', async () => {
|
it('should work with creators', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --routing --no-interactive`);
|
runCLI(`generate @nrwl/angular:app ${myapp} --routing --no-interactive`);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { ensureProject, runCLI, uniq, forEachCli } from '@nrwl/e2e/utils';
|
import { forEachCli, newProject, runCLI, uniq } from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli(() => {
|
forEachCli(() => {
|
||||||
describe('Protractor', () => {
|
describe('Protractor', () => {
|
||||||
@ -9,7 +9,7 @@ forEachCli(() => {
|
|||||||
|
|
||||||
xdescribe('Protractor', () => {
|
xdescribe('Protractor', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ensureProject();
|
newProject();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work', async () => {
|
it('should work', async () => {
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import { packagesWeCareAbout } from '@nrwl/workspace/src/command-line/report';
|
import { packagesWeCareAbout } from '@nrwl/workspace/src/command-line/report';
|
||||||
import { renameSync } from 'fs';
|
import { renameSync } from 'fs';
|
||||||
import {
|
import {
|
||||||
ensureProject,
|
|
||||||
forEachCli,
|
forEachCli,
|
||||||
newProject,
|
newProject,
|
||||||
readFile,
|
readFile,
|
||||||
@ -16,7 +15,7 @@ import {
|
|||||||
forEachCli('nx', () => {
|
forEachCli('nx', () => {
|
||||||
describe('Help', () => {
|
describe('Help', () => {
|
||||||
it('should show help', async () => {
|
it('should show help', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nrwl/web:app ${myapp}`);
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ forEachCli('nx', () => {
|
|||||||
forEachCli('angular', () => {
|
forEachCli('angular', () => {
|
||||||
describe('help', () => {
|
describe('help', () => {
|
||||||
it('should show help', async () => {
|
it('should show help', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nrwl/web:app ${myapp}`);
|
||||||
|
|
||||||
@ -80,7 +79,7 @@ forEachCli('angular', () => {
|
|||||||
forEachCli(() => {
|
forEachCli(() => {
|
||||||
describe('report', () => {
|
describe('report', () => {
|
||||||
it(`should report package versions`, async () => {
|
it(`should report package versions`, async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const reportOutput = runCommand('npm run nx report');
|
const reportOutput = runCommand('npm run nx report');
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
ensureProject,
|
|
||||||
forEachCli,
|
|
||||||
newProject,
|
newProject,
|
||||||
readFile,
|
readFile,
|
||||||
readJson,
|
readJson,
|
||||||
@ -11,17 +9,13 @@ import {
|
|||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli((currentCLIName) => {
|
describe('Cypress E2E Test runner', () => {
|
||||||
const linter = currentCLIName === 'angular' ? 'tslint' : 'eslint';
|
|
||||||
const nrwlPackageName = currentCLIName === 'angular' ? 'angular' : 'react';
|
|
||||||
|
|
||||||
describe('Cypress E2E Test runner', () => {
|
|
||||||
describe('project scaffolding', () => {
|
describe('project scaffolding', () => {
|
||||||
it('should generate an app with the Cypress as e2e test runner', () => {
|
it('should generate an app with the Cypress as e2e test runner', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/${nrwlPackageName}:app ${myapp} --e2eTestRunner=cypress --linter=${linter}`
|
`generate @nrwl/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Making sure the package.json file contains the Cypress dependency
|
// Making sure the package.json file contains the Cypress dependency
|
||||||
@ -47,7 +41,7 @@ forEachCli((currentCLIName) => {
|
|||||||
newProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/${nrwlPackageName}:app ${myapp} --e2eTestRunner=cypress --linter=${linter}`
|
`generate @nrwl/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(runCLI(`e2e ${myapp}-e2e --headless --no-watch`)).toContain(
|
expect(runCLI(`e2e ${myapp}-e2e --headless --no-watch`)).toContain(
|
||||||
@ -69,5 +63,4 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,17 +1,15 @@
|
|||||||
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
||||||
import {
|
import {
|
||||||
ensureProject,
|
newProject,
|
||||||
forEachCli,
|
|
||||||
runCLI,
|
runCLI,
|
||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli(() => {
|
describe('Jest', () => {
|
||||||
describe('Jest', () => {
|
|
||||||
it('should be able test projects using jest', async (done) => {
|
it('should be able test projects using jest', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --unit-test-runner jest`);
|
runCLI(`generate @nrwl/angular:app ${myapp} --unit-test-runner jest`);
|
||||||
@ -37,7 +35,7 @@ forEachCli(() => {
|
|||||||
}, 45000);
|
}, 45000);
|
||||||
|
|
||||||
it('should merge with jest config globals', async (done) => {
|
it('should merge with jest config globals', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const testGlobal = `'My Test Global'`;
|
const testGlobal = `'My Test Global'`;
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/workspace:lib ${mylib} --unit-test-runner jest`);
|
runCLI(`generate @nrwl/workspace:lib ${mylib} --unit-test-runner jest`);
|
||||||
@ -77,7 +75,7 @@ forEachCli(() => {
|
|||||||
}, 45000);
|
}, 45000);
|
||||||
|
|
||||||
it('should set the NODE_ENV to `test`', async (done) => {
|
it('should set the NODE_ENV to `test`', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/workspace:lib ${mylib} --unit-test-runner jest`);
|
runCLI(`generate @nrwl/workspace:lib ${mylib} --unit-test-runner jest`);
|
||||||
|
|
||||||
@ -97,7 +95,7 @@ forEachCli(() => {
|
|||||||
}, 45000);
|
}, 45000);
|
||||||
|
|
||||||
it('should support multiple `coverageReporters` through CLI', async (done) => {
|
it('should support multiple `coverageReporters` through CLI', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/workspace:lib ${mylib} --unit-test-runner jest`);
|
runCLI(`generate @nrwl/workspace:lib ${mylib} --unit-test-runner jest`);
|
||||||
|
|
||||||
@ -119,5 +117,4 @@ forEachCli(() => {
|
|||||||
expect(result.stdout).toContain('Coverage summary'); // text-summary
|
expect(result.stdout).toContain('Coverage summary'); // text-summary
|
||||||
done();
|
done();
|
||||||
}, 45000);
|
}, 45000);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,16 +4,13 @@ import {
|
|||||||
readFile,
|
readFile,
|
||||||
readJson,
|
readJson,
|
||||||
runCLI,
|
runCLI,
|
||||||
updateFile,
|
|
||||||
ensureProject,
|
|
||||||
uniq,
|
uniq,
|
||||||
forEachCli,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli('nx', () => {
|
describe('Linter', () => {
|
||||||
describe('Linter', () => {
|
|
||||||
it('linting should error when rules are not followed', () => {
|
it('linting should error when rules are not followed', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${myapp}`);
|
runCLI(`generate @nrwl/react:app ${myapp}`);
|
||||||
@ -33,7 +30,7 @@ forEachCli('nx', () => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
|
||||||
it('linting should not error when rules are not followed and the force flag is specified', () => {
|
it('linting should not error when rules are not followed and the force flag is specified', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${myapp}`);
|
runCLI(`generate @nrwl/react:app ${myapp}`);
|
||||||
@ -52,7 +49,7 @@ forEachCli('nx', () => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
|
||||||
it('linting should not error when all rules are followed', () => {
|
it('linting should not error when all rules are followed', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${myapp}`);
|
runCLI(`generate @nrwl/react:app ${myapp}`);
|
||||||
@ -72,7 +69,7 @@ forEachCli('nx', () => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
|
||||||
it('linting should error when an invalid linter is specified', () => {
|
it('linting should error when an invalid linter is specified', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${myapp}`);
|
runCLI(`generate @nrwl/react:app ${myapp}`);
|
||||||
@ -178,41 +175,4 @@ forEachCli('nx', () => {
|
|||||||
'Unexpected console statement.'
|
'Unexpected console statement.'
|
||||||
);
|
);
|
||||||
}, 1000000);
|
}, 1000000);
|
||||||
});
|
|
||||||
|
|
||||||
// bad test. fix and reenable
|
|
||||||
xit('supports warning options', () => {
|
|
||||||
newProject();
|
|
||||||
const myapp = uniq('myapp');
|
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${myapp}`);
|
|
||||||
|
|
||||||
const eslintrc = readJson(`apps/${myapp}/.eslintrc.json`);
|
|
||||||
eslintrc.rules['no-console'] = 'warn';
|
|
||||||
updateFile(
|
|
||||||
`apps/${myapp}/.eslintrc.json`,
|
|
||||||
JSON.stringify(eslintrc, null, 2)
|
|
||||||
);
|
|
||||||
updateFile(
|
|
||||||
`apps/${myapp}/src/main.ts`,
|
|
||||||
`console.log('once'); console.log('twice');`
|
|
||||||
);
|
|
||||||
|
|
||||||
let output = runCLI(`lint ${myapp}`, { silenceError: true });
|
|
||||||
expect(output).toMatch(/warnings found/);
|
|
||||||
output = runCLI(`lint ${myapp} --maxWarning=1`, { silenceError: true });
|
|
||||||
expect(output).toMatch(/warnings found/);
|
|
||||||
output = runCLI(`lint ${myapp} --maxWarning=3`, { silenceError: true });
|
|
||||||
expect(output).not.toMatch(/warnings found/);
|
|
||||||
output = runCLI(`lint ${myapp} --quiet`, { silenceError: true });
|
|
||||||
expect(output).not.toMatch(/warnings found/);
|
|
||||||
}, 1000000);
|
|
||||||
});
|
|
||||||
|
|
||||||
forEachCli('angular', () => {
|
|
||||||
describe('Linter', () => {
|
|
||||||
it('empty test', () => {
|
|
||||||
expect(1).toEqual(1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { stringUtils } from '@nrwl/workspace';
|
import { stringUtils } from '@nrwl/workspace';
|
||||||
import {
|
import {
|
||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
ensureProject,
|
newProject,
|
||||||
forEachCli,
|
|
||||||
readFile,
|
readFile,
|
||||||
readJson,
|
readJson,
|
||||||
runCLI,
|
runCLI,
|
||||||
@ -11,10 +10,9 @@ import {
|
|||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli('nx', () => {
|
describe('Next.js Applications', () => {
|
||||||
describe('Next.js Applications', () => {
|
|
||||||
it('should be able to serve with a proxy configuration', async () => {
|
it('should be able to serve with a proxy configuration', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
||||||
@ -73,15 +71,13 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should be able to consume a react lib', async () => {
|
it('should be able to consume a react lib', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
||||||
|
|
||||||
runCLI(
|
runCLI(`generate @nrwl/react:lib ${libName} --no-interactive --style=none`);
|
||||||
`generate @nrwl/react:lib ${libName} --no-interactive --style=none`
|
|
||||||
);
|
|
||||||
|
|
||||||
const mainPath = `apps/${appName}/pages/index.tsx`;
|
const mainPath = `apps/${appName}/pages/index.tsx`;
|
||||||
updateFile(mainPath, `import '@proj/${libName}';\n` + readFile(mainPath));
|
updateFile(mainPath, `import '@proj/${libName}';\n` + readFile(mainPath));
|
||||||
@ -112,14 +108,12 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should be able to dynamically load a lib', async () => {
|
it('should be able to dynamically load a lib', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
||||||
runCLI(
|
runCLI(`generate @nrwl/react:lib ${libName} --no-interactive --style=none`);
|
||||||
`generate @nrwl/react:lib ${libName} --no-interactive --style=none`
|
|
||||||
);
|
|
||||||
|
|
||||||
const mainPath = `apps/${appName}/pages/index.tsx`;
|
const mainPath = `apps/${appName}/pages/index.tsx`;
|
||||||
updateFile(
|
updateFile(
|
||||||
@ -142,7 +136,7 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should compile when using a workspace and react lib written in TypeScript', async () => {
|
it('should compile when using a workspace and react lib written in TypeScript', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const tsLibName = uniq('tslib');
|
const tsLibName = uniq('tslib');
|
||||||
const tsxLibName = uniq('tsxlib');
|
const tsxLibName = uniq('tsxlib');
|
||||||
@ -245,7 +239,6 @@ forEachCli('nx', () => {
|
|||||||
|
|
||||||
checkFilesExist(`dist/apps/${appName}/public/a/b.txt`);
|
checkFilesExist(`dist/apps/${appName}/public/a/b.txt`);
|
||||||
}, 120000);
|
}, 120000);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
async function checkApp(
|
async function checkApp(
|
||||||
@ -279,12 +272,6 @@ async function checkApp(
|
|||||||
expect(packageJson.dependencies['react-dom']).toBeDefined();
|
expect(packageJson.dependencies['react-dom']).toBeDefined();
|
||||||
expect(packageJson.dependencies.next).toBeDefined();
|
expect(packageJson.dependencies.next).toBeDefined();
|
||||||
|
|
||||||
const exportResult = runCLI(`export ${appName}`);
|
runCLI(`export ${appName}`);
|
||||||
checkFilesExist(`dist/apps/${appName}/exported/index.html`);
|
checkFilesExist(`dist/apps/${appName}/exported/index.html`);
|
||||||
}
|
}
|
||||||
|
|
||||||
forEachCli('angular', () => {
|
|
||||||
describe('next', () => {
|
|
||||||
it('is not supported', () => {});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|||||||
@ -1,25 +1,20 @@
|
|||||||
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
||||||
import { execSync, fork, spawn } from 'child_process';
|
import { execSync, fork, spawn } from 'child_process';
|
||||||
import * as http from 'http';
|
import * as http from 'http';
|
||||||
import * as path from 'path';
|
|
||||||
import * as treeKill from 'tree-kill';
|
import * as treeKill from 'tree-kill';
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
import {
|
import {
|
||||||
checkFilesDoNotExist,
|
checkFilesDoNotExist,
|
||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
ensureProject,
|
newProject,
|
||||||
forEachCli,
|
|
||||||
readFile,
|
readFile,
|
||||||
readJson,
|
readJson,
|
||||||
runCLI,
|
runCLI,
|
||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
runNgNew,
|
|
||||||
runNgAdd,
|
|
||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
workspaceConfigName,
|
workspaceConfigName,
|
||||||
yarnAdd,
|
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
function getData(): Promise<any> {
|
function getData(): Promise<any> {
|
||||||
@ -37,15 +32,12 @@ function getData(): Promise<any> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
forEachCli((currentCLIName) => {
|
describe('Node Applications', () => {
|
||||||
const linter = currentCLIName === 'angular' ? 'tslint' : 'eslint';
|
|
||||||
|
|
||||||
describe('Node Applications', () => {
|
|
||||||
it('should be able to generate an empty application', async () => {
|
it('should be able to generate an empty application', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nodeapp = uniq('nodeapp');
|
const nodeapp = uniq('nodeapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/node:app ${nodeapp} --linter=${linter}`);
|
runCLI(`generate @nrwl/node:app ${nodeapp} --linter=eslint`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nodeapp}`);
|
const lintResults = runCLI(`lint ${nodeapp}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -61,10 +53,10 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
it('should be able to generate an express application', async (done) => {
|
it('should be able to generate an express application', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nodeapp = uniq('nodeapp');
|
const nodeapp = uniq('nodeapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/express:app ${nodeapp} --linter=${linter}`);
|
runCLI(`generate @nrwl/express:app ${nodeapp} --linter=eslint`);
|
||||||
const lintResults = runCLI(`lint ${nodeapp}`);
|
const lintResults = runCLI(`lint ${nodeapp}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
|
|
||||||
@ -99,9 +91,7 @@ forEachCli((currentCLIName) => {
|
|||||||
expect(server).toBeTruthy();
|
expect(server).toBeTruthy();
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
server.stdout.once('data', async (data) => {
|
server.stdout.once('data', async (data) => {
|
||||||
expect(data.toString()).toContain(
|
expect(data.toString()).toContain('Listening at http://localhost:3333');
|
||||||
'Listening at http://localhost:3333'
|
|
||||||
);
|
|
||||||
const result = await getData();
|
const result = await getData();
|
||||||
|
|
||||||
expect(result.message).toEqual(`Welcome to ${nodeapp}!`);
|
expect(result.message).toEqual(`Welcome to ${nodeapp}!`);
|
||||||
@ -134,39 +124,10 @@ forEachCli((currentCLIName) => {
|
|||||||
});
|
});
|
||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
xit('should have correct ts options for nest application', async () => {
|
|
||||||
if (currentCLIName === 'angular') {
|
|
||||||
// Usually the tests use ensureProject() to setup the test workspace. But it will trigger
|
|
||||||
// the nx workspace schematic which creates a tsconfig file containing the parameters
|
|
||||||
// required by nest.
|
|
||||||
// However, when creating an Angular workspace and adding the workspace capability (as
|
|
||||||
// described in the docs) the tsconfig file could miss required options if Angular removes
|
|
||||||
// them from their config files as happened with emitDecoratorMetadata.
|
|
||||||
runNgNew();
|
|
||||||
runNgAdd('--npmScope projscope');
|
|
||||||
yarnAdd('@nrwl/nest');
|
|
||||||
} else {
|
|
||||||
ensureProject();
|
|
||||||
}
|
|
||||||
|
|
||||||
const nestapp = uniq('nestapp');
|
|
||||||
runCLI(`generate @nrwl/nest:app ${nestapp} --linter=${linter}`);
|
|
||||||
const configPath = tmpProjPath(`apps/${nestapp}/tsconfig.app.json`);
|
|
||||||
const json = ts.readConfigFile(configPath, ts.sys.readFile);
|
|
||||||
const config = ts.parseJsonConfigFileContent(
|
|
||||||
json.config,
|
|
||||||
ts.sys,
|
|
||||||
path.dirname(configPath)
|
|
||||||
); // respects "extends" inside tsconfigs
|
|
||||||
|
|
||||||
expect(config.options.emitDecoratorMetadata).toEqual(true); // required by nest to function properly
|
|
||||||
expect(config.options.target).toEqual(ts.ScriptTarget.ES2015); // required by nest swagger to function properly
|
|
||||||
}, 180000);
|
|
||||||
|
|
||||||
it('should be able to generate a nest application', async (done) => {
|
it('should be able to generate a nest application', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nestapp = uniq('nestapp');
|
const nestapp = uniq('nestapp');
|
||||||
runCLI(`generate @nrwl/nest:app ${nestapp} --linter=${linter}`);
|
runCLI(`generate @nrwl/nest:app ${nestapp} --linter=eslint`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nestapp}`);
|
const lintResults = runCLI(`lint ${nestapp}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -226,11 +187,11 @@ forEachCli((currentCLIName) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 120000);
|
}, 120000);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Node Libraries', () => {
|
describe('Node Libraries', () => {
|
||||||
it('should be able to generate a node library', async () => {
|
it('should be able to generate a node library', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nodelib = uniq('nodelib');
|
const nodelib = uniq('nodelib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/node:lib ${nodelib}`);
|
runCLI(`generate @nrwl/node:lib ${nodelib}`);
|
||||||
@ -245,7 +206,7 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
it('should be able to generate a publishable node library', async () => {
|
it('should be able to generate a publishable node library', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const nodeLib = uniq('nodelib');
|
const nodeLib = uniq('nodelib');
|
||||||
runCLI(
|
runCLI(
|
||||||
@ -281,7 +242,7 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
it('should be able to copy assets', () => {
|
it('should be able to copy assets', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nodelib = uniq('nodelib');
|
const nodelib = uniq('nodelib');
|
||||||
const nglib = uniq('nglib');
|
const nglib = uniq('nglib');
|
||||||
|
|
||||||
@ -311,7 +272,7 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
it('should fail when trying to compile typescript files that are invalid', () => {
|
it('should fail when trying to compile typescript files that are invalid', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nodeLib = uniq('nodelib');
|
const nodeLib = uniq('nodelib');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/node:lib ${nodeLib} --publishable --importPath=@proj/${nodeLib}`
|
`generate @nrwl/node:lib ${nodeLib} --publishable --importPath=@proj/${nodeLib}`
|
||||||
@ -324,11 +285,11 @@ forEachCli((currentCLIName) => {
|
|||||||
);
|
);
|
||||||
expect(() => runCLI(`build ${nodeLib}`)).toThrow();
|
expect(() => runCLI(`build ${nodeLib}`)).toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('nest libraries', function () {
|
describe('nest libraries', function () {
|
||||||
it('should be able to generate a nest library', async () => {
|
it('should be able to generate a nest library', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib}`);
|
runCLI(`generate @nrwl/nest:lib ${nestlib}`);
|
||||||
@ -359,7 +320,7 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
it('should be able to generate a nest library w/ service', async () => {
|
it('should be able to generate a nest library w/ service', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib} --service`);
|
runCLI(`generate @nrwl/nest:lib ${nestlib} --service`);
|
||||||
@ -374,7 +335,7 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
it('should be able to generate a nest library w/ controller', async () => {
|
it('should be able to generate a nest library w/ controller', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib} --controller`);
|
runCLI(`generate @nrwl/nest:lib ${nestlib} --controller`);
|
||||||
@ -389,7 +350,7 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
it('should be able to generate a nest library w/ controller and service', async () => {
|
it('should be able to generate a nest library w/ controller and service', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib} --controller --service`);
|
runCLI(`generate @nrwl/nest:lib ${nestlib} --controller --service`);
|
||||||
@ -402,9 +363,9 @@ forEachCli((currentCLIName) => {
|
|||||||
'Test Suites: 2 passed, 2 total'
|
'Test Suites: 2 passed, 2 total'
|
||||||
);
|
);
|
||||||
}, 60000);
|
}, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('with dependencies', () => {
|
describe('with dependencies', () => {
|
||||||
/**
|
/**
|
||||||
* Graph:
|
* Graph:
|
||||||
*
|
*
|
||||||
@ -427,7 +388,7 @@ forEachCli((currentCLIName) => {
|
|||||||
childLib = uniq('childlib');
|
childLib = uniq('childlib');
|
||||||
childLib2 = uniq('childlib2');
|
childLib2 = uniq('childlib2');
|
||||||
|
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
runCLI(`generate @nrwl/express:app ${app}`);
|
runCLI(`generate @nrwl/express:app ${app}`);
|
||||||
runCLI(`generate @nrwl/node:lib ${parentLib} --buildable=true`);
|
runCLI(`generate @nrwl/node:lib ${parentLib} --buildable=true`);
|
||||||
@ -521,7 +482,6 @@ forEachCli((currentCLIName) => {
|
|||||||
assertPackageJson(parentLib, childLib2, '0.0.1');
|
assertPackageJson(parentLib, childLib2, '0.0.1');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (currentCLIName === 'nx') {
|
|
||||||
it('should build an app composed out of buildable libs', () => {
|
it('should build an app composed out of buildable libs', () => {
|
||||||
const buildWithDeps = runCLI(`build ${app} --with-deps`);
|
const buildWithDeps = runCLI(`build ${app} --with-deps`);
|
||||||
expect(buildWithDeps).toContain(`Running target "build" succeeded`);
|
expect(buildWithDeps).toContain(`Running target "build" succeeded`);
|
||||||
@ -535,6 +495,4 @@ forEachCli((currentCLIName) => {
|
|||||||
);
|
);
|
||||||
expect(failedBuild).toContain(`Can't resolve`);
|
expect(failedBuild).toContain(`Can't resolve`);
|
||||||
}, 1000000);
|
}, 1000000);
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,26 +1,21 @@
|
|||||||
import {
|
import {
|
||||||
forEachCli,
|
|
||||||
ensureProject,
|
|
||||||
uniq,
|
|
||||||
runCLI,
|
|
||||||
updateFile,
|
|
||||||
expectTestsPass,
|
|
||||||
runCLIAsync,
|
|
||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
|
expectTestsPass,
|
||||||
|
newProject,
|
||||||
readJson,
|
readJson,
|
||||||
|
runCLI,
|
||||||
|
runCLIAsync,
|
||||||
|
uniq,
|
||||||
workspaceConfigName,
|
workspaceConfigName,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli((currentCLIName) => {
|
describe('Nx Plugin', () => {
|
||||||
const linter = currentCLIName === 'angular' ? 'tslint' : 'eslint';
|
|
||||||
|
|
||||||
describe('Nx Plugin', () => {
|
|
||||||
it('should be able to generate a Nx Plugin ', async (done) => {
|
it('should be able to generate a Nx Plugin ', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=${linter} --importPath=@proj/${plugin}`
|
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --importPath=@proj/${plugin}`
|
||||||
);
|
);
|
||||||
const lintResults = runCLI(`lint ${plugin}`);
|
const lintResults = runCLI(`lint ${plugin}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -62,10 +57,10 @@ forEachCli((currentCLIName) => {
|
|||||||
// doesn't use the collection we are building
|
// doesn't use the collection we are building
|
||||||
// we should change it to point to the right collection using relative path
|
// we should change it to point to the right collection using relative path
|
||||||
it(`should run the plugin's e2e tests`, async (done) => {
|
it(`should run the plugin's e2e tests`, async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const plugin = uniq('plugin-name');
|
const plugin = uniq('plugin-name');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=${linter} --importPath=@proj/${plugin}`
|
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --importPath=@proj/${plugin}`
|
||||||
);
|
);
|
||||||
const results = await runCLIAsync(`e2e ${plugin}-e2e`);
|
const results = await runCLIAsync(`e2e ${plugin}-e2e`);
|
||||||
expect(results.stdout).toContain('Compiling TypeScript files');
|
expect(results.stdout).toContain('Compiling TypeScript files');
|
||||||
@ -75,12 +70,12 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 250000);
|
}, 250000);
|
||||||
|
|
||||||
it('should be able to generate a migration', async (done) => {
|
it('should be able to generate a migration', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
const version = '1.0.0';
|
const version = '1.0.0';
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=${linter} --importPath=@proj/${plugin}`
|
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --importPath=@proj/${plugin}`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:migration --project=${plugin} --version=${version} --packageJsonUpdates=false`
|
`generate @nrwl/nx-plugin:migration --project=${plugin} --version=${version} --packageJsonUpdates=false`
|
||||||
@ -114,12 +109,12 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 45000);
|
}, 45000);
|
||||||
|
|
||||||
it('should be able to generate a schematic', async (done) => {
|
it('should be able to generate a schematic', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
const schematic = uniq('schematic');
|
const schematic = uniq('schematic');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=${linter} --importPath=@proj/${plugin}`
|
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --importPath=@proj/${plugin}`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:schematic ${schematic} --project=${plugin}`
|
`generate @nrwl/nx-plugin:schematic ${schematic} --project=${plugin}`
|
||||||
@ -156,12 +151,12 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 45000);
|
}, 45000);
|
||||||
|
|
||||||
it('should be able to generate a builder', async (done) => {
|
it('should be able to generate a builder', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
const builder = uniq('builder');
|
const builder = uniq('builder');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=${linter} --importPath=@proj/${plugin}`
|
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --importPath=@proj/${plugin}`
|
||||||
);
|
);
|
||||||
runCLI(`generate @nrwl/nx-plugin:builder ${builder} --project=${plugin}`);
|
runCLI(`generate @nrwl/nx-plugin:builder ${builder} --project=${plugin}`);
|
||||||
|
|
||||||
@ -197,10 +192,10 @@ forEachCli((currentCLIName) => {
|
|||||||
|
|
||||||
describe('--directory', () => {
|
describe('--directory', () => {
|
||||||
it('should create a plugin in the specified directory', () => {
|
it('should create a plugin in the specified directory', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=${linter} --directory subdir --importPath=@proj/${plugin}`
|
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --directory subdir --importPath=@proj/${plugin}`
|
||||||
);
|
);
|
||||||
checkFilesExist(`libs/subdir/${plugin}/package.json`);
|
checkFilesExist(`libs/subdir/${plugin}/package.json`);
|
||||||
const workspace = readJson(workspaceConfigName());
|
const workspace = readJson(workspaceConfigName());
|
||||||
@ -213,14 +208,13 @@ forEachCli((currentCLIName) => {
|
|||||||
});
|
});
|
||||||
describe('--tags', () => {
|
describe('--tags', () => {
|
||||||
it('should add tags to nx.json', async () => {
|
it('should add tags to nx.json', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=${linter} --tags=e2etag,e2ePackage --importPath=@proj/${plugin}`
|
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --tags=e2etag,e2ePackage --importPath=@proj/${plugin}`
|
||||||
);
|
);
|
||||||
const nxJson = readJson('nx.json');
|
const nxJson = readJson('nx.json');
|
||||||
expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']);
|
expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']);
|
||||||
}, 45000);
|
}, 45000);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,17 +1,15 @@
|
|||||||
import {
|
import {
|
||||||
checkFilesDoNotExist,
|
checkFilesDoNotExist,
|
||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
ensureProject,
|
newProject,
|
||||||
forEachCli,
|
readFile,
|
||||||
readJson,
|
readJson,
|
||||||
runCLI,
|
runCLI,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
readFile,
|
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli('nx', (cli) => {
|
describe('Build React libraries and apps', () => {
|
||||||
describe('Build React libraries and apps', () => {
|
|
||||||
/**
|
/**
|
||||||
* Graph:
|
* Graph:
|
||||||
*
|
*
|
||||||
@ -33,7 +31,7 @@ forEachCli('nx', (cli) => {
|
|||||||
childLib = uniq('childlib');
|
childLib = uniq('childlib');
|
||||||
childLib2 = uniq('childlib2');
|
childLib2 = uniq('childlib2');
|
||||||
|
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${app}`);
|
runCLI(`generate @nrwl/react:app ${app}`);
|
||||||
|
|
||||||
@ -75,7 +73,7 @@ forEachCli('nx', (cli) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add assets to child lib
|
// Add assets to child lib
|
||||||
updateFile(cli === 'angular' ? 'angular.json' : 'workspace.json', (c) => {
|
updateFile('workspace.json', (c) => {
|
||||||
const json = JSON.parse(c);
|
const json = JSON.parse(c);
|
||||||
json.projects[childLib].architect.build.options.assets = [
|
json.projects[childLib].architect.build.options.assets = [
|
||||||
`libs/${childLib}/src/assets`,
|
`libs/${childLib}/src/assets`,
|
||||||
@ -202,5 +200,4 @@ forEachCli('nx', (cli) => {
|
|||||||
);
|
);
|
||||||
expect(failedBuild).toContain(`Can't resolve`);
|
expect(failedBuild).toContain(`Can't resolve`);
|
||||||
}, 1000000);
|
}, 1000000);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -2,8 +2,7 @@ import { serializeJson } from '@nrwl/workspace';
|
|||||||
import {
|
import {
|
||||||
checkFilesDoNotExist,
|
checkFilesDoNotExist,
|
||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
ensureProject,
|
newProject,
|
||||||
forEachCli,
|
|
||||||
readFile,
|
readFile,
|
||||||
readJson,
|
readJson,
|
||||||
renameFile,
|
renameFile,
|
||||||
@ -14,19 +13,14 @@ import {
|
|||||||
workspaceConfigName,
|
workspaceConfigName,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli('nx', () => {
|
describe('React Applications', () => {
|
||||||
describe('React Applications', () => {
|
|
||||||
it('should be able to generate a react app + lib', async () => {
|
it('should be able to generate a react app + lib', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(`generate @nrwl/react:app ${appName} --style=css --no-interactive`);
|
||||||
`generate @nrwl/react:app ${appName} --style=css --no-interactive`
|
runCLI(`generate @nrwl/react:lib ${libName} --style=css --no-interactive`);
|
||||||
);
|
|
||||||
runCLI(
|
|
||||||
`generate @nrwl/react:lib ${libName} --style=css --no-interactive`
|
|
||||||
);
|
|
||||||
|
|
||||||
// Libs should not include package.json by default
|
// Libs should not include package.json by default
|
||||||
checkFilesDoNotExist(`libs/${libName}/package.json`);
|
checkFilesDoNotExist(`libs/${libName}/package.json`);
|
||||||
@ -48,7 +42,7 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should support vendor sourcemaps', () => {
|
it('should support vendor sourcemaps', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${appName} --no-interactive`);
|
runCLI(`generate @nrwl/react:app ${appName} --no-interactive`);
|
||||||
@ -77,7 +71,7 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should be able to generate a publishable react lib', async () => {
|
it('should be able to generate a publishable react lib', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
@ -114,7 +108,7 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should be able to generate a react lib with no components', async () => {
|
it('should be able to generate a react lib with no components', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
@ -138,7 +132,7 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should not create a dist folder if there is an error', async () => {
|
it('should not create a dist folder if there is an error', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
@ -157,7 +151,7 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should generate app with routing', async () => {
|
it('should generate app with routing', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${appName} --routing --no-interactive`);
|
runCLI(`generate @nrwl/react:app ${appName} --routing --no-interactive`);
|
||||||
@ -171,7 +165,7 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should generate app with different style options', async () => {
|
it('should generate app with different style options', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const styledComponentsApp = uniq('app');
|
const styledComponentsApp = uniq('app');
|
||||||
|
|
||||||
@ -186,10 +180,7 @@ forEachCli('nx', () => {
|
|||||||
{
|
{
|
||||||
presets: ['@nrwl/react/babel'],
|
presets: ['@nrwl/react/babel'],
|
||||||
plugins: [
|
plugins: [
|
||||||
[
|
['styled-components', { pure: true, ssr: true, displayName: true }],
|
||||||
'styled-components',
|
|
||||||
{ pure: true, ssr: true, displayName: true },
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
env: {
|
env: {
|
||||||
production: {
|
production: {
|
||||||
@ -256,12 +247,10 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should generate app with legacy-ie support', async () => {
|
it('should generate app with legacy-ie support', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(`generate @nrwl/react:app ${appName} --style=css --no-interactive`);
|
||||||
`generate @nrwl/react:app ${appName} --style=css --no-interactive`
|
|
||||||
);
|
|
||||||
|
|
||||||
// changing browser suporrt of this application
|
// changing browser suporrt of this application
|
||||||
updateFile(`apps/${appName}/.browserslistrc`, `IE 11`);
|
updateFile(`apps/${appName}/.browserslistrc`, `IE 11`);
|
||||||
@ -286,7 +275,7 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should be able to add a redux slice', async () => {
|
it('should be able to add a redux slice', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
@ -307,17 +296,14 @@ forEachCli('nx', () => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should be able to use JSX', async () => {
|
it('should be able to use JSX', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${appName} --no-interactive`);
|
runCLI(`generate @nrwl/react:app ${appName} --no-interactive`);
|
||||||
runCLI(`generate @nrwl/react:lib ${libName} --no-interactive`);
|
runCLI(`generate @nrwl/react:lib ${libName} --no-interactive`);
|
||||||
|
|
||||||
renameFile(
|
renameFile(`apps/${appName}/src/main.tsx`, `apps/${appName}/src/main.jsx`);
|
||||||
`apps/${appName}/src/main.tsx`,
|
|
||||||
`apps/${appName}/src/main.jsx`
|
|
||||||
);
|
|
||||||
renameFile(
|
renameFile(
|
||||||
`apps/${appName}/src/app/app.tsx`,
|
`apps/${appName}/src/app/app.tsx`,
|
||||||
`apps/${appName}/src/app/app.jsx`
|
`apps/${appName}/src/app/app.jsx`
|
||||||
@ -415,5 +401,4 @@ forEachCli('nx', () => {
|
|||||||
expect(e2eResults).toContain('All specs passed!');
|
expect(e2eResults).toContain('All specs passed!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,20 +1,18 @@
|
|||||||
import {
|
import {
|
||||||
forEachCli,
|
checkFilesExist,
|
||||||
|
newProject,
|
||||||
|
readFile,
|
||||||
runCLI,
|
runCLI,
|
||||||
supportUi,
|
supportUi,
|
||||||
uniq,
|
|
||||||
ensureProject,
|
|
||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
checkFilesExist,
|
uniq,
|
||||||
readFile,
|
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
import { writeFileSync, mkdirSync } from 'fs';
|
import { mkdirSync, writeFileSync } from 'fs';
|
||||||
|
|
||||||
forEachCli(() => {
|
describe('Storybook schematics', () => {
|
||||||
describe('Storybook schematics', () => {
|
|
||||||
describe('running Storybook and Cypress', () => {
|
describe('running Storybook and Cypress', () => {
|
||||||
it('should execute e2e tests using Cypress running against Storybook', () => {
|
it('should execute e2e tests using Cypress running against Storybook', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --no-interactive`);
|
runCLI(`generate @nrwl/angular:app ${myapp} --no-interactive`);
|
||||||
@ -149,7 +147,7 @@ forEachCli(() => {
|
|||||||
|
|
||||||
describe('build storybook', () => {
|
describe('build storybook', () => {
|
||||||
it('should build an Angular based storybook', () => {
|
it('should build an Angular based storybook', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const angularStorybookLib = uniq('test-ui-lib');
|
const angularStorybookLib = uniq('test-ui-lib');
|
||||||
createTestUILib(angularStorybookLib);
|
createTestUILib(angularStorybookLib);
|
||||||
@ -166,12 +164,10 @@ forEachCli(() => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
|
||||||
it('should build a React based storybook', () => {
|
it('should build a React based storybook', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const reactStorybookLib = uniq('test-ui-lib-react');
|
const reactStorybookLib = uniq('test-ui-lib-react');
|
||||||
runCLI(
|
runCLI(`generate @nrwl/react:lib ${reactStorybookLib} --no-interactive`);
|
||||||
`generate @nrwl/react:lib ${reactStorybookLib} --no-interactive`
|
|
||||||
);
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:storybook-configuration ${reactStorybookLib} --generateStories --no-interactive`
|
`generate @nrwl/react:storybook-configuration ${reactStorybookLib} --generateStories --no-interactive`
|
||||||
);
|
);
|
||||||
@ -185,12 +181,10 @@ forEachCli(() => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
|
||||||
it('should build a React based storybook that references another lib', () => {
|
it('should build a React based storybook that references another lib', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const reactStorybookLib = uniq('test-ui-lib-react');
|
const reactStorybookLib = uniq('test-ui-lib-react');
|
||||||
runCLI(
|
runCLI(`generate @nrwl/react:lib ${reactStorybookLib} --no-interactive`);
|
||||||
`generate @nrwl/react:lib ${reactStorybookLib} --no-interactive`
|
|
||||||
);
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:storybook-configuration ${reactStorybookLib} --generateStories --no-interactive`
|
`generate @nrwl/react:storybook-configuration ${reactStorybookLib} --generateStories --no-interactive`
|
||||||
);
|
);
|
||||||
@ -258,7 +252,7 @@ forEachCli(() => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
|
||||||
it('should build an Angular based storybook that references another lib', () => {
|
it('should build an Angular based storybook that references another lib', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const angularStorybookLib = uniq('test-ui-lib');
|
const angularStorybookLib = uniq('test-ui-lib');
|
||||||
createTestUILib(angularStorybookLib);
|
createTestUILib(angularStorybookLib);
|
||||||
@ -313,7 +307,6 @@ forEachCli(() => {
|
|||||||
).toContain(`<title>Storybook</title>`);
|
).toContain(`<title>Storybook</title>`);
|
||||||
}, 1000000);
|
}, 1000000);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export function createTestUILib(libName: string): void {
|
export function createTestUILib(libName: string): void {
|
||||||
|
|||||||
@ -15,7 +15,12 @@ interface RunCmdOpts {
|
|||||||
cwd?: string;
|
cwd?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export let cli;
|
let cli;
|
||||||
|
|
||||||
|
export function currentCli() {
|
||||||
|
return cli ? cli : 'nx';
|
||||||
|
}
|
||||||
|
|
||||||
let projName: string;
|
let projName: string;
|
||||||
|
|
||||||
export function setCurrentProjName(name: string) {
|
export function setCurrentProjName(name: string) {
|
||||||
@ -74,7 +79,7 @@ export function patchKarmaToWorkOnWSL(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function workspaceConfigName() {
|
export function workspaceConfigName() {
|
||||||
return cli === 'angular' ? 'angular.json' : 'workspace.json';
|
return currentCli() === 'angular' ? 'angular.json' : 'workspace.json';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function runCreateWorkspace(
|
export function runCreateWorkspace(
|
||||||
@ -95,7 +100,9 @@ export function runCreateWorkspace(
|
|||||||
) {
|
) {
|
||||||
const linterArg =
|
const linterArg =
|
||||||
preset === 'angular' || preset === 'angular-nest' ? ' --linter=tslint' : '';
|
preset === 'angular' || preset === 'angular-nest' ? ' --linter=tslint' : '';
|
||||||
let command = `npx create-nx-workspace@${process.env.PUBLISHED_VERSION} ${name} --cli=${cli} --preset=${preset} ${linterArg} --no-nxCloud --no-interactive`;
|
let command = `npx create-nx-workspace@${
|
||||||
|
process.env.PUBLISHED_VERSION
|
||||||
|
} ${name} --cli=${currentCli()} --preset=${preset} ${linterArg} --no-nxCloud --no-interactive`;
|
||||||
if (appName) {
|
if (appName) {
|
||||||
command += ` --appName=${appName}`;
|
command += ` --appName=${appName}`;
|
||||||
}
|
}
|
||||||
@ -112,7 +119,7 @@ export function runCreateWorkspace(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const create = execSync(command, {
|
const create = execSync(command, {
|
||||||
cwd: `./tmp/${cli}`,
|
cwd: `./tmp/${currentCli()}`,
|
||||||
stdio: [0, 1, 2],
|
stdio: [0, 1, 2],
|
||||||
env: process.env,
|
env: process.env,
|
||||||
});
|
});
|
||||||
@ -120,7 +127,7 @@ export function runCreateWorkspace(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function yarnAdd(pkg: string, projName?: string) {
|
export function yarnAdd(pkg: string, projName?: string) {
|
||||||
const cwd = projName ? `./tmp/${cli}/${projName}` : tmpProjPath();
|
const cwd = projName ? `./tmp/${currentCli()}/${projName}` : tmpProjPath();
|
||||||
const install = execSync(`yarn add ${pkg}`, {
|
const install = execSync(`yarn add ${pkg}`, {
|
||||||
cwd,
|
cwd,
|
||||||
// ...{ stdio: ['pipe', 'pipe', 'pipe'] },
|
// ...{ stdio: ['pipe', 'pipe', 'pipe'] },
|
||||||
@ -132,7 +139,7 @@ export function yarnAdd(pkg: string, projName?: string) {
|
|||||||
|
|
||||||
export function runNgNew(): string {
|
export function runNgNew(): string {
|
||||||
return execSync(`../../node_modules/.bin/ng new proj --no-interactive`, {
|
return execSync(`../../node_modules/.bin/ng new proj --no-interactive`, {
|
||||||
cwd: `./tmp/${cli}`,
|
cwd: `./tmp/${currentCli()}`,
|
||||||
env: process.env,
|
env: process.env,
|
||||||
}).toString();
|
}).toString();
|
||||||
}
|
}
|
||||||
@ -162,9 +169,9 @@ export function newProject(): void {
|
|||||||
(f) => f !== '@nrwl/nx-plugin' && f !== `@nrwl/eslint-plugin-nx`
|
(f) => f !== '@nrwl/nx-plugin' && f !== `@nrwl/eslint-plugin-nx`
|
||||||
)
|
)
|
||||||
.forEach((p) => {
|
.forEach((p) => {
|
||||||
runCLI(`g ${p}:init`, { cwd: `./tmp/${cli}/proj` });
|
runCLI(`g ${p}:init`, { cwd: `./tmp/${currentCli()}/proj` });
|
||||||
});
|
});
|
||||||
execSync(`mv ./tmp/${cli}/proj ${tmpBackupProjPath()}`);
|
execSync(`mv ./tmp/${currentCli()}/proj ${tmpBackupProjPath()}`);
|
||||||
}
|
}
|
||||||
execSync(`cp -a ${tmpBackupProjPath()} ${tmpProjPath()}`);
|
execSync(`cp -a ${tmpBackupProjPath()} ${tmpProjPath()}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -174,19 +181,6 @@ export function newProject(): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensures that a project has been setup
|
|
||||||
* in the temporary project path for the
|
|
||||||
* currently selected CLI.
|
|
||||||
*
|
|
||||||
* If one is not found, it creates a new project.
|
|
||||||
*/
|
|
||||||
export function ensureProject(): void {
|
|
||||||
// if (!directoryExists(tmpProjPath())) {
|
|
||||||
newProject();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
export function supportUi() {
|
export function supportUi() {
|
||||||
return false;
|
return false;
|
||||||
// return !process.env.NO_CHROME;
|
// return !process.env.NO_CHROME;
|
||||||
@ -203,7 +197,7 @@ export function runCommandAsync(
|
|||||||
exec(
|
exec(
|
||||||
command,
|
command,
|
||||||
{
|
{
|
||||||
cwd: opts.cwd || tmpProjPath(),
|
cwd: tmpProjPath(),
|
||||||
env: { ...process.env, FORCE_COLOR: 'false' },
|
env: { ...process.env, FORCE_COLOR: 'false' },
|
||||||
},
|
},
|
||||||
(err, stdout, stderr) => {
|
(err, stdout, stderr) => {
|
||||||
@ -216,6 +210,43 @@ export function runCommandAsync(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function runCommandUntil(
|
||||||
|
command: string,
|
||||||
|
criteria: (output: string) => boolean
|
||||||
|
) {
|
||||||
|
const p = exec(`./node_modules/.bin/nx ${command}`, {
|
||||||
|
cwd: tmpProjPath(),
|
||||||
|
env: { ...process.env, FORCE_COLOR: 'false' },
|
||||||
|
});
|
||||||
|
|
||||||
|
return new Promise((res, rej) => {
|
||||||
|
let output = '';
|
||||||
|
let complete = false;
|
||||||
|
p.stdout.on('data', (c) => {
|
||||||
|
output += c.toString();
|
||||||
|
if (criteria(output)) {
|
||||||
|
complete = true;
|
||||||
|
res(true);
|
||||||
|
p.kill();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
p.stderr.on('data', (c) => {
|
||||||
|
output += c.toString();
|
||||||
|
if (criteria(output)) {
|
||||||
|
complete = true;
|
||||||
|
res(true);
|
||||||
|
p.kill();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
p.on('exit', (code) => {
|
||||||
|
if (code !== 0 && !complete) {
|
||||||
|
console.log(output);
|
||||||
|
}
|
||||||
|
rej(`Exited with ${code}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function runCLIAsync(
|
export function runCLIAsync(
|
||||||
command: string,
|
command: string,
|
||||||
opts: RunCmdOpts = {
|
opts: RunCmdOpts = {
|
||||||
@ -436,9 +467,13 @@ export function getSize(filePath: string): number {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function tmpProjPath(path?: string) {
|
export function tmpProjPath(path?: string) {
|
||||||
return path ? `./tmp/${cli}/${projName}/${path}` : `./tmp/${cli}/${projName}`;
|
return path
|
||||||
|
? `./tmp/${currentCli()}/${projName}/${path}`
|
||||||
|
: `./tmp/${currentCli()}/${projName}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function tmpBackupProjPath(path?: string) {
|
function tmpBackupProjPath(path?: string) {
|
||||||
return path ? `./tmp/${cli}/proj-backup/${path}` : `./tmp/${cli}/proj-backup`;
|
return path
|
||||||
|
? `./tmp/${currentCli()}/proj-backup/${path}`
|
||||||
|
: `./tmp/${currentCli()}/proj-backup`;
|
||||||
}
|
}
|
||||||
|
|||||||
32
e2e/web/src/file-server.test.ts
Normal file
32
e2e/web/src/file-server.test.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import {
|
||||||
|
newProject,
|
||||||
|
readJson,
|
||||||
|
runCLI,
|
||||||
|
runCommandUntil,
|
||||||
|
uniq,
|
||||||
|
updateFile,
|
||||||
|
workspaceConfigName,
|
||||||
|
} from '@nrwl/e2e/utils';
|
||||||
|
import { serializeJson } from '@nrwl/workspace';
|
||||||
|
|
||||||
|
describe('file-server', () => {
|
||||||
|
it('should serve folder of files', async (done) => {
|
||||||
|
newProject();
|
||||||
|
const appName = uniq('app');
|
||||||
|
|
||||||
|
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`);
|
||||||
|
const workspaceJson = readJson(workspaceConfigName());
|
||||||
|
workspaceJson.projects[appName].architect['serve'].builder =
|
||||||
|
'@nrwl/web:file-server';
|
||||||
|
updateFile(workspaceConfigName(), serializeJson(workspaceJson));
|
||||||
|
|
||||||
|
await runCommandUntil(`serve ${appName}`, (output) => {
|
||||||
|
return (
|
||||||
|
output.indexOf('Built at') > -1 && output.indexOf('Available on') > -1
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// success, nothing to do
|
||||||
|
done();
|
||||||
|
}, 30000);
|
||||||
|
});
|
||||||
@ -1,26 +1,20 @@
|
|||||||
import {
|
import {
|
||||||
checkFilesExist,
|
|
||||||
checkFilesDoNotExist,
|
checkFilesDoNotExist,
|
||||||
ensureProject,
|
checkFilesExist,
|
||||||
forEachCli,
|
createFile,
|
||||||
|
newProject,
|
||||||
readFile,
|
readFile,
|
||||||
runCLI,
|
runCLI,
|
||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
createFile,
|
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nrwl/e2e/utils';
|
||||||
|
|
||||||
forEachCli((currentCLIName) => {
|
describe('Web Components Applications', () => {
|
||||||
describe('Web Components Applications', () => {
|
|
||||||
it('should be able to generate a web app', async () => {
|
it('should be able to generate a web app', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`);
|
||||||
const linter = currentCLIName === 'angular' ? 'tslint' : 'eslint';
|
|
||||||
runCLI(
|
|
||||||
`generate @nrwl/web:app ${appName} --no-interactive --linter=${linter}`
|
|
||||||
);
|
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${appName}`);
|
const lintResults = runCLI(`lint ${appName}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -59,14 +53,12 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should remove previous output before building', async () => {
|
it('should remove previous output before building', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`);
|
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`);
|
||||||
runCLI(
|
runCLI(`generate @nrwl/react:lib ${libName} --buildable --no-interactive`);
|
||||||
`generate @nrwl/react:lib ${libName} --buildable --no-interactive`
|
|
||||||
);
|
|
||||||
|
|
||||||
createFile(`dist/apps/${appName}/_should_remove.txt`);
|
createFile(`dist/apps/${appName}/_should_remove.txt`);
|
||||||
createFile(`dist/libs/${libName}/_should_remove.txt`);
|
createFile(`dist/libs/${libName}/_should_remove.txt`);
|
||||||
@ -85,7 +77,7 @@ forEachCli((currentCLIName) => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should do another build if differential loading is needed', async () => {
|
it('should do another build if differential loading is needed', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`);
|
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`);
|
||||||
@ -103,11 +95,11 @@ forEachCli((currentCLIName) => {
|
|||||||
output.match(/Starting type checking service.../g) || []
|
output.match(/Starting type checking service.../g) || []
|
||||||
).toHaveLength(1);
|
).toHaveLength(1);
|
||||||
}, 120000);
|
}, 120000);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('CLI - Environment Variables', () => {
|
describe('CLI - Environment Variables', () => {
|
||||||
it('should automatically load workspace and per-project environment variables', () => {
|
it('should automatically load workspace and per-project environment variables', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
//test if the Nx CLI loads root .env vars
|
//test if the Nx CLI loads root .env vars
|
||||||
@ -170,5 +162,4 @@ forEachCli((currentCLIName) => {
|
|||||||
'const envVars = ["test", "52", "QA", "ws-base", "ws-local", "app2-base", "app2-local", "shared2-in-app-local"];'
|
'const envVars = ["test", "52", "QA", "ws-base", "ws-local", "app2-base", "app2-local", "shared2-in-app-local"];'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
import { cli, forEachCli, runCreateWorkspace, uniq } from '@nrwl/e2e/utils';
|
import {
|
||||||
|
currentCli,
|
||||||
|
forEachCli,
|
||||||
|
runCreateWorkspace,
|
||||||
|
uniq,
|
||||||
|
} from '@nrwl/e2e/utils';
|
||||||
import { existsSync, mkdirSync } from 'fs-extra';
|
import { existsSync, mkdirSync } from 'fs-extra';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
|
|
||||||
@ -98,11 +103,13 @@ forEachCli(() => {
|
|||||||
it('should handle spaces in workspace path', () => {
|
it('should handle spaces in workspace path', () => {
|
||||||
const wsName = uniq('empty');
|
const wsName = uniq('empty');
|
||||||
|
|
||||||
const tmpDir = `./tmp/${cli}/with space`;
|
const tmpDir = `./tmp/${currentCli()}/with space`;
|
||||||
|
|
||||||
mkdirSync(tmpDir);
|
mkdirSync(tmpDir);
|
||||||
|
|
||||||
const command = `npx create-nx-workspace@${process.env.PUBLISHED_VERSION} ${wsName} --cli=${cli} --preset=empty --no-nxCloud --no-interactive`;
|
const command = `npx create-nx-workspace@${
|
||||||
|
process.env.PUBLISHED_VERSION
|
||||||
|
} ${wsName} --cli=${currentCli()} --preset=empty --no-nxCloud --no-interactive`;
|
||||||
execSync(command, {
|
execSync(command, {
|
||||||
cwd: tmpDir,
|
cwd: tmpDir,
|
||||||
stdio: [0, 1, 2],
|
stdio: [0, 1, 2],
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
ensureProject,
|
|
||||||
forEachCli,
|
forEachCli,
|
||||||
|
newProject,
|
||||||
readJson,
|
readJson,
|
||||||
runCLI,
|
runCLI,
|
||||||
uniq,
|
uniq,
|
||||||
@ -11,7 +11,7 @@ import {
|
|||||||
forEachCli(() => {
|
forEachCli(() => {
|
||||||
describe('Run Commands', () => {
|
describe('Run Commands', () => {
|
||||||
it('should not override environment variables already set when setting a custom env file path', async (done) => {
|
it('should not override environment variables already set when setting a custom env file path', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const nodeapp = uniq('nodeapp');
|
const nodeapp = uniq('nodeapp');
|
||||||
updateFile(
|
updateFile(
|
||||||
`.env`,
|
`.env`,
|
||||||
@ -38,7 +38,7 @@ forEachCli(() => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should interpolate provided arguments', async (done) => {
|
it('should interpolate provided arguments', async (done) => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp1');
|
const myapp = uniq('myapp1');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nrwl/web:app ${myapp}`);
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
ensureProject,
|
|
||||||
exists,
|
exists,
|
||||||
forEachCli,
|
forEachCli,
|
||||||
|
newProject,
|
||||||
readFile,
|
readFile,
|
||||||
readJson,
|
readJson,
|
||||||
runCLI,
|
runCLI,
|
||||||
@ -18,7 +18,7 @@ import { classify } from '@nrwl/workspace/src/utils/strings';
|
|||||||
|
|
||||||
forEachCli((cli) => {
|
forEachCli((cli) => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
ensureProject();
|
newProject();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('lint', () => {
|
describe('lint', () => {
|
||||||
@ -263,8 +263,8 @@ forEachCli((cli) => {
|
|||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const dryRunOutput = runCommand(
|
runCommand(
|
||||||
`npm run workspace-schematic ${custom} ${workspace} -- --no-interactive -d`
|
`nx workspace-schematic ${custom} ${workspace} --no-interactive -d`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(() =>
|
expect(() =>
|
||||||
@ -279,7 +279,7 @@ forEachCli((cli) => {
|
|||||||
).toThrow();
|
).toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('vvvshould support workspace-specific schematics', async () => {
|
it('should support workspace-specific schematics', async () => {
|
||||||
const json = readJson(`tools/schematics/${custom}/schema.json`);
|
const json = readJson(`tools/schematics/${custom}/schema.json`);
|
||||||
json.properties['directory'] = {
|
json.properties['directory'] = {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -304,24 +304,20 @@ forEachCli((cli) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const workspace = uniq('workspace');
|
const workspace = uniq('workspace');
|
||||||
const dryRunOutput = runCommand(
|
const dryRunOutput = runCLI(
|
||||||
`npm run workspace-schematic ${custom} ${workspace} -- --no-interactive --directory=dir --skipTsConfig=true -d`
|
`workspace-schematic ${custom} ${workspace} --no-interactive --directory=dir --skipTsConfig=true -d`
|
||||||
);
|
);
|
||||||
expect(exists(`libs/dir/${workspace}/src/index.ts`)).toEqual(false);
|
expect(exists(`libs/dir/${workspace}/src/index.ts`)).toEqual(false);
|
||||||
expect(dryRunOutput).toContain(`UPDATE ${workspaceConfigName()}`);
|
expect(dryRunOutput).toContain(`UPDATE ${workspaceConfigName()}`);
|
||||||
expect(dryRunOutput).toContain('UPDATE nx.json');
|
expect(dryRunOutput).toContain('UPDATE nx.json');
|
||||||
expect(dryRunOutput).not.toContain('UPDATE tsconfig.base.json');
|
|
||||||
|
|
||||||
const output = runCommand(
|
const output = runCLI(
|
||||||
`npm run workspace-schematic ${custom} ${workspace} -- --no-interactive --directory=dir`
|
`workspace-schematic ${custom} ${workspace} --no-interactive --directory=dir`
|
||||||
);
|
);
|
||||||
checkFilesExist(`libs/dir/${workspace}/src/index.ts`);
|
checkFilesExist(`libs/dir/${workspace}/src/index.ts`);
|
||||||
expect(output).toContain(`UPDATE ${workspaceConfigName()}`);
|
expect(output).toContain(`UPDATE ${workspaceConfigName()}`);
|
||||||
expect(output).toContain('UPDATE nx.json');
|
expect(output).toContain('UPDATE nx.json');
|
||||||
|
|
||||||
const another = uniq('another');
|
|
||||||
runCLI(`g workspace-schematic ${another} --no-interactive`);
|
|
||||||
|
|
||||||
const jsonFailing = readJson(`tools/schematics/${failing}/schema.json`);
|
const jsonFailing = readJson(`tools/schematics/${failing}/schema.json`);
|
||||||
jsonFailing.properties = {};
|
jsonFailing.properties = {};
|
||||||
jsonFailing.required = [];
|
jsonFailing.required = [];
|
||||||
@ -340,26 +336,15 @@ forEachCli((cli) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await runCommandAsync(
|
await runCLI(`workspace-schematic ${failing} --no-interactive`);
|
||||||
`npm run workspace-schematic -- ${failing} --no-interactive`
|
|
||||||
);
|
|
||||||
fail(`Should exit 1 for a workspace-schematic that throws an error`);
|
fail(`Should exit 1 for a workspace-schematic that throws an error`);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
const listSchematicsOutput = runCommand(
|
const listSchematicsOutput = runCLI(
|
||||||
'npm run workspace-schematic -- --list-schematics'
|
'workspace-schematic --list-schematics'
|
||||||
);
|
|
||||||
expect(listSchematicsOutput).toContain(
|
|
||||||
'nx workspace-schematic "--list-schematics"'
|
|
||||||
);
|
);
|
||||||
expect(listSchematicsOutput).toContain(custom);
|
expect(listSchematicsOutput).toContain(custom);
|
||||||
expect(listSchematicsOutput).toContain(failing);
|
expect(listSchematicsOutput).toContain(failing);
|
||||||
expect(listSchematicsOutput).toContain(another);
|
|
||||||
|
|
||||||
const promptOutput = runCommand(
|
|
||||||
`npm run workspace-schematic ${custom} mylib2 --dry-run`
|
|
||||||
);
|
|
||||||
expect(promptOutput).toContain('UPDATE nx.json');
|
|
||||||
}, 1000000);
|
}, 1000000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import { NxJson } from '@nrwl/workspace';
|
import { NxJson } from '@nrwl/workspace';
|
||||||
import {
|
import {
|
||||||
ensureProject,
|
|
||||||
forEachCli,
|
forEachCli,
|
||||||
listFiles,
|
listFiles,
|
||||||
newProject,
|
newProject,
|
||||||
@ -33,7 +32,7 @@ forEachCli((cliName) => {
|
|||||||
|
|
||||||
describe('run-one', () => {
|
describe('run-one', () => {
|
||||||
it('should build specific project', () => {
|
it('should build specific project', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
const mylib1 = uniq('mylib1');
|
const mylib1 = uniq('mylib1');
|
||||||
const mylib2 = uniq('mylib1');
|
const mylib2 = uniq('mylib1');
|
||||||
@ -140,7 +139,7 @@ forEachCli((cliName) => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
|
||||||
it('should run only failed projects', () => {
|
it('should run only failed projects', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
const myapp2 = uniq('myapp2');
|
const myapp2 = uniq('myapp2');
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp}`);
|
runCLI(`generate @nrwl/angular:app ${myapp}`);
|
||||||
@ -196,7 +195,7 @@ forEachCli((cliName) => {
|
|||||||
|
|
||||||
describe('affected:*', () => {
|
describe('affected:*', () => {
|
||||||
it('should print, build, and test affected apps', () => {
|
it('should print, build, and test affected apps', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
const myapp2 = uniq('myapp2');
|
const myapp2 = uniq('myapp2');
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
@ -356,7 +355,7 @@ forEachCli((cliName) => {
|
|||||||
let myapp2 = uniq('myapp');
|
let myapp2 = uniq('myapp');
|
||||||
let mylib = uniq('mylib');
|
let mylib = uniq('mylib');
|
||||||
it('should not affect other projects by generating a new project', () => {
|
it('should not affect other projects by generating a new project', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const nxJson: NxJson = readJson('nx.json');
|
const nxJson: NxJson = readJson('nx.json');
|
||||||
|
|
||||||
@ -557,7 +556,7 @@ forEachCli((cliName) => {
|
|||||||
|
|
||||||
describe('cache', () => {
|
describe('cache', () => {
|
||||||
it('should cache command execution', async () => {
|
it('should cache command execution', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const myapp1 = uniq('myapp1');
|
const myapp1 = uniq('myapp1');
|
||||||
const myapp2 = uniq('myapp2');
|
const myapp2 = uniq('myapp2');
|
||||||
@ -690,7 +689,7 @@ forEachCli((cliName) => {
|
|||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should only cache specific files if build outputs is configured with specific files', async () => {
|
it('should only cache specific files if build outputs is configured with specific files', async () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
|
|
||||||
const mylib1 = uniq('mylib1');
|
const mylib1 = uniq('mylib1');
|
||||||
runCLI(`generate @nrwl/react:lib ${mylib1} --buildable`);
|
runCLI(`generate @nrwl/react:lib ${mylib1} --buildable`);
|
||||||
@ -759,7 +758,7 @@ forEachCli((cliName) => {
|
|||||||
|
|
||||||
describe('workspace structure', () => {
|
describe('workspace structure', () => {
|
||||||
it('should have a vscode/extensions.json file created', () => {
|
it('should have a vscode/extensions.json file created', () => {
|
||||||
ensureProject();
|
newProject();
|
||||||
const extensions = readJson('.vscode/extensions.json');
|
const extensions = readJson('.vscode/extensions.json');
|
||||||
if (cliName === 'angular') {
|
if (cliName === 'angular') {
|
||||||
expect(extensions).toEqual({
|
expect(extensions).toEqual({
|
||||||
|
|||||||
8
nx.json
8
nx.json
@ -35,11 +35,12 @@
|
|||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"devkit": {
|
"devkit": {
|
||||||
"tags": []
|
"tags": ["tao"],
|
||||||
|
"implicitDependencies": ["tao"]
|
||||||
},
|
},
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"implicitDependencies": ["tao", "cli"]
|
"implicitDependencies": ["tao", "cli", "devkit"]
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"tags": [],
|
"tags": [],
|
||||||
@ -98,7 +99,8 @@
|
|||||||
"implicitDependencies": ["nx-plugin"]
|
"implicitDependencies": ["nx-plugin"]
|
||||||
},
|
},
|
||||||
"cli": {
|
"cli": {
|
||||||
"tags": []
|
"tags": [],
|
||||||
|
"implicitDependencies": ["tao"]
|
||||||
},
|
},
|
||||||
"angular": {
|
"angular": {
|
||||||
"tags": [],
|
"tags": [],
|
||||||
|
|||||||
19
package.json
19
package.json
@ -63,14 +63,15 @@
|
|||||||
"@ngrx/store": "9.1.0",
|
"@ngrx/store": "9.1.0",
|
||||||
"@ngrx/store-devtools": "9.1.0",
|
"@ngrx/store-devtools": "9.1.0",
|
||||||
"@ngtools/webpack": "~10.1.3",
|
"@ngtools/webpack": "~10.1.3",
|
||||||
"@nrwl/cli": "10.3.1-beta.1",
|
"@nrwl/cli": "10.4.1",
|
||||||
"@nrwl/cypress": "10.4.0-beta.2",
|
"@nrwl/tao": "10.4.1",
|
||||||
"@nrwl/eslint-plugin-nx": "10.4.0-beta.2",
|
"@nrwl/cypress": "10.4.1",
|
||||||
"@nrwl/jest": "10.4.0-beta.2",
|
"@nrwl/eslint-plugin-nx": "10.4.1",
|
||||||
"@nrwl/node": "10.4.0-beta.2",
|
"@nrwl/jest": "10.4.1",
|
||||||
|
"@nrwl/node": "10.4.1",
|
||||||
"@nrwl/nx-cloud": "10.1.9",
|
"@nrwl/nx-cloud": "10.1.9",
|
||||||
"@nrwl/web": "10.4.0-beta.2",
|
"@nrwl/web": "10.4.1",
|
||||||
"@nrwl/workspace": "10.4.0-beta.2",
|
"@nrwl/workspace": "10.4.1",
|
||||||
"@reduxjs/toolkit": "1.3.2",
|
"@reduxjs/toolkit": "1.3.2",
|
||||||
"@rollup/plugin-babel": "5.0.2",
|
"@rollup/plugin-babel": "5.0.2",
|
||||||
"@rollup/plugin-commonjs": "11.0.2",
|
"@rollup/plugin-commonjs": "11.0.2",
|
||||||
@ -252,7 +253,9 @@
|
|||||||
"yargs-parser": "20.0.0",
|
"yargs-parser": "20.0.0",
|
||||||
"zone.js": "^0.10.0",
|
"zone.js": "^0.10.0",
|
||||||
"ejs": "^3.1.5",
|
"ejs": "^3.1.5",
|
||||||
"tsconfig-paths":"^3.9.0"
|
"tsconfig-paths": "^3.9.0",
|
||||||
|
"node-watch": "0.7.0",
|
||||||
|
"http-server": "0.12.3"
|
||||||
},
|
},
|
||||||
"author": "Victor Savkin",
|
"author": "Victor Savkin",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@ -1,4 +1,10 @@
|
|||||||
export { Tree, FileChange } from '@nrwl/tao/src/shared/tree';
|
export { Tree, FileChange } from '@nrwl/tao/src/shared/tree';
|
||||||
|
export {
|
||||||
|
WorkspaceDefinition,
|
||||||
|
TargetDefinition,
|
||||||
|
ProjectDefinition,
|
||||||
|
} from '@nrwl/tao/src/shared/workspace';
|
||||||
|
export { TargetContext } from '@nrwl/tao/src/commands/run';
|
||||||
export { formatFiles } from './src/schematics/format-files';
|
export { formatFiles } from './src/schematics/format-files';
|
||||||
export { generateFiles } from './src/schematics/generate-files';
|
export { generateFiles } from './src/schematics/generate-files';
|
||||||
export { installPackagesTask } from './src/tasks/install-packages-task';
|
export { installPackagesTask } from './src/tasks/install-packages-task';
|
||||||
|
|||||||
@ -1,62 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "http://json-schema.org/schema",
|
|
||||||
"id": "BuildersSchema",
|
|
||||||
"title": "Builders schema for validating a list of builders.",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"$schema": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Link to schema."
|
|
||||||
},
|
|
||||||
"builders": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"$ref": "#/definitions/builder"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["builders"],
|
|
||||||
"definitions": {
|
|
||||||
"builder": {
|
|
||||||
"type": "object",
|
|
||||||
"description": "Target options for Builders.",
|
|
||||||
"allOf": [
|
|
||||||
{
|
|
||||||
"properties": {
|
|
||||||
"schema": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Schema for builder option validation."
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Builder description."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["schema", "description"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"properties": {
|
|
||||||
"implementation": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The next generation builder module."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["implementation"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"properties": {
|
|
||||||
"class": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The builder class module."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["class"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -8,7 +8,12 @@ import {
|
|||||||
Schema,
|
Schema,
|
||||||
} from '../shared/params';
|
} from '../shared/params';
|
||||||
import { commandName, printHelp } from '../shared/print-help';
|
import { commandName, printHelp } from '../shared/print-help';
|
||||||
import { WorkspaceDefinition, Workspaces } from '../shared/workspace';
|
import {
|
||||||
|
TargetDefinition,
|
||||||
|
WorkspaceDefinition,
|
||||||
|
Workspaces,
|
||||||
|
} from '../shared/workspace';
|
||||||
|
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
|
|
||||||
export interface RunOptions {
|
export interface RunOptions {
|
||||||
@ -130,17 +135,22 @@ export function validateTargetAndConfiguration(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TargetContext {
|
||||||
|
root: string;
|
||||||
|
target: TargetDefinition;
|
||||||
|
workspace: WorkspaceDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
export async function run(root: string, args: string[], isVerbose: boolean) {
|
export async function run(root: string, args: string[], isVerbose: boolean) {
|
||||||
const logger = getLogger(isVerbose) as any;
|
const logger = getLogger(isVerbose) as any;
|
||||||
const ws = new Workspaces();
|
const ws = new Workspaces();
|
||||||
|
|
||||||
return handleErrors(logger, isVerbose, async () => {
|
return handleErrors(logger, isVerbose, async () => {
|
||||||
const workspaceDefinition = ws.readWorkspaceConfiguration(root);
|
const workspace = ws.readWorkspaceConfiguration(root);
|
||||||
const opts = parseRunOpts(args, workspaceDefinition.defaultProject, logger);
|
const opts = parseRunOpts(args, workspace.defaultProject, logger);
|
||||||
validateTargetAndConfiguration(workspaceDefinition, opts);
|
validateTargetAndConfiguration(workspace, opts);
|
||||||
|
|
||||||
const target =
|
const target = workspace.projects[opts.project].architect[opts.target];
|
||||||
workspaceDefinition.projects[opts.project].architect[opts.target];
|
|
||||||
if (ws.isNxBuilder(target)) {
|
if (ws.isNxBuilder(target)) {
|
||||||
const { schema, implementation } = ws.readBuilder(target);
|
const { schema, implementation } = ws.readBuilder(target);
|
||||||
const combinedOptions = combineOptionsForBuilder(
|
const combinedOptions = combineOptionsForBuilder(
|
||||||
@ -153,7 +163,7 @@ export async function run(root: string, args: string[], isVerbose: boolean) {
|
|||||||
printRunHelp(opts, schema, logger);
|
printRunHelp(opts, schema, logger);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return await implementation(combinedOptions);
|
return await implementation(combinedOptions, { root, target, workspace });
|
||||||
} else {
|
} else {
|
||||||
return (await import('./ngcli-adapter')).run(logger, root, opts);
|
return (await import('./ngcli-adapter')).run(logger, root, opts);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,13 +39,13 @@ export class Workspaces {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isNxBuilder(target: TargetDefinition) {
|
isNxBuilder(target: TargetDefinition) {
|
||||||
const { buildersJson } = this.readBuildersJson(target);
|
const schema = this.readBuilder(target).schema;
|
||||||
return buildersJson['$schema'] === '@nrwl/tao/src/builders-schema.json';
|
return schema['cli'] === 'nx';
|
||||||
}
|
}
|
||||||
|
|
||||||
isNxSchematic(collectionName: string, schematicName: string) {
|
isNxSchematic(collectionName: string, schematicName: string) {
|
||||||
const schema = this.readSchematic(collectionName, schematicName).schema;
|
const schema = this.readSchematic(collectionName, schematicName).schema;
|
||||||
return schema['$schema'] === '@nrwl/tao/src/schematic-schema.json';
|
return schema['cli'] === 'nx';
|
||||||
}
|
}
|
||||||
|
|
||||||
readBuilder(target: TargetDefinition) {
|
readBuilder(target: TargetDefinition) {
|
||||||
|
|||||||
@ -15,6 +15,11 @@
|
|||||||
"implementation": "./src/builders/dev-server/dev-server.impl",
|
"implementation": "./src/builders/dev-server/dev-server.impl",
|
||||||
"schema": "./src/builders/dev-server/schema.json",
|
"schema": "./src/builders/dev-server/schema.json",
|
||||||
"description": "Serve a web application"
|
"description": "Serve a web application"
|
||||||
|
},
|
||||||
|
"file-server": {
|
||||||
|
"implementation": "./src/builders/file-server/file-server.impl",
|
||||||
|
"schema": "./src/builders/file-server/schema.json",
|
||||||
|
"description": "Serve a web application from a folder"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,6 +117,9 @@
|
|||||||
"webpack-subresource-integrity": "^1.5.1",
|
"webpack-subresource-integrity": "^1.5.1",
|
||||||
"worker-plugin": "3.2.0",
|
"worker-plugin": "3.2.0",
|
||||||
"webpack-dev-server": "3.11.0",
|
"webpack-dev-server": "3.11.0",
|
||||||
"webpack-node-externals": "1.7.2"
|
"webpack-node-externals": "1.7.2",
|
||||||
|
"node-watch": "0.7.0",
|
||||||
|
"http-server": "0.12.3",
|
||||||
|
"ignore": "^5.0.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
136
packages/web/src/builders/file-server/file-server.impl.ts
Normal file
136
packages/web/src/builders/file-server/file-server.impl.ts
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
import { JsonObject } from '@angular-devkit/core';
|
||||||
|
import watch from 'node-watch';
|
||||||
|
import { exec, execSync } from 'child_process';
|
||||||
|
import { TargetContext } from '@nrwl/devkit';
|
||||||
|
import ignore from 'ignore';
|
||||||
|
import { readFileSync } from 'fs-extra';
|
||||||
|
|
||||||
|
export interface FileServerOptions extends JsonObject {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
ssl: boolean;
|
||||||
|
sslKey?: string;
|
||||||
|
sslCert?: string;
|
||||||
|
proxyUrl?: string;
|
||||||
|
buildTarget: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getHttpServerArgs(opts: FileServerOptions) {
|
||||||
|
const args = [] as any[];
|
||||||
|
if (opts.port) {
|
||||||
|
args.push(`-p=${opts.port}`);
|
||||||
|
}
|
||||||
|
if (opts.host) {
|
||||||
|
args.push(`-a=${opts.host}`);
|
||||||
|
}
|
||||||
|
if (opts.ssl) {
|
||||||
|
args.push(`-S`);
|
||||||
|
}
|
||||||
|
if (opts.sslCert) {
|
||||||
|
args.push(`-C=${opts.sslCert}`);
|
||||||
|
}
|
||||||
|
if (opts.sslKey) {
|
||||||
|
args.push(`-K=${opts.sslCert}`);
|
||||||
|
}
|
||||||
|
if (opts.proxyUrl) {
|
||||||
|
args.push(`-P=${opts.proxyUrl}`);
|
||||||
|
}
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBuildTargetOutputPath(
|
||||||
|
opts: FileServerOptions,
|
||||||
|
context: TargetContext
|
||||||
|
) {
|
||||||
|
let buildOpts;
|
||||||
|
try {
|
||||||
|
const [project, target, config] = opts.buildTarget.split(':');
|
||||||
|
|
||||||
|
const buildTarget = context.workspace.projects[project].architect[target];
|
||||||
|
buildOpts = config
|
||||||
|
? { ...buildTarget.options, ...buildTarget.configurations[config] }
|
||||||
|
: buildTarget.options;
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error(`Invalid buildTarget: ${opts.buildTarget}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: vsavkin we should also check outputs
|
||||||
|
const outputPath = buildOpts.outputPath;
|
||||||
|
if (!outputPath) {
|
||||||
|
throw new Error(
|
||||||
|
`Invalid buildTarget: ${opts.buildTarget}. The target must contain outputPath property.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return outputPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getIgnoredGlobs(root: string) {
|
||||||
|
const ig = ignore();
|
||||||
|
try {
|
||||||
|
ig.add(readFileSync(`${root}/.gitignore`).toString());
|
||||||
|
} catch (e) {}
|
||||||
|
try {
|
||||||
|
ig.add(readFileSync(`${root}/.nxignore`).toString());
|
||||||
|
} catch (e) {}
|
||||||
|
return ig;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function (
|
||||||
|
opts: FileServerOptions,
|
||||||
|
context: TargetContext
|
||||||
|
) {
|
||||||
|
let changed = true;
|
||||||
|
let running = false;
|
||||||
|
|
||||||
|
const fileFilter = getIgnoredGlobs(context.root).createFilter();
|
||||||
|
// TODO: vsavkin create a transitive closure of all deps and watch src of all the packages in the closure
|
||||||
|
watch('libs', { recursive: true, filter: fileFilter }, () => {
|
||||||
|
changed = true;
|
||||||
|
run();
|
||||||
|
});
|
||||||
|
watch('apps', { recursive: true, filter: fileFilter }, () => {
|
||||||
|
changed = true;
|
||||||
|
run();
|
||||||
|
});
|
||||||
|
|
||||||
|
function run() {
|
||||||
|
if (changed && !running) {
|
||||||
|
changed = false;
|
||||||
|
running = true;
|
||||||
|
try {
|
||||||
|
execSync(`npx nx run ${opts.buildTarget} --with-deps`, {
|
||||||
|
stdio: [0, 1, 2],
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
running = false;
|
||||||
|
setTimeout(() => run(), 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const outputPath = getBuildTargetOutputPath(opts, context);
|
||||||
|
const args = getHttpServerArgs(opts);
|
||||||
|
run();
|
||||||
|
|
||||||
|
const serve = exec(`npx http-server ${outputPath} ${args.join(' ')}`, {
|
||||||
|
cwd: context.root,
|
||||||
|
});
|
||||||
|
serve.stdout.on('data', (chunk) => {
|
||||||
|
if (chunk.toString().indexOf('GET') === -1) {
|
||||||
|
process.stdout.write(chunk);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
serve.stderr.on('data', (chunk) => {
|
||||||
|
process.stderr.write(chunk);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new Promise((res) => {
|
||||||
|
serve.on('exit', (code) => {
|
||||||
|
if (code == 0) {
|
||||||
|
res({ success: true });
|
||||||
|
} else {
|
||||||
|
res({ success: false });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
39
packages/web/src/builders/file-server/schema.json
Normal file
39
packages/web/src/builders/file-server/schema.json
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"title": "File Server",
|
||||||
|
"description": "File Server",
|
||||||
|
"type": "object",
|
||||||
|
"cli": "nx",
|
||||||
|
"properties": {
|
||||||
|
"buildTarget": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Target which builds the application"
|
||||||
|
},
|
||||||
|
"port": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Port to listen on.",
|
||||||
|
"default": 4200
|
||||||
|
},
|
||||||
|
"host": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Host to listen on.",
|
||||||
|
"default": "localhost"
|
||||||
|
},
|
||||||
|
"ssl": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Serve using HTTPS.",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"sslKey": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "SSL key to use for serving HTTPS."
|
||||||
|
},
|
||||||
|
"sslCert": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "SSL certificate to use for serving HTTPS."
|
||||||
|
},
|
||||||
|
"proxyUrl": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL to proxy unhandled requests to."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "@nrwl/tao/src/builders-schema.json",
|
|
||||||
"builders": {
|
"builders": {
|
||||||
"run-commands": {
|
"run-commands": {
|
||||||
"implementation": "./src/builders/run-commands/run-commands.impl",
|
"implementation": "./src/builders/run-commands/run-commands.impl",
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
"title": "Run Commands",
|
"title": "Run Commands",
|
||||||
"description": "Run any custom commands with Nx",
|
"description": "Run any custom commands with Nx",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"cli": "nx",
|
||||||
"properties": {
|
"properties": {
|
||||||
"commands": {
|
"commands": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
"id": "SchematicsRunCommands",
|
"id": "SchematicsRunCommands",
|
||||||
"title": "Create a custom target to run any command",
|
"title": "Create a custom target to run any command",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"cli": "nx",
|
||||||
"examples": [
|
"examples": [
|
||||||
{
|
{
|
||||||
"command": "g @nrwl/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'",
|
"command": "g @nrwl/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "@nrwl/tao/src/schematic-schema.json",
|
"cli": "nx",
|
||||||
"id": "<%= name %>",
|
"id": "<%= name %>",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "@nrwl/tao/src/schematic-schema.json",
|
"cli": "nx",
|
||||||
"id": "SchematicsNxWorkspaceSchematic",
|
"id": "SchematicsNxWorkspaceSchematic",
|
||||||
"title": "Create a custom schematic",
|
"title": "Create a custom schematic",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|||||||
204
yarn.lock
204
yarn.lock
@ -2594,32 +2594,21 @@
|
|||||||
node-gyp "^6.1.0"
|
node-gyp "^6.1.0"
|
||||||
read-package-json-fast "^1.1.3"
|
read-package-json-fast "^1.1.3"
|
||||||
|
|
||||||
"@nrwl/cli@10.3.1-beta.1":
|
"@nrwl/cli@10.4.1":
|
||||||
version "10.3.1-beta.1"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-10.3.1-beta.1.tgz#a67326315884c986a0f366dcc82b8c3cdf24e25f"
|
resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-10.4.1.tgz#e3b662ae2e43264bcf9be7b9551448b52e6ddf1d"
|
||||||
integrity sha512-Wv19Unn6aWQ29Nx6rpWhzMh+bzTexyVm6Iol7f4mFDD5ZTqsxNFEuLCY69fwCE2tEN/6dHEV4IwWF9VdToZMLg==
|
integrity sha512-91AbEIbNC145KdaLCWCOVYktJ6GML25M5pN0ehSPmeIzOePpbF2zyGwUnSrmpdnjm63E0qkeDIspmt3527HGhA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@nrwl/tao" "10.3.1-beta.1"
|
"@nrwl/tao" "10.4.1"
|
||||||
chalk "2.4.2"
|
chalk "2.4.2"
|
||||||
tmp "0.0.33"
|
tmp "0.0.33"
|
||||||
yargs "15.4.1"
|
yargs "15.4.1"
|
||||||
yargs-parser "20.0.0"
|
yargs-parser "20.0.0"
|
||||||
|
|
||||||
"@nrwl/cli@10.4.0-beta.2":
|
"@nrwl/cypress@10.4.1":
|
||||||
version "10.4.0-beta.2"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-10.4.0-beta.2.tgz#d94d1a23e3664f8b1b288e376121e8424fc3e41c"
|
resolved "https://registry.yarnpkg.com/@nrwl/cypress/-/cypress-10.4.1.tgz#9765f01edb2c2130bd2ce51ba8be55437e0060e8"
|
||||||
integrity sha512-nlQJX3KlXSrVwibMYW/YmWq0lnvn36Q77rjqHjU2yZZz8/jFMBOp9skiWpe3L5B1x3Bd2vHIf4zxCP3CvLFriA==
|
integrity sha512-b4SaOt/wGalw2MCCwLAQs5JxkfAEMfKXy3lV9AYN46fbjSPJGkvKt59lqEqVWAvKaArFooijTXPQhz5HrBp6qA==
|
||||||
dependencies:
|
|
||||||
"@nrwl/tao" "10.4.0-beta.2"
|
|
||||||
chalk "2.4.2"
|
|
||||||
tmp "0.0.33"
|
|
||||||
yargs "15.4.1"
|
|
||||||
yargs-parser "20.0.0"
|
|
||||||
|
|
||||||
"@nrwl/cypress@10.4.0-beta.2":
|
|
||||||
version "10.4.0-beta.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/cypress/-/cypress-10.4.0-beta.2.tgz#305659dcb6e0b330114e8bb1dae387499f7b4c47"
|
|
||||||
integrity sha512-rXrX4O3vQmN3p5icLWGTp9H/kNeFZ2VmnWfqsBSz2LIOB/RalX/9TUPIiWzZxCv8fxA9Dib0o/yJLPgHGu9soQ==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular-devkit/architect" "~0.1001.3"
|
"@angular-devkit/architect" "~0.1001.3"
|
||||||
"@angular-devkit/core" "~10.1.3"
|
"@angular-devkit/core" "~10.1.3"
|
||||||
@ -2635,46 +2624,46 @@
|
|||||||
webpack-node-externals "1.7.2"
|
webpack-node-externals "1.7.2"
|
||||||
yargs-parser "20.0.0"
|
yargs-parser "20.0.0"
|
||||||
|
|
||||||
"@nrwl/eslint-plugin-nx@10.4.0-beta.2":
|
"@nrwl/eslint-plugin-nx@10.4.1":
|
||||||
version "10.4.0-beta.2"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/eslint-plugin-nx/-/eslint-plugin-nx-10.4.0-beta.2.tgz#262225d7bb370d8423579136c0c58acbd2074f98"
|
resolved "https://registry.yarnpkg.com/@nrwl/eslint-plugin-nx/-/eslint-plugin-nx-10.4.1.tgz#2063cdbe53a2f24904cdaada0ee6ee582be1582e"
|
||||||
integrity sha512-iX0SdrjtdqkjxhMS51SOne9JPD3s8BiYoLKHj0MdKBs8oowgJOHrr2RPHUT3EiWanuP9FUuN3rXqHaHQ9vuIHg==
|
integrity sha512-EWBuWD6kbc7yTc4rvZzT8DZyMFlMVBdOn7A3GIvVnkFJiXzvQ/ERg5Mv8dNmiEpU8f0MKZn3ILb4q28rOR5t/A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular-devkit/core" "~10.1.3"
|
"@angular-devkit/core" "~10.1.3"
|
||||||
"@typescript-eslint/experimental-utils" "^4.3.0"
|
"@typescript-eslint/experimental-utils" "^4.3.0"
|
||||||
confusing-browser-globals "^1.0.9"
|
confusing-browser-globals "^1.0.9"
|
||||||
|
|
||||||
"@nrwl/jest@10.4.0-beta.2":
|
"@nrwl/jest@10.4.1":
|
||||||
version "10.4.0-beta.2"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-10.4.0-beta.2.tgz#020493bd4a341bf35287fa9a32f438f7ee366ac2"
|
resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-10.4.1.tgz#eb9e587db0fe5a599fd761829620a71ebd5c90cd"
|
||||||
integrity sha512-v2ZTVkTwc5RfdBaBF2OeY2lhZf46LYI2yXGBVOACBlsqKao/GypWrmw5BYCQiFt/MLqTIzMMKscbYxNSknELyg==
|
integrity sha512-5UaA5hc05YxfvDTopJQa/uelqb+HnBfgb4OkwixMPF/fISio2fwHMsrG+DSc0PAI3DH/qwy2AjZCPAbAlgU3Gw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular-devkit/architect" "~0.1001.3"
|
"@angular-devkit/architect" "~0.1001.3"
|
||||||
"@angular-devkit/core" "~10.1.3"
|
"@angular-devkit/core" "~10.1.3"
|
||||||
"@angular-devkit/schematics" "~10.1.3"
|
"@angular-devkit/schematics" "~10.1.3"
|
||||||
rxjs "^6.5.4"
|
rxjs "^6.5.4"
|
||||||
|
|
||||||
"@nrwl/linter@10.4.0-beta.2":
|
"@nrwl/linter@10.4.1":
|
||||||
version "10.4.0-beta.2"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-10.4.0-beta.2.tgz#0e6a0c9ac8deb9e72d3d4d654811a44a0a46f0e3"
|
resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-10.4.1.tgz#66f6df5ba8bdc081d0459ed5ab67f949e16ce80e"
|
||||||
integrity sha512-fqRwvuwCfMMByKWHWGMoAtbZa1dlm17iuq5WIMRADLi5L5/9wc9wtvZyP+rCnYXLcQ4w/WFCKae+/juJhZ20aA==
|
integrity sha512-CNb9yDeF1ABOuniLFN4k5H+UGQPk4rdY6i56LND/RwEgsLzvi65J7FyD8N1EF7M0HoEoDRykyZiDwU9WlG0NIQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular-devkit/architect" "~0.1001.3"
|
"@angular-devkit/architect" "~0.1001.3"
|
||||||
glob "7.1.4"
|
glob "7.1.4"
|
||||||
minimatch "3.0.4"
|
minimatch "3.0.4"
|
||||||
tslib "^2.0.0"
|
tslib "^2.0.0"
|
||||||
|
|
||||||
"@nrwl/node@10.4.0-beta.2":
|
"@nrwl/node@10.4.1":
|
||||||
version "10.4.0-beta.2"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/node/-/node-10.4.0-beta.2.tgz#dbabe864bec378a3cd5f508d1e93e49d6594a4ef"
|
resolved "https://registry.yarnpkg.com/@nrwl/node/-/node-10.4.1.tgz#872ede5c4cb222f63e9bda1eaaee5bfec001ccfd"
|
||||||
integrity sha512-JeXSqBulbcXY1FB0KI5SKSkQdG8c/qQ01tGJ+C95vzuTMpWLj0rYxsxSVuVxDnVPtxrnBNOqA7WQKkwLDC5uYQ==
|
integrity sha512-B7BSx9jTEAd+GbHEBiEi49RgPGXRtQk1ozPTA7CFfGSM3v0hfLDqi1NTXFjfapR1kh5CFhP7n0UwlN9ggBUiIA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular-devkit/architect" "~0.1001.3"
|
"@angular-devkit/architect" "~0.1001.3"
|
||||||
"@angular-devkit/build-webpack" "~0.1001.3"
|
"@angular-devkit/build-webpack" "~0.1001.3"
|
||||||
"@angular-devkit/core" "~10.1.3"
|
"@angular-devkit/core" "~10.1.3"
|
||||||
"@angular-devkit/schematics" "~10.1.3"
|
"@angular-devkit/schematics" "~10.1.3"
|
||||||
"@nrwl/jest" "10.4.0-beta.2"
|
"@nrwl/jest" "10.4.1"
|
||||||
"@nrwl/linter" "10.4.0-beta.2"
|
"@nrwl/linter" "10.4.1"
|
||||||
circular-dependency-plugin "5.2.0"
|
circular-dependency-plugin "5.2.0"
|
||||||
copy-webpack-plugin "6.0.3"
|
copy-webpack-plugin "6.0.3"
|
||||||
fork-ts-checker-webpack-plugin "^3.1.1"
|
fork-ts-checker-webpack-plugin "^3.1.1"
|
||||||
@ -2700,26 +2689,10 @@
|
|||||||
tar "5.0.5"
|
tar "5.0.5"
|
||||||
uuid "^3.3.3"
|
uuid "^3.3.3"
|
||||||
|
|
||||||
"@nrwl/tao@10.3.1-beta.1":
|
"@nrwl/tao@10.4.1":
|
||||||
version "10.3.1-beta.1"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-10.3.1-beta.1.tgz#a51b48b5c0f077136a5a7e715c6436d683fab4db"
|
resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-10.4.1.tgz#5343078fd431b548df91d18f6170790602386b09"
|
||||||
integrity sha512-WDSgxXz0VB1zK2t6ErbX8I9uh8rjIVpBVajNbMVhwy+CzrsK4FMwRhhk3sbA5gCKv5yQ0xFygodHYeca8VpnCg==
|
integrity sha512-wlaC9f3pfX0JhSMhPmQCjr3BKEPhxMzmVQ6+cXbTLH8wIUqrYKs1I6FRu+gPI4zWuDQrX5S8sQk4wVUiraiJIA==
|
||||||
dependencies:
|
|
||||||
"@angular-devkit/architect" "~0.1001.3"
|
|
||||||
"@angular-devkit/core" "~10.1.3"
|
|
||||||
"@angular-devkit/schematics" "~10.1.3"
|
|
||||||
inquirer "^6.3.1"
|
|
||||||
minimist "^1.2.0"
|
|
||||||
semver "6.3.0"
|
|
||||||
strip-json-comments "2.0.1"
|
|
||||||
tmp "0.0.33"
|
|
||||||
tslib "^1.9.3"
|
|
||||||
yargs-parser "20.0.0"
|
|
||||||
|
|
||||||
"@nrwl/tao@10.4.0-beta.2":
|
|
||||||
version "10.4.0-beta.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-10.4.0-beta.2.tgz#2b94cc4eb121dee9e94dae4a7fbf873399b9f942"
|
|
||||||
integrity sha512-XBdaM3/TA96yj5aiftcQJZFfmOa1KEvJ1wZ/QMIjK+AWOHjl0XynwXnolh3mormrznaLY4Z819CNC68mgfhVqg==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular-devkit/architect" "~0.1001.3"
|
"@angular-devkit/architect" "~0.1001.3"
|
||||||
"@angular-devkit/core" "~10.1.3"
|
"@angular-devkit/core" "~10.1.3"
|
||||||
@ -2732,10 +2705,10 @@
|
|||||||
tslib "^2.0.0"
|
tslib "^2.0.0"
|
||||||
yargs-parser "20.0.0"
|
yargs-parser "20.0.0"
|
||||||
|
|
||||||
"@nrwl/web@10.4.0-beta.2":
|
"@nrwl/web@10.4.1":
|
||||||
version "10.4.0-beta.2"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/web/-/web-10.4.0-beta.2.tgz#15e5cc85558dfc9f8b4903fc32a84e045c8c8de4"
|
resolved "https://registry.yarnpkg.com/@nrwl/web/-/web-10.4.1.tgz#a22540bfdc25f887f760cb285b7a2490c22af34a"
|
||||||
integrity sha512-n6WS+9Tdfx4BSnaIT6n6vXkbskUnPtMeuXyxZzK0FcXuNU7MzIw1MNXVXYMeSsnjsUzqrErRWvBQ4nnvWjZ1tA==
|
integrity sha512-qXqjKna8fSWyD4Vgn/KfX+p7iU2C35PEsjlaHkvr34Z2zbLcKcZ1C4rSpjUWCLKzJOQ2D5kijNOBpswvrp08+g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular-devkit/architect" "~0.1001.3"
|
"@angular-devkit/architect" "~0.1001.3"
|
||||||
"@angular-devkit/build-optimizer" "~0.1001.3"
|
"@angular-devkit/build-optimizer" "~0.1001.3"
|
||||||
@ -2748,9 +2721,9 @@
|
|||||||
"@babel/plugin-transform-regenerator" "7.8.7"
|
"@babel/plugin-transform-regenerator" "7.8.7"
|
||||||
"@babel/preset-env" "7.9.6"
|
"@babel/preset-env" "7.9.6"
|
||||||
"@babel/preset-typescript" "7.10.4"
|
"@babel/preset-typescript" "7.10.4"
|
||||||
"@nrwl/cypress" "10.4.0-beta.2"
|
"@nrwl/cypress" "10.4.1"
|
||||||
"@nrwl/jest" "10.4.0-beta.2"
|
"@nrwl/jest" "10.4.1"
|
||||||
"@nrwl/linter" "10.4.0-beta.2"
|
"@nrwl/linter" "10.4.1"
|
||||||
"@rollup/plugin-babel" "5.0.2"
|
"@rollup/plugin-babel" "5.0.2"
|
||||||
"@rollup/plugin-commonjs" "11.0.2"
|
"@rollup/plugin-commonjs" "11.0.2"
|
||||||
"@rollup/plugin-image" "2.0.4"
|
"@rollup/plugin-image" "2.0.4"
|
||||||
@ -2825,15 +2798,15 @@
|
|||||||
webpack-subresource-integrity "^1.5.1"
|
webpack-subresource-integrity "^1.5.1"
|
||||||
worker-plugin "3.2.0"
|
worker-plugin "3.2.0"
|
||||||
|
|
||||||
"@nrwl/workspace@10.4.0-beta.2":
|
"@nrwl/workspace@10.4.1":
|
||||||
version "10.4.0-beta.2"
|
version "10.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-10.4.0-beta.2.tgz#f5fde6d70198b00213105c51eb3693925b3dddda"
|
resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-10.4.1.tgz#1839c31c91c260d927403fde34fc693015fb4777"
|
||||||
integrity sha512-2TUIdPQ6Hq8mmDCYaVoXfTGrfMoM4L45fLRrpyJWhJ3zgYJFSiS/Aiu7z1OaPrDkc3K9d+jdqmyaW7Smc7c+4Q==
|
integrity sha512-77JdHbnwpxwlVxXjzTKeP/KDsxZEck3aGvH7ZAnNo3RT6fdcdKHHAi1VK4jdSl36UlXYC3UOTZWJRU2jzj4sGw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular-devkit/architect" "~0.1001.3"
|
"@angular-devkit/architect" "~0.1001.3"
|
||||||
"@angular-devkit/core" "~10.1.3"
|
"@angular-devkit/core" "~10.1.3"
|
||||||
"@angular-devkit/schematics" "~10.1.3"
|
"@angular-devkit/schematics" "~10.1.3"
|
||||||
"@nrwl/cli" "10.4.0-beta.2"
|
"@nrwl/cli" "10.4.1"
|
||||||
axios "0.19.2"
|
axios "0.19.2"
|
||||||
chalk "2.4.2"
|
chalk "2.4.2"
|
||||||
cosmiconfig "^4.0.0"
|
cosmiconfig "^4.0.0"
|
||||||
@ -6608,6 +6581,11 @@ base@^0.11.1:
|
|||||||
mixin-deep "^1.2.0"
|
mixin-deep "^1.2.0"
|
||||||
pascalcase "^0.1.1"
|
pascalcase "^0.1.1"
|
||||||
|
|
||||||
|
basic-auth@^1.0.3:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-1.1.0.tgz#45221ee429f7ee1e5035be3f51533f1cdfd29884"
|
||||||
|
integrity sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=
|
||||||
|
|
||||||
batch-processor@1.0.0:
|
batch-processor@1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/batch-processor/-/batch-processor-1.0.0.tgz#75c95c32b748e0850d10c2b168f6bdbe9891ace8"
|
resolved "https://registry.yarnpkg.com/batch-processor/-/batch-processor-1.0.0.tgz#75c95c32b748e0850d10c2b168f6bdbe9891ace8"
|
||||||
@ -8423,6 +8401,11 @@ cors@2.8.5:
|
|||||||
object-assign "^4"
|
object-assign "^4"
|
||||||
vary "^1"
|
vary "^1"
|
||||||
|
|
||||||
|
corser@^2.0.1:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87"
|
||||||
|
integrity sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=
|
||||||
|
|
||||||
cosmiconfig@^4.0.0:
|
cosmiconfig@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc"
|
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc"
|
||||||
@ -10313,6 +10296,16 @@ ecdsa-sig-formatter@1.0.11:
|
|||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer "^5.0.1"
|
safe-buffer "^5.0.1"
|
||||||
|
|
||||||
|
ecstatic@^3.3.2:
|
||||||
|
version "3.3.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/ecstatic/-/ecstatic-3.3.2.tgz#6d1dd49814d00594682c652adb66076a69d46c48"
|
||||||
|
integrity sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==
|
||||||
|
dependencies:
|
||||||
|
he "^1.1.1"
|
||||||
|
mime "^1.6.0"
|
||||||
|
minimist "^1.1.0"
|
||||||
|
url-join "^2.0.5"
|
||||||
|
|
||||||
editor@1.0.0:
|
editor@1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742"
|
resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742"
|
||||||
@ -10330,6 +10323,13 @@ ejs@^3.1.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
jake "^10.6.1"
|
jake "^10.6.1"
|
||||||
|
|
||||||
|
ejs@^3.1.5:
|
||||||
|
version "3.1.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.5.tgz#aed723844dc20acb4b170cd9ab1017e476a0d93b"
|
||||||
|
integrity sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w==
|
||||||
|
dependencies:
|
||||||
|
jake "^10.6.1"
|
||||||
|
|
||||||
electron-to-chromium@^1.3.378:
|
electron-to-chromium@^1.3.378:
|
||||||
version "1.3.514"
|
version "1.3.514"
|
||||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.514.tgz#107499c28cb3c09fe6a863c19fc2202d5d9e8e41"
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.514.tgz#107499c28cb3c09fe6a863c19fc2202d5d9e8e41"
|
||||||
@ -12512,7 +12512,7 @@ he@1.1.1:
|
|||||||
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
|
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
|
||||||
integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0=
|
integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0=
|
||||||
|
|
||||||
he@1.2.x, he@^1.1.0, he@^1.2.0:
|
he@1.2.x, he@^1.1.0, he@^1.1.1, he@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
|
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
|
||||||
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
|
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
|
||||||
@ -12786,7 +12786,7 @@ http-proxy-middleware@0.19.1:
|
|||||||
lodash "^4.17.11"
|
lodash "^4.17.11"
|
||||||
micromatch "^3.1.10"
|
micromatch "^3.1.10"
|
||||||
|
|
||||||
http-proxy@^1.13.0, http-proxy@^1.17.0:
|
http-proxy@^1.13.0, http-proxy@^1.17.0, http-proxy@^1.18.0:
|
||||||
version "1.18.1"
|
version "1.18.1"
|
||||||
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
|
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
|
||||||
integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
|
integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
|
||||||
@ -12795,6 +12795,22 @@ http-proxy@^1.13.0, http-proxy@^1.17.0:
|
|||||||
follow-redirects "^1.0.0"
|
follow-redirects "^1.0.0"
|
||||||
requires-port "^1.0.0"
|
requires-port "^1.0.0"
|
||||||
|
|
||||||
|
http-server@0.12.3:
|
||||||
|
version "0.12.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/http-server/-/http-server-0.12.3.tgz#ba0471d0ecc425886616cb35c4faf279140a0d37"
|
||||||
|
integrity sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==
|
||||||
|
dependencies:
|
||||||
|
basic-auth "^1.0.3"
|
||||||
|
colors "^1.4.0"
|
||||||
|
corser "^2.0.1"
|
||||||
|
ecstatic "^3.3.2"
|
||||||
|
http-proxy "^1.18.0"
|
||||||
|
minimist "^1.2.5"
|
||||||
|
opener "^1.5.1"
|
||||||
|
portfinder "^1.0.25"
|
||||||
|
secure-compare "3.0.1"
|
||||||
|
union "~0.5.0"
|
||||||
|
|
||||||
http-signature@~1.2.0:
|
http-signature@~1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
||||||
@ -15906,7 +15922,7 @@ mime-types@^2.1.12, mime-types@^2.1.26, mime-types@~2.1.17, mime-types@~2.1.19,
|
|||||||
dependencies:
|
dependencies:
|
||||||
mime-db "1.44.0"
|
mime-db "1.44.0"
|
||||||
|
|
||||||
mime@1.6.0, mime@^1.4.1:
|
mime@1.6.0, mime@^1.4.1, mime@^1.6.0:
|
||||||
version "1.6.0"
|
version "1.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
|
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
|
||||||
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
|
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
|
||||||
@ -16025,7 +16041,7 @@ minimist-options@^4.0.2:
|
|||||||
is-plain-obj "^1.1.0"
|
is-plain-obj "^1.1.0"
|
||||||
kind-of "^6.0.3"
|
kind-of "^6.0.3"
|
||||||
|
|
||||||
minimist@1.2.5, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5:
|
minimist@1.2.5, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5:
|
||||||
version "1.2.5"
|
version "1.2.5"
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
|
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
|
||||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
||||||
@ -16159,7 +16175,7 @@ mkdirp@0.5.3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
minimist "^1.2.5"
|
minimist "^1.2.5"
|
||||||
|
|
||||||
mkdirp@0.5.5, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@~0.5.1, mkdirp@~0.5.x:
|
mkdirp@0.5.5, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5, mkdirp@~0.5.1, mkdirp@~0.5.x:
|
||||||
version "0.5.5"
|
version "0.5.5"
|
||||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
||||||
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
|
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
|
||||||
@ -16611,6 +16627,11 @@ node-sass-tilde-importer@^1.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
find-parent-dir "^0.3.0"
|
find-parent-dir "^0.3.0"
|
||||||
|
|
||||||
|
node-watch@0.7.0:
|
||||||
|
version "0.7.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/node-watch/-/node-watch-0.7.0.tgz#033c0c04239d9348f3402b6b6f9c1e689a7edbe1"
|
||||||
|
integrity sha512-OOBiglke5SlRQT5WYfwXTmYqTfXjcTNBHpalyHLtLxDpQYVpVRkJqabcch1kmwJsjV/J4OZuzEafeb4soqtFZA==
|
||||||
|
|
||||||
nopt@^4.0.1:
|
nopt@^4.0.1:
|
||||||
version "4.0.3"
|
version "4.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48"
|
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48"
|
||||||
@ -17044,6 +17065,11 @@ opencollective-postinstall@^2.0.0, opencollective-postinstall@^2.0.2:
|
|||||||
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
|
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
|
||||||
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==
|
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==
|
||||||
|
|
||||||
|
opener@^1.5.1:
|
||||||
|
version "1.5.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598"
|
||||||
|
integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==
|
||||||
|
|
||||||
opn@^5.3.0, opn@^5.5.0:
|
opn@^5.3.0, opn@^5.5.0:
|
||||||
version "5.5.0"
|
version "5.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc"
|
resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc"
|
||||||
@ -17797,6 +17823,15 @@ popper.js@^1.14.4, popper.js@^1.14.7:
|
|||||||
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b"
|
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b"
|
||||||
integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==
|
integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==
|
||||||
|
|
||||||
|
portfinder@^1.0.25:
|
||||||
|
version "1.0.28"
|
||||||
|
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
|
||||||
|
integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==
|
||||||
|
dependencies:
|
||||||
|
async "^2.6.2"
|
||||||
|
debug "^3.1.1"
|
||||||
|
mkdirp "^0.5.5"
|
||||||
|
|
||||||
portfinder@^1.0.26:
|
portfinder@^1.0.26:
|
||||||
version "1.0.26"
|
version "1.0.26"
|
||||||
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.26.tgz#475658d56ca30bed72ac7f1378ed350bd1b64e70"
|
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.26.tgz#475658d56ca30bed72ac7f1378ed350bd1b64e70"
|
||||||
@ -18618,7 +18653,7 @@ qs@6.7.0:
|
|||||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc"
|
resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc"
|
||||||
integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==
|
integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==
|
||||||
|
|
||||||
qs@^6.6.0:
|
qs@^6.4.0, qs@^6.6.0:
|
||||||
version "6.9.4"
|
version "6.9.4"
|
||||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687"
|
resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687"
|
||||||
integrity sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==
|
integrity sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==
|
||||||
@ -20188,6 +20223,11 @@ schema-utils@^2.0.0, schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6
|
|||||||
ajv "^6.12.2"
|
ajv "^6.12.2"
|
||||||
ajv-keywords "^3.4.1"
|
ajv-keywords "^3.4.1"
|
||||||
|
|
||||||
|
secure-compare@3.0.1:
|
||||||
|
version "3.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/secure-compare/-/secure-compare-3.0.1.tgz#f1a0329b308b221fae37b9974f3d578d0ca999e3"
|
||||||
|
integrity sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=
|
||||||
|
|
||||||
select-hose@^2.0.0:
|
select-hose@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
|
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
|
||||||
@ -22239,6 +22279,13 @@ union-value@^1.0.0:
|
|||||||
is-extendable "^0.1.1"
|
is-extendable "^0.1.1"
|
||||||
set-value "^2.0.1"
|
set-value "^2.0.1"
|
||||||
|
|
||||||
|
union@~0.5.0:
|
||||||
|
version "0.5.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/union/-/union-0.5.0.tgz#b2c11be84f60538537b846edb9ba266ba0090075"
|
||||||
|
integrity sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==
|
||||||
|
dependencies:
|
||||||
|
qs "^6.4.0"
|
||||||
|
|
||||||
uniq@^1.0.1:
|
uniq@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"
|
resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"
|
||||||
@ -22367,6 +22414,11 @@ urix@^0.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
|
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
|
||||||
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
|
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
|
||||||
|
|
||||||
|
url-join@^2.0.5:
|
||||||
|
version "2.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/url-join/-/url-join-2.0.5.tgz#5af22f18c052a000a48d7b82c5e9c2e2feeda728"
|
||||||
|
integrity sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=
|
||||||
|
|
||||||
url-loader@^3.0.0:
|
url-loader@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-3.0.0.tgz#9f1f11b371acf6e51ed15a50db635e02eec18368"
|
resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-3.0.0.tgz#9f1f11b371acf6e51ed15a50db635e02eec18368"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user