From 21b601b5a77a70c6239249833e8639d7dd9cee98 Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Thu, 22 Apr 2021 09:24:21 +0200 Subject: [PATCH] fix(@schematics/angular): remove jasmine-spec-reporter and ts-node from default workspace The dependencies are only needed for protractor tests, so they should only be added by the e2e schematics. (cherry picked from commit 29cf8125ca28f43596a24a2626f1221d0a33e73c) --- packages/schematics/angular/e2e/index.ts | 12 ++++++++++-- .../angular/workspace/files/package.json.template | 4 +--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/schematics/angular/e2e/index.ts b/packages/schematics/angular/e2e/index.ts index a4fc7d1cd603..56a05e94b807 100644 --- a/packages/schematics/angular/e2e/index.ts +++ b/packages/schematics/angular/e2e/index.ts @@ -74,11 +74,19 @@ export default function (options: E2eOptions): Rule { }), move(root), ])), - host => addPackageJsonDependency(host, { + host => [{ type: NodeDependencyType.Dev, name: 'protractor', version: '~7.0.0', - }), + }, { + type: NodeDependencyType.Dev, + name: 'jasmine-spec-reporter', + version: '~7.0.0', + }, { + type: NodeDependencyType.Dev, + name: 'ts-node', + version: '~9.1.1', + }].forEach(dep => addPackageJsonDependency(host, dep)), addScriptsToPackageJson(), ]); }; diff --git a/packages/schematics/angular/workspace/files/package.json.template b/packages/schematics/angular/workspace/files/package.json.template index a1ae065373bc..be076d6cc3e8 100644 --- a/packages/schematics/angular/workspace/files/package.json.template +++ b/packages/schematics/angular/workspace/files/package.json.template @@ -29,13 +29,11 @@ "@types/jasmine": "~3.6.0",<% } %> "@types/node": "^12.11.1",<% if (!minimal) { %> "jasmine-core": "~3.7.0", - "jasmine-spec-reporter": "~7.0.0", "karma": "~6.3.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.0.3", "karma-jasmine": "~4.0.0", - "karma-jasmine-html-reporter": "^1.5.0", - "ts-node": "~9.1.1",<% } %> + "karma-jasmine-html-reporter": "^1.5.0",<% } %> "typescript": "<%= latestVersions.TypeScript %>" } }