feat: Update main entry point and improve build script for cleaner architecture
This commit is contained in:
7
main.ts
7
main.ts
@@ -2,6 +2,7 @@
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import mustache from 'mustache';
|
||||
import path from 'path';
|
||||
import { program } from 'commander';
|
||||
|
||||
import { log, logSuccess, logInfo, logWarning, logError, colors } from './src/utils/logger';
|
||||
@@ -26,7 +27,11 @@ program
|
||||
.version('1.0.0')
|
||||
.option('-i, --input <file>', 'Archivo OpenAPI/Swagger (yaml o json)', 'swagger.yaml')
|
||||
.option('-o, --output <dir>', 'Directorio de salida', './src/app')
|
||||
.option('-t, --templates <dir>', 'Directorio de templates personalizados', './templates')
|
||||
.option(
|
||||
'-t, --templates <dir>',
|
||||
'Directorio de templates personalizados',
|
||||
path.join(__dirname, 'templates')
|
||||
)
|
||||
.option('--skip-install', 'No instalar dependencias')
|
||||
.option('--dry-run', 'Simular sin generar archivos')
|
||||
.parse(process.argv);
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
"name": "openapi-clean-arch-generator",
|
||||
"version": "1.0.0",
|
||||
"description": "Generador de código Angular con Clean Architecture desde OpenAPI/Swagger",
|
||||
"main": "dist/generate.js",
|
||||
"main": "dist/main.js",
|
||||
"bin": {
|
||||
"generate-clean-arch": "./dist/generate.js"
|
||||
"generate-clean-arch": "./dist/main.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"build": "tsc && cp -r templates dist/",
|
||||
"prepublishOnly": "npm run build",
|
||||
"generate": "node dist/generate.js",
|
||||
"generate": "node dist/main.js",
|
||||
"generate:dev": "ts-node main.ts",
|
||||
"lint": "eslint 'main.ts' 'src/**/*.ts' -f unix",
|
||||
"lint:fix": "eslint 'main.ts' 'src/**/*.ts' --fix -f unix",
|
||||
|
||||
Reference in New Issue
Block a user