nx 17.1.1 → 17.1.2
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/bin/post-install.js +2 -0
- package/package.json +12 -12
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/polyfills.js +1 -1
- package/src/native/index.d.ts +2 -8
- package/src/project-graph/utils/project-configuration-utils.d.ts +1 -0
- package/src/project-graph/utils/project-configuration-utils.js +9 -0
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -0
- package/src/project-graph/utils/retrieve-workspace-files.js +26 -22
- package/src/utils/workspace-context.d.ts +2 -3
|
@@ -97,9 +97,11 @@ plugins, root = workspace_root_1.workspaceRoot) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
const rootMap = createRootMap(projectRootMap);
|
|
100
101
|
return {
|
|
101
102
|
projects: readProjectConfigurationsFromRootMap(projectRootMap),
|
|
102
103
|
externalNodes,
|
|
104
|
+
rootMap,
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
exports.buildProjectsConfigurationsFromProjectPathsAndPlugins = buildProjectsConfigurationsFromProjectPathsAndPlugins;
|
|
@@ -221,3 +223,10 @@ function readTargetDefaultsForTarget(targetName, targetDefaults, executor) {
|
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
225
|
exports.readTargetDefaultsForTarget = readTargetDefaultsForTarget;
|
|
226
|
+
function createRootMap(projectRootMap) {
|
|
227
|
+
const map = {};
|
|
228
|
+
for (const [projectRoot, { name: projectName }] of projectRootMap) {
|
|
229
|
+
map[projectRoot] = projectName;
|
|
230
|
+
}
|
|
231
|
+
return map;
|
|
232
|
+
}
|
|
@@ -44,5 +44,6 @@ export declare function retrieveProjectConfigurationsWithoutPluginInference(root
|
|
|
44
44
|
export declare function createProjectConfigurations(workspaceRoot: string, nxJson: NxJsonConfiguration, configFiles: string[], plugins: LoadedNxPlugin[]): {
|
|
45
45
|
projects: Record<string, ProjectConfiguration>;
|
|
46
46
|
externalNodes: Record<string, ProjectGraphExternalNode>;
|
|
47
|
+
rootMap: Record<string, string>;
|
|
47
48
|
};
|
|
48
49
|
export declare function configurationGlobs(workspaceRoot: string, plugins: LoadedNxPlugin[]): string[];
|
|
@@ -23,12 +23,13 @@ async function retrieveWorkspaceFiles(workspaceRoot, nxJson) {
|
|
|
23
23
|
perf_hooks_1.performance.mark('native-file-deps:end');
|
|
24
24
|
perf_hooks_1.performance.measure('native-file-deps', 'native-file-deps:start', 'native-file-deps:end');
|
|
25
25
|
perf_hooks_1.performance.mark('get-workspace-files:start');
|
|
26
|
-
|
|
26
|
+
let projects;
|
|
27
|
+
let externalNodes;
|
|
28
|
+
const { projectFileMap, globalFiles } = (0, workspace_context_1.getNxWorkspaceFilesFromContext)(workspaceRoot, globs, (configs) => {
|
|
27
29
|
const projectConfigurations = createProjectConfigurations(workspaceRoot, nxJson, configs, plugins);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
30
|
+
projects = projectConfigurations.projects;
|
|
31
|
+
externalNodes = projectConfigurations.externalNodes;
|
|
32
|
+
return projectConfigurations.rootMap;
|
|
32
33
|
});
|
|
33
34
|
perf_hooks_1.performance.mark('get-workspace-files:end');
|
|
34
35
|
perf_hooks_1.performance.measure('get-workspace-files', 'get-workspace-files:start', 'get-workspace-files:end');
|
|
@@ -40,9 +41,9 @@ async function retrieveWorkspaceFiles(workspaceRoot, nxJson) {
|
|
|
40
41
|
},
|
|
41
42
|
projectConfigurations: {
|
|
42
43
|
version: 2,
|
|
43
|
-
projects
|
|
44
|
+
projects,
|
|
44
45
|
},
|
|
45
|
-
externalNodes
|
|
46
|
+
externalNodes,
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
exports.retrieveWorkspaceFiles = retrieveWorkspaceFiles;
|
|
@@ -78,13 +79,16 @@ function retrieveProjectConfigurationsSync(workspaceRoot, nxJson) {
|
|
|
78
79
|
}
|
|
79
80
|
exports.retrieveProjectConfigurationsSync = retrieveProjectConfigurationsSync;
|
|
80
81
|
function _retrieveProjectConfigurations(workspaceRoot, nxJson, plugins, globs) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
let result;
|
|
83
|
+
(0, workspace_context_1.getProjectConfigurationsFromContext)(workspaceRoot, globs, (configs) => {
|
|
84
|
+
const { projects, externalNodes, rootMap } = createProjectConfigurations(workspaceRoot, nxJson, configs, plugins);
|
|
85
|
+
result = {
|
|
86
|
+
projectNodes: projects,
|
|
87
|
+
externalNodes: externalNodes,
|
|
86
88
|
};
|
|
89
|
+
return rootMap;
|
|
87
90
|
});
|
|
91
|
+
return result;
|
|
88
92
|
}
|
|
89
93
|
async function retrieveProjectConfigurationPaths(root, nxJson) {
|
|
90
94
|
const projectGlobPatterns = configurationGlobs(root, await (0, nx_plugin_1.loadNxPlugins)(nxJson?.plugins ?? [], (0, installation_directory_1.getNxRequirePaths)(root), root));
|
|
@@ -104,18 +108,17 @@ function retrieveProjectConfigurationsWithoutPluginInference(root) {
|
|
|
104
108
|
if (projectsWithoutPluginCache.has(cacheKey)) {
|
|
105
109
|
return projectsWithoutPluginCache.get(cacheKey);
|
|
106
110
|
}
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
let projects;
|
|
112
|
+
(0, workspace_context_1.getProjectConfigurationsFromContext)(root, projectGlobPatterns, (configs) => {
|
|
113
|
+
const projectConfigurations = createProjectConfigurations(root, nxJson, configs, [
|
|
109
114
|
{ plugin: (0, package_json_workspaces_1.getNxPackageJsonWorkspacesPlugin)(root) },
|
|
110
115
|
{ plugin: project_json_1.CreateProjectJsonProjectsPlugin },
|
|
111
116
|
]);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
projectsWithoutPluginCache.set(cacheKey, projectConfigurations);
|
|
118
|
-
return projectConfigurations;
|
|
117
|
+
projects = projectConfigurations.projects;
|
|
118
|
+
return projectConfigurations.rootMap;
|
|
119
|
+
});
|
|
120
|
+
projectsWithoutPluginCache.set(cacheKey, projects);
|
|
121
|
+
return projects;
|
|
119
122
|
}
|
|
120
123
|
exports.retrieveProjectConfigurationsWithoutPluginInference = retrieveProjectConfigurationsWithoutPluginInference;
|
|
121
124
|
function buildAllWorkspaceFiles(projectFileMap, globalFiles) {
|
|
@@ -130,13 +133,14 @@ function buildAllWorkspaceFiles(projectFileMap, globalFiles) {
|
|
|
130
133
|
}
|
|
131
134
|
function createProjectConfigurations(workspaceRoot, nxJson, configFiles, plugins) {
|
|
132
135
|
perf_hooks_1.performance.mark('build-project-configs:start');
|
|
133
|
-
const { projects, externalNodes } = (0, project_configuration_utils_1.buildProjectsConfigurationsFromProjectPathsAndPlugins)(nxJson, configFiles, plugins, workspaceRoot);
|
|
136
|
+
const { projects, externalNodes, rootMap } = (0, project_configuration_utils_1.buildProjectsConfigurationsFromProjectPathsAndPlugins)(nxJson, configFiles, plugins, workspaceRoot);
|
|
134
137
|
let projectConfigurations = projects;
|
|
135
138
|
perf_hooks_1.performance.mark('build-project-configs:end');
|
|
136
139
|
perf_hooks_1.performance.measure('build-project-configs', 'build-project-configs:start', 'build-project-configs:end');
|
|
137
140
|
return {
|
|
138
141
|
projects: projectConfigurations,
|
|
139
142
|
externalNodes,
|
|
143
|
+
rootMap,
|
|
140
144
|
};
|
|
141
145
|
}
|
|
142
146
|
exports.createProjectConfigurations = createProjectConfigurations;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { ConfigurationParserResult } from '../native';
|
|
2
1
|
export declare function setupWorkspaceContext(workspaceRoot: string): void;
|
|
3
|
-
export declare function getNxWorkspaceFilesFromContext(workspaceRoot: string, globs: string[], parseConfigurations: (files: string[]) =>
|
|
2
|
+
export declare function getNxWorkspaceFilesFromContext(workspaceRoot: string, globs: string[], parseConfigurations: (files: string[]) => Record<string, string>): import("../native").NxWorkspaceFiles;
|
|
4
3
|
export declare function globWithWorkspaceContext(workspaceRoot: string, globs: string[]): string[];
|
|
5
|
-
export declare function getProjectConfigurationsFromContext(workspaceRoot: string, globs: string[], parseConfigurations: (files: string[]) =>
|
|
4
|
+
export declare function getProjectConfigurationsFromContext(workspaceRoot: string, globs: string[], parseConfigurations: (files: string[]) => Record<string, string>): Record<string, string>;
|
|
6
5
|
export declare function updateFilesInContext(updatedFiles: string[], deletedFiles: string[]): Record<string, string>;
|
|
7
6
|
export declare function getAllFileDataInContext(workspaceRoot: string): import("../native").FileData[];
|
|
8
7
|
export declare function resetWorkspaceContext(): void;
|