@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
152 lines (151 loc) • 4.88 kB
TypeScript
import { EventEmitter } from 'events';
export interface UserProfile {
id: string;
name: string;
email?: string;
preferences: UserPreferences;
metadata: {
created: Date;
lastUpdated: Date;
version: string;
};
}
export interface UserPreferences {
cli: {
packageManager: 'npm' | 'yarn' | 'pnpm' | 'bun' | 'auto';
defaultFramework: 'react' | 'vue' | 'svelte' | 'angular' | 'vanilla';
typescript: boolean;
skipConfirmations: boolean;
verboseOutput: boolean;
colorOutput: boolean;
autoUpdate: boolean;
telemetry: boolean;
};
development: {
defaultTemplate: string;
autoInstallDependencies: boolean;
generateDocumentation: boolean;
setupTesting: boolean;
setupLinting: boolean;
setupFormatting: boolean;
gitInitialization: boolean;
dockerConfiguration: boolean;
};
editor: {
preferred: 'vscode' | 'webstorm' | 'atom' | 'sublime' | 'vim' | 'none';
generateConfig: boolean;
installExtensions: boolean;
formatOnSave: boolean;
};
project: {
workspaceLayout: 'nested' | 'flat' | 'monorepo';
namingConvention: 'camelCase' | 'kebab-case' | 'snake_case' | 'PascalCase';
fileOrganization: 'feature' | 'type' | 'domain';
testLocation: 'colocated' | 'separate' | '__tests__';
};
build: {
bundler: 'webpack' | 'vite' | 'rollup' | 'parcel' | 'auto';
target: 'es2015' | 'es2018' | 'es2020' | 'esnext';
optimization: 'development' | 'production' | 'auto';
sourceMaps: boolean;
minification: boolean;
treeshaking: boolean;
};
ui: {
theme: 'auto' | 'light' | 'dark';
animations: boolean;
progressIndicators: boolean;
sounds: boolean;
notifications: boolean;
};
performance: {
monitoring: boolean;
profiling: boolean;
caching: boolean;
parallelBuilds: boolean;
memoryLimit: number;
};
plugins: {
autoInstall: boolean;
autoUpdate: boolean;
allowBeta: boolean;
marketplaceUrl: string;
trustedPublishers: string[];
};
custom: Record<string, any>;
}
export interface PreferenceSchema {
[key: string]: {
type: 'string' | 'number' | 'boolean' | 'array' | 'object';
default: any;
description: string;
choices?: any[];
min?: number;
max?: number;
validator?: (value: any) => boolean | string;
category: string;
advanced?: boolean;
};
}
export interface PreferenceUpdate {
key: string;
oldValue: any;
newValue: any;
timestamp: Date;
source: 'user' | 'migration' | 'import' | 'reset';
}
export declare class UserPreferenceManager extends EventEmitter {
private globalConfigPath;
private userProfilesPath;
private currentProfile?;
private schema;
private updateHistory;
constructor();
private createSchema;
private loadOrCreateProfile;
private createDefaultProfile;
private createDefaultPreferences;
private migrateProfile;
private generateProfileId;
private mergeDeep;
get<T = any>(key: string, defaultValue?: T): T;
set(key: string, value: any, source?: 'user' | 'migration' | 'import' | 'reset'): void;
private validateValue;
private getNestedValue;
private setNestedValue;
has(key: string): boolean;
delete(key: string): void;
private deleteNestedValue;
reset(category?: string): void;
getAll(): UserPreferences;
getCurrentProfile(): UserProfile | undefined;
createProfile(name: string, basedOn?: string): UserProfile;
loadProfile(id: string): UserProfile | null;
switchProfile(id: string): boolean;
listProfiles(): Array<{
id: string;
name: string;
lastUpdated: Date;
}>;
deleteProfile(id: string): boolean;
exportProfile(id?: string): string;
importProfile(data: string): UserProfile;
private saveProfile;
private saveProfileToFile;
getSchema(): PreferenceSchema;
getSchemaByCategory(category: string): PreferenceSchema;
getCategories(): string[];
getUpdateHistory(): PreferenceUpdate[];
getPackageManager(): string;
getDefaultFramework(): string;
isTypescriptDefault(): boolean;
shouldSkipConfirmations(): boolean;
isVerboseOutput(): boolean;
isColorOutputEnabled(): boolean;
isTelemetryEnabled(): boolean;
getPreferredEditor(): string;
shouldAutoInstallDependencies(): boolean;
}
export declare function createUserPreferenceManager(): UserPreferenceManager;
export declare function getGlobalUserPreferences(): UserPreferenceManager;
export declare function setGlobalUserPreferences(preferences: UserPreferenceManager): void;