nx 18.2.0-canary.20240320-64b2396 → 18.2.0-canary.20240322-61cb63d
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 +12 -12
- package/src/command-line/affected/command-object.js +49 -22
- package/src/command-line/generate/generate.js +3 -3
- package/src/command-line/run/command-object.js +9 -2
- package/src/command-line/run/run-one.js +1 -1
- package/src/command-line/run-many/command-object.js +4 -1
- package/src/command-line/show/command-object.d.ts +2 -0
- package/src/command-line/show/command-object.js +19 -2
- package/src/daemon/client/client.js +19 -7
- package/src/daemon/daemon-project-graph-error.d.ts +8 -0
- package/src/daemon/daemon-project-graph-error.js +13 -0
- package/src/daemon/server/handle-hash-tasks.js +11 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +1 -0
- package/src/daemon/server/project-graph-incremental-recomputation.js +55 -6
- package/src/daemon/server/shutdown-utils.js +1 -3
- package/src/daemon/socket-utils.js +7 -1
- package/src/project-graph/build-project-graph.d.ts +18 -1
- package/src/project-graph/build-project-graph.js +71 -24
- package/src/project-graph/project-graph.d.ts +23 -2
- package/src/project-graph/project-graph.js +117 -14
- package/src/project-graph/utils/project-configuration-utils.d.ts +27 -4
- package/src/project-graph/utils/project-configuration-utils.js +87 -41
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +6 -14
- package/src/project-graph/utils/retrieve-workspace-files.js +3 -16
- package/src/utils/output.d.ts +1 -1
- package/src/utils/params.d.ts +2 -2
- package/src/utils/params.js +14 -0
@@ -1,7 +1,6 @@
|
|
1
1
|
import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
2
2
|
import { NxJsonConfiguration } from '../../config/nx-json';
|
3
|
-
import {
|
4
|
-
import { ConfigurationSourceMaps } from './project-configuration-utils';
|
3
|
+
import { ConfigurationResult } from './project-configuration-utils';
|
5
4
|
import { LoadedNxPlugin } from '../../utils/nx-plugin';
|
6
5
|
/**
|
7
6
|
* Walks the workspace directory to create the `projectFileMap`, `ProjectConfigurations` and `allWorkspaceFiles`
|
@@ -10,12 +9,12 @@ import { LoadedNxPlugin } from '../../utils/nx-plugin';
|
|
10
9
|
* @param nxJson
|
11
10
|
*/
|
12
11
|
export declare function retrieveWorkspaceFiles(workspaceRoot: string, projectRootMap: Record<string, string>): Promise<{
|
13
|
-
allWorkspaceFiles: import("
|
12
|
+
allWorkspaceFiles: import("nx/src/devkit-exports").FileData[];
|
14
13
|
fileMap: {
|
15
14
|
projectFileMap: ProjectFiles;
|
16
|
-
nonProjectFiles: import("
|
15
|
+
nonProjectFiles: import("nx/src/native").FileData[];
|
17
16
|
};
|
18
|
-
rustReferences: import("
|
17
|
+
rustReferences: import("nx/src/native").NxWorkspaceFilesExternals;
|
19
18
|
}>;
|
20
19
|
/**
|
21
20
|
* Walk through the workspace and return `ProjectConfigurations`. Only use this if the projectFileMap is not needed.
|
@@ -23,15 +22,8 @@ export declare function retrieveWorkspaceFiles(workspaceRoot: string, projectRoo
|
|
23
22
|
* @param workspaceRoot
|
24
23
|
* @param nxJson
|
25
24
|
*/
|
26
|
-
export declare function retrieveProjectConfigurations(workspaceRoot: string, nxJson: NxJsonConfiguration): Promise<
|
27
|
-
export declare function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot: string, nxJson: NxJsonConfiguration): Promise<
|
28
|
-
export type RetrievedGraphNodes = {
|
29
|
-
externalNodes: Record<string, ProjectGraphExternalNode>;
|
30
|
-
projects: Record<string, ProjectConfiguration>;
|
31
|
-
sourceMaps: ConfigurationSourceMaps;
|
32
|
-
projectRootMap: Record<string, string>;
|
33
|
-
};
|
25
|
+
export declare function retrieveProjectConfigurations(workspaceRoot: string, nxJson: NxJsonConfiguration): Promise<ConfigurationResult>;
|
26
|
+
export declare function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot: string, nxJson: NxJsonConfiguration): Promise<ConfigurationResult>;
|
34
27
|
export declare function retrieveProjectConfigurationPaths(root: string, plugins: LoadedNxPlugin[]): string[];
|
35
28
|
export declare function retrieveProjectConfigurationsWithoutPluginInference(root: string): Promise<Record<string, ProjectConfiguration>>;
|
36
|
-
export declare function createProjectConfigurations(workspaceRoot: string, nxJson: NxJsonConfiguration, configFiles: string[], plugins: LoadedNxPlugin[]): Promise<RetrievedGraphNodes>;
|
37
29
|
export declare function configurationGlobs(plugins: LoadedNxPlugin[]): string[];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.configurationGlobs = exports.
|
3
|
+
exports.configurationGlobs = exports.retrieveProjectConfigurationsWithoutPluginInference = exports.retrieveProjectConfigurationPaths = exports.retrieveProjectConfigurationsWithAngularProjects = exports.retrieveProjectConfigurations = exports.retrieveWorkspaceFiles = void 0;
|
4
4
|
const perf_hooks_1 = require("perf_hooks");
|
5
5
|
const installation_directory_1 = require("../../utils/installation-directory");
|
6
6
|
const angular_json_1 = require("../../adapter/angular-json");
|
@@ -58,7 +58,7 @@ exports.retrieveProjectConfigurationsWithAngularProjects = retrieveProjectConfig
|
|
58
58
|
function _retrieveProjectConfigurations(workspaceRoot, nxJson, plugins) {
|
59
59
|
const globPatterns = configurationGlobs(plugins);
|
60
60
|
const workspaceFiles = (0, workspace_context_1.globWithWorkspaceContext)(workspaceRoot, globPatterns);
|
61
|
-
return createProjectConfigurations(workspaceRoot, nxJson, workspaceFiles, plugins);
|
61
|
+
return (0, project_configuration_utils_1.createProjectConfigurations)(workspaceRoot, nxJson, workspaceFiles, plugins);
|
62
62
|
}
|
63
63
|
function retrieveProjectConfigurationPaths(root, plugins) {
|
64
64
|
const projectGlobPatterns = configurationGlobs(plugins);
|
@@ -76,7 +76,7 @@ async function retrieveProjectConfigurationsWithoutPluginInference(root) {
|
|
76
76
|
return projectsWithoutPluginCache.get(cacheKey);
|
77
77
|
}
|
78
78
|
const projectFiles = (0, workspace_context_1.globWithWorkspaceContext)(root, projectGlobPatterns) ?? [];
|
79
|
-
const { projects } = await createProjectConfigurations(root, nxJson, projectFiles, [
|
79
|
+
const { projects } = await (0, project_configuration_utils_1.createProjectConfigurations)(root, nxJson, projectFiles, [
|
80
80
|
{ plugin: (0, package_json_workspaces_1.getNxPackageJsonWorkspacesPlugin)(root) },
|
81
81
|
{ plugin: project_json_1.ProjectJsonProjectsPlugin },
|
82
82
|
]);
|
@@ -84,19 +84,6 @@ async function retrieveProjectConfigurationsWithoutPluginInference(root) {
|
|
84
84
|
return projects;
|
85
85
|
}
|
86
86
|
exports.retrieveProjectConfigurationsWithoutPluginInference = retrieveProjectConfigurationsWithoutPluginInference;
|
87
|
-
async function createProjectConfigurations(workspaceRoot, nxJson, configFiles, plugins) {
|
88
|
-
perf_hooks_1.performance.mark('build-project-configs:start');
|
89
|
-
const { projects, externalNodes, rootMap, sourceMaps } = await (0, project_configuration_utils_1.buildProjectsConfigurationsFromProjectPathsAndPlugins)(nxJson, configFiles, plugins, workspaceRoot);
|
90
|
-
perf_hooks_1.performance.mark('build-project-configs:end');
|
91
|
-
perf_hooks_1.performance.measure('build-project-configs', 'build-project-configs:start', 'build-project-configs:end');
|
92
|
-
return {
|
93
|
-
projects,
|
94
|
-
externalNodes,
|
95
|
-
projectRootMap: rootMap,
|
96
|
-
sourceMaps,
|
97
|
-
};
|
98
|
-
}
|
99
|
-
exports.createProjectConfigurations = createProjectConfigurations;
|
100
87
|
function configurationGlobs(plugins) {
|
101
88
|
const globPatterns = [];
|
102
89
|
for (const { plugin } of plugins) {
|
package/src/utils/output.d.ts
CHANGED
package/src/utils/params.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { NxJsonConfiguration } from '../config/nx-json';
|
2
|
-
import { TargetConfiguration, ProjectsConfigurations } from '../config/workspace-json-project-json';
|
1
|
+
import type { NxJsonConfiguration } from '../config/nx-json';
|
2
|
+
import type { TargetConfiguration, ProjectsConfigurations } from '../config/workspace-json-project-json';
|
3
3
|
type PropertyDescription = {
|
4
4
|
type?: string | string[];
|
5
5
|
required?: string[];
|
package/src/utils/params.js
CHANGED
@@ -13,6 +13,20 @@ async function handleErrors(isVerbose, fn) {
|
|
13
13
|
if (err.constructor.name === 'UnsuccessfulWorkflowExecution') {
|
14
14
|
logger_1.logger.error('The generator workflow failed. See above.');
|
15
15
|
}
|
16
|
+
else if (err.name === 'ProjectGraphError') {
|
17
|
+
const projectGraphError = err;
|
18
|
+
let title = projectGraphError.message;
|
19
|
+
if (isVerbose) {
|
20
|
+
title += ' See errors below.';
|
21
|
+
}
|
22
|
+
const bodyLines = isVerbose
|
23
|
+
? [projectGraphError.stack]
|
24
|
+
: ['Pass --verbose to see the stacktraces.'];
|
25
|
+
output_1.output.error({
|
26
|
+
title,
|
27
|
+
bodyLines: bodyLines,
|
28
|
+
});
|
29
|
+
}
|
16
30
|
else {
|
17
31
|
const lines = (err.message ? err.message : err.toString()).split('\n');
|
18
32
|
const bodyLines = lines.slice(1);
|