@sprouted/create-vibes
Version:
Create a new Vibes monorepo
69 lines • 1.96 kB
TypeScript
export interface Template {
name: string;
path: string;
description?: string;
variables?: TemplateVariable[];
transforms?: Transform[];
files?: TemplateFile[];
}
export interface TemplateVariable {
name: string;
type: 'string' | 'boolean' | 'array' | 'select';
required?: boolean;
default?: any;
options?: string[];
description?: string;
}
export interface Transform {
type: 'replace' | 'inject' | 'conditional' | 'case';
config: TransformConfig;
}
export interface TransformConfig {
pattern?: string | RegExp;
replacement?: string;
condition?: (vars: Record<string, any>) => boolean;
caseType?: 'pascal' | 'camel' | 'snake' | 'kebab';
}
export interface TemplateFile {
source: string;
destination: string;
condition?: (vars: Record<string, any>) => boolean;
transforms?: Transform[];
}
export interface Feature {
id: string;
name: string;
description?: string;
dependencies?: string[];
devDependencies?: string[];
peerDependencies?: string[];
config?: Record<string, any>;
files?: TemplateFile[];
postInstall?: (context: FeatureContext) => Promise<void>;
}
export interface FeatureContext {
projectPath: string;
packageManager: 'npm' | 'yarn' | 'pnpm';
variables: Record<string, any>;
features: string[];
}
export interface TemplateConfig {
name: string;
description: string;
type: 'feature' | 'app' | 'component';
variables: TemplateVariable[];
files: TemplateFile[];
features?: Feature[];
}
export interface GenerateOptions {
outputPath: string;
overwrite?: boolean;
dryRun?: boolean;
silent?: boolean;
}
export interface PackageManager {
install: (packages: string[], dev?: boolean) => Promise<void>;
addScript: (name: string, command: string) => Promise<void>;
updatePackageJson: (updates: Record<string, any>) => Promise<void>;
}
//# sourceMappingURL=types.d.ts.map