Third party libraries can attempt to write color codes to the output even though the CLI has already determined that color should not be used. The previously implemented color removal code is no longer functional since the update of ansi-colors to 4.1.0. While this appears to be a defect in the aforementioned package, the new CLI removal method not only bypasses the defect but also unneeded execution logic that the CLI does not need in this case.
Fixes: #17053
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)
```
Pass the "grep" and "invertGrep" flags through to the Angular Protractor
builder as "jasmineNodeOpts" so that individual specs within an E2E test
file can be targeted.
Fixes#13020
In #16846, the URL for docs search was updated to point to the
corresponding vX.angular.io website (with an appropriate query for the
search). However, on the archive versions of the website (i.e. versions
older than the current stable), non-docs pages (including the home page)
are redirected to `/docs` (losing the query params).
This commit fixes the URL to include `/docs`, so that it is not
redirected (and preserve the query params that will trigger the search).
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.
Set the `BROWSERSLIST_IGNORE_OLD_DATA` enviorment variable to disable Browserslist old data warning
`Browserslist: caniuse-lite is outdated. Please run next command `npm update`
See: 819c433745/node.js (L324)
This allows the CLI version check during update bootstrapping to be disabled via the `NG_DISABLE_VERSION_CHECK` environment variable. This is not considered an officially supported option and is intended mainly for testing/troubleshooting scenarios.
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
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