1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-23 23:59:27 +08:00

4271 Commits

Author SHA1 Message Date
Amadou Sall
aebcbfed1a docs: add Architect CLI to the "Tooling" section 2019-06-06 14:23:35 -07:00
Amadou Sall
a89a5b59a4 docs: remove mention of the Angular CLI depending on Node 8 2019-06-06 14:23:35 -07:00
Renovate Bot
e509255dc5 build: update tslint-no-circular-imports to version ^0.7.0 2019-06-06 14:23:12 -07:00
Alan Agius
275fdef350 ci: disable TypeScript patch updates for different major and minor versions.
At the moment, we get patch updates for different major and minor versions than the current version of TypeScript installed.

```json
{
  "packageRules": [
    {
      "packageNames": [
        "typescript"
      ],
      "separateMinorPatch": true
    },
    {
      "packageNames": [
        "typescript"
      ],
      "updateTypes": [
        "minor",
        "major"
      ],
      "enabled": false
    }
  ]
}
```

What the first rule does is override Renovate's results so that if TypeScript has both a minor update as well as a patch update then you get both PRs. Renovate's default otherwise is to just give you the latest minor or squash. So for example if the current TypeScript is `3.4.4` then the default behaviour is just to PR you for `3.5.1`. With this rule, we get both `3.4.5` and `3.5.1`.

The second rule then disables major and minor updates for TypeScript, which has the effect of them suppressing the minor `3.5.1` update.

For more context see: https://github.com/renovatebot/config-help/issues/260
2019-06-06 14:22:56 -07:00
Charles Lyding
2d27cb4671 fix(@angular/cli): resolve update migrations from referenced package root
This ensures that migration fields that reference other packages use the package version specified in the migrating package's dependencies and not the version that a package manager happens to hoist to the root of the workspace.
2019-06-06 14:22:02 -07:00
Amadou Sall
7dac687767 refactor(@schematics/angular): remove non-useful or operator 2019-06-06 14:21:24 -07:00
Alan
ac90732e0b refactor: deprecate isSupported static in AngularCompilerPlugin 2019-06-06 14:20:16 -07:00
Alan Agius
be35b78211 refactor: remove beta versions from latest versions 2019-06-06 14:16:51 -07:00
Alan
50c974a583 fix(@schematics/angular): add '@angular-devkit/build-webpack' package to the version 8 migration 2019-06-06 14:16:51 -07:00
Alan
89a122cd5c fix(@schematics/angular): update ng-packagr and tsickle when migrating to version 8 2019-06-06 14:16:51 -07:00
Matt Lewis
ef981d63b7 fix(@angular/cli): add analytics option to options schema 2019-06-06 14:16:23 -07:00
Alan Agius
8d479c93d2 test: add test to verify that the new es2015 class wrapping logic handles wrapping of tslib and tsickle classes
Related to https://github.com/ngrx/platform/issues/1905 and https://github.com/ng-packagr/ng-packagr/issues/1307

Fixes 
2019-06-06 14:15:30 -07:00
Alan Agius
8104fce690 fix(@angular-devkit/build-optimizer): wrap ClassDeclarations in an IIFE for better treeshaking
With this change we wrap ClassDeclarations inside an IIFE, also we move some code from the class fold into the wrap-enums.

This changes the below code:
```js
export class Foo {
	method() {
	}
}
Foo.bar = 'barValue';
__decorate([
	methodDecorator
], Foo.prototype, "method", null);
```

to

```js
export const Foo = /*@__PURE__*/ (() => {
  class Foo {
    method() {
    }
  }
  Foo.bar = 'barValue';
  __decorate([
    methodDecorator
  ], Foo.prototype, "method", null);

  return Foo;
})();
```

Fixes 
2019-06-06 14:15:30 -07:00
Alan Agius
f5200775f9 fix(@angular-devkit/build-optimizer): wrap es2015 class expressions for better tree-shaking
ClassExpressions such as the below are not treeshakable unless we wrap them in an IIFE

```js
let AggregateColumnDirective = class AggregateColumnDirective {
	constructor(viewContainerRef) { }
};
AggregateColumnDirective = __decorate([
	Directive({}),
	__metadata("design:paramtypes", [ViewContainerRef])
], AggregateColumnDirective);
```

With this change we wrap the above in an IIFE and mark it as a PURE function.
```js
const AggregateColumnDirective = /*@__PURE__*/ (() => {
	let AggregateColumnDirective = class AggregateColumnDirective {
		constructor(viewContainerRef) { }
	};
	AggregateColumnDirective = __decorate([
		Directive({}),
		__metadata("design:paramtypes", [ViewContainerRef])
	], AggregateColumnDirective);

	return AggregateColumnDirective;
})();
```

With this pattern if the class is unused it will be dropped.

Note: In future we should rename `wrap-enums` to something more generic, and combine class-fold with this transformer especially considering the future fix that needs to be done for https://github.com/angular/angular-cli/issues/14610

Fixes 
2019-06-06 14:15:30 -07:00
Alan Agius
bebd8b6c09 refactor: use standard node resolution and use async/await instead of rxjs 2019-06-06 14:07:37 -07:00
Judy Bogart
7ef64dbe46 docs: more complete description 2019-06-06 14:06:53 -07:00
Judy Bogart
3ec845caf3 docs: make connection of live-reload and public-host explicit 2019-06-06 14:06:53 -07:00
Filipe Silva
24f37a602c feat(@schematics/angular): default Ivy apps to AOT true
Testing on AIO with Angular master as of 28/05/2019 I got these results:
JIT ~414ms (369, 378, 408, 323, 593)
AOT using VE ~1383ms (1365, 1185, 1767, 1135, 1467)
AOT using Ivy ~517ms (600, 391, 444, 756, 394)

This is largely due to https://github.com/angular/angular/pull/29380 and https://github.com/angular/angular/pull/30238.

The second PR above was not merged to master, and thus will not be in 8.0.0. This PR should be merged to match it.
2019-06-06 14:03:00 -07:00
Charles Lyding
6ec09919b5 test: fix prelease CLI E2E check 2019-05-30 14:54:16 -07:00
Renovate Bot
3b46107a2f build: update @angular/animations to version 2019-05-30 14:11:41 -07:00
Nick Webster
a976e45f8b fix(@angular-devkit/build-angular): exclude map files from 'bundle' budgets 2019-05-30 14:05:59 -07:00
Renovate Bot
e7419d5d24 build: update semver to version 6.1.1 2019-05-30 14:05:06 -07:00
Renovate Bot
559e7423be build: update browserslist to version 4.6.1 2019-05-30 14:04:52 -07:00
Renovate Bot
8b89cbdb53 build: update com_google_protobuf to version 2019-05-30 14:04:34 -07:00
Alan Agius
bed09493b0 test: refactor webpack tests to work and use angular compiler-cli 8 2019-05-30 14:03:01 -07:00
Alan Agius
e14f2e113e fix(@ngtools/webpack): update supported compiler-cli supported version
`@ngtools/webpack` only supports compiler version 8 as per the peerDependency.

The fixes the `isSupported` version static and also removes code that was to support prior versions of compiler-cli
2019-05-30 14:03:01 -07:00
Charles Lyding
34a55c96b2 refactor(@schematics/update): fix lint error 2019-05-30 13:55:14 -07:00
Charles Lyding
aceaacde50 fix(@angular/cli): provide an option to update dirty repositories 2019-05-30 13:55:14 -07:00
Charles Lyding
19ed795cb1 fix(@angular-devkit/architect): support all observable types as build results
Fixes 
2019-05-30 13:33:51 -07:00
Alan Agius
5a100c7768 fix(@schematics/update): improve error message when finding incompatible peer dependencies
fix 
2019-05-30 10:45:28 -07:00
Alan Agius
99a2740366 ci: add build_bazel packages in bazel package group 2019-05-30 10:26:38 -07:00
Alan Agius
576119f2ca fix(@schematics/angular): TypeScript related migrations should cater for BOM
In the CLI `UpdateRecorder` methods such as `insertLeft`, `remove` etc.. accepts positions which are not offset by a BOM. This is because when a file has a BOM a different recorder will be used https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/tree/recorder.ts#L72 which caters for an addition offset/delta.

The main reason for this is that when a developer is writing a schematic they shouldn't need to compute the offset based if a file has a BOM or not and is handled out of the box.

Example
```ts
recorder.insertLeft(5, 'true');
```

However this is unfortunate in the case if a ts SourceFile is used and one uses `getWidth` and `getStart` method they will already be offset by 1, which at the end it results in a double offset and hence the problem.

Fixes 
2019-05-30 10:21:49 -07:00
Charles Lyding
0048bf286f fix(@schematics/update): respect semver rules for migration from & to
This implements the logic provided in the following link with the exception that the lower range is exclusive instead of inclusive.
https://github.com/npm/node-semver#hyphen-ranges-xyz---abc

Fixes 
2019-05-30 10:20:42 -07:00
Paul Gschwendtner
a57f053867 fix(@angular/cli): ng-update migrations not running with --migrate-only
With Angular CLI version 8, migrations cannot be re-run with the
`--migrate-only` flag as there was a recent regression introduced
in e406f00909 (diff-0d0a748fb9a38a7ccde08d9b42e70bce) as it now passes
a normalized platform path to the `engine.createCollection` call.

This breaks as there is incorrect logic within
`node-modules-engine-host` that causes the schematic collection to be
searched within the `package.json#schematics` entry. This is incorrect
as migration schematics specify their migration schematics in a separate
schematic collection file which is part of `package.json#ng-update`.

Fixes 
2019-05-30 10:19:16 -07:00
Charles Lyding
410b56e107 fix(@angular/cli): check for CI environment variable in tty helper
Fixes 
2019-05-30 12:32:01 +02:00
Filipe Silva
37debd7105 ci: remove duplicate anchor keys in circleci cfg
When updating to Pipelines (https://circleci.com/docs/2.0/build-processing/), duplicate keys cause builds to fail.
2019-05-29 17:16:41 -07:00
Alan Agius
3afdab21a0 fix(@schematics/angular): add migration to update web-animations-js polyfill
Previous versions rely on `this` which breaks differential loading since it's `undefined` when using script tags with type module.

Fixes 
2019-05-28 13:32:53 -07:00
Alan Agius
757d8df3e6 fix(@angular/cli): ng config doesn't parse positional array
Fixes 
2019-05-28 21:01:13 +02:00
Alan Agius
c70cf991ac refactor(@angular-devkit/architect): remove index2 from testing folder 2019-05-28 21:00:29 +02:00
Alan Agius
db344641f4 fix(@angular/cli): ng generate --help shows the wrong collection
At the moment, collectionName and schematicCollections are not set in various schematics command which result in fallbacking to the hardcoded default collectionName https://github.com/angular/angular-cli/blob/master/packages/angular/cli/models/schematic-command.ts#L79

Hence, this will result in incorrect information being present when using the `--help`, `--list`.

Fixes 
2019-05-28 20:57:21 +02:00
mgechev
9a4e2f5870 fix(@schematics/angular): drop the worker alias
Fix 
2019-05-28 20:55:58 +02:00
Renovate Bot
80c7479bbf build: update mini-css-extract-plugin to version 0.7.0 2019-05-28 20:53:05 +02:00
Renovate Bot
c1cb92ff6b build: update core-js to version 3.1.3 2019-05-28 20:52:45 +02:00
Alan
8110a5b27c ci: add bazel workspace file to renovate packageFiles 2019-05-28 20:52:30 +02:00
Renovate Bot
bf7c4aadbe build: update terser-webpack-plugin to version 1.3.0 2019-05-28 20:52:15 +02:00
Renovate Bot
5df02a3de5 build: update webpack to version 4.32.2 2019-05-23 19:16:49 +02:00
Renovate Bot
db819cbd2c build: update semver to version 6.1.0 2019-05-23 19:16:31 +02:00
Renovate Bot
ac493cf6e3 build: update @angular/animations to version 2019-05-23 19:16:21 +02:00
Alan
3a400c54cb fix(@angular-devkit/build-angular): dev-server port number mismatches in logs when using port=0
Fixes 
2019-05-23 19:15:50 +02:00
Alan
22d77285e1 fix(@schematics/angular): handle newline after @ of a decorator
Fixes 
2019-05-23 19:14:58 +02:00