import { Rule, SchematicContext, Tree, chain, schematic } from "@angular-devkit/schematics"; import { BackendSchematics } from "./add-artifacts/backend-schematics"; import { getEnums, getModels } from "../router.gen"; export function gen(): Rule { return async (tree: Tree, context: SchematicContext) => { const rules: any[] = [ ...getModels().map(m => schematic(BackendSchematics.UC, m)), ...getEnums().map(edef => schematic(BackendSchematics.ENUM, edef)) ]; return chain(rules)(tree, context); }; }