nx 19.3.0-canary.20240606-bccb2c5 → 19.3.0-canary.20240607-7495f06

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.
@@ -14,7 +14,6 @@ const workspace_context_1 = require("../src/utils/workspace-context");
14
14
  const logger_1 = require("../src/utils/logger");
15
15
  (async () => {
16
16
  const start = new Date();
17
- let errored = false;
18
17
  try {
19
18
  (0, workspace_context_1.setupWorkspaceContext)(workspace_root_1.workspaceRoot);
20
19
  if (isMainNxPackage() && (0, fileutils_1.fileExists)((0, path_1.join)(workspace_root_1.workspaceRoot, 'nx.json'))) {
@@ -39,13 +38,12 @@ const logger_1 = require("../src/utils/logger");
39
38
  }
40
39
  }
41
40
  catch (e) {
42
- errored = true;
43
41
  logger_1.logger.verbose(e);
44
42
  }
45
43
  finally {
46
44
  const end = new Date();
47
45
  logger_1.logger.verbose(`Nx postinstall steps took ${end.getTime() - start.getTime()}ms`);
48
- process.exit(errored ? 1 : 0);
46
+ process.exit(0);
49
47
  }
50
48
  })();
51
49
  function isMainNxPackage() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.3.0-canary.20240606-bccb2c5",
3
+ "version": "19.3.0-canary.20240607-7495f06",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -70,7 +70,7 @@
70
70
  "yargs-parser": "21.1.1",
71
71
  "node-machine-id": "1.1.12",
72
72
  "ora": "5.3.0",
73
- "@nrwl/tao": "19.3.0-canary.20240606-bccb2c5"
73
+ "@nrwl/tao": "19.3.0-canary.20240607-7495f06"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "@swc-node/register": "^1.8.0",
@@ -85,16 +85,16 @@
85
85
  }
86
86
  },
87
87
  "optionalDependencies": {
88
- "@nx/nx-darwin-x64": "19.3.0-canary.20240606-bccb2c5",
89
- "@nx/nx-darwin-arm64": "19.3.0-canary.20240606-bccb2c5",
90
- "@nx/nx-linux-x64-gnu": "19.3.0-canary.20240606-bccb2c5",
91
- "@nx/nx-linux-x64-musl": "19.3.0-canary.20240606-bccb2c5",
92
- "@nx/nx-win32-x64-msvc": "19.3.0-canary.20240606-bccb2c5",
93
- "@nx/nx-linux-arm64-gnu": "19.3.0-canary.20240606-bccb2c5",
94
- "@nx/nx-linux-arm64-musl": "19.3.0-canary.20240606-bccb2c5",
95
- "@nx/nx-linux-arm-gnueabihf": "19.3.0-canary.20240606-bccb2c5",
96
- "@nx/nx-win32-arm64-msvc": "19.3.0-canary.20240606-bccb2c5",
97
- "@nx/nx-freebsd-x64": "19.3.0-canary.20240606-bccb2c5"
88
+ "@nx/nx-darwin-x64": "19.3.0-canary.20240607-7495f06",
89
+ "@nx/nx-darwin-arm64": "19.3.0-canary.20240607-7495f06",
90
+ "@nx/nx-linux-x64-gnu": "19.3.0-canary.20240607-7495f06",
91
+ "@nx/nx-linux-x64-musl": "19.3.0-canary.20240607-7495f06",
92
+ "@nx/nx-win32-x64-msvc": "19.3.0-canary.20240607-7495f06",
93
+ "@nx/nx-linux-arm64-gnu": "19.3.0-canary.20240607-7495f06",
94
+ "@nx/nx-linux-arm64-musl": "19.3.0-canary.20240607-7495f06",
95
+ "@nx/nx-linux-arm-gnueabihf": "19.3.0-canary.20240607-7495f06",
96
+ "@nx/nx-win32-arm64-msvc": "19.3.0-canary.20240607-7495f06",
97
+ "@nx/nx-freebsd-x64": "19.3.0-canary.20240607-7495f06"
98
98
  },
99
99
  "nx-migrations": {
100
100
  "migrations": "./migrations.json",
@@ -98,10 +98,23 @@ function updateGitIgnore(root) {
98
98
  const ignorePath = (0, path_1.join)(root, '.gitignore');
99
99
  try {
100
100
  let contents = (0, fs_1.readFileSync)(ignorePath, 'utf-8');
101
+ const lines = contents.split('\n');
102
+ let sepIncluded = false;
101
103
  if (!contents.includes('.nx/cache')) {
102
- contents = [contents, '', '.nx/cache'].join('\n');
103
- (0, fs_1.writeFileSync)(ignorePath, contents, 'utf-8');
104
+ if (!sepIncluded) {
105
+ lines.push('\n');
106
+ sepIncluded = true;
107
+ }
108
+ lines.push('.nx/cache');
109
+ }
110
+ if (!contents.includes('.nx/workspace-data')) {
111
+ if (!sepIncluded) {
112
+ lines.push('\n');
113
+ sepIncluded = true;
114
+ }
115
+ lines.push('.nx/workspace-data');
104
116
  }
117
+ (0, fs_1.writeFileSync)(ignorePath, lines.join('\n'), 'utf-8');
105
118
  }
106
119
  catch { }
107
120
  }
@@ -19,7 +19,6 @@ const nx_json_1 = require("../../config/nx-json");
19
19
  const daemon_socket_messenger_1 = require("./daemon-socket-messenger");
20
20
  const cache_1 = require("../cache");
21
21
  const error_types_1 = require("../../project-graph/error-types");
22
- const dotenv_1 = require("../../utils/dotenv");
23
22
  const get_nx_workspace_files_1 = require("../message-types/get-nx-workspace-files");
24
23
  const get_context_file_data_1 = require("../message-types/get-context-file-data");
25
24
  const get_files_in_directory_1 = require("../message-types/get-files-in-directory");
@@ -41,7 +40,6 @@ class DaemonClient {
41
40
  this._daemonReady = null;
42
41
  this._out = null;
43
42
  this._err = null;
44
- (0, dotenv_1.loadRootEnvFiles)(workspace_root_1.workspaceRoot);
45
43
  try {
46
44
  this.nxJson = (0, configuration_1.readNxJson)();
47
45
  }
@@ -42,7 +42,7 @@ export interface NormalizedRunCommandsOptions extends RunCommandsOptions {
42
42
  [k: string]: any;
43
43
  };
44
44
  unparsedCommandArgs?: {
45
- [k: string]: string;
45
+ [k: string]: string | string[];
46
46
  };
47
47
  args?: string;
48
48
  }
@@ -29,7 +29,9 @@ const propKeys = [
29
29
  'command',
30
30
  'commands',
31
31
  'color',
32
+ 'no-color',
32
33
  'parallel',
34
+ 'no-parallel',
33
35
  'readyWhen',
34
36
  'cwd',
35
37
  'args',
@@ -131,6 +133,7 @@ function normalizeOptions(options) {
131
133
  'parse-numbers': false,
132
134
  'parse-positional-numbers': false,
133
135
  'dot-notation': false,
136
+ 'camel-case-expansion': false,
134
137
  },
135
138
  });
136
139
  options.unknownOptions = Object.keys(options)
@@ -294,20 +297,21 @@ function interpolateArgsIntoCommand(command, opts, forwardAllArgs) {
294
297
  else if (forwardAllArgs) {
295
298
  let args = '';
296
299
  if (Object.keys(opts.unknownOptions ?? {}).length > 0) {
297
- args +=
298
- ' ' +
299
- Object.keys(opts.unknownOptions)
300
- .filter((k) => typeof opts.unknownOptions[k] !== 'object' &&
301
- opts.parsedArgs[k] === opts.unknownOptions[k])
302
- .map((k) => `--${k}=${opts.unknownOptions[k]}`)
303
- .map(wrapArgIntoQuotesIfNeeded)
304
- .join(' ');
300
+ const unknownOptionsArgs = Object.keys(opts.unknownOptions)
301
+ .filter((k) => typeof opts.unknownOptions[k] !== 'object' &&
302
+ opts.parsedArgs[k] === opts.unknownOptions[k])
303
+ .map((k) => `--${k}=${opts.unknownOptions[k]}`)
304
+ .map(wrapArgIntoQuotesIfNeeded)
305
+ .join(' ');
306
+ if (unknownOptionsArgs) {
307
+ args += ` ${unknownOptionsArgs}`;
308
+ }
305
309
  }
306
310
  if (opts.args) {
307
311
  args += ` ${opts.args}`;
308
312
  }
309
313
  if (opts.__unparsed__?.length > 0) {
310
- const filterdParsedOptions = filterPropKeysFromUnParsedOptions(opts.__unparsed__, opts.unparsedCommandArgs);
314
+ const filterdParsedOptions = filterPropKeysFromUnParsedOptions(opts.__unparsed__, opts.parsedArgs);
311
315
  if (filterdParsedOptions.length > 0) {
312
316
  args += ` ${filterdParsedOptions
313
317
  .map(wrapArgIntoQuotesIfNeeded)
@@ -335,13 +339,14 @@ function parseArgs(unparsedCommandArgs, unknownOptions, args) {
335
339
  * @param unparsedCommandArgs e.g. { prop1: 'value1', prop2: 'value2', args: 'test'}
336
340
  * @returns filtered options that are not part of the propKeys array e.g. ['--prop1', 'value1', '--prop2=value2']
337
341
  */
338
- function filterPropKeysFromUnParsedOptions(__unparsed__, unparsedCommandArgs = {}) {
342
+ function filterPropKeysFromUnParsedOptions(__unparsed__, parseArgs = {}) {
339
343
  const parsedOptions = [];
340
344
  for (let index = 0; index < __unparsed__.length; index++) {
341
345
  const element = __unparsed__[index];
342
346
  if (element.startsWith('--')) {
343
347
  const key = element.replace('--', '');
344
348
  if (element.includes('=')) {
349
+ // key can be in the format of --key=value or --key.subkey=value (e.g. env.foo=bar)
345
350
  if (!propKeys.includes(key.split('=')[0].split('.')[0])) {
346
351
  // check if the key is part of the propKeys array
347
352
  parsedOptions.push(element);
@@ -351,7 +356,8 @@ function filterPropKeysFromUnParsedOptions(__unparsed__, unparsedCommandArgs = {
351
356
  // check if the next element is a value for the key
352
357
  if (propKeys.includes(key)) {
353
358
  if (index + 1 < __unparsed__.length &&
354
- __unparsed__[index + 1] === unparsedCommandArgs[key]) {
359
+ parseArgs[key] &&
360
+ __unparsed__[index + 1].toString() === parseArgs[key].toString()) {
355
361
  index++; // skip the next element
356
362
  }
357
363
  }
@@ -9,12 +9,12 @@ import { LoadedNxPlugin } from '../plugins/internal-api';
9
9
  * @param nxJson
10
10
  */
11
11
  export declare function retrieveWorkspaceFiles(workspaceRoot: string, projectRootMap: Record<string, string>): Promise<{
12
- allWorkspaceFiles: import("../file-utils").FileData[];
12
+ allWorkspaceFiles: import("nx/src/devkit-exports").FileData[];
13
13
  fileMap: {
14
14
  projectFileMap: ProjectFiles;
15
- nonProjectFiles: import("../../native").FileData[];
15
+ nonProjectFiles: import("nx/src/native").FileData[];
16
16
  };
17
- rustReferences: import("../../native").NxWorkspaceFilesExternals;
17
+ rustReferences: import("nx/src/native").NxWorkspaceFilesExternals;
18
18
  }>;
19
19
  /**
20
20
  * Walk through the workspace and return `ProjectConfigurations`. Only use this if the projectFileMap is not needed.