MCPcopy
hub / github.com/loopbackio/loopback-next / getPackages

Function getPackages

packages/tsdocs/src/helper.ts:60–79  ·  view source on GitHub ↗
(
  rootDir = process.cwd(),
)

Source from the content-addressed store, hash-verified

58 * @param rootDir - Root directory
59 */
60export async function getPackages(
61 rootDir = process.cwd(),
62): Promise<LernaPackage[]> {
63 const {content: rootPkg} = await pkgJson.load(rootDir);
64 const workspaces = await mapWorkspaces({cwd: rootDir, pkg: rootPkg});
65 const packages: LernaPackage[] = await Promise.all(
66 Array.from(workspaces, async ([name, location]) => {
67 const {content: pkg} = await pkgJson.load(location);
68 return {
69 name,
70 location,
71 rootPath: rootDir,
72 manifestLocation: path.join(location, 'package.json'),
73 private: pkg.private ?? false,
74 };
75 }),
76 );
77 packages.sort((p1, p2) => p1.location.localeCompare(p2.location));
78 return packages;
79}
80
81/**
82 * Check if a package should be processed for tsdocs

Callers 2

getPackagesWithTsDocsFunction · 0.85
getSortedPackagesFunction · 0.85

Calls 1

loadMethod · 0.65

Tested by

no test coverage detected