167 Commits

Author SHA1 Message Date
Charles Lyding
e84fa72751 fix(@angular/cli): ensure update migrations are fully executed
With the move to refactor and centralize the update logic, the schematics wrapper context needs to be updated to create an exception for the new location of the update schematic.
2021-04-02 08:09:16 +02:00
Alan Agius
f6e1fd84a2 refactor(@angular-devkit/schematics-cli): move @schematics/schematics into this package
This change removes the need for the `@schematics/schematics` package and moves it inside `@angular-devkit/schematics-cli`.
2021-04-02 08:09:07 +02:00
Charles Lyding
2dd0cbd2e9 refactor(@angular/cli): inline @schematics/update:update schematic
This change removes the need for the `@schematics/update` package within the Angular tooling and removes the dependency from the `@angular/cli` package.
Only the `update` schematic from the `@schematics/update` package was used and this schematic's logic will eventually be folded into the update command logic directly.
2021-03-29 08:18:11 -06:00
Charles Lyding
06335515eb fix(@angular/cli): avoid exceptions for expected errors in architect commands
Errors caused by invalid options or workspace configuration will now be presented as fatal console messages and the CLI will exit gracefully with an exit code of 1.
2021-03-10 08:19:42 -06:00
Alan Agius
a5877bf917 feat(@angular/cli): deprecate --prod command line argument
With this change we deprecated the `--prod` command line argument. This argument is confusing especially to new users, since users expect that this builds an application in production mode. This however, is only an alias for `--configuration="production"`
2021-03-10 08:16:38 -06:00
Alan Agius
dbce2a3f28 refactor(@angular/cli): remove dependency on universal-analytics
With this change we remove the dependency on the unmaintained universal-analytics package. We also solve several package deprecation warnings when creating a new workspace.

Closes #16952
2021-03-01 13:59:26 -05:00
Aravind V Nair
a408aeeaa6 docs(@angular/cli): switching angular.io URL from HTTP to HTTPS
Signed-off-by: Aravind V Nair <22199259+aravindvnair99@users.noreply.github.com>
2021-02-15 14:46:40 -06:00
Charles Lyding
52aaa8c167 fix(@angular/cli): update NPM 7 guidance
Update NPM 7 behavior based on https://github.com/angular/angular-cli/issues/19957#issuecomment-775407654
2021-02-08 19:48:42 -05:00
profanis
9a6541f882 refactor(@angular/cli): fix super minor typo
while I was making myself familiar with the code-base
to solve an open issue, I saw this super minor typo
and decided to fix it
2021-01-28 19:39:34 +01:00
Charles Lyding
86d69e22fb fix(@angular/cli): redirect Angular schematic dependency requests to known versions
This change adds logic to redirect module resolution requests for Angular schematics to ensure that the correct versions of core schematic related packages are used.  This also ensures that the runtime version of the schematics package matches the version used inside the schematic and that object instances passed into the schematic are compatible.
The current set of core schematic related packages are `@angular-devkit/*` and `@schematics/angular`.  Only first-party Angular schematics are currently affected by this change.
2021-01-28 12:44:34 +01:00
Charles Lyding
776a6ece58 fix(@angular/cli): avoid analytics cli object check if not present
The `cli` workspace configuration property was previously checked to determine if it was an object even if the property did not yet exist.
2021-01-20 14:44:12 -05:00
Charles Lyding
1f16d113a9 fix(@angular/cli): avoid using number inquirer prompt in schematic prompts
The number prompt type currently prevents correction of an invalid user entered value after schema validation. An input type is now used instead.  Type coercion based on the schema type(s) already occurs during the filter phase for the inquirer question.
2021-01-14 15:37:41 -05:00
Alan Agius
bd158e9f6d fix(@angular/cli): show deprecation warning when using camel cased arguments 2020-12-02 16:06:36 +01:00
Alan Agius
2a2293cd2d fix(@angular/cli): dasherize names option names when using JSON help
This ensures that arguments listed in https://angular.io/cli help pages are all in kebab cases.

This is a prerequisite to deprecate camel cased arguments.
2020-12-02 16:02:27 +01:00
Charles Lyding
aad3bbf0c1 refactor(@angular/cli): use direct schematic workflow option transform option 2020-11-16 13:14:24 -05:00
Charles Lyding
acc22a399f refactor(@angular/cli): remove async from abstract functions
This is in preparation to support TypeScript 4.1.  Within TypeScript 4.1 abstract class members cannot be marked as async.
2020-11-05 08:31:35 +01:00
Alan Agius
0bc15970ad refactor(@schematics/angular): use jsonc-parser instead of devkit parser 2020-11-05 08:31:02 +01:00
Alan Agius
a038699ec3 refactor(@angular/cli): remove usage of devkit core JsonParser 2020-11-05 08:31:02 +01:00
Charles Lyding
5db4ec7df7 refactor(@angular/cli): remove outdated workspace targets warning
The stable workspace API will now normalize configuration file content.
2020-10-30 10:17:49 -05:00
Charles Lyding
fd63e29406 fix(@angular/cli): coerce prompt answers to requested property types
This change converts answers from prompts into the property type requested from the schema.  This allows properties that expect a number to correctly validate when an input prompt is used.
2020-10-21 16:37:11 +02:00
Alan Agius
47373010e2 refactor(@angular/cli): rename ng xi18n to ng extract-i18n
`ng i18n-extract` and `ng xi18n` has been deprecated in favor of `ng extract-i18n` to have a better intuitive naming and match the architect key in `angular.json`.
2020-10-21 16:33:59 +02:00
Alan Agius
a09a2e4056 fix(@angular/cli): include deprecated option in JSON help
This option is used to mark deprecated options as such in AIO.
2020-10-20 16:54:05 +02:00
Alan Agius
2960bf08b2 refactor(@angular/cli): remove redundant context transform 2020-10-13 12:47:06 -04:00
Alan Agius
5318e4c511 fix(@angular/cli): don't display prompts twice
Closes #19027
2020-10-13 12:37:59 -04:00
Alan Agius
49199cee5d fix(@angular/cli): don't show deprecation messages for defaults when using --defaults
With this change we use the addUndefinedDefaults transformer post validation and don't create prompts which have a default value when options.defaults is truthy.

Closes: #18692
2020-10-13 12:36:48 -04:00
Alan Agius
90988aaf52 fix(@angular/cli): collect analytics option usage from workspace config and prompts
With this change we fix two analytics collection bugs:
- We now collect the usage of options defined in the workspace config (angular.json).
- We now also collect values set via schematic prompts.

Closes: #17900
2020-10-07 09:54:59 -04:00
Charles Lyding
d903d39fc8 refactor(@angular/cli): use new NodeWorkflow schematic features
This change reduces the amount of schematic runtime setup code by leveraging the new options for the root path and schema validation in the NodeWorkflow class.
2020-10-02 18:56:11 -04:00
Charles Lyding
b2b536789b refactor(@angular/cli): discover/load workspace on startup
Previously, the workspace configuration file was found and loaded by individual commands potentially multiple times.  This change moves the initial workspace location discovery and loading of the workspace to the CLI startup.  It also provides the workspace to each command so that the commands can reuse the already loaded and parsed workspace configuration.
2020-10-02 07:53:07 -04:00
Alan Agius
e96fbd3c8a refactor(@angular-devkit/build-angular): change errors and warnings messages
Sometimes the WARNING IN/ERROR IN can lead of ambiguous messages

 - Use `Warning` instead of `WARNING IN`
-  Use `Error` instead of `Error In`
2020-09-30 16:17:05 +02:00
Alan Agius
88c3acb945 fix(@angular/cli): favor dirname when resolving @schematics/angular
This ensures that the correct build-in version of `@schematics/angular` is resolved.

Closes #18840
2020-09-24 00:05:58 +03:00
Alan Agius
64cc005f0b refactor: change UPDATE action color to cyan 2020-09-14 16:36:30 -04:00
Keen Yee Liau
297fc923ab build: remove experimental build event protocol 2020-09-11 13:24:38 -04:00
Charles Lyding
5275892f63 refactor(@angular/cli): remove any type usage 2020-08-24 07:50:01 -04:00
Alan Agius
951d99e979 feat(@angular/cli): show warning when using deprecated options
With this change we show a warning when a deprecated option is also defined in the workspace configuration file (angular.json).

Closes: #14966
2020-08-17 18:18:24 +02:00
Alan Agius
e40c72a8dc feat(@angular-devkit/architect-cli): show warning when using deprecated options 2020-08-17 18:18:24 +02:00
Alan Agius
c824bbb4f7 refactor(@angular/cli): update CLI package to be strict compliant 2020-08-12 19:29:13 +01:00
Alan Agius
05588fcee1 refactor: clean up unused code and imports 2020-07-24 08:01:52 +02:00
Alan Agius
5bb853f1d5 build: update @types/inquirer to 7.3.0 2020-07-23 23:30:22 +02:00
Alan Agius
a85ba990eb refactor: clean up several files
Most of these changes are requires for TS 4 update
2020-07-22 12:56:34 +01:00
Kishan Gajera
ba0f7acce2 fix(@angular/cli): throw error when specified project does not exist
Currently this falls through to a misleading error for an unsupported build target.

Closes #17682
2020-06-16 09:44:05 +02:00
Alan Agius
b66b9b8161 refactor(@angular/cli): remove deprecated get/set commands
BREAKING CHANGE:
Deprecated `ng set` and `ng get` have been removed, use `ng config` instead.
2020-05-07 10:38:12 -07:00
Alan Agius
28f87cb312 refactor(@angular/cli): remove deprecated typescriptMismatch
BREAKING CHANGE:
Removed deprecated `typescriptMismatch` warning option. Users will be migrated off this option automatically. Users wishing to disable TypeScript version checks should use the Angular compiler option `disableTypeScriptVersionCheck`, see https://angular.io/guide/angular-compiler-options#disabletypescriptversioncheck for more information.
2020-05-07 10:37:48 -07:00
Charles Lyding
f4127b5b43 fix(@angular/cli): fully use add command registry option when installing packages
Fixes: #16766
2020-02-10 16:02:05 -08:00
Charles Lyding
7cce3f0811 fix(@angular/cli): ensure built-in Angular schematics package can be found
The `@angular/cli` package contains a built-in version of the `@schematics/angular` package.  The module resolution paths for the schematics workflow should not assume package hoisting behavior when resolving.  This change corrects that oversight.
2020-01-22 09:00:04 -08:00
Alan Agius
23589ed00e fix(@angular/cli): inform user and error if schematics package is in unreachable location (#16466)
This is a workaround for the schematics runtime to support the requirement of packages containing migrations (or other schematics) to not have a direct/runtime dependency on the schematics package.

Closes: #16392
2020-01-02 11:27:04 -08:00
Alan Agius
35ca3901ac refactor: strip leading slash to prevent confusion 2019-12-02 10:10:34 -08:00
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