-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@schematics/angular): update karma to 5.0.0
Related to: #17435
- Loading branch information
1 parent
da7fbc6
commit f0e6a69
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/schematics/angular/migrations/update-10/update-dependencies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
import { Rule } from '@angular-devkit/schematics'; | ||
import { | ||
addPackageJsonDependency, | ||
getPackageJsonDependency, | ||
} from '../../utility/dependencies'; | ||
import { latestVersions } from '../../utility/latest-versions'; | ||
|
||
export default function (): Rule { | ||
return (host, context) => { | ||
const dependenciesToUpdate: Record<string, string> = { | ||
'karma': '~5.0.0', | ||
'ng-packagr': latestVersions.ngPackagr, | ||
}; | ||
|
||
for (const [name, version] of Object.entries(dependenciesToUpdate)) { | ||
const current = getPackageJsonDependency(host, name); | ||
if (!current || current.version === version) { | ||
continue; | ||
} | ||
|
||
addPackageJsonDependency(host, { | ||
type: current.type, | ||
name, | ||
version, | ||
overwrite: true, | ||
}); | ||
} | ||
|
||
// Check for @angular-devkit/schematics and @angular-devkit/core | ||
for (const name of ['@angular-devkit/schematics', '@angular-devkit/core']) { | ||
const current = getPackageJsonDependency(host, name); | ||
if (current) { | ||
context.logger.info( | ||
`Package "${name}" found in the workspace package.json. ` + | ||
'This package typically does not need to be installed manually. ' + | ||
'If it is not being used by project code, it can be removed from the package.json.', | ||
); | ||
} | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters