UNPKG

@elsikora/setup-wizard

Version:

Setup Wizard - CLI scaffolding utility

57 lines (56 loc) 2.73 kB
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 .gitignore file. * Provides functionality to create a comprehensive .gitignore file * that helps prevent unwanted files from being tracked by Git. */ export declare class GitignoreModuleService 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; /** * Initializes a new instance of the GitignoreModuleService. * @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 .gitignore setup. * Checks for existing .gitignore file and asks if user wants to replace it. * @returns Promise resolving to true if setup should proceed, false otherwise */ handleExistingSetup(): Promise<boolean>; /** * Installs and configures .gitignore. * Generates a new .gitignore file with common patterns. * @returns Promise resolving to the module setup result */ install(): Promise<IModuleSetupResult>; /** * Determines if .gitignore should be installed. * Asks the user if they want to generate a .gitignore file. * 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 the setup results. * Lists what was included in the generated .gitignore file. * @param isSuccess - Whether the setup was successful * @param error - Optional error if setup failed */ private displaySetupSummary; /** * Generates a new .gitignore file. * @returns Promise resolving to an object indicating success or failure with optional error */ private generateNewGitignore; }