import { Rule, SchematicContext, Tree, chain, schematic } from "@angular-devkit/schematics"; import { FrontendSchematics } from "./add-artifacts/frontend-schematics"; import { Project } from "@vmfvmf/ywtc-lib"; import { getEnums, getModels } from "../router.gen"; export function gen(prj: Project): Rule { return async (tree: Tree, context: SchematicContext) => { const rules: any[] = [ ...getModels().map(model => schematic(FrontendSchematics.UC, model)), ...getEnums().map(enumDef => schematic(FrontendSchematics.ENUM, enumDef)) ]; return chain(rules)(tree, context); }; }