feat(angular): migrate versions to 14.2.0 (#11530)

* feat(angular): migrate versions to 14.2.0-next.0

* feat(angular): support 14.2.0-rc.0
This commit is contained in:
Colum Ferry 2022-08-29 10:39:40 +01:00 committed by GitHub
parent 8b02670a39
commit aaeeaedceb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 623 additions and 671 deletions

View File

@ -26,24 +26,24 @@
"echo": "echo 12345"
},
"devDependencies": {
"@angular-devkit/architect": "~0.1401.1",
"@angular-devkit/build-angular": "~14.1.1",
"@angular-devkit/core": "~14.1.1",
"@angular-devkit/schematics": "~14.1.1",
"@angular-devkit/architect": "~0.1402.0",
"@angular-devkit/build-angular": "~14.2.0",
"@angular-devkit/core": "~14.2.0",
"@angular-devkit/schematics": "~14.2.0",
"@angular-eslint/eslint-plugin": "~14.0.0",
"@angular-eslint/eslint-plugin-template": "~14.0.0",
"@angular-eslint/template-parser": "~14.0.0",
"@angular/cli": "~14.1.1",
"@angular/common": "~14.1.1",
"@angular/compiler": "~14.1.1",
"@angular/compiler-cli": "~14.1.1",
"@angular/core": "~14.1.1",
"@angular/forms": "~14.1.1",
"@angular/platform-browser": "~14.1.1",
"@angular/platform-browser-dynamic": "~14.1.1",
"@angular/router": "~14.1.1",
"@angular/service-worker": "~14.1.1",
"@angular/upgrade": "~14.1.1",
"@angular/cli": "~14.2.0",
"@angular/common": "~14.2.0",
"@angular/compiler": "~14.2.0",
"@angular/compiler-cli": "~14.2.0",
"@angular/core": "~14.2.0",
"@angular/forms": "~14.2.0",
"@angular/platform-browser": "~14.2.0",
"@angular/platform-browser-dynamic": "~14.2.0",
"@angular/router": "~14.2.0",
"@angular/service-worker": "~14.2.0",
"@angular/upgrade": "~14.2.0",
"@babel/helper-create-regexp-features-plugin": "^7.14.5",
"@cypress/react": "^6.0.0",
"@cypress/webpack-preprocessor": "^5.12.0",
@ -76,7 +76,7 @@
"@rollup/plugin-image": "^2.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@schematics/angular": "~14.1.0",
"@schematics/angular": "~14.2.0",
"@storybook/addon-essentials": "~6.5.9",
"@storybook/addon-knobs": "~6.3.0",
"@storybook/angular": "~6.5.9",
@ -192,7 +192,7 @@
"mini-css-extract-plugin": "~2.4.7",
"minimatch": "3.0.5",
"next-sitemap": "^3.1.10",
"ng-packagr": "~14.1.0",
"ng-packagr": "~14.2.0",
"ngrx-store-freeze": "0.2.4",
"node-fetch": "^2.6.7",
"nx": "14.6.0-beta.7",

View File

@ -160,6 +160,12 @@
"version": "14.5.2-beta.0",
"description": "Update the @angular/cli package version to ~14.1.0.",
"factory": "./src/migrations/update-14-5-2/update-angular-cli"
},
"update-angular-cli-version-14-2-0": {
"cli": "nx",
"version": "14.6.0-beta.0",
"description": "Update the @angular/cli package version to ~14.2.0.",
"factory": "./src/migrations/update-14-6-0/update-angular-cli"
}
},
"packageJsonUpdates": {
@ -1469,6 +1475,46 @@
"jest-preset-angular": {
"version": "~12.2.0",
"alwaysAddToPackageJson": false
},
"@angular-devkit/architect": {
"version": "~0.1402.0",
"alwaysAddToPackageJson": false
},
"@angular-devkit/build-angular": {
"version": "~14.2.0",
"alwaysAddToPackageJson": false
},
"@angular-devkit/build-webpack": {
"version": "~0.1402.0",
"alwaysAddToPackageJson": false
},
"@angular-devkit/core": {
"version": "~14.2.0",
"alwaysAddToPackageJson": false
},
"@angular-devkit/schematics": {
"version": "~14.2.0",
"alwaysAddToPackageJson": false
},
"@schematics/angular": {
"version": "~14.2.0",
"alwaysAddToPackageJson": false
},
"@angular/core": {
"version": "~14.2.0",
"alwaysAddToPackageJson": true
},
"@angular/material": {
"version": "~14.2.0",
"alwaysAddToPackageJson": false
},
"@angular/cdk": {
"version": "~14.2.0",
"alwaysAddToPackageJson": false
},
"ng-packagr": {
"version": "~14.2.0",
"alwaysAddToPackageJson": false
}
}
}

View File

@ -37,7 +37,7 @@
"migrations": "./migrations.json"
},
"dependencies": {
"@angular-devkit/schematics": "~14.1.1",
"@angular-devkit/schematics": "~14.2.0",
"@nrwl/cypress": "file:../cypress",
"@nrwl/devkit": "file:../devkit",
"@nrwl/jest": "file:../jest",
@ -46,7 +46,7 @@
"@nrwl/web": "file:../web",
"@nrwl/workspace": "file:../workspace",
"@phenomnomnominal/tsquery": "4.1.1",
"@schematics/angular": "~14.1.0",
"@schematics/angular": "~14.2.0",
"chalk": "4.1.0",
"chokidar": "^3.5.1",
"http-server": "^14.1.0",

View File

@ -0,0 +1,42 @@
import { readJson, Tree, writeJson } from '@nrwl/devkit';
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
import updateAngularCli from './update-angular-cli';
describe('update-angular-cli migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
});
it('should update @angular/cli version when defined as a dev dependency', async () => {
writeJson(tree, 'package.json', {
devDependencies: { '@angular/cli': '~13.3.0' },
});
await updateAngularCli(tree);
const { devDependencies } = readJson(tree, 'package.json');
expect(devDependencies['@angular/cli']).toEqual('~14.2.0');
});
it('should update @angular/cli version when defined as a dependency', async () => {
writeJson(tree, 'package.json', {
dependencies: { '@angular/cli': '~13.3.0' },
});
await updateAngularCli(tree);
const { dependencies } = readJson(tree, 'package.json');
expect(dependencies['@angular/cli']).toEqual('~14.2.0');
});
it('should add @angular/cli to package.json when it is not set', async () => {
const initialPackageJson = readJson(tree, 'package.json');
await updateAngularCli(tree);
const packageJson = readJson(tree, 'package.json');
expect(packageJson).toStrictEqual(initialPackageJson);
});
});

View File

@ -0,0 +1,23 @@
import { formatFiles, Tree, updateJson } from '@nrwl/devkit';
const angularCliVersion = '~14.2.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);
}
}

View File

@ -1,8 +1,8 @@
export const nxVersion = require('../../package.json').version;
export const angularVersion = '~14.1.1';
export const angularDevkitVersion = '~14.1.1';
export const ngPackagrVersion = '~14.1.0';
export const angularVersion = '~14.2.0';
export const angularDevkitVersion = '~14.2.0';
export const ngPackagrVersion = '~14.2.0';
export const ngrxVersion = '~14.0.0';
export const rxjsVersion = '~7.5.0';
export const zoneJsVersion = '~0.11.4';

View File

@ -2,7 +2,7 @@ export const nxVersion = require('../../package.json').version;
export const tslintVersion = '~6.1.0';
export const tslintToEslintConfigVersion = '^2.13.0';
export const buildAngularVersion = '~14.1.0';
export const buildAngularVersion = '~14.2.0';
export const typescriptESLintVersion = '^5.29.0';
export const eslintVersion = '~8.15.0';

View File

@ -1,6 +1,6 @@
export const nxVersion = require('../../package.json').version;
export const angularCliVersion = '~14.1.0';
export const angularCliVersion = '~14.2.0';
export const typescriptVersion = '~4.7.2';
export const prettierVersion = '^2.6.2';
export const tslintVersion = '~6.1.0';

View File

@ -1,6 +1,6 @@
export const nxVersion = require('../../package.json').version;
export const angularCliVersion = '~14.1.0';
export const angularCliVersion = '~14.2.0';
export const typescriptVersion = '~4.7.2';
export const prettierVersion = '^2.6.2';
export const tslintVersion = '~6.1.0';

1133
yarn.lock

File diff suppressed because it is too large Load Diff