import type { ShellCommand } from "../shell-types"; import type { PmDeps } from "./pm-types"; import { VERSIONS } from "../../constants/config"; const A_RESET = "\x1b[0m"; const A_BOLD = "\x1b[1m"; const A_CYAN = "\x1b[36m"; export function createPnpmCommand(deps: PmDeps): ShellCommand { return { name: "pnpm", async execute(params, ctx) { if (!deps.hasFile("/")) return { stdout: "", stderr: "Volume unavailable\n", exitCode: 1 }; const sub = params[0]; if (!sub || sub === "help" || sub === "--help") { return { stdout: `${A_BOLD}Usage:${A_RESET} pnpm \n\n` + `${A_BOLD}Manage your dependencies:${A_RESET}\n` + ` ${A_CYAN}add${A_RESET} [pkg] Install packages\n` + ` ${A_CYAN}install${A_RESET} Install from manifest\n` + ` ${A_CYAN}remove${A_RESET} Remove a package\n` + ` ${A_CYAN}list${A_RESET} List installed packages\n\n` + `${A_BOLD}Run your scripts:${A_RESET}\n` + ` ${A_CYAN}run${A_RESET}