UNPKG

@tryloop/oats

Version:

🌾 OATS - OpenAPI TypeScript Sync. The missing link between your OpenAPI specs and TypeScript applications. Automatically watch, generate, and sync TypeScript clients from your API definitions.

73 lines • 1.94 kB
/** * Package Link Manager * * Manages npm/yarn/pnpm package linking and unlinking operations * with proper error handling and verification * * @module @oatsjs/utils/link-manager */ import type { RuntimeConfig } from '../types/config.types.js'; export interface LinkInfo { packageName: string; clientPath: string; frontendPath?: string; linkedAt: Date; } export declare class LinkManager { private static instance; private logger; private linkedPackages; private isShuttingDown; private constructor(); /** * Get singleton instance */ static getInstance(): LinkManager; /** * Detect package manager for a project */ private detectPackageManager; /** * Execute a command with error handling */ private runCommand; /** * Link a package from client to frontend */ linkPackage(packageName: string, clientPath: string, frontendPath: string, config?: RuntimeConfig): Promise<void>; /** * Unlink a specific package */ private unlinkPackage; /** * Unlink all packages on shutdown */ unlinkAll(config?: RuntimeConfig): Promise<void>; /** * Run install command in frontend directories after unlinking */ private runInstallInFrontends; /** * Get information about linked packages */ getLinkedPackages(): ReadonlyMap<string, LinkInfo>; /** * Check if a package is linked */ isPackageLinked(packageName: string): boolean; /** * Clear all linked packages without unlinking * (useful for testing or when packages are already unlinked externally) */ clearLinkedPackages(): void; /** * Get link status summary */ getLinkStatus(): { count: number; packages: string[]; oldestLink?: Date; }; } export declare const linkManager: LinkManager; //# sourceMappingURL=link-manager.d.ts.map