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.56 kB
TypeScript
/**
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
* into absolute package paths. Returns an empty array if the `workspaces` property is not found or
* there's some other issue.
*/
export declare function getPackagePathsFromWorkspaceRoot(root: string): string[];
/**
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
* into absolute package paths. Returns an empty array if the `workspaces` property is not found or
* there's some other issue.
*/
export declare function getPackagePathsFromWorkspaceRootAsync(root: string): Promise<string[]>;
/**
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
* into an array with names, paths, and package.json contents for each package (each "workspace"
* in npm/yarn/pnpm terms). Returns an empty array if there's any issue.
*/
export declare function getWorkspaceInfoFromWorkspaceRoot(root: string): import("../..").WorkspaceInfos;
/**
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
* into an array with names, paths, and package.json contents for each package (each "workspace"
* in npm/yarn/pnpm terms). Returns an empty array if there's any issue.
*
* NOTE: As of writing, this will start promises to read all package.json files in parallel,
* without direct concurrency control.
*/
export declare function getWorkspaceInfoFromWorkspaceRootAsync(root: string): Promise<import("../..").WorkspaceInfos>;