204 Commits

Author SHA1 Message Date
Charles Lyding
331f628139 fix(@angular/cli): temporarily limit npm to version 6
This change will display an error message if using npm 7 (or versions earlier than 6). This is a temporarily change while npm 7 usability concerns are addressed.
2021-02-04 14:59:40 -08:00
Charles Lyding
30758d1cc4 fix(@angular/cli): resolve migration collections from containing package
This change ensures that migration collections defined in a package's `ng-update` metadata are resolved from the containing package.  This avoids issues that may arise from package manager hoisting behavior which can result in the wrong migration collection being chosen.  The `--migrate-only` option already contained this resolution logic and now the full update contains it as well.
2021-02-03 12:21:52 -05:00
Alan Agius
b8336b2c94 refactor(@angular/cli): use ES6 imports instead of require
Main benefit is to use type definitions.
2021-02-02 07:46:32 +01:00
Dominic Elm
33ee97625e fix(@angular/cli): remove unnecessary promise around "open" 2021-02-01 10:29:54 +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
bd040bd4d6 feat(@angular/cli): provide additional status messaging for ng add
This adds a spinner as well as shows more information regarding what package version was selected to be installed.

Closes #17983
2021-01-28 07:36:15 +01:00
Alan Agius
efcec6249d docs: clarify that the options of ng lint in AIO are of the deprecated builder
Fix: #19638
2020-12-19 21:01:01 +01:00
Alan Agius
e49991b858 docs: add missing full stop at the end of the configuration description 2020-12-09 14:36:07 -05:00
Alan Agius
c99cef7ed6 docs: remove when true, when false from argument descriptions
It's confusing and redundant to use `When true` and `when false` in descriptions for a CLI arguments because specifying false/true is redundant in a command line argument flag and in most cases users will not do it.

Example:
`--foo=true` is the same as `--foo`
`--foo=false` is the same as `--no-foo`
2020-12-08 14:39:23 -05:00
Alan Agius
9c57e45d4e docs: improve description for optimization, configuration and target options.
Closes #16572
Closes #17978
Closes https://github.com/angular/angular/issues/39780
2020-11-25 09:09:00 +00: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
Lukas Spirig
01c99e9cd8 fix(@angular/cli): correctly read transitive dependency
For `ng update --migrateOnly ...` the update implementation checks for transitive
dependencies and tries to parse the containing directory as JSON. This PR
fixes this by providing the correct path to the package.json.
2020-11-03 17:43:14 -06:00
Alan Agius
94ada4f6b8 docs(@angular/cli): use application instead of app 2020-11-02 13:36:13 -06:00
Alan Agius
a75478a45b docs(@angular-devkit/build-angular): remove ="true" from prod flag in ng build documentation 2020-10-26 14:24:41 -04: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
5f930c984b docs: remove =true from --next
`=true` us redundant
2020-10-21 15:05:32 +02:00
Charles Lyding
37686b684e fix(@angular/cli): skip searching deprecated packages with ng add
When attempting to add a package via the add command, packages that have been marked as deprecated will no longer be installed when the deprecated package's peer dependencies match the project's dependencies.
2020-10-20 18:48:00 +02:00
Alan Agius
ea1325e03e docs(@angular/cli): fix formatting in docs command 2020-10-20 08:51:02 +02:00
Alan Agius
212374a5f1 refactor(@angular/cli): remove install-package under utils
Remove the lone `install-package.ts` file from tasks to utilities
2020-10-19 19:28:13 +02: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
Drummond Dawson
7254d18ccb fix(@angular/cli): add blank line in migration commit message
Adds a blank line in the commit message between the subject and body in order to properly separate the two.
2020-10-04 16:50:00 -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
824add1778 fix(@angular/cli): no-op ng update --all
'--all' functionality has been removed from `ng update` as updating multiple packages at once is not recommended. To update the depencencies in your workspace 'package.json' use the update command of your package manager.

Closes #15278
Closes #13095
Closes #12261
Closes #12243
Closes #18813
2020-09-29 16:48:51 +02:00
Alan Agius
64cc005f0b refactor: change UPDATE action color to cyan 2020-09-14 16:36:30 -04:00
Alan Agius
a21eb1588e fix(@angular/cli): improve logs in ng update
These addresses;
- When a large number of migration are executed, it's hard to differentiate between the title and description.
- Fix alignments of logs
2020-09-14 16:36:30 -04:00
Charles Lyding
b6ea1ab15e fix(@angular/cli): remove version command node module assumptions
This change removes all direct usage of the `node_modules` directory from the version command.  This provides improved support for yarn PnP as well as prevents a crash when a workspace does not have a `node_modules` directory.

Fixes #10474
2020-09-14 07:23:55 -04:00
Keen Yee Liau
297fc923ab build: remove experimental build event protocol 2020-09-11 13:24:38 -04:00
Andrei Alecu
d01d647431 refactor(@angular/cli): improve update package discovery 2020-09-03 18:21:06 +02:00
Charles Lyding
5275892f63 refactor(@angular/cli): remove any type usage 2020-08-24 07:50:01 -04:00
Charles Lyding
97637abab4 refactor(@angular/cli): replace experimental workspace API with stable API
This change removes one of the last usages of the experimental workspace API.
2020-08-17 18:05:27 +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
fc5d2b3ff2 test: remove tsconfig.base.json from test cases 2020-08-12 19:26:12 +01:00
Keen Yee Liau
fa9136a971 build: minor fixes for google3 sync
This commit makes a few minor changes to enable syncing the CLI repository
into google3.

1. mark pkg_tar and pkg_npm as external
2. remove dependencies (marked as comment) which are stale in google3
3. remove TS files generated from JSON schema in BUILD files since these
   files are compiled and added to the g3 codebase at sync time
4. Some minor typing changes
5. Remove duplicate licenses
6. mark dependencies which are not available in g3 as external
7. Immediately type the result of JSON.parse() as required by g3 linter.
   Otherwise, the type defaults to `any`.
2020-07-24 22:52:22 +02:00
Alan Agius
05588fcee1 refactor: clean up unused code and imports 2020-07-24 08:01:52 +02:00
Vlad Tansky
9fb21644c7 docs: fix typo in ng update --next description
according to https://github.com/angular/angular-cli/pull/18306#issuecomment-660988904
2020-07-21 10:25:53 +01:00
Vlad Tansky
c8e5f7d167 docs: fix typo in ng update --next description 2020-07-21 10:25:53 +01:00
Alan Agius
ef465487fd fix(@angular/cli): resolve external schematics from workspace root
Resolve schematics collections from the workspace root, as otherwise it will be resolved from the temporary installed CLI version

Closes #18083
2020-07-01 11:29:25 -07:00
Alan Agius
93e253bc93 refactor: rename tsconfig.json to tsconfig.base.json 2020-05-20 12:12:33 -07: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
Alan Agius
57bc38e9fa fix(@angular/cli): allow configuration option in ng deploy
Fixes #17613
2020-05-04 10:54:19 -07:00
Alan Agius
493aa74019 docs: update analytics command aio link 2020-04-23 10:33:05 -07:00
Alan Agius
4d2d6cdc22 fix(@angular/cli): allow configuration option in ng deploy
Previously we only allowed `--project` and `--help` as a valid options. With this change we also allow `--configuration`

Fixes #17332
2020-03-30 16:13:05 -07:00
Alan Agius
4f50aa0e40 fix(@angular/cli): display post migration message when updating from previous major version
Fixes #17256
2020-03-23 14:18:06 -07:00
Tarik Alani
b518cb8d69 docs: update latest angular version referenced in docs
Update upgrade guide to reference version 9 as the latest angular version
2020-03-19 09:47:25 -07:00
Alan Agius
66b218c5f6 fix(@angular/cli): print ng update errors stack to log file
When an error occurs during ng update we currently discard the stack trace which in some cases made it hard to identify the cause of the error.

Now, we print the stack trace to a log file similarly to unhandled exceptions.

Example of CMD output;
```cmd
** Executing migrations of package '@angular/core' **

> Static flag migration.
  Removes the `static` flag from dynamic queries.
  As of Angular 9, the "static" flag defaults to false and is no longer required for your view and content queries.
  Read more about this here: https://v9.angular.io/guide/migration-dynamic-flag
× Migration failed: x
  See "C:\Users\alag\AppData\Local\Temp\ng-NgmC1G\angular-errors.log" for further details.
```

Example of log file contents:
```txt
[error] Error: x
    at UpdateCommand.executeSchematic (C:\git\angular-cli\test\node_modules\@angular\cli\commands\update-impl.js:98:19)
    at UpdateCommand.executePackageMigrations (C:\git\angular-cli\test\node_modules\@angular\cli\commands\update-impl.js:167:39)
    at UpdateCommand.executeMigrations (C:\git\angular-cli\test\node_modules\@angular\cli\commands\update-impl.js:161:21)
    at UpdateCommand.run (C:\git\angular-cli\test\node_modules\@angular\cli\commands\update-impl.js:394:38)
    at async UpdateCommand.validateAndRun (C:\git\angular-cli\test\node_modules\@angular\cli\models\command.js:134:28)
    at async Object.runCommand (C:\git\angular-cli\test\node_modules\@angular\cli\models\command-runner.js:201:24)
    at async default_1 (C:\git\angular-cli\test\node_modules\@angular\cli\lib\cli\index.js:62:31)
```
2020-02-18 12:43:35 -08: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
John Papa
5f3ff00dd8 fix(@angular/cli): added clarity on angular cli version issues
fixes #16888
2020-02-10 16:01:49 -08:00