@angular/cli 12.1.0 → 12.1.4

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.
@@ -168,7 +168,16 @@ class VersionCommand extends command_1.Command {
168
168
  async getPackageManager() {
169
169
  try {
170
170
  const manager = await package_manager_1.getPackageManager(this.context.root);
171
- const version = child_process_1.execSync(`${manager} --version`, { encoding: 'utf8', stdio: 'pipe' }).trim();
171
+ const version = child_process_1.execSync(`${manager} --version`, {
172
+ encoding: 'utf8',
173
+ stdio: ['ignore', 'pipe', 'ignore'],
174
+ env: {
175
+ ...process.env,
176
+ // NPM updater notifier will prevents the child process from closing until it timeout after 3 minutes.
177
+ NO_UPDATE_NOTIFIER: '1',
178
+ NPM_CONFIG_UPDATE_NOTIFIER: 'false',
179
+ },
180
+ }).trim();
172
181
  return `${manager} ${version}`;
173
182
  }
174
183
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "12.1.0",
3
+ "version": "12.1.4",
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.0",
32
- "@angular-devkit/core": "12.1.0",
33
- "@angular-devkit/schematics": "12.1.0",
34
- "@schematics/angular": "12.1.0",
31
+ "@angular-devkit/architect": "0.1201.4",
32
+ "@angular-devkit/core": "12.1.4",
33
+ "@angular-devkit/schematics": "12.1.4",
34
+ "@schematics/angular": "12.1.4",
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.0",
55
- "@angular-devkit/architect": "0.1201.0",
56
- "@angular-devkit/build-angular": "12.1.0",
57
- "@angular-devkit/build-webpack": "0.1201.0",
58
- "@angular-devkit/core": "12.1.0",
59
- "@angular-devkit/schematics": "12.1.0"
54
+ "@angular/cli": "12.1.4",
55
+ "@angular-devkit/architect": "0.1201.4",
56
+ "@angular-devkit/build-angular": "12.1.4",
57
+ "@angular-devkit/build-webpack": "0.1201.4",
58
+ "@angular-devkit/core": "12.1.4",
59
+ "@angular-devkit/schematics": "12.1.4"
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,81 @@ 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, rcOptions);
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 normalizeOptions(envVariablesOptions, undefined, rcOptions);
112
+ }
113
+ function normalizeOptions(rawOptions, location = process.cwd(), existingNormalizedOptions = {}) {
114
+ var _a;
115
+ const options = { ...existingNormalizedOptions };
116
+ for (const [key, value] of Object.entries(rawOptions)) {
117
+ let substitutedValue = value;
118
+ // Substitute any environment variable references.
119
+ if (typeof value === 'string') {
120
+ substitutedValue = value.replace(/\$\{([^\}]+)\}/, (_, name) => process.env[name] || '');
121
+ }
122
+ switch (key) {
123
+ // Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them,
124
+ // even though they are documented.
125
+ // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/README.md
126
+ // https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/auth.js#L45-L91
127
+ case '_authToken':
128
+ case 'token':
129
+ case 'username':
130
+ case 'password':
131
+ case '_auth':
132
+ case 'auth':
133
+ (_a = options['forceAuth']) !== null && _a !== void 0 ? _a : (options['forceAuth'] = {});
134
+ options['forceAuth'][key] = substitutedValue;
135
+ break;
136
+ case 'noproxy':
137
+ case 'no-proxy':
138
+ options['noProxy'] = substitutedValue;
139
+ break;
140
+ case 'maxsockets':
141
+ options['maxSockets'] = substitutedValue;
142
+ break;
143
+ case 'https-proxy':
144
+ case 'proxy':
145
+ options['proxy'] = substitutedValue;
146
+ break;
147
+ case 'strict-ssl':
148
+ options['strictSSL'] = substitutedValue;
149
+ break;
150
+ case 'local-address':
151
+ options['localAddress'] = substitutedValue;
152
+ break;
153
+ case 'cafile':
154
+ if (typeof substitutedValue === 'string') {
155
+ const cafile = path.resolve(path.dirname(location), substitutedValue);
156
+ try {
157
+ options['ca'] = fs_1.readFileSync(cafile, 'utf8').replace(/\r?\n/g, '\n');
158
+ }
159
+ catch { }
140
160
  }
141
- }
161
+ break;
162
+ default:
163
+ options[key] = substitutedValue;
164
+ break;
142
165
  }
143
166
  }
144
167
  return options;
@@ -210,18 +233,7 @@ function getNpmPackageJson(packageName, logger, options = {}) {
210
233
  return cachedResponse;
211
234
  }
212
235
  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
- }
236
+ ensureNpmrc(logger, usingYarn, verbose);
225
237
  const resultPromise = pacote.packument(packageName, {
226
238
  fullMetadata: true,
227
239
  ...npmrc,