@nu-art/commando
Version:
Shell command execution framework with interactive sessions, CLI parameter resolution, and plugin system for building and executing shell scripts programmatically
68 lines (67 loc) • 2.36 kB
TypeScript
import { Logger } from '@nu-art/ts-common';
import { Commando_PNPM } from '../plugins/pnpm.js';
/**
* PNPM package manager service for managing PNPM installations.
*
* Handles installation, version management, and package operations.
* Works with Commando_PNPM plugin to execute PNPM commands.
*
* **Features**:
* - Install/uninstall PNPM
* - Version management
* - Package installation
* - Environment variable configuration
*/
export declare class Cli_PNPM extends Logger {
private _expectedVersion;
private _homeEnvVar;
constructor();
get homeEnvVar(): string;
set homeEnvVar(value: string);
get expectedVersion(): string;
set expectedVersion(value: string);
/**
* Installs PNPM with the expected version.
*
* Checks if PNPM is already installed with the expected version.
* Uninstalls and reinstalls if version mismatch.
*
* @param commando - Commando_PNPM instance to use for installation
* @returns This instance for method chaining
*/
install: (commando: Commando_PNPM) => Promise<this | undefined>;
/**
* Checks if PNPM is installed.
*
* Verifies environment variable is set.
*
* @returns True if PNPM_HOME environment variable is set
*/
isInstalled: () => boolean;
/**
* Installs packages using PNPM.
*
* Delegates to Commando_PNPM.installPackages().
*
* @param commando - Commando_PNPM instance to use
* @returns Promise that resolves when packages are installed
*/
installPackages: (commando: Commando_PNPM) => Promise<Commando_PNPM>;
/**
* Uninstalls PNPM by removing its home directory.
*
* @returns Promise that resolves when uninstall completes
*/
uninstall: () => Promise<void>;
/**
* Asynchronously creates a workspace file with a list of packages.
* Each package is listed under the 'packages:' section in the file.
*
* @param listOfLibs An array of library names to include in the workspace.
* @param pathToWorkspaceFolder The filesystem path where the workspace file will be written.
* @example
* await createWorkspace(['pack1', 'pack2'], './path/to/workspace.yaml');
*/
createWorkspace: (listOfLibs: string[], pathToWorkspaceFolder?: string) => Promise<void>;
}
export declare const PNPM: Cli_PNPM;