nx 19.0.0-canary.20240425-cec57c4 → 19.0.0-canary.20240426-ac9ad35

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",
3
- "version": "19.0.0-canary.20240425-cec57c4",
3
+ "version": "19.0.0-canary.20240426-ac9ad35",
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": {
@@ -66,7 +66,7 @@
66
66
  "yargs-parser": "21.1.1",
67
67
  "node-machine-id": "1.1.12",
68
68
  "ora": "5.3.0",
69
- "@nrwl/tao": "19.0.0-canary.20240425-cec57c4"
69
+ "@nrwl/tao": "19.0.0-canary.20240426-ac9ad35"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@swc-node/register": "^1.8.0",
@@ -81,16 +81,16 @@
81
81
  }
82
82
  },
83
83
  "optionalDependencies": {
84
- "@nx/nx-darwin-x64": "19.0.0-canary.20240425-cec57c4",
85
- "@nx/nx-darwin-arm64": "19.0.0-canary.20240425-cec57c4",
86
- "@nx/nx-linux-x64-gnu": "19.0.0-canary.20240425-cec57c4",
87
- "@nx/nx-linux-x64-musl": "19.0.0-canary.20240425-cec57c4",
88
- "@nx/nx-win32-x64-msvc": "19.0.0-canary.20240425-cec57c4",
89
- "@nx/nx-linux-arm64-gnu": "19.0.0-canary.20240425-cec57c4",
90
- "@nx/nx-linux-arm64-musl": "19.0.0-canary.20240425-cec57c4",
91
- "@nx/nx-linux-arm-gnueabihf": "19.0.0-canary.20240425-cec57c4",
92
- "@nx/nx-win32-arm64-msvc": "19.0.0-canary.20240425-cec57c4",
93
- "@nx/nx-freebsd-x64": "19.0.0-canary.20240425-cec57c4"
84
+ "@nx/nx-darwin-x64": "19.0.0-canary.20240426-ac9ad35",
85
+ "@nx/nx-darwin-arm64": "19.0.0-canary.20240426-ac9ad35",
86
+ "@nx/nx-linux-x64-gnu": "19.0.0-canary.20240426-ac9ad35",
87
+ "@nx/nx-linux-x64-musl": "19.0.0-canary.20240426-ac9ad35",
88
+ "@nx/nx-win32-x64-msvc": "19.0.0-canary.20240426-ac9ad35",
89
+ "@nx/nx-linux-arm64-gnu": "19.0.0-canary.20240426-ac9ad35",
90
+ "@nx/nx-linux-arm64-musl": "19.0.0-canary.20240426-ac9ad35",
91
+ "@nx/nx-linux-arm-gnueabihf": "19.0.0-canary.20240426-ac9ad35",
92
+ "@nx/nx-win32-arm64-msvc": "19.0.0-canary.20240426-ac9ad35",
93
+ "@nx/nx-freebsd-x64": "19.0.0-canary.20240426-ac9ad35"
94
94
  },
95
95
  "nx-migrations": {
96
96
  "migrations": "./migrations.json",
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const messaging_1 = require("./messaging");
4
4
  const loader_1 = require("../loader");
5
5
  const serializable_error_1 = require("../../../utils/serializable-error");
6
+ if (process.env.NX_PERF_LOGGING === 'true') {
7
+ require('../../../utils/perf-logging');
8
+ }
6
9
  global.NX_GRAPH_CREATION = true;
7
10
  let plugin;
8
11
  process.on('message', async (message) => {
@@ -12,7 +12,7 @@ export interface CreateNodesContext {
12
12
  /**
13
13
  * The subset of configuration files which match the createNodes pattern
14
14
  */
15
- readonly configFiles: string[];
15
+ readonly configFiles: readonly string[];
16
16
  }
17
17
  /**
18
18
  * A function which parses a configuration file into a set of nodes.
@@ -1,7 +1,7 @@
1
1
  import type { NxPluginV1 } from '../../utils/nx-plugin.deprecated';
2
2
  import type { CreateNodesResultWithContext, LoadedNxPlugin, NormalizedPlugin } from './internal-api';
3
- import type { CreateNodesContext, NxPlugin, NxPluginV2 } from './public-api';
3
+ import { type CreateNodesContext, type NxPlugin, type NxPluginV2 } from './public-api';
4
4
  export declare function isNxPluginV2(plugin: NxPlugin): plugin is NxPluginV2;
5
5
  export declare function isNxPluginV1(plugin: NxPlugin | LoadedNxPlugin): plugin is NxPluginV1;
6
6
  export declare function normalizeNxPlugin(plugin: NxPlugin): NormalizedPlugin;
7
- export declare function runCreateNodesInParallel(configFiles: string[], plugin: NormalizedPlugin, options: unknown, context: CreateNodesContext): Promise<CreateNodesResultWithContext[]>;
7
+ export declare function runCreateNodesInParallel(configFiles: readonly string[], plugin: NormalizedPlugin, options: unknown, context: CreateNodesContext): Promise<CreateNodesResultWithContext[]>;
@@ -43,30 +43,29 @@ async function runCreateNodesInParallel(configFiles, plugin, options, context) {
43
43
  performance.mark(`${plugin.name}:createNodes - start`);
44
44
  const errors = [];
45
45
  const results = [];
46
- const promises = configFiles.map((file) => {
46
+ const promises = configFiles.map(async (file) => {
47
47
  performance.mark(`${plugin.name}:createNodes:${file} - start`);
48
- // Result is either static or a promise, using Promise.resolve lets us
49
- // handle both cases with same logic
50
- const value = Promise.resolve(plugin.createNodes[1](file, options, context));
51
- return value
52
- .catch((e) => {
53
- performance.mark(`${plugin.name}:createNodes:${file} - end`);
48
+ try {
49
+ const value = await plugin.createNodes[1](file, options, context);
50
+ if (value) {
51
+ results.push({
52
+ ...value,
53
+ file,
54
+ pluginName: plugin.name,
55
+ });
56
+ }
57
+ }
58
+ catch (e) {
54
59
  errors.push(new error_types_1.CreateNodesError({
55
60
  error: e,
56
61
  pluginName: plugin.name,
57
62
  file,
58
63
  }));
59
- return null;
60
- })
61
- .then((r) => {
64
+ }
65
+ finally {
62
66
  performance.mark(`${plugin.name}:createNodes:${file} - end`);
63
67
  performance.measure(`${plugin.name}:createNodes:${file}`, `${plugin.name}:createNodes:${file} - start`, `${plugin.name}:createNodes:${file} - end`);
64
- // Existing behavior is to ignore null results of
65
- // createNodes function.
66
- if (r) {
67
- results.push({ ...r, file, pluginName: plugin.name });
68
- }
69
- });
68
+ }
70
69
  });
71
70
  await Promise.all(promises).then(() => {
72
71
  performance.mark(`${plugin.name}:createNodes - end`);
@@ -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.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const perf_hooks_1 = require("perf_hooks");
4
- if (process.env.NX_PERF_LOGGING === 'true') {
4
+ let initialized = false;
5
+ if (process.env.NX_PERF_LOGGING === 'true' && !initialized) {
6
+ initialized = true;
5
7
  const obs = new perf_hooks_1.PerformanceObserver((list) => {
6
8
  for (const entry of list.getEntries()) {
7
9
  console.log(`Time for '${entry.name}'`, entry.duration);