@git.zone/cli
Version:
A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.
78 lines (77 loc) • 1.96 kB
TypeScript
export interface IRegisteredProject {
projectPath: string;
projectName: string;
containers: {
mongo?: string;
minio?: string;
elasticsearch?: string;
};
ports: {
mongo?: number;
s3?: number;
s3Console?: number;
elasticsearch?: number;
};
enabledServices: string[];
lastActive: number;
}
export interface IGlobalRegistryData {
projects: {
[projectPath: string]: IRegisteredProject;
};
}
export declare class GlobalRegistry {
private static instance;
private kvStore;
private docker;
private constructor();
/**
* Get the singleton instance
*/
static getInstance(): GlobalRegistry;
/**
* Register or update a project in the global registry
*/
registerProject(data: Omit<IRegisteredProject, 'lastActive'>): Promise<void>;
/**
* Remove a project from the registry
*/
unregisterProject(projectPath: string): Promise<void>;
/**
* Update the lastActive timestamp for a project
*/
touchProject(projectPath: string): Promise<void>;
/**
* Get all registered projects
*/
getAllProjects(): Promise<{
[path: string]: IRegisteredProject;
}>;
/**
* Check if a project is registered
*/
isRegistered(projectPath: string): Promise<boolean>;
/**
* Get status of all containers across all registered projects
*/
getGlobalStatus(): Promise<Array<{
projectPath: string;
projectName: string;
containers: Array<{
name: string;
status: string;
}>;
lastActive: number;
}>>;
/**
* Stop all containers across all registered projects
*/
stopAll(): Promise<{
stopped: string[];
failed: string[];
}>;
/**
* Remove stale registry entries (projects that no longer exist on disk)
*/
cleanup(): Promise<string[]>;
}