UNPKG

@elsikora/setup-wizard

Version:

Setup Wizard - CLI scaffolding utility

90 lines 4.18 kB
import type { IModuleService } from "../../infrastructure/interface/module-service.interface"; import type { ICliInterfaceService } from "../interface/cli-interface-service.interface"; import type { ICommandService } from "../interface/command-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"; import { PackageJsonService } from "./package-json.service"; /** * Service for setting up and managing branch-lint configuration. * Provides functionality to enforce consistent branch naming conventions * and simplify branch creation using an interactive interface. */ export declare class BranchLintModuleService implements IModuleService { /** CLI interface service for user interaction */ readonly CLI_INTERFACE_SERVICE: ICliInterfaceService; /** Command service for executing shell commands */ readonly COMMAND_SERVICE: ICommandService; /** Configuration service for managing app configuration */ readonly CONFIG_SERVICE: IConfigService; /** File system service for file operations */ readonly FILE_SYSTEM_SERVICE: IFileSystemService; /** Service for managing package.json */ readonly PACKAGE_JSON_SERVICE: PackageJsonService; /** Cached branch-lint module configuration */ private config; /** * Initializes a new instance of the BranchLintModuleService. * @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 branch-lint setup. * Checks for existing configuration files and asks if user wants to remove them. * @returns Promise resolving to true if setup should proceed, false otherwise */ handleExistingSetup(): Promise<boolean>; /** * Installs and configures branch-lint. * Sets up configuration files, git hooks, and package.json scripts. * @returns Promise resolving to the module setup result */ install(): Promise<IModuleSetupResult>; /** * Determines whether optional ticket-id placeholder should be enabled. * Uses saved module configuration as default value. * @returns Promise resolving to true when ticket-id placeholder should be enabled */ shouldEnableTicketId(): Promise<boolean>; /** * Determines if branch-lint should be installed. * Asks the user if they want to set up these tools 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>; /** * Creates the branch-lint configuration file. * @param isTicketIdEnabled - Whether optional ticket-id placeholder should be enabled */ private createConfigs; /** * Displays a summary of the setup results. * @param isTicketIdEnabled - Whether optional ticket-id placeholder is enabled */ private displaySetupSummary; /** * Finds existing branch-lint configuration files. * @returns Promise resolving to an array of file paths for existing configuration files */ private findExistingConfigFiles; /** * Sets up branch-lint. * Installs dependencies, creates configuration files, and configures git hooks. * @param isTicketIdEnabled - Whether optional ticket-id placeholder should be enabled */ private setupBranchLint; /** * Sets up Husky git hooks. * Initializes Husky, adds prepare script, and creates pre-push hook. */ private setupHusky; /** * Sets up npm scripts for Branch-lint. * Adds 'branch' script for using an interactive interface CLI. */ private setupScripts; } //# sourceMappingURL=branch-lint-module.service.d.ts.map