INNER CODE UNIT · TypeScript
aurora
sabinadams/aurora · src/aurora.ts:14
export default async function aurora() {
// Grab the aurora configuration options from config file
const config: AuroraConfig = await getAuroraConfigJSON();
// Parse out the information from each prisma file
const schemas: SchemaInformation[] = await Promise.all(config.files.map(parseSchema));
// Get a list of all the models
let models: string = renderModels(
combineModels(
schemas.reduce((acc: DMMF.Model[], curr: SchemaInformation) => [...acc, ...curr.models], [])
)
);
// Get all the enums
const enums: string = renderEnums(
combineEnums(
schemas.reduce(
(acc: DMMF.DatamodelEnum[], curr: SchemaInformation) => [...acc, ...curr.enums],