feat(@schematics/angular): rename experimentalIvy to enableIvy

Followup to https://github.com/angular/angular/pull/28569#discussion_r259558085
This commit is contained in:
Filipe Silva 2019-02-26 11:49:09 +00:00 committed by Minko Gechev
parent 3d6ae63178
commit 05966646e7
10 changed files with 12 additions and 12 deletions

View File

@ -7,7 +7,7 @@
"exclude": [ "exclude": [
"test.ts", "test.ts",
"**/*.spec.ts" "**/*.spec.ts"
]<% if (experimentalIvy) { %>, ]<% if (enableIvy) { %>,
"angularCompilerOptions": { "angularCompilerOptions": {
"enableIvy": true "enableIvy": true
}<% } %> }<% } %>

View File

@ -430,7 +430,7 @@ export default function (options: ApplicationOptions): Rule {
move(sourceDir), move(sourceDir),
]), MergeStrategy.Overwrite), ]), MergeStrategy.Overwrite),
options.minimal ? noop() : schematic('e2e', e2eOptions), options.minimal ? noop() : schematic('e2e', e2eOptions),
options.experimentalIvy ? addPostInstallScript() : noop(), options.enableIvy ? addPostInstallScript() : noop(),
options.skipPackageJson ? noop() : addDependenciesToPackageJson(options), options.skipPackageJson ? noop() : addDependenciesToPackageJson(options),
options.lintFix ? applyLintFix(sourceDir) : noop(), options.lintFix ? applyLintFix(sourceDir) : noop(),
]); ]);

View File

@ -208,8 +208,8 @@ describe('Application Schematic', () => {
expect(pkg.devDependencies['typescript']).toEqual(latestVersions.TypeScript); expect(pkg.devDependencies['typescript']).toEqual(latestVersions.TypeScript);
}); });
it(`should add a postinstall in package.json when 'experimentalIvy'`, () => { it(`should add a postinstall in package.json when 'enableIvy'`, () => {
const tree = schematicRunner.runSchematic('application', { ...defaultOptions, experimentalIvy: true }, workspaceTree); const tree = schematicRunner.runSchematic('application', { ...defaultOptions, enableIvy: true }, workspaceTree);
const pkg = JSON.parse(tree.readContent('/package.json')); const pkg = JSON.parse(tree.readContent('/package.json'));
expect(pkg.scripts.postinstall).toEqual('ivy-ngcc'); expect(pkg.scripts.postinstall).toEqual('ivy-ngcc');
}); });

View File

@ -19,7 +19,7 @@
}, },
"x-prompt": "What name would you like to use for the application?" "x-prompt": "What name would you like to use for the application?"
}, },
"experimentalIvy": { "enableIvy": {
"description": "EXPERIMENTAL: True to create a new app that uses the Ivy rendering engine.", "description": "EXPERIMENTAL: True to create a new app that uses the Ivy rendering engine.",
"type": "boolean", "type": "boolean",
"default": false "default": false

View File

@ -46,7 +46,7 @@ export default function (options: NgNewOptions): Rule {
const applicationOptions: ApplicationOptions = { const applicationOptions: ApplicationOptions = {
projectRoot: '', projectRoot: '',
name: options.name, name: options.name,
experimentalIvy: options.experimentalIvy, enableIvy: options.enableIvy,
inlineStyle: options.inlineStyle, inlineStyle: options.inlineStyle,
inlineTemplate: options.inlineTemplate, inlineTemplate: options.inlineTemplate,
prefix: options.prefix, prefix: options.prefix,

View File

@ -18,8 +18,8 @@
}, },
"x-prompt": "What name would you like to use for the new workspace and initial project?" "x-prompt": "What name would you like to use for the new workspace and initial project?"
}, },
"experimentalIvy": { "enableIvy": {
"description": "EXPERIMENTAL: When true, creates a new app that uses the Ivy rendering engine.", "description": "When true, creates a new app that uses the Ivy rendering engine.",
"type": "boolean", "type": "boolean",
"default": false "default": false
}, },

View File

@ -11,7 +11,7 @@ export default async function() {
const extraArgs = []; const extraArgs = [];
if (argv['ivy']) { if (argv['ivy']) {
extraArgs.push('--experimentalIvy'); extraArgs.push('--enable-ivy');
} }
if (argv.noproject) { if (argv.noproject) {

View File

@ -11,7 +11,7 @@ import { ng } from '../../utils/process';
import { createProject } from '../../utils/project'; import { createProject } from '../../utils/project';
export default async function() { export default async function() {
await createProject('ivy-project', '--experimental-ivy'); await createProject('ivy-project', '--enable-ivy');
await ng('generate', 'module', 'lazy', '--routing'); await ng('generate', 'module', 'lazy', '--routing');
await prependToFile('src/app/app.module.ts', `import { RouterModule } from '@angular/router';`); await prependToFile('src/app/app.module.ts', `import { RouterModule } from '@angular/router';`);

View File

@ -17,7 +17,7 @@ export default async function() {
return; return;
} }
try { try {
await createProject('ivy-project', '--experimental-ivy'); await createProject('ivy-project', '--enable-ivy');
await ngServe('--prod'); await ngServe('--prod');

View File

@ -38,7 +38,7 @@ export async function createProject(name: string, ...args: string[]) {
const extraArgs = []; const extraArgs = [];
if (argv['ivy']) { if (argv['ivy']) {
extraArgs.push('--experimentalIvy'); extraArgs.push('--enableIvy');
} }
process.chdir(getGlobalVariable('tmp-root')); process.chdir(getGlobalVariable('tmp-root'));