225 Commits

Author SHA1 Message Date
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Charles Lyding
203f9626df refactor(@angular/cli): correct various uncaught code style issues
This change cleans up some of the code by removing unused variables/imports, unnecessary double negation, and some long line lengths.
2021-04-28 09:58:15 +02:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Alan Agius
5558047eef fix(@angular/cli): add package manager name and version in ng version output 2021-04-22 14:23:13 +02:00
Keen Yee Liau
49ba5e20aa refactor(@schematics/angular): Do not include Protractor test in new project
Do not include Protractor for new projects since we do not have a concrete
plan for Protractor yet.
2021-04-21 12:38:46 -07:00
David Shevitz
bb3f36f30a docs: remove reference to protractor. 2021-04-21 12:35:50 -07:00
Alan Agius
131379f49f fix(@angular/cli): run all migrations when updating from or between prereleases
With this change we consider the update schematics are idempotent. When updating from or between prereleases we will execute all migrations for the version.
2021-04-19 20:28:53 +02:00
Alan Agius
d68cb92dc2 fix(@angular/cli): add message update updating from non LTS versions of the CLI 2021-04-14 17:20:33 -04:00
Alan Agius
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Alan Agius
14c8a09014 refactor(@angular/cli): remove Ivy Workspace from ng version
In version 12, only Ivy will be allowed to be used to compile an application.
2021-03-30 14:36:48 -06: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
Alan Agius
cc10302fd7 refactor(@angular/cli): add more actionable missing lint target message 2021-03-16 15:49:46 +01:00
Alan Agius
4b0223b64e build: automate @angular/cli schema.json generation
With this change we automate the generation of `@angular/cli/lib/config/schema.json`. While on paper we could use quicktype for this. Quicktype doesn't handle `patternProperties` and `oneOf` that well.

How does this works?
Relative `$ref` will be resolved and inlined as part of the root schema definitions.

Example
```json
"@schematics/angular:enum": {
    "$ref": "../../../../schematics/angular/enum/schema.json"
},
```

Will be parsed and transformed to
```json
"@schematics/angular:enum": {
  "$ref": "#/definitions/SchematicsAngularEnumSchema"
},
"definitions: {
  "SchematicsAngularEnumSchema": {
    "title": "Angular Enum Options Schema",
    "type": "object",
    "description": "Generates a new, generic enum definition for the given or default project.",
    "properties": {...}
   }
}
```
2021-03-11 21:51:37 +01:00
Charles Lyding
985dc1a4c7 feat(@angular/cli): confirm ng add action before installation
BREAKING CHANGE:
The `ng add` command will now ask the user to confirm the package and version prior to installing and executing an uninstalled package.
This new behavior allows a user to abort the action if the version selected is not appropriate or if a typo occurred on the command line and an incorrect package would be installed.
A `--skip-confirmation` option has been added to skip the prompt and directly install and execute the package. This option is useful in CI and non-TTY scenarios such as automated scripts.
2021-03-11 08:54:07 +01: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
Charles Lyding
3d99468b45 fix(@angular/cli): support update migration packages with no entry points
Some schematic only packages may not have entry points defined (`main`/`exports`).  These type of packages will now be correctly resolved when attempting to locate update migrations.

Fixes #20032
2021-02-17 12:43:13 -06:00
Charles Lyding
9a44bf4aaf fix(@angular/cli): improve error logging when resolving update migrations
Failure to resolve a migration package from the workspace root will now not crash and instead error with a message.  Verbose logging (`--verbose`) is also added to provide more details regarding the resolution process.
2021-02-11 14:25:55 -05: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
Bruno Baia
d64dc76d7e docs: update ESLint migration link 2021-02-08 09:34:25 -05:00
Alan Agius
cae2209ca8 fix(@angular/cli): only show incompatible NPM error when NPM is used as package manager 2021-02-05 12:40:47 -05:00
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