From ae0fdfac321a7863b6fd800cc3fafd1db04ca03c Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 30 Mar 2021 10:48:44 +0200 Subject: [PATCH] refactor(@angular/cli): remove `Ivy Workspace` from `ng version` In version 12, only Ivy will be allowed to be used to compile an application. --- packages/angular/cli/commands/version-impl.ts | 14 -------------- tests/legacy-cli/e2e/tests/misc/version.ts | 12 ------------ 2 files changed, 26 deletions(-) diff --git a/packages/angular/cli/commands/version-impl.ts b/packages/angular/cli/commands/version-impl.ts index 1044d9e34bfe..1619eccee6d8 100644 --- a/packages/angular/cli/commands/version-impl.ts +++ b/packages/angular/cli/commands/version-impl.ts @@ -8,7 +8,6 @@ import * as path from 'path'; import { Command } from '../models/command'; import { colors } from '../utilities/color'; -import { JSONFile } from '../utilities/json-file'; import { Schema as VersionCommandSchema } from './version'; interface PartialPackageInfo { @@ -125,7 +124,6 @@ export class VersionCommand extends Command { return acc; }, []) .join('\n... ')} - Ivy Workspace: ${workspacePackage ? this.getIvyWorkspace() : ''} Package${namePad.slice(7)}Version -------${namePad.replace(/ /g, '-')}------------------ @@ -165,16 +163,4 @@ export class VersionCommand extends Command { return version || ''; } - - private getIvyWorkspace(): string { - try { - const json = new JSONFile(path.resolve(this.context.root, 'tsconfig.json')); - - return json.get(['angularCompilerOptions', 'enableIvy']) === false - ? 'No' - : 'Yes'; - } catch { - return ''; - } - } } diff --git a/tests/legacy-cli/e2e/tests/misc/version.ts b/tests/legacy-cli/e2e/tests/misc/version.ts index 09eff96fec9c..9d6858ac1362 100644 --- a/tests/legacy-cli/e2e/tests/misc/version.ts +++ b/tests/legacy-cli/e2e/tests/misc/version.ts @@ -1,8 +1,6 @@ -import { getGlobalVariable } from '../../utils/env'; import { deleteFile } from '../../utils/fs'; import { ng } from '../../utils/process'; - export default async function() { const { stdout: commandOutput } = await ng('version'); const { stdout: optionOutput } = await ng('--version'); @@ -10,16 +8,6 @@ export default async function() { throw new Error('version not displayed'); } - const argv = getGlobalVariable('argv'); - const veProject = argv['ve']; - - const ivyWorkspaceMatch = veProject - ? 'Ivy Workspace: No' - : 'Ivy Workspace: Yes'; - if (!optionOutput.includes(ivyWorkspaceMatch)) { - throw new Error(`Expected output to contain ${ivyWorkspaceMatch}`); - } - if (commandOutput !== optionOutput) { throw new Error('version variants have differing output'); }