@elsikora/setup-wizard
Version:
Setup Wizard - CLI scaffolding utility
78 lines (77 loc) • 3.66 kB
TypeScript
import type { IModuleService } from "../../infrastructure/interface/module-service.interface";
import type { ICliInterfaceService } from "../interface/cli-interface-service.interface";
import type { IConfigService } from "../interface/config-service.interface";
import type { IFileSystemService } from "../interface/file-system-service.interface";
import type { IModuleSetupResult } from "../interface/module-setup-result.interface";
/**
* Service for setting up and managing IDE-specific configurations.
* Provides functionality to generate editor configurations for different IDEs
* to ensure consistent code style and linting settings.
*/
export declare class IdeModuleService implements IModuleService {
/** CLI interface service for user interaction */
readonly CLI_INTERFACE_SERVICE: ICliInterfaceService;
/** Configuration service for managing app configuration */
readonly CONFIG_SERVICE: IConfigService;
/** File system service for file operations */
readonly FILE_SYSTEM_SERVICE: IFileSystemService;
/** Cached IDE configuration */
private config;
/** Selected IDEs to configure */
private selectedIdes;
/**
* Initializes a new instance of the IdeModuleService.
* @param cliInterfaceService - Service for CLI user interactions
* @param fileSystemService - Service for file system operations
* @param configService - Service for managing app configuration
*/
constructor(cliInterfaceService: ICliInterfaceService, fileSystemService: IFileSystemService, configService: IConfigService);
/**
* Handles existing IDE configuration setup.
* Checks for existing configuration files and asks for user confirmation if found.
* @returns Promise resolving to true if setup should proceed, false otherwise
*/
handleExistingSetup(): Promise<boolean>;
/**
* Installs and configures IDE-specific settings.
* Guides the user through selecting IDEs and generating configuration files.
* @returns Promise resolving to the module setup result
*/
install(): Promise<IModuleSetupResult>;
/**
* Determines if IDE configuration should be installed.
* Asks the user if they want to set up IDE configurations for their project.
* Uses the saved config value as default if it exists.
* @returns Promise resolving to true if the module should be installed, false otherwise
*/
shouldInstall(): Promise<boolean>;
/**
* Displays a summary of successful and failed IDE configuration setups.
* @param successful - Array of successfully set up IDE configurations
* @param failed - Array of IDE configurations that failed to set up
*/
private displaySetupSummary;
/**
* Finds existing IDE configuration files that might be overwritten.
* @returns Promise resolving to an array of file paths for existing configuration files
*/
private findExistingConfigFiles;
/**
* Prompts the user to select which IDEs they want to configure.
* @param savedIdes - Previously saved IDE selections
* @returns Promise resolving to an array of selected IDE enum values
*/
private selectIdes;
/**
* Sets up configuration for a specific IDE.
* Creates necessary directories and configuration files.
* @param ide - The IDE to set up configuration for
* @returns Promise resolving to an object indicating success or failure with optional error
*/
private setupIde;
/**
* Sets up configuration for all selected IDEs.
* Creates and writes IDE-specific configuration files.
*/
private setupSelectedIdes;
}