Skip to content

Commit

Permalink
refactor(@angular/cli): remove Ivy Workspace from ng version
Browse files Browse the repository at this point in the history
In version 12, only Ivy will be allowed to be used to compile an application.
  • Loading branch information
alan-agius4 authored and filipesilva committed Mar 30, 2021
1 parent 27a41f2 commit 14c8a09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
14 changes: 0 additions & 14 deletions packages/angular/cli/commands/version-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -125,7 +124,6 @@ export class VersionCommand extends Command<VersionCommandSchema> {
return acc;
}, [])
.join('\n... ')}
Ivy Workspace: ${workspacePackage ? this.getIvyWorkspace() : ''}
Package${namePad.slice(7)}Version
-------${namePad.replace(/ /g, '-')}------------------
Expand Down Expand Up @@ -165,16 +163,4 @@ export class VersionCommand extends Command<VersionCommandSchema> {

return version || '<error>';
}

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 '<error>';
}
}
}
12 changes: 0 additions & 12 deletions tests/legacy-cli/e2e/tests/misc/version.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
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');
if (!optionOutput.includes('Angular CLI:')) {
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');
}
Expand Down

0 comments on commit 14c8a09

Please sign in to comment.