@@ -5,6 +5,7 @@ import { DependencyMap, PluginManager } from '../plugins/plugin-manager.js';
55import { Reporter } from '../ui/reporters/reporter.js' ;
66import { createStartupShellScriptsIfNotExists } from '../utils/file.js' ;
77import { InitializeOrchestrator } from './initialize.js' ;
8+ import { ValidateOrchestrator } from './validate.js' ;
89
910export interface PlanArgs {
1011 path ?: string ;
@@ -21,13 +22,14 @@ export class PlanOrchestrator {
2122 static async run ( args : PlanArgs , reporter : Reporter ) : Promise < PlanOrchestratorResponse > {
2223 ctx . processStarted ( ProcessName . PLAN )
2324
24- const { typeIdsToDependenciesMap , pluginManager , project } = await InitializeOrchestrator . run ( {
25+ const initializationResult = await InitializeOrchestrator . run ( {
2526 ...args ,
2627 } , reporter ) ;
28+ const { typeIdsToDependenciesMap, pluginManager, project } = initializationResult ;
2729
2830 await createStartupShellScriptsIfNotExists ( ) ;
2931
30- await PlanOrchestrator . validate ( project , pluginManager , typeIdsToDependenciesMap )
32+ await ValidateOrchestrator . run ( { existing : initializationResult } , reporter ) ;
3133 project . resolveDependenciesAndCalculateEvalOrder ( typeIdsToDependenciesMap ) ;
3234 project . addXCodeToolsConfig ( ) ; // We have to add xcode-tools config always since almost every resource depends on it
3335
@@ -46,16 +48,6 @@ export class PlanOrchestrator {
4648 } ;
4749 }
4850
49- private static async validate ( project : Project , pluginManager : PluginManager , dependencyMap : DependencyMap ) {
50- ctx . subprocessStarted ( SubProcessName . VALIDATE )
51-
52- project . validateTypeIds ( dependencyMap ) ;
53- const validationResults = await pluginManager . validate ( project ) ;
54- project . handlePluginResourceValidationResults ( validationResults ) ;
55-
56- ctx . subprocessFinished ( SubProcessName . VALIDATE )
57- }
58-
5951 private static async plan ( project : Project , pluginManager : PluginManager ) : Promise < Plan > {
6052 ctx . subprocessStarted ( SubProcessName . GENERATE_PLAN )
6153 const plan = await pluginManager . plan ( project ) ;
0 commit comments