121 Commits

Author SHA1 Message Date
Charles Lyding
e7bf105214 fix(@angular/cli): skip project analytics prompt when using update
The prompt will cause the workspace configuration file to be updated which can result in an unclean repository.

Fixes #16012
2019-11-04 13:25:13 -08:00
Charles Lyding
5df776780d fix(@angular-devkit/schematics): use NodeWorkflow root to resolve collections 2019-10-28 17:48:08 -07:00
Filipe Silva
65c2a1965f feat(@angular/cli): support using multiple configurations
It's now possible to use multiple configurations by separating them with a comma:
```
ng build --configuration=one,two,three
```

They will be applied from left to right. If `--prod` is also present, it will be considered to be the first configuration and thus able to be overriden.

You can also use it in target strings:
```
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "latest-project:build:one,two"
          },
          "configurations": {
            "production": {
              "browserTarget": "latest-project:build:production,one,two"
            }
          }
```

Fix https://github.com/angular/angular-cli/issues/10612
2019-10-14 13:40:48 -07:00
Keen Yee Liau
7e1e8adf7a feat(@angular/cli): allow subclass to override default collection name
This PR provides a way for subclass that extends `SchematicCommand` to
provide a different default collection name.
This is needed in g3 where the collection name is different from
external.
2019-10-03 14:42:20 -07:00
Charles Lyding
225ff385ac fix(@angular/cli): do not warn on multiple array option use
Fixes #15630
2019-09-19 14:42:52 -07:00
Charles
a1487b3e9e feat(@angular/cli): check/prompt for workspace level analytics configuration (#14264) 2019-09-12 11:45:59 -07:00
Alan Agius
26dd51221a style: collapse if statements (#15449) 2019-08-27 10:25:14 -07:00
Charles Lyding
b630317b4b refactor(@angular/cli): convert workspace access to async
This is in preparation for conversion from the experimental workspace API to the stable workspace API.
2019-08-16 09:32:04 -07:00
mgechev
5df50bacbe feat(@angular/cli): implement deploy command 2019-07-30 21:07:50 -07:00
Alan
b9598835bb fix(@angular/cli): don't add leftovers when there are none
At the moment we are adding leftover args to `--` even when it's an empty array, this causes schematics without arguments to fail silently, because of 07780b9272/packages/angular/cli/models/schematic-command.ts (L463)

Fixes: #15156
2019-07-29 10:45:45 -07:00
Minko Gechev
d274add7b4
fix(@angular/cli): use correct schematic defaults considering workspace (#15041)
Fix #14986

This PR includes some refactoring to simplify the interaction
of the `NodeWorkflow` and the `BaseWorkflow` with the registry.

We were registering redundant `addPostTransform`s. Some of them in
the constructor of the `BaseWorkflow`, which did not allow us to
intercept `addUndefinedDefaults`.

Additionally, we were setting the `validateOptionsWithSchema` transform
multiple times unnecessarily.

An issue left to fix is support for the `--project` option in
schematic commands. Currently, `getProjectName` does not know about
this option, since `createWorkflow` does not know how to parse the
command line arguments. The parsing logic is implemented partially
by the concrete implementation of the `SchematicCommand` template
method.
2019-07-16 09:58:01 -07:00
Hans
15b9ea8998 feat(@angular/cli): report telemetry opt-ins (#15054)
Only when prompted.
2019-07-12 15:15:21 -07:00
Charles Lyding
5b5f140109 refactor(@angular/cli): use stable workspace API 2019-07-10 04:05:26 +08:00
Hans Larsen
ce4e9f1d80 fix(@angular/cli): pass in metrics to the pageview for commands
We might want to pass those later.
2019-06-28 10:49:27 -07:00
Alan
70a4cbe306 style: enable no-debugger and no-console tslint rules 2019-06-27 09:28:35 -07:00
Hans Larsen
46ade49a2f feat(@angular/cli): report RAM in gigabytes instead of megabytes
Otherwise its too much noise. Some people have weird MB count probably due to
containers and VMs.
2019-06-27 09:17:26 -07:00
Hans Larsen
2e6d2e18b9 feat(@angular/cli): ping back when user opts out of analytics
On prompt only, does not contain any user info. Since prompt should be only
shown at install or first run, this is not going to ping more than once and
the users privacy is also protected.
2019-06-26 11:22:19 -07:00
Hans Larsen
cf86f0663e feat(@angular/cli): move non-stable version analytics to own property
And refactor it to be put magic strings in a single place.
2019-06-26 11:22:19 -07:00
cexbrayat
371bd6194a fix(@angular/cli): validate version in doc command
As the JSON Schema validation is minimum in the CLI, we have to also validate in code.
This PR:
- updates the JSON Schema to use `number` and `enum` instead of `integer` and `const` that are not supported.
- adds validation in the doc command implementation
- adds error reporting if the version is not valid
- fixes a typo in an error message in the parser
2019-06-24 17:30:44 -07:00
Charles Lyding
c4313f55e4 refactor(@angular/cli): unify color handling and support 2019-06-24 17:27:59 -07:00
Alan
c7135fae35 fix(@angular-devkit/build-angular): browser builder should not swollow error messages
Closes #14813
2019-06-19 17:07:27 -07: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 #14519
2019-05-28 20:57:21 +02:00
Charles Lyding
57189f6eca fix(@angular/cli): standardize TTY checks 2019-05-22 10:02:58 +02:00
Charles Lyding
4130191877 fix(@angular/cli): show analytics prompt when no global configuration file
Fixes #14486
2019-05-22 10:02:58 +02:00
Charles Lyding
290898536b fix(@angular/cli): prevent nested schematic execution from generating analytics
Fixes #14190
2019-05-15 14:11:48 -07:00
Charles Lyding
3912fdee5d fix(@angular/cli): enable analytics for safe builders
Fixes #14355
2019-05-13 15:55:15 -07:00
Charles Lyding
7a72f2fb17 refactor(@angular/cli): avoid aggressive eager command loading
Currently, upon execution `ng` will load all description files AND code for all available commands.  This requires a large amount of unnecessary file access and processing since only at most one command will be executed.  This change limits the loading to only command being executed in the common case and a subset of commands in the event an alias is used.  The help command now loads all commands during its execution which is needed to gather command description information.  Further improvements are possible by only loading the necessary metadata instead of the execution code (and its dependencies) as well.
This change allows for savings of ~250ms per execution.

Examples:
Before -- `./node_modules/.bin/ng version  0.99s user 0.17s system 113% cpu 1.020 total`
After -- `./node_modules/.bin/ng version  0.70s user 0.13s system 110% cpu 0.749 total`

Before -- `./node_modules/.bin/ng g c a  1.91s user 0.30s system 111% cpu 1.996 total`
After -- `./node_modules/.bin/ng g c a  1.62s user 0.27s system 110% cpu 1.715 total`
2019-05-10 15:04:32 -07:00
Charles Lyding
8254cfe87f fix(@angular/cli): honor builder schema additional properties option
Fixes #14354
2019-05-09 10:07:42 -07:00
Charles Lyding
a818badbb2 fix(@angular/cli): remove Angular specific version check from base architect command
Fixes #14266
2019-04-25 10:23:25 -07:00
Charles Lyding
475ba6610c fix(@angular/cli): only show postinstall prompt when global analytics not configured 2019-04-24 07:16:58 -10:00
Filipe Silva
5ec27db6bc feat(@angular/cli): verify Angular version is supported 2019-04-15 11:31:34 -07:00
Filipe Silva
b6b00ebc98 build: update typescript to version 3.4.3 2019-04-13 10:23:02 -07:00
Charles Lyding
e0043b4078 refactor(@angular/cli): cleanup architect imports 2019-04-04 19:49:56 -07:00
Stephen Fluin
be0c3d5af6 fix(@angular/cli): improve opt-out language 2019-04-03 21:58:58 +02:00
Hans Larsen
600b0218fd feat(@angular/cli): add tracking for command duration 2019-03-28 13:28:41 -07:00
Hans Larsen
2ffbdfa86a build: add a validation script for the analytics.md tables
Also added enums to update when changing dimensions.
2019-03-28 13:28:41 -07:00
Hans Larsen
55471770db refactor: use dimensions for some values instead of metrics
This is after a discussion with someone internal. Metrics are good
for sums but not for comparisons and search/filtering.
2019-03-28 13:28:41 -07:00
Hans Larsen
e9ee58a89e refactor(@angular/cli): move analytics constants to devkit core
They need to be shared with builders and schematics.
2019-03-28 13:28:41 -07:00
Charles Lyding
e41e10d313 feat(@angular/cli): support stable architect API 2019-03-27 16:33:39 -07:00
Hans Larsen
6e5095b134 feat(@angular/cli): allows analytics sharing with a third party
Documentation can be seen at https://next.angular.io/cli/usage-analytics-gathering
2019-03-26 10:07:30 -07:00
Hans Larsen
c840fcb529 fix(@angular/cli): dont force a prompt on non-interactive terminals
For some reason we were forcing the prompt on postinstall, breaking CI.
2019-03-25 12:37:05 -07:00
Hans Larsen
696272bd40 fix(@angular/cli): if no global config file found, analytics can be null
This happens if there is no file at all (otherwise it would be undefined). This was
causing an exception and returning false instead of undefined, preventing the
prompt. Now we return undefined in this case.

To be clear, this is because getWorkspace returns null, and the logic makes
analyticsConfig null in this case.
2019-03-25 12:37:05 -07:00
Alan
75abc79e37 fix(@angular/cli): fix import path for TimingOptions
Fixes #13978
2019-03-25 11:21:05 -07:00
Hans Larsen
0a1d4298ec build: remove DO_NOT_SUBMIT tags from messaging
This is conditional to https://github.com/angular/angular/pull/29382 being
submitted.
2019-03-20 15:08:07 -07:00
Hans Larsen
2e58fb33ca feat(@angular/cli): add custom implementation for analytics for commands
Some commands (like schematics) need to have custom reporting for
analytics. Schematics and Architect commands need to verify if the
schematic/architect builder run is in the safelist, for example.
2019-03-20 15:08:07 -07:00
Hans Larsen
1cbd915c26 feat(@angular/cli): add support for analytics command proper
To add/remove/prompt about the analytics configuration.
2019-03-20 15:08:07 -07:00
Hans Larsen
cf5cf19bb5 feat(@angular/cli): add analytic support to commands and command-runner
This is only reporting commands and their flags right now, and not
schematics or project analytics.
2019-03-20 15:08:07 -07:00
Alan Agius
71c6cc506e refactor: add allowAdditionalArgs to be able to bypass extra params validations (#13556) 2019-02-05 21:13:45 -08:00
Alan Agius
f8e873b645 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
2019-01-30 11:41:42 -08:00
cexbrayat
3684df8aca fix(@angular/cli): remove redundant period in deprecation warning
As `parser.ts` currently always adds a period at the end of the warning message and the `x-deprecated` messages also have one, this removes the always added one to avoid a double period in the warning message.

Fixes:

    Option "styleext" is deprecated: Use "style" instead..

to:

    Option "styleext" is deprecated: Use "style" instead.
2018-12-14 10:43:40 -08:00