feat(schematics): add install task for ngrx schematics

This commit is contained in:
Jason Jean 2018-08-10 17:46:54 -04:00 committed by Victor Savkin
parent edba67f728
commit 6560db75f7

View File

@ -24,6 +24,7 @@ import {
RequestContext RequestContext
} from './rules'; } from './rules';
import { formatFiles } from '../../utils/rules/format-files'; import { formatFiles } from '../../utils/rules/format-files';
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
/** /**
* Rule to generate the Nx 'ngrx' Collection * Rule to generate the Nx 'ngrx' Collection
@ -57,7 +58,7 @@ export default function generateNgrxCollection(_options: Schema): Rule {
] ]
: []; : [];
const packageJsonModification = !options.skipPackageJson const packageJsonModification = !options.skipPackageJson
? [addNgRxToPackageJson()] ? [addNgRxToPackageJson(), addInstallTask]
: []; : [];
return chain([ return chain([
@ -69,6 +70,10 @@ export default function generateNgrxCollection(_options: Schema): Rule {
}; };
} }
function addInstallTask(_, context: SchematicContext) {
context.addTask(new NodePackageInstallTask());
}
// ******************************************************** // ********************************************************
// Internal Function // Internal Function
// ******************************************************** // ********************************************************