All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
Before only first line end was being replaced.
Also, the replace value was incorrectly escaped.
The CA read from cafile being corrupt resulted in broken updates
when using registry with self-signed certificate.
The workaround till this is merged is to use `ca` or `ca[]` properties in `.npmrc`.
With this change Pacote is updated to version 11.1.13.
This also requires normalization of options because Pacote now passes the options to `npm-registry-fetch` which requires some options to be camelCased.
Partially addresses #19624
With this change the CLI offers a way for a package authors to specify if during `ng add` the package should be saved as a `dependencies`, `devDependencies` or not saved at all.
Such config needs to be specified in `package.json`
Example:
```json
"ng-add": {
"save": false
}
```
Possible values are;
- false - Don't add the package to `package.json`
- true - Add the package to the `dependencies`
- `dependencies` - Add the package to the `dependencies`
- `devDependencies` - Add the package to the `devDependencies`
Closes#12003 , closes#15764 and closes#13237
According to [the npm config
docs](https://docs.npmjs.com/misc/config#npmrc-files), a user can
specify the path to their `npmrc` files using the environment
variables `NPM_CONFIG_USERCONFIG` and `NPM_CONFIG_GLOBALCONFIG`. When
set, these variables should override the default paths.
This adds extensive option checking and error handling with the goal to catch user errors as early in the process as possible. Bad option combinations and/or values will result in actionable information and stop the process before network access and processing occurs.
If no version specifier is supplied `ng add` will now try to find the most recent version of the package that has peer dependencies that match the package versions supplied in the project's package.json