private onResolve(context: Context, reflection: ContainerReflection) { reflection.kindString = CubejsGroupPlugin.getKindSingular(reflection.kind); if (reflection.children && reflection.children.length > 0) { this.populateOrder(reflection.children); reflection.children.sort(CubejsGroupPlugin.sortCallback); reflection.groups = CubejsGroupPlugin.getReflectionGroups(reflection.children); } }
/** * Triggered when the converter has finished resolving a project. * * @param context The context object describing the current state the converter is in. */ private onEndResolve(context: Context) { function walkDirectory(directory: SourceDirectory) { directory.groups = CubejsGroupPlugin.getReflectionGroups(directory.getAllReflections()); for (const key in directory.directories) { if (!directory.directories.hasOwnProperty(key)) { continue; } walkDirectory(directory.directories[key]); } } const project = context.project; if (project.children && project.children.length > 0) { this.populateOrder(project.children); project.children.sort(CubejsGroupPlugin.sortCallback); project.groups = CubejsGroupPlugin.getReflectionGroups(project.children); } walkDirectory(project.directory); project.files.forEach((file) => { file.groups = CubejsGroupPlugin.getReflectionGroups(file.reflections); }); }