@angular/cli 12.0.4 → 12.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "12.0.4",
3
+ "version": "12.0.5",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/angular/angular-cli",
30
30
  "dependencies": {
31
- "@angular-devkit/architect": "0.1200.4",
32
- "@angular-devkit/core": "12.0.4",
33
- "@angular-devkit/schematics": "12.0.4",
34
- "@schematics/angular": "12.0.4",
31
+ "@angular-devkit/architect": "0.1200.5",
32
+ "@angular-devkit/core": "12.0.5",
33
+ "@angular-devkit/schematics": "12.0.5",
34
+ "@schematics/angular": "12.0.5",
35
35
  "@yarnpkg/lockfile": "1.1.0",
36
36
  "ansi-colors": "4.1.1",
37
37
  "debug": "4.3.1",
@@ -52,12 +52,12 @@
52
52
  "ng-update": {
53
53
  "migrations": "@schematics/angular/migrations/migration-collection.json",
54
54
  "packageGroup": {
55
- "@angular/cli": "12.0.4",
56
- "@angular-devkit/architect": "0.1200.4",
57
- "@angular-devkit/build-angular": "12.0.4",
58
- "@angular-devkit/build-webpack": "0.1200.4",
59
- "@angular-devkit/core": "12.0.4",
60
- "@angular-devkit/schematics": "12.0.4"
55
+ "@angular/cli": "12.0.5",
56
+ "@angular-devkit/architect": "0.1200.5",
57
+ "@angular-devkit/build-angular": "12.0.5",
58
+ "@angular-devkit/build-webpack": "0.1200.5",
59
+ "@angular-devkit/core": "12.0.5",
60
+ "@angular-devkit/schematics": "12.0.5"
61
61
  }
62
62
  },
63
63
  "engines": {
@@ -17,6 +17,7 @@ const pacote = require('pacote');
17
17
  const npmPackageJsonCache = new Map();
18
18
  let npmrc;
19
19
  function readOptions(logger, yarn = false, showPotentials = false) {
20
+ var _a;
20
21
  const cwd = process.cwd();
21
22
  const baseFilename = yarn ? 'yarnrc' : 'npmrc';
22
23
  const dotFilename = '.' + baseFilename;
@@ -31,8 +32,8 @@ function readOptions(logger, yarn = false, showPotentials = false) {
31
32
  }
32
33
  }
33
34
  const defaultConfigLocations = [
34
- path.join(globalPrefix, 'etc', baseFilename),
35
- path.join(os_1.homedir(), dotFilename),
35
+ (!yarn && process.env.NPM_CONFIG_GLOBALCONFIG) || path.join(globalPrefix, 'etc', baseFilename),
36
+ (!yarn && process.env.NPM_CONFIG_USERCONFIG) || path.join(os_1.homedir(), dotFilename),
36
37
  ];
37
38
  const projectConfigLocations = [path.join(cwd, dotFilename)];
38
39
  const root = path.parse(cwd).root;
@@ -53,27 +54,45 @@ function readOptions(logger, yarn = false, showPotentials = false) {
53
54
  // See: https://github.com/npm/npm-registry-fetch/blob/ebddbe78a5f67118c1f7af2e02c8a22bcaf9e850/index.js#L99-L126
54
55
  const rcConfig = yarn ? lockfile.parse(data) : ini.parse(data);
55
56
  for (const [key, value] of Object.entries(rcConfig)) {
57
+ let substitutedValue = value;
58
+ // Substitute any environment variable references.
59
+ if (typeof value === 'string') {
60
+ substitutedValue = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
61
+ }
56
62
  switch (key) {
63
+ // Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them,
64
+ // even though they are documented.
65
+ // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/README.md
66
+ // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/auth.js#L45-L91
67
+ case '_authToken':
68
+ case 'token':
69
+ case 'username':
70
+ case 'password':
71
+ case '_auth':
72
+ case 'auth':
73
+ (_a = options['forceAuth']) !== null && _a !== void 0 ? _a : (options['forceAuth'] = {});
74
+ options['forceAuth'][key] = substitutedValue;
75
+ break;
57
76
  case 'noproxy':
58
77
  case 'no-proxy':
59
- options['noProxy'] = value;
78
+ options['noProxy'] = substitutedValue;
60
79
  break;
61
80
  case 'maxsockets':
62
- options['maxSockets'] = value;
81
+ options['maxSockets'] = substitutedValue;
63
82
  break;
64
83
  case 'https-proxy':
65
84
  case 'proxy':
66
- options['proxy'] = value;
85
+ options['proxy'] = substitutedValue;
67
86
  break;
68
87
  case 'strict-ssl':
69
- options['strictSSL'] = value;
88
+ options['strictSSL'] = substitutedValue;
70
89
  break;
71
90
  case 'local-address':
72
- options['localAddress'] = value;
91
+ options['localAddress'] = substitutedValue;
73
92
  break;
74
93
  case 'cafile':
75
- if (typeof value === 'string') {
76
- const cafile = path.resolve(path.dirname(location), value);
94
+ if (typeof substitutedValue === 'string') {
95
+ const cafile = path.resolve(path.dirname(location), substitutedValue);
77
96
  try {
78
97
  options['ca'] = fs_1.readFileSync(cafile, 'utf8').replace(/\r?\n/g, '\n');
79
98
  }
@@ -81,21 +100,11 @@ function readOptions(logger, yarn = false, showPotentials = false) {
81
100
  }
82
101
  break;
83
102
  default:
84
- options[key] = value;
103
+ options[key] = substitutedValue;
85
104
  break;
86
105
  }
87
106
  }
88
107
  }
89
- else if (showPotentials) {
90
- logger.info(`Trying '${location}'...not found.`);
91
- }
92
- }
93
- // Substitute any environment variable references
94
- for (const key in options) {
95
- const value = options[key];
96
- if (typeof value === 'string') {
97
- options[key] = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
98
- }
99
108
  }
100
109
  return options;
101
110
  }
@@ -30,6 +30,7 @@ function ensureNpmrc(logger, usingYarn, verbose) {
30
30
  }
31
31
  }
32
32
  function readOptions(logger, yarn = false, showPotentials = false) {
33
+ var _a;
33
34
  const cwd = process.cwd();
34
35
  const baseFilename = yarn ? 'yarnrc' : 'npmrc';
35
36
  const dotFilename = '.' + baseFilename;
@@ -66,27 +67,45 @@ function readOptions(logger, yarn = false, showPotentials = false) {
66
67
  // See: https://github.com/npm/npm-registry-fetch/blob/ebddbe78a5f67118c1f7af2e02c8a22bcaf9e850/index.js#L99-L126
67
68
  const rcConfig = yarn ? lockfile.parse(data) : ini.parse(data);
68
69
  for (const [key, value] of Object.entries(rcConfig)) {
70
+ let substitutedValue = value;
71
+ // Substitute any environment variable references.
72
+ if (typeof value === 'string') {
73
+ substitutedValue = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
74
+ }
69
75
  switch (key) {
76
+ // Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them,
77
+ // even though they are documented.
78
+ // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/README.md
79
+ // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/auth.js#L45-L91
80
+ case '_authToken':
81
+ case 'token':
82
+ case 'username':
83
+ case 'password':
84
+ case '_auth':
85
+ case 'auth':
86
+ (_a = options['forceAuth']) !== null && _a !== void 0 ? _a : (options['forceAuth'] = {});
87
+ options['forceAuth'][key] = substitutedValue;
88
+ break;
70
89
  case 'noproxy':
71
90
  case 'no-proxy':
72
- options['noProxy'] = value;
91
+ options['noProxy'] = substitutedValue;
73
92
  break;
74
93
  case 'maxsockets':
75
- options['maxSockets'] = value;
94
+ options['maxSockets'] = substitutedValue;
76
95
  break;
77
96
  case 'https-proxy':
78
97
  case 'proxy':
79
- options['proxy'] = value;
98
+ options['proxy'] = substitutedValue;
80
99
  break;
81
100
  case 'strict-ssl':
82
- options['strictSSL'] = value;
101
+ options['strictSSL'] = substitutedValue;
83
102
  break;
84
103
  case 'local-address':
85
- options['localAddress'] = value;
104
+ options['localAddress'] = substitutedValue;
86
105
  break;
87
106
  case 'cafile':
88
- if (typeof value === 'string') {
89
- const cafile = path.resolve(path.dirname(location), value);
107
+ if (typeof substitutedValue === 'string') {
108
+ const cafile = path.resolve(path.dirname(location), substitutedValue);
90
109
  try {
91
110
  options['ca'] = fs_1.readFileSync(cafile, 'utf8').replace(/\r?\n/g, '\n');
92
111
  }
@@ -94,21 +113,11 @@ function readOptions(logger, yarn = false, showPotentials = false) {
94
113
  }
95
114
  break;
96
115
  default:
97
- options[key] = value;
116
+ options[key] = substitutedValue;
98
117
  break;
99
118
  }
100
119
  }
101
120
  }
102
- else if (showPotentials) {
103
- logger.info(`Trying '${location}'...not found.`);
104
- }
105
- }
106
- // Substitute any environment variable references
107
- for (const key in options) {
108
- const value = options[key];
109
- if (typeof value === 'string') {
110
- options[key] = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
111
- }
112
121
  }
113
122
  return options;
114
123
  }