nx
Version:
46 lines (45 loc) • 2.59 kB
TypeScript
import { ProjectConfiguration } from '../../../config/workspace-json-project-json';
import type { ConfigurationSourceMaps, SourceInformation } from './source-maps';
export { validateProject } from './target-normalization';
export declare function mergeProjectConfigurationIntoRootMap(projectRootMap: Record<string, ProjectConfiguration>, project: ProjectConfiguration, configurationSourceMaps?: ConfigurationSourceMaps, sourceInformation?: SourceInformation, skipTargetNormalization?: boolean, deferSpreadsWithoutBase?: boolean): {
nameChanged: boolean;
};
export declare function readProjectConfigurationsFromRootMap(projectRootMap: Record<string, ProjectConfiguration>): Record<string, ProjectConfiguration>;
export declare function createRootMap(projectRootMap: Record<string, ProjectConfiguration>): Record<string, string>;
/**
* Owns the rootMap (root → ProjectConfiguration) and nameMap
* (name → ProjectConfiguration), coordinating merges with the
* {@link ProjectNameInNodePropsManager} for deferred name substitutions.
*
* The nameMap entries are the *same object references* as the rootMap
* entries, so when a merge adds targets to a rootMap entry the nameMap
* entry automatically has them too — no copying, no staleness.
*/
export declare class ProjectNodesManager {
private rootMap;
private nameMap;
private nameSubstitutionManager;
constructor();
getRootMap(): Record<string, ProjectConfiguration>;
/**
* Merges a project into the rootMap, updates the nameMap, and notifies
* the substitution manager if the name changed at this root.
*/
mergeProjectNode(project: ProjectConfiguration, configurationSourceMaps?: ConfigurationSourceMaps, sourceInformation?: SourceInformation): void;
/**
* Inserts project-name sentinels into `inputs` and `dependsOn` on the
* merged objects from `mergedRootMap` (defaulting to this manager's
* rootMap). Walking the merged entries matters because a spread-produced
* array is a fresh instance.
*
* Pass a different `mergedRootMap` for the default-plugin intermediate
* pass, then call again with `this.rootMap` after it's applied so
* sentinel parents rebind onto the final arrays.
*/
registerNameRefs(pluginResultProjects?: Record<string, Omit<ProjectConfiguration, 'root'> & Partial<ProjectConfiguration>>, mergedRootMap?: Record<string, ProjectConfiguration>): void;
/**
* Applies all pending name substitutions. Call once after all plugin
* results have been merged.
*/
applySubstitutions(): void;
}