17 Commits

Author SHA1 Message Date
Alan Agius
e9717e5812 fix(@angular/cli): don't resolve .npmrc from parent directories
Unlike `yarn`, `npm` doesn't resolve `.npmrc` from parent locations instead it looks in predefied locations in
- per-project config file (/path/to/my/project/.npmrc)
- per-user config file (~/.npmrc)
- global config file ($PREFIX/etc/npmrc)
- npm builtin config file (/path/to/npm/npmrc)

https://docs.npmjs.com/cli/v7/configuring-npm/npmrc#files
2021-06-16 19:28:53 -04:00
Alan Agius
77c96f8b2a fix(@angular/cli): handle unscoped authentication details in .npmrc files
Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them, even though they are documented.
8954f61d8d/README.md
8954f61d8d/auth.js (L45-L91)
2021-06-16 19:28:53 -04:00
Alan Agius
e680aa1f48 refactor(@angular/cli): remove duplicate npmrc logic 2021-06-16 19:28:53 -04:00
Charles Lyding
c1512e4274 build: update files to be eslint compliant
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.
2021-05-03 07:31:02 -04:00
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
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
minijus
5cdf4ccd1d fix(@schematics/update): update line end normalization for CA file read from .npmrc
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`.
2021-01-26 09:25:29 -06:00
Alan Agius
36889b6a76 fix(@angular/cli): update pacote to version 11
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
2020-12-16 13:57:08 +00:00
Charles Lyding
5275892f63 refactor(@angular/cli): remove any type usage 2020-08-24 07:50:01 -04:00
Alan Agius
e8135babd4 refactor: update pacote to version 10 2019-11-06 10:51:35 -08:00
Alan Agius
d133ba68c0 feat(@angular/cli): add support for ng-add packages that should not be saved as dependencies
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
2019-10-14 13:40:31 -07:00
Charles Lyding
0abeadbc10 refactor(@angular/cli): use canonical npm logic to determine update package version 2019-09-19 14:41:04 -07:00
Charles Lyding
2565077dbe fix(@angular/cli): correctly account for linked packages in update
Fixes #15511
Fixes #15294
2019-09-11 10:10:48 -07:00
Adam Vigneaux
87b01ffd6a feat(@angular/cli): add support for custom npmrc paths
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.
2019-08-29 23:47:22 +05:30
Filipe Silva
e8dff5718f build: update to TS 3.5 2019-07-29 10:15:23 -07:00
Charles Lyding
b7fc6125e5 fix(@angular/cli): improve error handling of update command
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.
2019-05-15 14:34:03 -07:00
Charles Lyding
b956db6262 fix(@angular/cli): 'ng add' selects supported version via peer dependencies
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
2019-01-21 20:27:20 -08:00