Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a1378a2

Browse files
alan-agius4clydin
authored andcommittedJun 2, 2020
fix(@schematics/angular): update several testing dev dependencies
1 parent d44d374 commit a1378a2

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed
 

‎packages/schematics/angular/migrations/migration-collection.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@
9595
"factory": "./update-10/update-libraries-tslib",
9696
"description": "Update library projects to use tslib version 2 as a direct dependency."
9797
},
98-
"update-workspace-dependencies": {
99-
"version": "10.0.0-rc.1",
100-
"factory": "./update-10/update-dependencies",
101-
"description": "Workspace dependencies updates."
102-
},
10398
"solution-style-tsconfig": {
10499
"version": "10.0.0-beta.7",
105100
"factory": "./update-10/solution-style-tsconfig",
@@ -109,6 +104,11 @@
109104
"version": "10.0.0-rc.1",
110105
"factory": "./update-10/update-module-and-target-compiler-options",
111106
"description": "Update 'module' and 'target' TypeScript compiler options."
107+
},
108+
"update-workspace-dependencies": {
109+
"version": "10.0.0-rc.2",
110+
"factory": "./update-10/update-dependencies",
111+
"description": "Workspace dependencies updates."
112112
}
113113
}
114114
}

‎packages/schematics/angular/migrations/update-10/update-dependencies.ts

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import { Rule } from '@angular-devkit/schematics';
9+
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
910
import {
1011
addPackageJsonDependency,
1112
getPackageJsonDependency,
@@ -15,13 +16,19 @@ import { latestVersions } from '../../utility/latest-versions';
1516
export default function (): Rule {
1617
return (host, context) => {
1718
const dependenciesToUpdate: Record<string, string> = {
19+
'jasmine-core': '~3.5.0',
20+
'jasmine-spec-reporter': '~5.0.0',
1821
'karma': '~5.0.0',
22+
'karma-chrome-launcher': '~3.1.0',
23+
'karma-coverage-istanbul-reporter': '~3.0.2',
1924
'karma-jasmine': '~3.3.0',
25+
'karma-jasmine-html-reporter': '^1.5.0',
2026
'protractor': '~7.0.0',
2127
'ng-packagr': latestVersions.ngPackagr,
2228
'tslib': '^2.0.0',
2329
};
2430

31+
let hasChanges = false;
2532
for (const [name, version] of Object.entries(dependenciesToUpdate)) {
2633
const current = getPackageJsonDependency(host, name);
2734
if (!current || current.version === version) {
@@ -34,6 +41,12 @@ export default function (): Rule {
3441
version,
3542
overwrite: true,
3643
});
44+
45+
hasChanges = true;
46+
}
47+
48+
if (hasChanges) {
49+
context.addTask(new NodePackageInstallTask());
3750
}
3851

3952
// Check for @angular-devkit/schematics and @angular-devkit/core

‎tests/legacy-cli/e2e/tests/update/update-7.0.ts

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
import * as fs from 'fs';
21
import { createProjectFromAsset } from '../../utils/assets';
32
import { expectFileMatchToExist, expectFileToExist, expectFileToMatch } from '../../utils/fs';
43
import { ng, noSilentNg, silentNpm } from '../../utils/process';
54
import { isPrereleaseCli, useBuiltPackages, useCIChrome, useCIDefaults } from '../../utils/project';
65
import { expectToFail } from '../../utils/utils';
76

87
export default async function() {
9-
const extraUpdateArgs = (await isPrereleaseCli()) ? ['--next', '--force'] : [];
10-
11-
// Create new project from previous version files.
12-
// We must use the original NPM packages to force a real update.
13-
await createProjectFromAsset('7.0-project', true);
14-
// Update to version 8, to use the self update CLI feature.
15-
await ng('update', '@angular/cli@8');
16-
17-
fs.writeFileSync('.npmrc', 'registry = http://localhost:4873', 'utf8');
18-
19-
// Update the CLI.
20-
// Users of CLI <7.2 will see the following warnings:
21-
// packageGroup metadata of package @angular/cli is malformed. Ignoring.
22-
// This is expected since the format changed in 7.2.
23-
await ng('update', '@angular/cli', ...extraUpdateArgs);
8+
await createProjectFromAsset('7.0-project');
9+
await ng('update', '@angular/cli', '--migrate-only', '--from=7');
2410

2511
// Test CLI migrations.
2612
// Should update the lazy route syntax via update-lazy-module-paths.
@@ -44,6 +30,7 @@ export default async function() {
4430
await silentNpm('install');
4531

4632
// Update Angular.
33+
const extraUpdateArgs = (await isPrereleaseCli()) ? ['--next', '--force'] : [];
4734
await ng('update', '@angular/core', ...extraUpdateArgs);
4835

4936
// Run CLI commands.

0 commit comments

Comments
 (0)
Please sign in to comment.