"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BuildCommand = void 0;
const chalk_1 = __importDefault(require("chalk"));
const generate_components_1 = require("./generate-components");
const spinner_1 = require("../utils/spinner");
class BuildCommand {
    constructor() {
        this.spinner = new spinner_1.EnhancedSpinner("Building application...");
    }
    async execute(options) {
        console.log(chalk_1.default.blue.bold("🏗️  Building your application from Living Brain...\n"));
        try {
            this.spinner.start();
            const generateCommand = new generate_components_1.GenerateComponentsCommand();
            // Build is an alias for generating all components with complete architecture
            await generateCommand.execute("all", {
                ...options,
                completeArchitecture: true,
                updatePreview: true,
                withTests: true,
                finalCanvas: true
            });
            this.spinner.succeed("Application build completed successfully!");
            console.log(chalk_1.default.green("\n🚀 Your application is ready. Run 'npm run dev' to see it in action."));
        }
        catch (error) {
            this.spinner.fail("Build failed");
            throw error;
        }
    }
}
exports.BuildCommand = BuildCommand;
//# sourceMappingURL=build.js.map