-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
747 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# library | ||
|
||
Create a library | ||
|
||
## Usage | ||
|
||
```bash | ||
ng generate library ... | ||
``` | ||
|
||
```bash | ||
ng g lib ... # same | ||
``` | ||
|
||
By default, Nx will search for `library` in the default collection provisioned in `angular.json`. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
ng g @nrwl/node:library ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
ng g library ... --dry-run | ||
``` | ||
|
||
### Examples | ||
|
||
Generate libs/myapp/mylib: | ||
|
||
```bash | ||
ng g lib mylib --directory=myapp | ||
``` | ||
|
||
## Options | ||
|
||
### directory | ||
|
||
Alias(es): d | ||
|
||
Type: `string` | ||
|
||
A directory where the app is placed | ||
|
||
### linter | ||
|
||
Default: `tslint` | ||
|
||
Type: `string` | ||
|
||
Possible values: `eslint`, `tslint` | ||
|
||
The tool to use for running lint checks. | ||
|
||
### name | ||
|
||
Type: `string` | ||
|
||
Library name | ||
|
||
### skipFormat | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Skip formatting files | ||
|
||
### skipTsConfig | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Do not update tsconfig.json for development experience. | ||
|
||
### tags | ||
|
||
Alias(es): t | ||
|
||
Type: `string` | ||
|
||
Add tags to the library (used for linting) | ||
|
||
### unitTestRunner | ||
|
||
Default: `jest` | ||
|
||
Type: `string` | ||
|
||
Possible values: `jest`, `none` | ||
|
||
Test runner to use for unit tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# library | ||
|
||
Create a library | ||
|
||
## Usage | ||
|
||
```bash | ||
nx generate library ... | ||
``` | ||
|
||
```bash | ||
nx g lib ... # same | ||
``` | ||
|
||
By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
nx g @nrwl/node:library ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
nx g library ... --dry-run | ||
``` | ||
|
||
### Examples | ||
|
||
Generate libs/myapp/mylib: | ||
|
||
```bash | ||
nx g lib mylib --directory=myapp | ||
``` | ||
|
||
## Options | ||
|
||
### directory | ||
|
||
Alias(es): d | ||
|
||
Type: `string` | ||
|
||
A directory where the app is placed | ||
|
||
### linter | ||
|
||
Default: `tslint` | ||
|
||
Type: `string` | ||
|
||
Possible values: `eslint`, `tslint` | ||
|
||
The tool to use for running lint checks. | ||
|
||
### name | ||
|
||
Type: `string` | ||
|
||
Library name | ||
|
||
### skipFormat | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Skip formatting files | ||
|
||
### skipTsConfig | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Do not update tsconfig.json for development experience. | ||
|
||
### tags | ||
|
||
Alias(es): t | ||
|
||
Type: `string` | ||
|
||
Add tags to the library (used for linting) | ||
|
||
### unitTestRunner | ||
|
||
Default: `jest` | ||
|
||
Type: `string` | ||
|
||
Possible values: `jest`, `none` | ||
|
||
Test runner to use for unit tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# library | ||
|
||
Create a library | ||
|
||
## Usage | ||
|
||
```bash | ||
nx generate library ... | ||
``` | ||
|
||
```bash | ||
nx g lib ... # same | ||
``` | ||
|
||
By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
nx g @nrwl/node:library ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
nx g library ... --dry-run | ||
``` | ||
|
||
### Examples | ||
|
||
Generate libs/myapp/mylib: | ||
|
||
```bash | ||
nx g lib mylib --directory=myapp | ||
``` | ||
|
||
## Options | ||
|
||
### directory | ||
|
||
Alias(es): d | ||
|
||
Type: `string` | ||
|
||
A directory where the app is placed | ||
|
||
### linter | ||
|
||
Default: `tslint` | ||
|
||
Type: `string` | ||
|
||
Possible values: `eslint`, `tslint` | ||
|
||
The tool to use for running lint checks. | ||
|
||
### name | ||
|
||
Type: `string` | ||
|
||
Library name | ||
|
||
### skipFormat | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Skip formatting files | ||
|
||
### skipTsConfig | ||
|
||
Default: `false` | ||
|
||
Type: `boolean` | ||
|
||
Do not update tsconfig.json for development experience. | ||
|
||
### tags | ||
|
||
Alias(es): t | ||
|
||
Type: `string` | ||
|
||
Add tags to the library (used for linting) | ||
|
||
### unitTestRunner | ||
|
||
Default: `jest` | ||
|
||
Type: `string` | ||
|
||
Possible values: `jest`, `none` | ||
|
||
Test runner to use for unit tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/node/src/schematics/library/files/lib/src/lib/__fileName__.spec.ts__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { <%= propertyName %> } from './<%= fileName %>'; | ||
|
||
describe('<%= propertyName %>', () => { | ||
it('should work', () => { | ||
expect(<%= propertyName %>()).toEqual('<%= name %>'); | ||
}) | ||
}) |
3 changes: 3 additions & 0 deletions
3
packages/node/src/schematics/library/files/lib/src/lib/__fileName__.ts__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function <%= propertyName %>(): string { | ||
return '<%= name %>'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "<%= offsetFromRoot %>tsconfig.json", | ||
"compilerOptions": { | ||
"types": [ | ||
"node" | ||
] | ||
}, | ||
"include": ["**/*.ts"] | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/node/src/schematics/library/files/lib/tsconfig.lib.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "<%= offsetFromRoot %>dist/out-tsc", | ||
"types": [ | ||
"node" | ||
] | ||
}, | ||
"exclude": ["**/*.spec.ts"], | ||
"include": ["**/*.ts"] | ||
} |
Oops, something went wrong.