<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #25284
24 lines
598 B
TypeScript
24 lines
598 B
TypeScript
import { formatFiles, Tree, updateJson } from '@nx/devkit';
|
|
|
|
export const angularCliVersion = '~18.0.0';
|
|
|
|
export default async function (tree: Tree) {
|
|
let shouldFormat = false;
|
|
|
|
updateJson(tree, 'package.json', (json) => {
|
|
if (json.devDependencies?.['@angular/cli']) {
|
|
json.devDependencies['@angular/cli'] = angularCliVersion;
|
|
shouldFormat = true;
|
|
} else if (json.dependencies?.['@angular/cli']) {
|
|
json.dependencies['@angular/cli'] = angularCliVersion;
|
|
shouldFormat = true;
|
|
}
|
|
|
|
return json;
|
|
});
|
|
|
|
if (shouldFormat) {
|
|
await formatFiles(tree);
|
|
}
|
|
}
|