import type { PowerhouseConfig } from "@powerhousedao/config"; import type { Command } from "commander"; export declare const POWERHOUSE_CONFIG_FILE = "powerhouse.config.json"; export declare const POWERHOUSE_GLOBAL_DIR: string; export declare const SUPPORTED_PACKAGE_MANAGERS: string[]; export declare const packageManagers: { bun: { globalPathRegexp: RegExp; installCommand: string; uninstallCommand: string; workspaceOption: string; lockfile: string; updateCommand: string; buildAffected: string; }; pnpm: { globalPathRegexp: RegExp; installCommand: string; uninstallCommand: string; workspaceOption: string; lockfile: string; updateCommand: string; buildAffected: string; }; yarn: { globalPathRegexp: RegExp; installCommand: string; uninstallCommand: string; workspaceOption: string; lockfile: string; updateCommand: string; buildAffected: string; }; npm: { installCommand: string; uninstallCommand: string; workspaceOption: string; lockfile: string; updateCommand: string; buildAffected: string; }; }; type PathValidation = (dir: string) => boolean; export type PackageManager = "npm" | "yarn" | "pnpm" | "bun"; export type ProjectInfo = { isGlobal: boolean; path: string; packageManager: PackageManager; }; export declare function defaultPathValidation(): boolean; export declare function isPowerhouseProject(dir: string): boolean; export declare function findNodeProjectRoot(dir: string, pathValidation?: PathValidation): string | null; export declare function getProjectInfo(debug?: boolean): ProjectInfo; /** * Generates a unique drive ID based on the project path. * The same project path will always generate the same ID. * @param name - The name prefix for the drive ID (e.g., "vetra", "powerhouse") * @returns A unique drive ID in the format "{name}-{hash}" */ export declare function generateProjectDriveId(name: string): string; export declare function getPackageManagerFromLockfile(dir: string): PackageManager; export declare function updatePackagesArray(currentPackages: PowerhouseConfig["packages"], dependencies: { name: string; version: string | undefined; full: string; }[], task?: "install" | "uninstall"): PowerhouseConfig["packages"]; export declare function updateConfigFile(dependencies: { name: string; version: string | undefined; full: string; }[], projectPath: string, task?: "install" | "uninstall"): void; /** * Recursively searches for a specific file by traversing up the directory tree. * Starting from the given path, it checks each parent directory until it finds * the target file or reaches the root directory. * * @param startPath - The absolute path of the directory to start searching from * @param targetFile - The name of the file to search for (e.g., 'package.json', 'pnpm-workspace.yaml') * @returns The absolute path of the directory containing the target file, or null if not found * * @example * // Find the workspace root directory * const workspaceRoot = findContainerDirectory('/path/to/project/src', 'pnpm-workspace.yaml'); * * // Find the nearest package.json * const packageDir = findContainerDirectory('/path/to/project/src/components', 'package.json'); */ export declare const findContainerDirectory: (startPath: string, targetFile: string) => string | null; /** * Applies custom help formatting to a command to avoid duplication in help output * * @param command - The Command instance to enhance * @param helpText - The custom help text to display * @returns The command for chaining */ export declare function setCustomHelp(command: Command, helpText: string): Command; /** * Updates the styles.css file to include imports for newly installed packages * @param dependencies - Array of dependencies that were installed * @param projectPath - Path to the project root */ export declare function updateStylesFile(dependencies: { name: string; version: string | undefined; full: string; }[], projectPath: string): void; /** * Removes CSS imports for uninstalled packages from styles.css */ export declare function removeStylesImports(dependencies: { name: string; version: string | undefined; full: string; }[], projectPath: string): void; export {}; //# sourceMappingURL=utils.d.ts.map