@nx/js 22.6.0-rc.2 → 22.6.1

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": "22.6.0-rc.2",
3
+ "version": "22.6.1",
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": "22.6.0-rc.2",
43
- "@nx/workspace": "22.6.0-rc.2",
42
+ "@nx/devkit": "22.6.1",
43
+ "@nx/workspace": "22.6.1",
44
44
  "@zkochan/js-yaml": "0.0.7",
45
45
  "babel-plugin-const-enum": "^1.0.1",
46
46
  "babel-plugin-macros": "^3.1.0",
@@ -60,7 +60,7 @@
60
60
  "tslib": "^2.3.0"
61
61
  },
62
62
  "devDependencies": {
63
- "nx": "22.6.0-rc.2"
63
+ "nx": "22.6.1"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "verdaccio": "^6.0.5"
@@ -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: false,
23
+ windowsHide: true,
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: false,
33
+ windowsHide: true,
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: false,
42
+ windowsHide: true,
43
43
  });
44
44
  }, function () {
45
45
  killAll(tree, signal, callback);
@@ -151,7 +151,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
151
151
  env: processEnv(true),
152
152
  cwd: context.root,
153
153
  stdio: ['ignore', 'pipe', 'pipe'],
154
- windowsHide: false,
154
+ windowsHide: true,
155
155
  });
156
156
  const resultJson = JSON.parse(result.toString());
157
157
  const distTags = resultJson['dist-tags'] || {};
@@ -173,7 +173,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
173
173
  env: processEnv(true),
174
174
  cwd: context.root,
175
175
  stdio: 'ignore',
176
- windowsHide: false,
176
+ windowsHide: true,
177
177
  });
178
178
  console.log(`Added the dist-tag ${tag} to v${currentVersion} for registry ${registry}.\n`);
179
179
  }
@@ -286,7 +286,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
286
286
  env: processEnv(true),
287
287
  cwd: context.root,
288
288
  stdio: ['ignore', 'pipe', 'pipe'],
289
- windowsHide: false,
289
+ windowsHide: true,
290
290
  });
291
291
  // If in dry-run mode, the version on disk will not represent the version that would be published, so we scrub it from the output to avoid confusion.
292
292
  const dryRunVersionPlaceholder = 'X.X.X-dry-run';
@@ -1 +1 @@
1
- {"version":3,"file":"verdaccio.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/verdaccio/verdaccio.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAOrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAUnD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe;;;GAqDzB;AAoTD,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"verdaccio.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/verdaccio/verdaccio.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAOrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAUnD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe;;;GAqDzB;AAkTD,eAAe,iBAAiB,CAAC"}
@@ -116,7 +116,7 @@ function createVerdaccioOptions(options, workspaceRoot) {
116
116
  }
117
117
  function setupNpm(options) {
118
118
  try {
119
- (0, child_process_1.execSync)('npm --version', { env, windowsHide: false });
119
+ (0, child_process_1.execSync)('npm --version', { env, windowsHide: true });
120
120
  }
121
121
  catch (e) {
122
122
  return () => { };
@@ -127,13 +127,13 @@ function setupNpm(options) {
127
127
  scopes.forEach((scope) => {
128
128
  const registryName = scope ? `${scope}:registry` : 'registry';
129
129
  try {
130
- npmRegistryPaths.push((0, child_process_1.execSync)(`npm config get ${registryName} --location ${options.location}`, { env, windowsHide: false })
130
+ npmRegistryPaths.push((0, child_process_1.execSync)(`npm config get ${registryName} --location ${options.location}`, { env, windowsHide: true })
131
131
  ?.toString()
132
132
  ?.trim()
133
133
  ?.replace('\u001b[2K\u001b[1G', '') // strip out ansi codes
134
134
  );
135
- (0, child_process_1.execSync)(`npm config set ${registryName} http://${options.listenAddress}:${options.port}/ --location ${options.location}`, { env, windowsHide: false });
136
- (0, child_process_1.execSync)(`npm config set //${options.listenAddress}:${options.port}/:_authToken="secretVerdaccioToken" --location ${options.location}`, { env, windowsHide: false });
135
+ (0, child_process_1.execSync)(`npm config set ${registryName} http://${options.listenAddress}:${options.port}/ --location ${options.location}`, { env, windowsHide: true });
136
+ (0, child_process_1.execSync)(`npm config set //${options.listenAddress}:${options.port}/:_authToken="secretVerdaccioToken" --location ${options.location}`, { env, windowsHide: true });
137
137
  devkit_1.logger.info(`Set npm ${registryName} to http://${options.listenAddress}:${options.port}/`);
138
138
  }
139
139
  catch (e) {
@@ -142,7 +142,7 @@ function setupNpm(options) {
142
142
  });
143
143
  return () => {
144
144
  try {
145
- const currentNpmRegistryPath = (0, child_process_1.execSync)(`npm config get registry --location ${options.location}`, { env, windowsHide: false })
145
+ const currentNpmRegistryPath = (0, child_process_1.execSync)(`npm config get registry --location ${options.location}`, { env, windowsHide: true })
146
146
  ?.toString()
147
147
  ?.trim()
148
148
  ?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
@@ -150,18 +150,18 @@ function setupNpm(options) {
150
150
  const registryName = scope ? `${scope}:registry` : 'registry';
151
151
  if (npmRegistryPaths[index] &&
152
152
  currentNpmRegistryPath.includes(options.listenAddress)) {
153
- (0, child_process_1.execSync)(`npm config set ${registryName} ${npmRegistryPaths[index]} --location ${options.location}`, { env, windowsHide: false });
153
+ (0, child_process_1.execSync)(`npm config set ${registryName} ${npmRegistryPaths[index]} --location ${options.location}`, { env, windowsHide: true });
154
154
  devkit_1.logger.info(`Reset npm ${registryName} to ${npmRegistryPaths[index]}`);
155
155
  }
156
156
  else {
157
157
  (0, child_process_1.execSync)(`npm config delete ${registryName} --location ${options.location}`, {
158
158
  env,
159
- windowsHide: false,
159
+ windowsHide: true,
160
160
  });
161
161
  devkit_1.logger.info('Cleared custom npm registry');
162
162
  }
163
163
  });
164
- (0, child_process_1.execSync)(`npm config delete //${options.listenAddress}:${options.port}/:_authToken --location ${options.location}`, { env, windowsHide: false });
164
+ (0, child_process_1.execSync)(`npm config delete //${options.listenAddress}:${options.port}/:_authToken --location ${options.location}`, { env, windowsHide: true });
165
165
  }
166
166
  catch (e) {
167
167
  throw new Error(`Failed to reset npm registry: ${e.message}`);
@@ -176,17 +176,17 @@ function getYarnUnsafeHttpWhitelist(isYarnV1) {
176
176
  return !isYarnV1
177
177
  ? new Set(JSON.parse((0, child_process_1.execSync)(`yarn config get unsafeHttpWhitelist --json`, {
178
178
  env,
179
- windowsHide: false,
179
+ windowsHide: true,
180
180
  }).toString()))
181
181
  : null;
182
182
  }
183
183
  function setYarnUnsafeHttpWhitelist(currentWhitelist, options) {
184
184
  if (currentWhitelist.size > 0) {
185
- (0, child_process_1.execSync)(`yarn config set unsafeHttpWhitelist --json '${JSON.stringify(Array.from(currentWhitelist))}'` + (options.location === 'user' ? ' --home' : ''), { env, windowsHide: false });
185
+ (0, child_process_1.execSync)(`yarn config set unsafeHttpWhitelist --json '${JSON.stringify(Array.from(currentWhitelist))}'` + (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
186
186
  }
187
187
  else {
188
188
  (0, child_process_1.execSync)(`yarn config unset unsafeHttpWhitelist` +
189
- (options.location === 'user' ? ' --home' : ''), { env, windowsHide: false });
189
+ (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
190
190
  }
191
191
  }
192
192
  function setupYarn(options) {
@@ -195,9 +195,7 @@ function setupYarn(options) {
195
195
  const scopes = ['', ...(options.scopes || [])];
196
196
  try {
197
197
  isYarnV1 =
198
- (0, semver_1.major)((0, child_process_1.execSync)('yarn --version', { env, windowsHide: false })
199
- .toString()
200
- .trim()) === 1;
198
+ (0, semver_1.major)((0, child_process_1.execSync)('yarn --version', { env, windowsHide: true }).toString().trim()) === 1;
201
199
  }
202
200
  catch {
203
201
  // This would fail if yarn is not installed which is okay
@@ -209,14 +207,14 @@ function setupYarn(options) {
209
207
  const scopeName = scope ? `${scope}:` : '';
210
208
  yarnRegistryPaths.push((0, child_process_1.execSync)(`yarn config get ${scopeName}${registryConfigName}`, {
211
209
  env,
212
- windowsHide: false,
210
+ windowsHide: true,
213
211
  })
214
212
  ?.toString()
215
213
  ?.trim()
216
214
  ?.replace('\u001b[2K\u001b[1G', '') // strip out ansi codes
217
215
  );
218
216
  (0, child_process_1.execSync)(`yarn config set ${scopeName}${registryConfigName} http://${options.listenAddress}:${options.port}/` +
219
- (options.location === 'user' ? ' --home' : ''), { env, windowsHide: false });
217
+ (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
220
218
  devkit_1.logger.info(`Set yarn ${scopeName}registry to http://${options.listenAddress}:${options.port}/`);
221
219
  });
222
220
  const currentWhitelist = getYarnUnsafeHttpWhitelist(isYarnV1);
@@ -229,7 +227,7 @@ function setupYarn(options) {
229
227
  }
230
228
  return () => {
231
229
  try {
232
- const currentYarnRegistryPath = (0, child_process_1.execSync)(`yarn config get ${registryConfigName}`, { env, windowsHide: false })
230
+ const currentYarnRegistryPath = (0, child_process_1.execSync)(`yarn config get ${registryConfigName}`, { env, windowsHide: true })
233
231
  ?.toString()
234
232
  ?.trim()
235
233
  ?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
@@ -242,13 +240,13 @@ function setupYarn(options) {
242
240
  (0, child_process_1.execSync)(`yarn config set ${registryName} ${yarnRegistryPaths[index]}` +
243
241
  (options.location === 'user' ? ' --home' : ''), {
244
242
  env,
245
- windowsHide: false,
243
+ windowsHide: true,
246
244
  });
247
245
  devkit_1.logger.info(`Reset yarn ${registryName} to ${yarnRegistryPaths[index]}`);
248
246
  }
249
247
  else {
250
248
  (0, child_process_1.execSync)(`yarn config ${isYarnV1 ? 'delete' : 'unset'} ${registryName}` +
251
- (options.location === 'user' ? ' --home' : ''), { env, windowsHide: false });
249
+ (options.location === 'user' ? ' --home' : ''), { env, windowsHide: true });
252
250
  devkit_1.logger.info(`Cleared custom yarn ${registryConfigName}`);
253
251
  }
254
252
  });
@@ -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: false,
13
+ windowsHide: true,
14
14
  })
15
15
  ?.toString()
16
16
  ?.trim() ?? 'https://registry.npmjs.org',
@@ -34,7 +34,7 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
34
34
  console.log(`Local registry started on ${registry}`);
35
35
  process.env.npm_config_registry = registry;
36
36
  (0, child_process_1.execSync)(`npm config set //${listenAddress}:${port}/:_authToken "${authToken}" --ws=false`, {
37
- windowsHide: false,
37
+ windowsHide: true,
38
38
  });
39
39
  // bun
40
40
  process.env.BUN_CONFIG_REGISTRY = registry;
@@ -48,7 +48,7 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
48
48
  resolve(() => {
49
49
  childProcess.kill();
50
50
  (0, child_process_1.execSync)(`npm config delete //${listenAddress}:${port}/:_authToken --ws=false`, {
51
- windowsHide: false,
51
+ windowsHide: true,
52
52
  });
53
53
  });
54
54
  childProcess?.stdout?.off('data', listener);
@@ -13,7 +13,7 @@ const cache_directory_1 = require("nx/src/utils/cache-directory");
13
13
  const util_1 = require("./util");
14
14
  let ts;
15
15
  const pmc = (0, devkit_1.getPackageManagerCommand)();
16
- const TSCONFIG_CACHE_VERSION = 1;
16
+ const TSCONFIG_CACHE_VERSION = 2;
17
17
  const TS_CONFIG_CACHE_PATH = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, 'tsconfig-files.hash');
18
18
  // Module-level cache store — each invocation gets a unique Symbol key
19
19
  const cacheStore = new Map();
@@ -281,7 +281,7 @@ function buildTscTargets(config, options, context, configFiles, cache) {
281
281
  targets[targetName] = {
282
282
  dependsOn,
283
283
  command,
284
- options: { cwd: config.project.root },
284
+ options: { cwd: config.project.normalized },
285
285
  cache: true,
286
286
  inputs: getInputs(namedInputs, config, tsConfig, internalProjectReferences, context.workspaceRoot, cache),
287
287
  outputs: getOutputs(config, tsConfig, internalProjectReferences, context.workspaceRoot,
@@ -311,7 +311,7 @@ function buildTscTargets(config, options, context, configFiles, cache) {
311
311
  targets[targetName] = {
312
312
  dependsOn: [`^${targetName}`],
313
313
  command: `${compiler} --build ${options.build.configName}${options.verboseOutput ? ' --verbose' : ''}`,
314
- options: { cwd: config.project.root },
314
+ options: { cwd: config.project.normalized },
315
315
  cache: true,
316
316
  inputs: getInputs(namedInputs, config, tsConfig, internalProjectReferences, context.workspaceRoot, cache),
317
317
  outputs: getOutputs(config, tsConfig, internalProjectReferences, context.workspaceRoot,
@@ -889,12 +889,28 @@ function readFile(filePath, workspaceRoot, cache) {
889
889
  function toAbsolutePaths(cache, workspaceRoot) {
890
890
  const updatedCache = {};
891
891
  for (const [key, { data, extendedFilesHash, hash }] of Object.entries(cache)) {
892
+ const raw = {
893
+ nx: { addTypecheckTarget: data.raw?.['nx']?.addTypecheckTarget },
894
+ };
895
+ if (data.raw?.include) {
896
+ raw.include = data.raw.include;
897
+ }
898
+ if (data.raw?.exclude) {
899
+ raw.exclude = data.raw.exclude;
900
+ }
901
+ if (data.raw?.files) {
902
+ raw.files = data.raw.files;
903
+ }
892
904
  updatedCache[key] = {
893
905
  data: {
894
- options: { noEmit: data.options.noEmit },
895
- raw: {
896
- nx: { addTypecheckTarget: data.raw?.['nx']?.addTypecheckTarget },
906
+ options: {
907
+ noEmit: data.options.noEmit,
908
+ allowJs: data.options.allowJs,
909
+ resolveJsonModule: data.options.resolveJsonModule,
910
+ emitDeclarationOnly: data.options.emitDeclarationOnly,
911
+ declarationMap: data.options.declarationMap,
897
912
  },
913
+ raw,
898
914
  extendedConfigFiles: data.extendedConfigFiles,
899
915
  },
900
916
  extendedFilesHash,
@@ -926,12 +942,28 @@ function toAbsolutePaths(cache, workspaceRoot) {
926
942
  function toRelativePaths(cache, workspaceRoot) {
927
943
  const updatedCache = {};
928
944
  for (const [key, { data, extendedFilesHash, hash }] of Object.entries(cache)) {
945
+ const raw = {
946
+ nx: { addTypecheckTarget: data.raw?.['nx']?.addTypecheckTarget },
947
+ };
948
+ if (data.raw?.include) {
949
+ raw.include = data.raw.include;
950
+ }
951
+ if (data.raw?.exclude) {
952
+ raw.exclude = data.raw.exclude;
953
+ }
954
+ if (data.raw?.files) {
955
+ raw.files = data.raw.files;
956
+ }
929
957
  updatedCache[key] = {
930
958
  data: {
931
- options: { noEmit: data.options.noEmit },
932
- raw: {
933
- nx: { addTypecheckTarget: data.raw?.['nx']?.addTypecheckTarget },
959
+ options: {
960
+ noEmit: data.options.noEmit,
961
+ allowJs: data.options.allowJs,
962
+ resolveJsonModule: data.options.resolveJsonModule,
963
+ emitDeclarationOnly: data.options.emitDeclarationOnly,
964
+ declarationMap: data.options.declarationMap,
934
965
  },
966
+ raw,
935
967
  extendedConfigFiles: data.extendedConfigFiles,
936
968
  },
937
969
  extendedFilesHash,
@@ -89,7 +89,7 @@ function execLockFileUpdate(command, cwd, env) {
89
89
  ...process.env,
90
90
  ...env,
91
91
  },
92
- windowsHide: false,
92
+ windowsHide: true,
93
93
  });
94
94
  }
95
95
  catch (e) {
@@ -62,7 +62,7 @@ class JsVersionActions extends release_1.VersionActions {
62
62
  // Must be non-blocking async to allow spinner to render
63
63
  currentVersion = await new Promise((resolve, reject) => {
64
64
  (0, node_child_process_1.exec)(`npm view ${packageName} version --"${registryConfigKey}=${registry}" --tag=${tag}`, {
65
- windowsHide: false,
65
+ windowsHide: true,
66
66
  }, (error, stdout, stderr) => {
67
67
  if (error) {
68
68
  return reject(error);
@@ -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: false }, (error, stdout, stderr) => {
79
+ (0, child_process_1.exec)(command, { cwd, windowsHide: true }, (error, stdout, stderr) => {
80
80
  if (error) {
81
81
  return reject((stderr ? `${stderr}\n` : '') + error);
82
82
  }
@@ -60,7 +60,7 @@ async function compileSwc(context, normalizedOptions, postCompilationCallback) {
60
60
  const swcCmdLog = (0, node_child_process_1.execSync)(getSwcCmd(normalizedOptions), {
61
61
  encoding: 'utf8',
62
62
  cwd: normalizedOptions.swcCliOptions.swcCwd,
63
- windowsHide: false,
63
+ windowsHide: true,
64
64
  stdio: 'pipe',
65
65
  });
66
66
  devkit_1.logger.log(swcCmdLog.replace(/\n/, ''));
@@ -109,7 +109,7 @@ async function* compileSwcWatch(context, normalizedOptions, postCompilationCallb
109
109
  let watcherOnExit;
110
110
  const swcWatcher = (0, node_child_process_1.exec)(getSwcCmd(normalizedOptions, true), {
111
111
  cwd: normalizedOptions.swcCliOptions.swcCwd,
112
- windowsHide: false,
112
+ windowsHide: true,
113
113
  });
114
114
  processOnExit = () => {
115
115
  swcWatcher.kill();