@nx/js 20.0.1 → 20.0.2

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": "@nx/js",
3
- "version": "20.0.1",
3
+ "version": "20.0.2",
4
4
  "private": false,
5
5
  "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "@babel/preset-env": "^7.23.2",
40
40
  "@babel/preset-typescript": "^7.22.5",
41
41
  "@babel/runtime": "^7.22.6",
42
- "@nx/devkit": "20.0.1",
43
- "@nx/workspace": "20.0.1",
42
+ "@nx/devkit": "20.0.2",
43
+ "@nx/workspace": "20.0.2",
44
44
  "@zkochan/js-yaml": "0.0.7",
45
45
  "babel-plugin-const-enum": "^1.0.1",
46
46
  "babel-plugin-macros": "^2.8.0",
@@ -20,7 +20,7 @@ async function killTree(pid, signal) {
20
20
  switch (process.platform) {
21
21
  case 'win32':
22
22
  (0, child_process_1.exec)('taskkill /pid ' + pid + ' /T /F', {
23
- windowsHide: true,
23
+ windowsHide: false,
24
24
  }, (error) => {
25
25
  // Ignore Fatal errors (128) because it might be due to the process already being killed.
26
26
  // On Linux/Mac we can check ESRCH (no such process), but on Windows we can't.
@@ -30,7 +30,7 @@ async function killTree(pid, signal) {
30
30
  case 'darwin':
31
31
  buildProcessTree(pid, tree, pidsToProcess, function (parentPid) {
32
32
  return (0, child_process_1.spawn)('pgrep', ['-P', parentPid], {
33
- windowsHide: true,
33
+ windowsHide: false,
34
34
  });
35
35
  }, function () {
36
36
  killAll(tree, signal, callback);
@@ -39,7 +39,7 @@ async function killTree(pid, signal) {
39
39
  default: // Linux
40
40
  buildProcessTree(pid, tree, pidsToProcess, function (parentPid) {
41
41
  return (0, child_process_1.spawn)('ps', ['-o', 'pid', '--no-headers', '--ppid', parentPid], {
42
- windowsHide: true,
42
+ windowsHide: false,
43
43
  });
44
44
  }, function () {
45
45
  killAll(tree, signal, callback);
@@ -96,7 +96,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
96
96
  env: processEnv(true),
97
97
  cwd: context.root,
98
98
  stdio: ['ignore', 'pipe', 'pipe'],
99
- windowsHide: true,
99
+ windowsHide: false,
100
100
  });
101
101
  const resultJson = JSON.parse(result.toString());
102
102
  const distTags = resultJson['dist-tags'] || {};
@@ -117,7 +117,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
117
117
  env: processEnv(true),
118
118
  cwd: context.root,
119
119
  stdio: 'ignore',
120
- windowsHide: true,
120
+ windowsHide: false,
121
121
  });
122
122
  console.log(`Added the dist-tag ${tag} to v${currentVersion} for registry ${registry}.\n`);
123
123
  }
@@ -204,7 +204,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
204
204
  env: processEnv(true),
205
205
  cwd: context.root,
206
206
  stdio: ['ignore', 'pipe', 'pipe'],
207
- windowsHide: true,
207
+ windowsHide: false,
208
208
  });
209
209
  /**
210
210
  * We cannot JSON.parse the output directly because if the user is using lifecycle scripts, npm/pnpm will mix its publish output with the JSON output all on stdout.
@@ -38,12 +38,12 @@ async function verdaccioExecutor(options, context) {
38
38
  }
39
39
  const cleanupFunctions = options.location === 'none' ? [] : [setupNpm(options), setupYarn(options)];
40
40
  const processExitListener = (signal) => {
41
- if (childProcess) {
42
- childProcess.kill(signal);
43
- }
44
41
  for (const fn of cleanupFunctions) {
45
42
  fn();
46
43
  }
44
+ if (childProcess) {
45
+ childProcess.kill(signal);
46
+ }
47
47
  };
48
48
  process.on('exit', processExitListener);
49
49
  process.on('SIGTERM', processExitListener);
@@ -113,7 +113,7 @@ function createVerdaccioOptions(options, workspaceRoot) {
113
113
  }
114
114
  function setupNpm(options) {
115
115
  try {
116
- (0, child_process_1.execSync)('npm --version', { env, windowsHide: true });
116
+ (0, child_process_1.execSync)('npm --version', { env, windowsHide: false });
117
117
  }
118
118
  catch (e) {
119
119
  return () => { };
@@ -124,13 +124,13 @@ function setupNpm(options) {
124
124
  scopes.forEach((scope) => {
125
125
  const registryName = scope ? `${scope}:registry` : 'registry';
126
126
  try {
127
- npmRegistryPaths.push((0, child_process_1.execSync)(`npm config get ${registryName} --location ${options.location}`, { env, windowsHide: true })
127
+ npmRegistryPaths.push((0, child_process_1.execSync)(`npm config get ${registryName} --location ${options.location}`, { env, windowsHide: false })
128
128
  ?.toString()
129
129
  ?.trim()
130
130
  ?.replace('\u001b[2K\u001b[1G', '') // strip out ansi codes
131
131
  );
132
- (0, child_process_1.execSync)(`npm config set ${registryName} http://localhost:${options.port}/ --location ${options.location}`, { env, windowsHide: true });
133
- (0, child_process_1.execSync)(`npm config set //localhost:${options.port}/:_authToken="secretVerdaccioToken" --location ${options.location}`, { env, windowsHide: true });
132
+ (0, child_process_1.execSync)(`npm config set ${registryName} http://localhost:${options.port}/ --location ${options.location}`, { env, windowsHide: false });
133
+ (0, child_process_1.execSync)(`npm config set //localhost:${options.port}/:_authToken="secretVerdaccioToken" --location ${options.location}`, { env, windowsHide: false });
134
134
  devkit_1.logger.info(`Set npm ${registryName} to http://localhost:${options.port}/`);
135
135
  }
136
136
  catch (e) {
@@ -139,7 +139,7 @@ function setupNpm(options) {
139
139
  });
140
140
  return () => {
141
141
  try {
142
- const currentNpmRegistryPath = (0, child_process_1.execSync)(`npm config get registry --location ${options.location}`, { env, windowsHide: true })
142
+ const currentNpmRegistryPath = (0, child_process_1.execSync)(`npm config get registry --location ${options.location}`, { env, windowsHide: false })
143
143
  ?.toString()
144
144
  ?.trim()
145
145
  ?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
@@ -147,18 +147,18 @@ function setupNpm(options) {
147
147
  const registryName = scope ? `${scope}:registry` : 'registry';
148
148
  if (npmRegistryPaths[index] &&
149
149
  currentNpmRegistryPath.includes('localhost')) {
150
- (0, child_process_1.execSync)(`npm config set ${registryName} ${npmRegistryPaths[index]} --location ${options.location}`, { env, windowsHide: true });
150
+ (0, child_process_1.execSync)(`npm config set ${registryName} ${npmRegistryPaths[index]} --location ${options.location}`, { env, windowsHide: false });
151
151
  devkit_1.logger.info(`Reset npm ${registryName} to ${npmRegistryPaths[index]}`);
152
152
  }
153
153
  else {
154
154
  (0, child_process_1.execSync)(`npm config delete ${registryName} --location ${options.location}`, {
155
155
  env,
156
- windowsHide: true,
156
+ windowsHide: false,
157
157
  });
158
158
  devkit_1.logger.info('Cleared custom npm registry');
159
159
  }
160
160
  });
161
- (0, child_process_1.execSync)(`npm config delete //localhost:${options.port}/:_authToken --location ${options.location}`, { env, windowsHide: true });
161
+ (0, child_process_1.execSync)(`npm config delete //localhost:${options.port}/:_authToken --location ${options.location}`, { env, windowsHide: false });
162
162
  }
163
163
  catch (e) {
164
164
  throw new Error(`Failed to reset npm registry: ${e.message}`);
@@ -173,17 +173,17 @@ function getYarnUnsafeHttpWhitelist(isYarnV1) {
173
173
  return !isYarnV1
174
174
  ? new Set(JSON.parse((0, child_process_1.execSync)(`yarn config get unsafeHttpWhitelist --json`, {
175
175
  env,
176
- windowsHide: true,
176
+ windowsHide: false,
177
177
  }).toString()))
178
178
  : null;
179
179
  }
180
180
  function setYarnUnsafeHttpWhitelist(currentWhitelist, options) {
181
181
  if (currentWhitelist.size > 0) {
182
- (0, child_process_1.execSync)(`yarn config set unsafeHttpWhitelist --json '${JSON.stringify(Array.from(currentWhitelist))}'` + (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
182
+ (0, child_process_1.execSync)(`yarn config set unsafeHttpWhitelist --json '${JSON.stringify(Array.from(currentWhitelist))}'` + (options.location === 'user' ? ' --home' : ''), { env, windowsHide: false });
183
183
  }
184
184
  else {
185
185
  (0, child_process_1.execSync)(`yarn config unset unsafeHttpWhitelist` +
186
- (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
186
+ (options.location === 'user' ? ' --home' : ''), { env, windowsHide: false });
187
187
  }
188
188
  }
189
189
  function setupYarn(options) {
@@ -192,7 +192,9 @@ function setupYarn(options) {
192
192
  const scopes = ['', ...(options.scopes || [])];
193
193
  try {
194
194
  isYarnV1 =
195
- (0, semver_1.major)((0, child_process_1.execSync)('yarn --version', { env, windowsHide: true }).toString().trim()) === 1;
195
+ (0, semver_1.major)((0, child_process_1.execSync)('yarn --version', { env, windowsHide: false })
196
+ .toString()
197
+ .trim()) === 1;
196
198
  }
197
199
  catch {
198
200
  // This would fail if yarn is not installed which is okay
@@ -204,14 +206,14 @@ function setupYarn(options) {
204
206
  const scopeName = scope ? `${scope}:` : '';
205
207
  yarnRegistryPaths.push((0, child_process_1.execSync)(`yarn config get ${scopeName}${registryConfigName}`, {
206
208
  env,
207
- windowsHide: true,
209
+ windowsHide: false,
208
210
  })
209
211
  ?.toString()
210
212
  ?.trim()
211
213
  ?.replace('\u001b[2K\u001b[1G', '') // strip out ansi codes
212
214
  );
213
215
  (0, child_process_1.execSync)(`yarn config set ${scopeName}${registryConfigName} http://localhost:${options.port}/` +
214
- (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
216
+ (options.location === 'user' ? ' --home' : ''), { env, windowsHide: false });
215
217
  devkit_1.logger.info(`Set yarn ${scopeName}registry to http://localhost:${options.port}/`);
216
218
  });
217
219
  const currentWhitelist = getYarnUnsafeHttpWhitelist(isYarnV1);
@@ -224,7 +226,7 @@ function setupYarn(options) {
224
226
  }
225
227
  return () => {
226
228
  try {
227
- const currentYarnRegistryPath = (0, child_process_1.execSync)(`yarn config get ${registryConfigName}`, { env, windowsHide: true })
229
+ const currentYarnRegistryPath = (0, child_process_1.execSync)(`yarn config get ${registryConfigName}`, { env, windowsHide: false })
228
230
  ?.toString()
229
231
  ?.trim()
230
232
  ?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
@@ -237,13 +239,13 @@ function setupYarn(options) {
237
239
  (0, child_process_1.execSync)(`yarn config set ${registryName} ${yarnRegistryPaths[index]}` +
238
240
  (options.location === 'user' ? ' --home' : ''), {
239
241
  env,
240
- windowsHide: true,
242
+ windowsHide: false,
241
243
  });
242
244
  devkit_1.logger.info(`Reset yarn ${registryName} to ${yarnRegistryPaths[index]}`);
243
245
  }
244
246
  else {
245
247
  (0, child_process_1.execSync)(`yarn config ${isYarnV1 ? 'delete' : 'unset'} ${registryName}` +
246
- (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
248
+ (options.location === 'user' ? ' --home' : ''), { env, windowsHide: false });
247
249
  devkit_1.logger.info(`Cleared custom yarn ${registryConfigName}`);
248
250
  }
249
251
  });
@@ -121,7 +121,7 @@ To fix this you will either need to add a package.json file at that location, or
121
121
  // Must be non-blocking async to allow spinner to render
122
122
  currentVersion = await new Promise((resolve, reject) => {
123
123
  (0, node_child_process_1.exec)(`npm view ${packageName} version --"${registryConfigKey}=${registry}" --tag=${tag}`, {
124
- windowsHide: true,
124
+ windowsHide: false,
125
125
  }, (error, stdout, stderr) => {
126
126
  if (error) {
127
127
  return reject(error);
@@ -89,7 +89,7 @@ function execLockFileUpdate(command, cwd, env = {}) {
89
89
  ...process.env,
90
90
  ...env,
91
91
  },
92
- windowsHide: true,
92
+ windowsHide: false,
93
93
  });
94
94
  }
95
95
  catch (e) {
@@ -10,7 +10,7 @@ async function setupVerdaccio(tree, options) {
10
10
  if (!tree.exists('.verdaccio/config.yml')) {
11
11
  (0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), '.verdaccio', {
12
12
  npmUplinkRegistry: (0, child_process_1.execSync)('npm config get registry', {
13
- windowsHide: true,
13
+ windowsHide: false,
14
14
  })
15
15
  ?.toString()
16
16
  ?.trim() ?? 'https://registry.npmjs.org',
@@ -28,7 +28,7 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
28
28
  const registry = `http://localhost:${port}`;
29
29
  process.env.npm_config_registry = registry;
30
30
  (0, child_process_1.execSync)(`npm config set //localhost:${port}/:_authToken "secretVerdaccioToken"`, {
31
- windowsHide: true,
31
+ windowsHide: false,
32
32
  });
33
33
  // yarnv1
34
34
  process.env.YARN_REGISTRY = registry;
@@ -39,7 +39,7 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
39
39
  resolve(() => {
40
40
  childProcess.kill();
41
41
  (0, child_process_1.execSync)(`npm config delete //localhost:${port}/:_authToken`, {
42
- windowsHide: true,
42
+ windowsHide: false,
43
43
  });
44
44
  });
45
45
  childProcess?.stdout?.off('data', listener);
@@ -76,7 +76,7 @@ async function getNpmConfigValue(key, cwd) {
76
76
  async function execAsync(command, cwd) {
77
77
  // Must be non-blocking async to allow spinner to render
78
78
  return new Promise((resolve, reject) => {
79
- (0, child_process_1.exec)(command, { cwd, windowsHide: true }, (error, stdout, stderr) => {
79
+ (0, child_process_1.exec)(command, { cwd, windowsHide: false }, (error, stdout, stderr) => {
80
80
  if (error) {
81
81
  return reject(error);
82
82
  }
@@ -62,7 +62,7 @@ async function compileSwc(context, normalizedOptions, postCompilationCallback) {
62
62
  const swcCmdLog = (0, node_child_process_1.execSync)(getSwcCmd(normalizedOptions), {
63
63
  encoding: 'utf8',
64
64
  cwd: normalizedOptions.swcCliOptions.swcCwd,
65
- windowsHide: true,
65
+ windowsHide: false,
66
66
  });
67
67
  devkit_1.logger.log(swcCmdLog.replace(/\n/, ''));
68
68
  const isCompileSuccess = swcCmdLog.includes('Successfully compiled');
@@ -99,7 +99,7 @@ async function* compileSwcWatch(context, normalizedOptions, postCompilationCallb
99
99
  let watcherOnExit;
100
100
  const swcWatcher = (0, node_child_process_1.exec)(getSwcCmd(normalizedOptions, true), {
101
101
  cwd: normalizedOptions.swcCliOptions.swcCwd,
102
- windowsHide: true,
102
+ windowsHide: false,
103
103
  });
104
104
  processOnExit = () => {
105
105
  swcWatcher.kill();