MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / findWorkspacePackages

Function findWorkspacePackages

scripts/check-changelog-stubs.ts:28–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26type Pkg = { name?: string; private?: boolean };
27
28const findWorkspacePackages = (): string[] => {
29 const root = JSON.parse(readFileSync(resolve(repoRoot, "package.json"), "utf8")) as {
30 workspaces?: string[];
31 };
32 const patterns = root.workspaces ?? [];
33 const dirs = new Set<string>();
34 for (const pattern of patterns) {
35 // Bun.Glob — handles workspace patterns like "packages/*/*", "apps/*"
36 for (const match of new Bun.Glob(`${pattern}/package.json`).scanSync({ cwd: repoRoot })) {
37 dirs.add(dirname(resolve(repoRoot, match)));
38 }
39 }
40 return [...dirs].sort();
41};
42
43const STUB_TEMPLATE = (name: string) => `# ${name}\n`;
44

Callers 1

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected