Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: angular/angular-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.2.3
Choose a base ref
...
head repository: angular/angular-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.2.4
Choose a head ref
  • 7 commits
  • 13 files changed
  • 6 contributors

Commits on Jan 24, 2019

  1. ci: checkout existing branch on snapshots

    hansl authored and Angular Builds committed Jan 24, 2019
    Copy the full SHA
    ded9930 View commit details

Commits on Jan 30, 2019

  1. fix(@schematics/angular): remove leading comments when removing `core…

    …-js/es7/reflect` (#13528)
    
    Fixes #13491
    alan-agius4 authored and Angular Builds committed Jan 30, 2019
    Copy the full SHA
    e719310 View commit details
  2. fix(@schematics/angular): use baseUrl for default e2e test

    replace usage of `'/'` for default end-to-end test by `browser.baseUrl`
    to take into account any accesspath and rely on provided setting.
    loganmzz authored and Angular Builds committed Jan 30, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a88909b View commit details
  3. fix(@angular/cli): remove unsupported dryRun and force from ng add

    Fixes #13479
    Alan authored and Angular Builds committed Jan 30, 2019
    Copy the full SHA
    000a565 View commit details
  4. fix(@schematics/schematics): use correct collection.json path

    louislarry authored and Angular Builds committed Jan 30, 2019
    Copy the full SHA
    cdcaff8 View commit details
  5. fix(@angular/cli): schematics commands should fail on unknown options

    When an addition argument is parsed the schematic commands should fail with an error.
    
    Fixes #12549
    alan-agius4 authored and Angular Builds committed Jan 30, 2019
    Copy the full SHA
    6ad093d View commit details

Commits on Jan 31, 2019

  1. release: v7.2.4

    Angular Builds committed Jan 31, 2019
    Copy the full SHA
    87e63b5 View commit details
76 changes: 38 additions & 38 deletions .monorepo.json
Original file line number Diff line number Diff line change
@@ -42,16 +42,16 @@
},
"packages": {
"@_/benchmark": {
"version": "0.12.3",
"hash": "4eecb4a76317039defc5c2b4bd31e4f9"
"version": "0.12.4",
"hash": "5225044ecf49d630564a68b710f6b82f"
},
"@_/builders": {
"version": "0.12.3",
"hash": "796f00a3b325334632fd8bb9d1b46b02"
"version": "0.12.4",
"hash": "f34470f978203f13c312094472b0a343"
},
"devkit": {
"version": "0.12.3",
"hash": "745e7268f2b6198860130ea91512d17b"
"version": "0.12.4",
"hash": "35cf39f0905caa12d94707fc37fa2db2"
},
"@angular/cli": {
"name": "Angular CLI",
@@ -62,15 +62,15 @@
"url": "/packages/angular/cli/README.md"
}
],
"version": "7.2.3",
"version": "7.2.4",
"snapshotRepo": "angular/cli-builds",
"hash": "9b35bfedb6edbf0ddb3359661029c487"
"hash": "ed2af382f3de3783908e072e8dee6a96"
},
"@angular/pwa": {
"name": "Angular PWA Schematics",
"section": "Schematics",
"version": "0.12.3",
"hash": "64aebc964f8fe310adf68d47c0951d2b",
"version": "0.12.4",
"hash": "8afe29596bd4f22aed92be3f8d6ac0e3",
"snapshotRepo": "angular/angular-pwa-builds"
},
"@angular-devkit/architect": {
@@ -81,21 +81,21 @@
"url": "/packages/angular_devkit/architect/README.md"
}
],
"version": "0.12.3",
"hash": "b1b314f5995a7737ebd9a018eeb1b885",
"version": "0.12.4",
"hash": "5fcec7431e41ac519d7cb9ef2131a056",
"snapshotRepo": "angular/angular-devkit-architect-builds"
},
"@angular-devkit/architect-cli": {
"name": "Architect CLI",
"version": "0.12.3",
"hash": "97a324207f39c9a5c7e235028b89a100",
"version": "0.12.4",
"hash": "003a2720a85a63da633a5abda33d48e0",
"snapshotRepo": "angular/angular-devkit-architect-cli-builds"
},
"@angular-devkit/benchmark": {
"name": "Benchmark",
"section": "Tooling",
"version": "1.1.3",
"hash": "51c140e97927376499a69eb6538fde4a"
"version": "1.1.4",
"hash": "b00c2187aefb97e639f9c528c0c15346"
},
"@angular-devkit/build-optimizer": {
"name": "Build Optimizer",
@@ -105,8 +105,8 @@
"url": "/packages/angular_devkit/build_optimizer/README.md"
}
],
"version": "0.12.3",
"hash": "bf9798ab1944df2e79a7cab09d0bdf7e",
"version": "0.12.4",
"hash": "7459ed64280366e512d25a66705fedbd",
"snapshotRepo": "angular/angular-devkit-build-optimizer-builds"
},
"@angular-devkit/build-ng-packagr": {
@@ -117,8 +117,8 @@
"url": "/packages/angular_devkit/build_ng_packagr/README.md"
}
],
"version": "0.12.3",
"hash": "6e6664cb08e7fd262876e40185e0bcfd",
"version": "0.12.4",
"hash": "4276035d24c774e89d19b61d36127d58",
"snapshotRepo": "angular/angular-devkit-build-ng-packagr-builds"
},
"@angular-devkit/build-angular": {
@@ -129,8 +129,8 @@
"url": "/packages/angular_devkit/build_angular/README.md"
}
],
"version": "0.12.3",
"hash": "f8ae9dcd6e27c38c305d1d983c33617b",
"version": "0.12.4",
"hash": "f4b9bcbb6eabc954bee1a5d352be216b",
"snapshotRepo": "angular/angular-devkit-build-angular-builds"
},
"@angular-devkit/build-webpack": {
@@ -141,9 +141,9 @@
"url": "/packages/angular_devkit/build_webpack/README.md"
}
],
"version": "0.12.3",
"version": "0.12.4",
"snapshotRepo": "angular/angular-devkit-build-webpack-builds",
"hash": "1bf80422bd8c9c291c4c7522a6f5b2e4"
"hash": "0dea4384e16fec23843ff7215598a24e"
},
"@angular-devkit/core": {
"name": "Core",
@@ -153,8 +153,8 @@
"url": "/packages/angular_devkit/core/README.md"
}
],
"version": "7.2.3",
"hash": "0651134e16f7e56f75fcdbc004592bc0",
"version": "7.2.4",
"hash": "7a64327e0185442a073b1a32de26ba19",
"snapshotRepo": "angular/angular-devkit-core-builds"
},
"@angular-devkit/schematics": {
@@ -165,43 +165,43 @@
"url": "/packages/angular_devkit/schematics/README.md"
}
],
"version": "7.2.3",
"hash": "e74767ba92a7fbd9c96c9885e8763070",
"version": "7.2.4",
"hash": "b20e63e732f3bf99220d75ae241b6b66",
"snapshotRepo": "angular/angular-devkit-schematics-builds"
},
"@angular-devkit/schematics-cli": {
"name": "Schematics CLI",
"section": "Tooling",
"version": "0.12.3",
"hash": "8c4e82787d6a0b25537898a19386b9d3",
"version": "0.12.4",
"hash": "ac9244c8e5b40a19abb0d86d73f74a7b",
"snapshotRepo": "angular/angular-devkit-schematics-cli-builds"
},
"@ngtools/webpack": {
"name": "Webpack Angular Plugin",
"version": "7.2.3",
"version": "7.2.4",
"section": "Misc",
"hash": "1ed975e4610c53dc5da498899f8662d0",
"hash": "48f371dc2b3b5cdf554d7aa39e3bcc1c",
"snapshotRepo": "angular/ngtools-webpack-builds"
},
"@schematics/angular": {
"name": "Angular Schematics",
"section": "Schematics",
"version": "7.2.3",
"hash": "98e60074ce9a034bd40696eddddabeff",
"version": "7.2.4",
"hash": "10ac53a918c4f43273a4b95682e1f8b6",
"snapshotRepo": "angular/schematics-angular-builds"
},
"@schematics/schematics": {
"name": "Schematics Schematics",
"version": "0.12.3",
"version": "0.12.4",
"section": "Schematics",
"hash": "971b83539a1dae2fd2e2277cac85c404",
"hash": "71edbc04f0c491b0febc981c0302a73d",
"snapshotRepo": "angular/schematics-schematics-builds"
},
"@schematics/update": {
"name": "Package Update Schematics",
"version": "0.12.3",
"version": "0.12.4",
"section": "Schematics",
"hash": "28f85c28358760c39b3d5d04b8405a9e",
"hash": "32ba0aba6a9697aa3fdc89c952cbca9b",
"snapshotRepo": "angular/schematics-update-builds"
}
}
2 changes: 1 addition & 1 deletion packages/angular/cli/commands/add.json
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
]
},
{
"$ref": "./definitions.json#/definitions/schematic"
"$ref": "./definitions.json#/definitions/interactive"
},
{
"$ref": "./definitions.json#/definitions/base"
6 changes: 5 additions & 1 deletion packages/angular/cli/commands/definitions.json
Original file line number Diff line number Diff line change
@@ -49,7 +49,11 @@
"default": false,
"aliases": [ "f" ],
"description": "When true, forces overwriting of existing files."
},
}
}
},
"interactive": {
"properties": {
"interactive": {
"type": "boolean",
"default": "true",
3 changes: 2 additions & 1 deletion packages/angular/cli/commands/generate.json
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
]
},
{ "$ref": "./definitions.json#/definitions/base" },
{ "$ref": "./definitions.json#/definitions/schematic" }
{ "$ref": "./definitions.json#/definitions/schematic" },
{ "$ref": "./definitions.json#/definitions/interactive" }
]
}
3 changes: 2 additions & 1 deletion packages/angular/cli/commands/new.json
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@
"required": []
},
{ "$ref": "./definitions.json#/definitions/base" },
{ "$ref": "./definitions.json#/definitions/schematic" }
{ "$ref": "./definitions.json#/definitions/schematic" },
{ "$ref": "./definitions.json#/definitions/interactive" }
]
}
9 changes: 9 additions & 0 deletions packages/angular/cli/models/schematic-command.ts
Original file line number Diff line number Diff line change
@@ -437,6 +437,15 @@ export abstract class SchematicCommand<
args = await this.parseArguments(schematicOptions || [], o);
}

// ng-add is special because we don't know all possible options at this point
if (args['--'] && schematicName !== 'ng-add') {
args['--'].forEach(additional => {
this.logger.fatal(`Unknown option: '${additional.split(/=/)[0]}'`);
});

return 1;
}

const pathOptions = o ? this.setPathOptions(o, workingDir) : {};
let input = Object.assign(pathOptions, args);

2 changes: 1 addition & 1 deletion packages/schematics/angular/e2e/files/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/') as Promise<any>;
return browser.get(browser.baseUrl) as Promise<any>;
}

getTitleText() {
Original file line number Diff line number Diff line change
@@ -29,18 +29,15 @@ function _removeReflectFromPolyfills(tree: Tree, path: string) {
const recorder = tree.beginUpdate(path);

const sourceFile = ts.createSourceFile(path, source.toString(), ts.ScriptTarget.Latest);
const imports = (
sourceFile.statements
.filter(s => s.kind === ts.SyntaxKind.ImportDeclaration) as ts.ImportDeclaration[]
);
const imports = sourceFile.statements
.filter(s => s.kind === ts.SyntaxKind.ImportDeclaration) as ts.ImportDeclaration[];

for (const i of imports) {
const module = i.moduleSpecifier.kind == ts.SyntaxKind.StringLiteral
&& (i.moduleSpecifier as ts.StringLiteral).text;
const module = ts.isStringLiteral(i.moduleSpecifier) && i.moduleSpecifier.text;

switch (module) {
case 'core-js/es7/reflect':
recorder.remove(i.getStart(sourceFile), i.getWidth(sourceFile));
recorder.remove(i.getFullStart(), i.getFullWidth());
break;
}
}
Original file line number Diff line number Diff line change
@@ -42,6 +42,34 @@ import 'web-animations-js'; // Run \`npm install --save web-animations-js\`.
import 'zone.js/dist/zone'; // Included with Angular CLI.
`;

const newPolyfills = `
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
/** IE10 and IE11 requires the following for the Reflect API. */
import 'core-js/es6/reflect';
import 'web-animations-js'; // Run \`npm install --save web-animations-js\`.
(window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
(window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
`;


describe('polyfillMetadataRule', () => {
const schematicRunner = new SchematicTestRunner(
@@ -84,7 +112,7 @@ describe('polyfillMetadataRule', () => {
const tree2 = await schematicRunner.runSchematicAsync('migration-03', {}, tree.branch())
.toPromise();

expect(tree2.readContent(polyfillPath)).not.toMatch(/import .*es7.*reflect.*;/);
expect(tree2.readContent(polyfillPath)).toBe(newPolyfills);
});

it('should work as expected for a project with a root', async () => {
@@ -96,6 +124,6 @@ describe('polyfillMetadataRule', () => {
const tree2 = await schematicRunner.runSchematicAsync('migration-03', {}, tree.branch())
.toPromise();

expect(tree2.readContent(polyfillPath)).not.toMatch(/import .*es7.*reflect.*;/);
expect(tree2.readContent(polyfillPath)).toBe(newPolyfills);
});
});
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
// We read package.json using a require() call, which is standard JSON.
{
// This is just to indicate to your IDE that there is a schema for collection.json.
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",

// Schematics are listed as a map of schematicName => schematicDescription.
// Each description contains a description field which is required, a factory reference,
7 changes: 6 additions & 1 deletion scripts/snapshots.ts
Original file line number Diff line number Diff line change
@@ -91,7 +91,12 @@ async function _publishSnapshot(

_exec('git', ['clone', url], { cwd: root }, publishLogger);
if (branch) {
_exec('git', ['checkout', '-B', branch], { cwd: destPath }, publishLogger);
// Try to checkout an existing branch, otherwise create it.
try {
_exec('git', ['checkout', branch], { cwd: destPath }, publishLogger);
} catch {
_exec('git', ['checkout', '-b', branch], { cwd: destPath }, publishLogger);
}
}

// Clear snapshot directory before publishing to remove deleted build files.
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/');
return browser.get(browser.baseUrl);
}

getTitleText() {
9 changes: 9 additions & 0 deletions tests/legacy-cli/e2e/tests/commands/unknown-option.ts
Original file line number Diff line number Diff line change
@@ -15,4 +15,13 @@ export default async function() {
[ 'build', '--notanoption' ],
/should NOT have additional properties\(notanoption\)./,
));

const ngGenerateArgs = [ 'generate', 'component', 'component-name', '--notanoption' ];
await expectToFail(() => ng(...ngGenerateArgs));

await execAndWaitForOutputToMatch(
'ng',
ngGenerateArgs,
/Unknown option: '--notanoption'/,
);
}