Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): add karma as an optional peer dep…
Browse files Browse the repository at this point in the history
…endency

karma is currently used by the karma builder within this package but is not represented in the dependencies.  The can lead to accidental version mismatches as well as package manager hoisting problems due to the package manager not knowing the full dependency set of the package.
  • Loading branch information
clydin authored and alan-agius4 committed Sep 25, 2020
1 parent 0bacb6b commit 5bbac07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/angular_devkit/build_angular/package.json
Expand Up @@ -81,13 +81,17 @@
"peerDependencies": {
"@angular/compiler-cli": "^11.0.0 || ^11.0.0-next",
"@angular/localize": "^11.0.0 || ^11.0.0-next",
"karma": "^5.2.0",
"ng-packagr": "^10.0.0",
"typescript": ">=3.9 < 4.1"
},
"peerDependenciesMeta": {
"@angular/localize": {
"optional": true
},
"karma": {
"optional": true
},
"ng-packagr": {
"optional": true
}
Expand Down
3 changes: 0 additions & 3 deletions packages/angular_devkit/build_angular/src/karma/index.ts
Expand Up @@ -26,7 +26,6 @@ import { SingleTestTransformLoader } from '../webpack/plugins/single-test-transf
import { findTests } from './find-tests';
import { Schema as KarmaBuilderOptions } from './schema';

// tslint:disable-next-line:no-implicit-dependencies
export type KarmaConfigOptions = import('karma').ConfigOptions & {
buildWebpack?: unknown;
configFile?: string;
Expand All @@ -36,7 +35,6 @@ async function initialize(
options: KarmaBuilderOptions,
context: BuilderContext,
webpackConfigurationTransformer?: ExecutionTransformer<webpack.Configuration>,
// tslint:disable-next-line:no-implicit-dependencies
): Promise<[typeof import('karma'), webpack.Configuration]> {
const { config } = await generateBrowserWebpackConfigFromContext(
// only two properties are missing:
Expand All @@ -53,7 +51,6 @@ async function initialize(
],
);

// tslint:disable-next-line:no-implicit-dependencies
const karma = await import('karma');

return [
Expand Down

0 comments on commit 5bbac07

Please sign in to comment.