Skip to content

Commit e442ba9

Browse files
Merge pull request #43 from peterbsmyth/ngrx-schematics-add
feat(schematics): include @ngrx/schematics in ng add command
2 parents c2d0f69 + 6ff6402 commit e442ba9

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
import { chain, Rule } from '@angular-devkit/schematics';
1+
import {
2+
chain,
3+
Rule
4+
} from '@angular-devkit/schematics';
5+
import { addDepsToPackageJson } from '@nrwl/workspace';
6+
27
import { initLintingRules } from '../rules';
8+
import { NGRX_VERSION } from '../utils';
39

4-
export default function (): Rule {
5-
return chain([initLintingRules()]);
10+
export default function(): Rule {
11+
return chain([
12+
initLintingRules(),
13+
addDepsToPackageJson({
14+
'@ngrx/schematics': NGRX_VERSION
15+
})
16+
]);
617
}

libs/ddd/src/schematics/rules/add-ngrx-to-package-json.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
*/
44
import { Rule } from '@angular-devkit/schematics';
55
import { addDepsToPackageJson } from '@nrwl/workspace';
6+
import { NGRX_VERSION } from '../utils';
67

78
/**
89
* addNgRxToPackageJson
910
* add the ngrx packages to the package.json and install them
1011
*/
1112
export function addNgRxToPackageJson(): Rule {
12-
const ngrxVersion = '10.0.0';
13-
1413
return addDepsToPackageJson(
1514
{
16-
'@ngrx/store': ngrxVersion,
17-
'@ngrx/effects': ngrxVersion,
18-
'@ngrx/entity': ngrxVersion,
19-
'@ngrx/store-devtools': ngrxVersion,
15+
'@ngrx/store': NGRX_VERSION,
16+
'@ngrx/effects': NGRX_VERSION,
17+
'@ngrx/entity': NGRX_VERSION,
18+
'@ngrx/store-devtools': NGRX_VERSION,
2019
},
2120
{}
2221
);
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
export * from './read-into-source-file';
21
export * from './check-rule-exists';
2+
export * from './insert';
3+
export * from './ngrx-version';
4+
export * from './read-into-source-file';
35
export * from './read-workspace-name';
4-
export * from './validate-inputs';
56
export * from './update-dep-const';
6-
export * from './insert';
7+
export * from './validate-inputs';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const NGRX_VERSION = '10.1.2';

0 commit comments

Comments
 (0)