@nxworker/workspace
Version:
Nx plugin providing generators for managing workspace files, including the move-file generator for safely moving files between projects while updating all imports
21 lines (20 loc) • 1.79 kB
TypeScript
import type { Tree, ProjectConfiguration } from '@nx/devkit';
import type { ProjectGraph } from '@nx/devkit';
import type { MoveFileGeneratorSchema } from '../schema';
import type { MoveContext } from '../types/move-context';
/**
* Coordinates the move workflow by executing the individual move steps in order.
*
* @param tree - The virtual file system tree.
* @param options - Generator options controlling the move.
* @param projects - Map of all projects in the workspace.
* @param getProjectGraphAsync - Lazy getter for the dependency graph (only creates when needed).
* @param ctx - Precomputed move context produced by resolveAndValidate.
* @param cachedTreeExists - Function to check file existence with caching.
* @param updateProjectSourceFilesCache - Function to update project source files cache.
* @param updateFileExistenceCache - Function to update file existence cache.
* @param getProjectSourceFiles - Function to get project source files with caching.
* @param getCachedDependentProjects - Function to get cached dependent projects.
* @param skipFinalization - Skip deletion and formatting (for batch operations).
*/
export declare function executeMove(tree: Tree, options: MoveFileGeneratorSchema, projects: Map<string, ProjectConfiguration>, getProjectGraphAsync: () => Promise<ProjectGraph>, ctx: MoveContext, cachedTreeExists: (tree: Tree, filePath: string) => boolean, updateProjectSourceFilesCache: (projectRoot: string, oldPath: string, newPath: string | null) => void, updateFileExistenceCache: (filePath: string, exists: boolean) => void, getProjectSourceFiles: (tree: Tree, projectRoot: string) => string[], getCachedDependentProjects: (projectGraph: ProjectGraph, projectName: string) => Set<string>, skipFinalization?: boolean): Promise<void>;