MCPcopy Index your code
hub / github.com/code-pushup/cli / listWorkspaces

Function listWorkspaces

packages/utils/src/lib/workspace-packages.ts:32–43  ·  view source on GitHub ↗
(
  cwd: string,
)

Source from the content-addressed store, hash-verified

30}
31
32export async function listWorkspaces(
33 cwd: string,
34): Promise<{ workspaces: WorkspacePackage[]; rootPackageJson: PackageJson }> {
35 const rootPackageJson = await readRootPackageJson(cwd);
36 const patterns = Array.isArray(rootPackageJson.workspaces)
37 ? rootPackageJson.workspaces
38 : rootPackageJson.workspaces?.packages;
39 return {
40 workspaces: await listPackages(cwd, patterns),
41 rootPackageJson,
42 };
43}
44
45export async function hasWorkspacesEnabled(cwd: string): Promise<boolean> {
46 const packageJson = await readRootPackageJson(cwd);

Callers 4

listWorkspaceProjectsFunction · 0.90
listProjectsFunction · 0.90
listProjectsFunction · 0.90

Calls 2

readRootPackageJsonFunction · 0.85
listPackagesFunction · 0.85

Tested by

no test coverage detected