nx 19.4.2 → 19.4.3

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.4.2",
3
+ "version": "19.4.3",
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.4.2"
73
+ "@nrwl/tao": "19.4.3"
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.4.2",
89
- "@nx/nx-darwin-arm64": "19.4.2",
90
- "@nx/nx-linux-x64-gnu": "19.4.2",
91
- "@nx/nx-linux-x64-musl": "19.4.2",
92
- "@nx/nx-win32-x64-msvc": "19.4.2",
93
- "@nx/nx-linux-arm64-gnu": "19.4.2",
94
- "@nx/nx-linux-arm64-musl": "19.4.2",
95
- "@nx/nx-linux-arm-gnueabihf": "19.4.2",
96
- "@nx/nx-win32-arm64-msvc": "19.4.2",
97
- "@nx/nx-freebsd-x64": "19.4.2"
88
+ "@nx/nx-darwin-x64": "19.4.3",
89
+ "@nx/nx-darwin-arm64": "19.4.3",
90
+ "@nx/nx-linux-x64-gnu": "19.4.3",
91
+ "@nx/nx-linux-x64-musl": "19.4.3",
92
+ "@nx/nx-win32-x64-msvc": "19.4.3",
93
+ "@nx/nx-linux-arm64-gnu": "19.4.3",
94
+ "@nx/nx-linux-arm64-musl": "19.4.3",
95
+ "@nx/nx-linux-arm-gnueabihf": "19.4.3",
96
+ "@nx/nx-win32-arm64-msvc": "19.4.3",
97
+ "@nx/nx-freebsd-x64": "19.4.3"
98
98
  },
99
99
  "nx-migrations": {
100
100
  "migrations": "./migrations.json",
@@ -13,6 +13,7 @@ const semver_1 = require("semver");
13
13
  const installed_plugins_1 = require("../../utils/plugins/installed-plugins");
14
14
  const installation_directory_1 = require("../../utils/installation-directory");
15
15
  const nx_json_1 = require("../../config/nx-json");
16
+ const error_types_1 = require("../../project-graph/error-types");
16
17
  const nxPackageJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(__dirname, '../../../package.json'));
17
18
  exports.packagesWeCareAbout = [
18
19
  'lerna',
@@ -93,19 +94,11 @@ exports.reportHandler = reportHandler;
93
94
  async function getReportData() {
94
95
  const pm = (0, package_manager_1.detectPackageManager)();
95
96
  const pmVersion = (0, package_manager_1.getPackageManagerVersion)(pm);
97
+ const { graph, error: projectGraphError } = await tryGetProjectGraph();
96
98
  const nxJson = (0, nx_json_1.readNxJson)();
97
- const localPlugins = await findLocalPlugins(nxJson);
99
+ const localPlugins = await findLocalPlugins(graph, nxJson);
98
100
  const communityPlugins = findInstalledCommunityPlugins();
99
101
  const registeredPlugins = findRegisteredPluginsBeingUsed(nxJson);
100
- let projectGraphError = null;
101
- if (isNativeAvailable()) {
102
- try {
103
- await (0, project_graph_1.createProjectGraphAsync)();
104
- }
105
- catch (e) {
106
- projectGraphError = e;
107
- }
108
- }
109
102
  const packageVersionsWeCareAbout = findInstalledPackagesWeCareAbout();
110
103
  packageVersionsWeCareAbout.unshift({
111
104
  package: 'nx',
@@ -130,9 +123,24 @@ async function getReportData() {
130
123
  };
131
124
  }
132
125
  exports.getReportData = getReportData;
133
- async function findLocalPlugins(nxJson) {
126
+ async function tryGetProjectGraph() {
127
+ try {
128
+ return { graph: await (0, project_graph_1.createProjectGraphAsync)() };
129
+ }
130
+ catch (error) {
131
+ if (error instanceof error_types_1.ProjectGraphError) {
132
+ return {
133
+ graph: error.getPartialProjectGraph(),
134
+ error: error,
135
+ };
136
+ }
137
+ return {
138
+ error,
139
+ };
140
+ }
141
+ }
142
+ async function findLocalPlugins(projectGraph, nxJson) {
134
143
  try {
135
- const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
136
144
  const localPlugins = await (0, local_plugins_1.getLocalWorkspacePlugins)((0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph), nxJson);
137
145
  return Array.from(localPlugins.keys());
138
146
  }
@@ -25,5 +25,5 @@ export declare const nxPluginCache: Map<unknown, [
25
25
  Promise<LoadedNxPlugin>,
26
26
  () => void
27
27
  ]>;
28
- export declare function loadNxPlugins(plugins: PluginConfiguration[], root?: string): Promise<[LoadedNxPlugin[], () => void]>;
28
+ export declare function loadNxPlugins(plugins: PluginConfiguration[], root?: string): Promise<readonly [LoadedNxPlugin[], () => void]>;
29
29
  export declare function getDefaultPlugins(root: string): Promise<string[]>;
@@ -69,18 +69,19 @@ exports.LoadedNxPlugin = LoadedNxPlugin;
69
69
  // referenced multiple times.
70
70
  exports.nxPluginCache = new Map();
71
71
  async function loadNxPlugins(plugins, root = workspace_root_1.workspaceRoot) {
72
- const result = [];
72
+ performance.mark('loadNxPlugins:start');
73
73
  const loadingMethod = process.env.NX_ISOLATE_PLUGINS === 'true'
74
74
  ? isolation_1.loadNxPluginInIsolation
75
75
  : loader_1.loadNxPlugin;
76
76
  plugins = await normalizePlugins(plugins, root);
77
+ const result = new Array(plugins?.length);
77
78
  const cleanupFunctions = [];
78
- for (const plugin of plugins) {
79
+ await Promise.all(plugins.map(async (plugin, idx) => {
79
80
  const [loadedPluginPromise, cleanup] = await loadingMethod(plugin, root);
80
- result.push(loadedPluginPromise);
81
+ result[idx] = loadedPluginPromise;
81
82
  cleanupFunctions.push(cleanup);
82
- }
83
- return [
83
+ }));
84
+ const ret = [
84
85
  await Promise.all(result),
85
86
  () => {
86
87
  for (const fn of cleanupFunctions) {
@@ -91,6 +92,9 @@ async function loadNxPlugins(plugins, root = workspace_root_1.workspaceRoot) {
91
92
  }
92
93
  },
93
94
  ];
95
+ performance.mark('loadNxPlugins:end');
96
+ performance.measure('loadNxPlugins', 'loadNxPlugins:start', 'loadNxPlugins:end');
97
+ return ret;
94
98
  }
95
99
  exports.loadNxPlugins = loadNxPlugins;
96
100
  async function normalizePlugins(plugins, root) {
@@ -3,8 +3,8 @@ 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
- const net_1 = require("net");
7
6
  const consume_messages_from_socket_1 = require("../../../utils/consume-messages-from-socket");
7
+ const net_1 = require("net");
8
8
  const fs_1 = require("fs");
9
9
  if (process.env.NX_PERF_LOGGING === 'true') {
10
10
  require('../../../utils/perf-logging');
@@ -264,6 +264,14 @@ class TaskOrchestrator {
264
264
  });
265
265
  }
266
266
  }
267
+ else if (targetConfiguration.executor === 'nx:noop') {
268
+ (0, fs_1.writeFileSync)(temporaryOutputPath, '');
269
+ results.push({
270
+ task,
271
+ status: 'success',
272
+ terminalOutput: '',
273
+ });
274
+ }
267
275
  else {
268
276
  // cache prep
269
277
  const { code, terminalOutput } = await this.runTaskInForkedProcess(task, env, pipeOutput, temporaryOutputPath, streamOutput);