workspace-tools
Version:
A collection of utilities that are useful in a git-controlled monorepo managed by one of these tools:
26 lines (25 loc) • 1.16 kB
TypeScript
import type { WorkspaceInfos } from "../../types/WorkspaceInfo";
import type { Catalogs } from "../../types/Catalogs";
/** @deprecated Use `getWorkspaceManagerRoot` */
export declare function getPnpmWorkspaceRoot(cwd: string): string;
/** Get paths for each package ("workspace") in a pnpm monorepo. */
export declare function getWorkspacePackagePaths(cwd: string): string[];
/**
* Get an array with names, paths, and package.json contents for each package ("workspace")
* in a pnpm monorepo.
*/
export declare function getPnpmWorkspaces(cwd: string): WorkspaceInfos;
/**
* Get an array with names, paths, and package.json contents for each package ("workspace")
* in a pnpm monorepo.
*/
export declare function getPnpmWorkspacesAsync(cwd: string): Promise<WorkspaceInfos>;
/**
* Get version catalogs if present.
* Returns undefined if there's no catalog, or any issue reading or parsing.
* @see https://pnpm.io/catalogs
*/
export declare function getPnpmCatalogs(cwd: string): Catalogs | undefined;
export { getPnpmWorkspaces as getWorkspaces };
export { getPnpmWorkspacesAsync as getWorkspacesAsync };
export { getPnpmCatalogs as getCatalogs };