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