@re-shell/cli
Version:
Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja
65 lines (64 loc) • 1.92 kB
TypeScript
import { EventEmitter } from 'events';
import { Template } from './template-engine';
export interface WizardOptions {
outputPath?: string;
validate?: boolean;
interactive?: boolean;
defaults?: Partial<Template>;
templatePath?: string;
includeExamples?: boolean;
}
export interface WizardStep {
id: string;
title: string;
description?: string;
type: 'input' | 'select' | 'multiselect' | 'confirm' | 'custom';
required?: boolean;
validate?: (value: any) => boolean | string;
transform?: (value: any) => any;
when?: (answers: any) => boolean;
default?: any;
choices?: any[];
customHandler?: (answers: any) => Promise<any>;
}
export interface WizardResult {
template: Template;
outputPath: string;
validated: boolean;
validationResult?: any;
examples?: GeneratedExample[];
}
export interface GeneratedExample {
name: string;
description: string;
files: Array<{
path: string;
content: string;
}>;
command: string;
}
export declare class TemplateWizard extends EventEmitter {
private options;
private prompter;
private validator;
private steps;
private currentTemplate;
constructor(options?: WizardOptions);
private initializeSteps;
run(): Promise<WizardResult>;
private promptStep;
private configureVariables;
private configureFiles;
private configureHooks;
private buildTemplate;
private saveTemplate;
private generateReadme;
private generateExamples;
private formatCategoryName;
addStep(step: WizardStep): void;
removeStep(id: string): boolean;
getSteps(): WizardStep[];
setOptions(options: Partial<WizardOptions>): void;
}
export declare function createTemplateInteractive(options?: WizardOptions): Promise<WizardResult>;
export declare function createTemplateWizard(options?: WizardOptions): TemplateWizard;