@angular/cli 12.1.2 → 12.1.3

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.1.2",
3
+ "version": "12.1.3",
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.1201.2",
32
- "@angular-devkit/core": "12.1.2",
33
- "@angular-devkit/schematics": "12.1.2",
34
- "@schematics/angular": "12.1.2",
31
+ "@angular-devkit/architect": "0.1201.3",
32
+ "@angular-devkit/core": "12.1.3",
33
+ "@angular-devkit/schematics": "12.1.3",
34
+ "@schematics/angular": "12.1.3",
35
35
  "@yarnpkg/lockfile": "1.1.0",
36
36
  "ansi-colors": "4.1.1",
37
37
  "debug": "4.3.1",
@@ -51,12 +51,12 @@
51
51
  "ng-update": {
52
52
  "migrations": "@schematics/angular/migrations/migration-collection.json",
53
53
  "packageGroup": {
54
- "@angular/cli": "12.1.2",
55
- "@angular-devkit/architect": "0.1201.2",
56
- "@angular-devkit/build-angular": "12.1.2",
57
- "@angular-devkit/build-webpack": "0.1201.2",
58
- "@angular-devkit/core": "12.1.2",
59
- "@angular-devkit/schematics": "12.1.2"
54
+ "@angular/cli": "12.1.3",
55
+ "@angular-devkit/architect": "0.1201.3",
56
+ "@angular-devkit/build-angular": "12.1.3",
57
+ "@angular-devkit/build-webpack": "0.1201.3",
58
+ "@angular-devkit/core": "12.1.3",
59
+ "@angular-devkit/schematics": "12.1.3"
60
60
  }
61
61
  },
62
62
  "engines": {
@@ -50,7 +50,6 @@ function ensureNpmrc(logger, usingYarn, verbose) {
50
50
  }
51
51
  }
52
52
  function readOptions(logger, yarn = false, showPotentials = false) {
53
- var _a;
54
53
  const cwd = process.cwd();
55
54
  const baseFilename = yarn ? 'yarnrc' : 'npmrc';
56
55
  const dotFilename = '.' + baseFilename;
@@ -78,7 +77,7 @@ function readOptions(logger, yarn = false, showPotentials = false) {
78
77
  if (showPotentials) {
79
78
  logger.info(`Locating potential ${baseFilename} files:`);
80
79
  }
81
- const options = {};
80
+ let rcOptions = {};
82
81
  for (const location of [...defaultConfigLocations, ...projectConfigLocations]) {
83
82
  if (fs_1.existsSync(location)) {
84
83
  if (showPotentials) {
@@ -88,57 +87,84 @@ function readOptions(logger, yarn = false, showPotentials = false) {
88
87
  // Normalize RC options that are needed by 'npm-registry-fetch'.
89
88
  // See: https://github.com/npm/npm-registry-fetch/blob/ebddbe78a5f67118c1f7af2e02c8a22bcaf9e850/index.js#L99-L126
90
89
  const rcConfig = yarn ? lockfile.parse(data) : ini.parse(data);
91
- for (const [key, value] of Object.entries(rcConfig)) {
92
- let substitutedValue = value;
93
- // Substitute any environment variable references.
94
- if (typeof value === 'string') {
95
- substitutedValue = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
96
- }
97
- switch (key) {
98
- // Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them,
99
- // even though they are documented.
100
- // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/README.md
101
- // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/auth.js#L45-L91
102
- case '_authToken':
103
- case 'token':
104
- case 'username':
105
- case 'password':
106
- case '_auth':
107
- case 'auth':
108
- (_a = options['forceAuth']) !== null && _a !== void 0 ? _a : (options['forceAuth'] = {});
109
- options['forceAuth'][key] = substitutedValue;
110
- break;
111
- case 'noproxy':
112
- case 'no-proxy':
113
- options['noProxy'] = substitutedValue;
114
- break;
115
- case 'maxsockets':
116
- options['maxSockets'] = substitutedValue;
117
- break;
118
- case 'https-proxy':
119
- case 'proxy':
120
- options['proxy'] = substitutedValue;
121
- break;
122
- case 'strict-ssl':
123
- options['strictSSL'] = substitutedValue;
124
- break;
125
- case 'local-address':
126
- options['localAddress'] = substitutedValue;
127
- break;
128
- case 'cafile':
129
- if (typeof substitutedValue === 'string') {
130
- const cafile = path.resolve(path.dirname(location), substitutedValue);
131
- try {
132
- options['ca'] = fs_1.readFileSync(cafile, 'utf8').replace(/\r?\n/g, '\n');
133
- }
134
- catch { }
135
- }
136
- break;
137
- default:
138
- options[key] = substitutedValue;
139
- break;
90
+ rcOptions = normalizeOptions(rcConfig, location);
91
+ }
92
+ }
93
+ const envVariablesOptions = {};
94
+ for (const [key, value] of Object.entries(process.env)) {
95
+ if (!value) {
96
+ continue;
97
+ }
98
+ let normalizedName = key.toLowerCase();
99
+ if (normalizedName.startsWith('npm_config_')) {
100
+ normalizedName = normalizedName.substring(11);
101
+ }
102
+ else if (yarn && normalizedName.startsWith('yarn_')) {
103
+ normalizedName = normalizedName.substring(5);
104
+ }
105
+ else {
106
+ continue;
107
+ }
108
+ normalizedName = normalizedName.replace(/(?!^)_/g, '-'); // don't replace _ at the start of the key.s
109
+ envVariablesOptions[normalizedName] = value;
110
+ }
111
+ return {
112
+ ...rcOptions,
113
+ ...normalizeOptions(envVariablesOptions),
114
+ };
115
+ }
116
+ function normalizeOptions(rawOptions, location = process.cwd()) {
117
+ var _a;
118
+ const options = {};
119
+ for (const [key, value] of Object.entries(rawOptions)) {
120
+ let substitutedValue = value;
121
+ // Substitute any environment variable references.
122
+ if (typeof value === 'string') {
123
+ substitutedValue = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
124
+ }
125
+ switch (key) {
126
+ // Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them,
127
+ // even though they are documented.
128
+ // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/README.md
129
+ // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/auth.js#L45-L91
130
+ case '_authToken':
131
+ case 'token':
132
+ case 'username':
133
+ case 'password':
134
+ case '_auth':
135
+ case 'auth':
136
+ (_a = options['forceAuth']) !== null && _a !== void 0 ? _a : (options['forceAuth'] = {});
137
+ options['forceAuth'][key] = substitutedValue;
138
+ break;
139
+ case 'noproxy':
140
+ case 'no-proxy':
141
+ options['noProxy'] = substitutedValue;
142
+ break;
143
+ case 'maxsockets':
144
+ options['maxSockets'] = substitutedValue;
145
+ break;
146
+ case 'https-proxy':
147
+ case 'proxy':
148
+ options['proxy'] = substitutedValue;
149
+ break;
150
+ case 'strict-ssl':
151
+ options['strictSSL'] = substitutedValue;
152
+ break;
153
+ case 'local-address':
154
+ options['localAddress'] = substitutedValue;
155
+ break;
156
+ case 'cafile':
157
+ if (typeof substitutedValue === 'string') {
158
+ const cafile = path.resolve(path.dirname(location), substitutedValue);
159
+ try {
160
+ options['ca'] = fs_1.readFileSync(cafile, 'utf8').replace(/\r?\n/g, '\n');
161
+ }
162
+ catch { }
140
163
  }
141
- }
164
+ break;
165
+ default:
166
+ options[key] = substitutedValue;
167
+ break;
142
168
  }
143
169
  }
144
170
  return options;
@@ -210,18 +236,7 @@ function getNpmPackageJson(packageName, logger, options = {}) {
210
236
  return cachedResponse;
211
237
  }
212
238
  const { usingYarn = false, verbose = false, registry } = options;
213
- if (!npmrc) {
214
- try {
215
- npmrc = readOptions(logger, false, verbose);
216
- }
217
- catch { }
218
- if (usingYarn) {
219
- try {
220
- npmrc = { ...npmrc, ...readOptions(logger, true, verbose) };
221
- }
222
- catch { }
223
- }
224
- }
239
+ ensureNpmrc(logger, usingYarn, verbose);
225
240
  const resultPromise = pacote.packument(packageName, {
226
241
  fullMetadata: true,
227
242
  ...npmrc,