UNPKG

kawkab-frontend

Version:

Kawkab frontend is a frontend library for the Kawkab framework

14 lines (13 loc) 559 B
import { generateFile } from '../utils/stub.js'; export function makeComponentCommand(program) { program .command('make:component <name> [module]') .description('Create a new React functional component in a specific module') .action((name, module = 'main') => { const componentName = name.charAt(0).toUpperCase() + name.slice(1); const targetPath = `app/${module}/components/${componentName}.tsx`; generateFile('component.stub', targetPath, { ComponentName: componentName, }); }); }