UNPKG

dna-template-cli

Version:

DNA Template CLI v0.3.4 - Enhanced Commands Added (enhanced-create, enhanced-list, enhanced-validate)

48 lines (47 loc) 2.53 kB
"use strict"; /** * @fileoverview Enhanced Create command with comprehensive error handling and validation * Simplified version using workspace adapter pattern */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.enhancedCreateCommand = void 0; const commander_1 = require("commander"); const chalk_compat_1 = __importDefault(require("../utils/chalk-compat")); const logger_1 = require("../utils/logger"); const error_handler_1 = require("../utils/error-handler"); exports.enhancedCreateCommand = new commander_1.Command('enhanced-create') .description('Create a new project with enhanced error handling and validation') .argument('[name]', 'project name') .option('-t, --template <name>', 'template to use') .option('-f, --framework <framework>', 'target framework') .option('-o, --output <path>', 'output directory', process.cwd()) .option('--dry-run', 'preview changes without creating files') .option('-y, --yes', 'skip interactive prompts and use defaults') .action(async (projectName, options) => { try { logger_1.logger.info('🧬 Enhanced Project Creation Starting...'); const name = projectName || 'my-dna-project'; const template = options.template || 'foundation'; const framework = options.framework || 'nextjs'; const outputPath = options.output || `./${name}`; logger_1.logger.info(`📁 Creating project: ${chalk_compat_1.default.cyan(name)}`); logger_1.logger.info(`🧬 Template: ${chalk_compat_1.default.cyan(template)}`); logger_1.logger.info(`⚡ Framework: ${chalk_compat_1.default.cyan(framework)}`); logger_1.logger.info(`📍 Output: ${chalk_compat_1.default.cyan(outputPath)}`); if (options.dryRun) { logger_1.logger.info('🔍 Dry run mode - no files will be created'); logger_1.logger.info('✅ Enhanced project creation simulation completed'); return; } // Enhanced create command functionality would go here logger_1.logger.info('🚧 Enhanced project creation is available in development mode'); logger_1.logger.info('💡 Use standard create command for now: dna-cli create'); logger_1.logger.info('✅ Enhanced project creation completed successfully'); } catch (error) { (0, error_handler_1.handleError)(error); } });