@yolkai/nx-schematics
Version:
41 lines (38 loc) • 1.55 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const nx_workspace_1 = require("@yolkai/nx-workspace");
const literals_1 = require("@angular-devkit/core/src/utils/literals");
function displayInformation(host, context) {
context.logger.info(literals_1.stripIndents `
"implicitDependencies" have been added to your nx.json.
`);
context.logger.warn(literals_1.stripIndents `
Files not defined in implicitDependencies will NOT affect your projects.
.ie yarn affected:apps --files=README.md will return no apps since it is not defined.
You should add additional files which you expect to affect your projects into this configuration.
`);
}
const addImplicitDependencies = nx_workspace_1.updateJsonInTree('nx.json', nxJson => {
return Object.assign({}, nxJson, { implicitDependencies: {
'angular.json': '*',
'package.json': '*',
'tsconfig.json': '*',
'tslint.json': '*',
'nx.json': '*'
} });
});
const changeNpmRunUpdate = nx_workspace_1.updateJsonInTree('package.json', packageJson => {
packageJson.scripts.update = 'ng update @yolkai/nx-schematics';
packageJson.scripts['update:check'] = 'ng update';
delete packageJson.scripts['update:skip'];
return packageJson;
});
function default_1() {
return schematics_1.chain([
displayInformation,
addImplicitDependencies,
changeNpmRunUpdate
]);
}
exports.default = default_1;