UNPKG

@schemifyjs/schematics

Version:

Reusable schematics for scaffolding SchemifyJS projects.

19 lines (18 loc) 812 B
import path from 'path'; import { generateNameVariants } from '../../shared/utils/generate-name-variants.util.js'; import { SchematicEngine } from '../../shared/utils/generate-project.util.js'; import { runInstallCommand } from './commands/install.command.js'; import { fileURLToPath } from 'url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); export class ApplicationScaffolder { async scaffold(schemify) { const outputPath = path.resolve(schemify.name); const schematicPath = path.resolve(__dirname, '../application/files/nestjs/ts'); await SchematicEngine({ schematicPath: schematicPath, outputPath: outputPath, replacements: generateNameVariants(schemify.name) }); await runInstallCommand(outputPath); } }