feat(schematics) add migration to add affected:lint npm script

This commit is contained in:
Jason Jean 2018-06-01 17:41:51 -04:00 committed by Victor Savkin
parent 1ec9af56fd
commit e18f94e566
2 changed files with 21 additions and 1 deletions

View File

@ -2,8 +2,13 @@
"schematics": {
"update-to-6.0.0": {
"version": "6",
"description": " ",
"description": "Update to Angular CLI 6 and Nx6",
"factory": "./update-6-0-0/update-6-0-0"
},
"update-to-6.0.5": {
"version": "6.0.5",
"description": "Add affected:lint npm script",
"factory": "./update-6-0-5/update-6-0-5"
}
}
}

View File

@ -0,0 +1,15 @@
import {
Rule,
Tree,
SchematicContext,
chain
} from '@angular-devkit/schematics';
import { updateJsonInTree } from '../../src/utils/ast-utils';
export default function(): Rule {
return updateJsonInTree('package.json', packageJson => {
packageJson.scripts['affected:lint'] =
'./node_modules/.bin/nx affected:lint';
return packageJson;
});
}