1- import { ResourceDefinitions } from '../plugins/entities/definitions/resource.js' ;
1+ import { Project } from '../entities/project.js' ;
2+ import { ProjectConfig } from '../entities/project-config.js' ;
3+ import { ResourceConfig } from '../entities/resource-config.js' ;
24import { InternalError } from '../utils/errors.js' ;
35import { ConfigClass } from './language-definition.js' ;
46import { ConfigLoader } from './loader/index.js' ;
5- import { DependencyGraphBuilder } from './output-generator/dependency-graph-builder.js' ;
6- import { CompiledProject } from './output-generator/entities/compiled-project.js' ;
7- import { CompiledProjectTransformer } from './output-generator/transformer.js' ;
8- import { ProjectConfig } from './parser/entities/configs/project.js' ;
9- import { ParsedModule } from './parser/entities/parsed-module.js' ;
10- import { ParsedProject } from './parser/entities/parsed-project.js' ;
117import { FileParser } from './parser/index.js' ;
128import { JsonFileParser } from './parser/json/file-parser.js' ;
139
@@ -17,7 +13,7 @@ export class ConfigCompiler {
1713 'json' : new JsonFileParser ( ) ,
1814 }
1915
20- static async parseProject ( directory : string ) : Promise < ParsedProject > {
16+ static async parseProject ( directory : string ) : Promise < Project > {
2117 const loadedProject = await ( new ConfigLoader ( ) . loadProject ( directory ) ) ;
2218
2319 const configBlocksResult = await Promise . all ( loadedProject . coreModule . files . map ( ( file ) => {
@@ -35,18 +31,10 @@ export class ConfigCompiler {
3531 throw new Error ( 'One or zero project config can be specified' ) ;
3632 }
3733
38- const projectConfig = parsedProjectConfigs [ 0 ] as ProjectConfig ;
39- return new ParsedProject ( {
40- coreModule : new ParsedModule ( {
41- configBlocks : configBlocks . filter ( ( u ) => u . configClass !== ConfigClass . PROJECT ) ,
42- } ) ,
34+ const projectConfig = parsedProjectConfigs [ 0 ] as unknown as ProjectConfig ;
35+ return new Project ( {
4336 projectConfig,
37+ resourceConfigs : configBlocks . filter ( ( u ) => u . configClass !== ConfigClass . PROJECT ) as ResourceConfig [ ] ,
4438 } )
4539 }
46-
47- static compileProject ( parsedProject : ParsedProject , definitions : ResourceDefinitions ) : CompiledProject {
48- const compiledProject = CompiledProjectTransformer . validateAndTransform ( parsedProject , definitions ) ;
49- DependencyGraphBuilder . buildDependencyGraph ( compiledProject ) ;
50- return compiledProject ;
51- }
5240}
0 commit comments