studioApps
The codebase's apps: what tcm dev is pointed at (isApp: a browser entry point nothing calls; not a test), by
name.
import type { Codebase } from "#codebase/tcmts/cli/codebase"; import { isApp } from "#codebase/tcmts/cli/pages"; import type { Placement } from "#codebase/tcmts/cli/placement"; import { isTestPath } from "#codebase/tcmts/cli/testing"; export function studioApps(cb: Codebase, placement: Placement): { path: string; hash: string }[] { return cb.store .names() .filter( (n) => n.kind === "term" && !isTestPath(n.path) && isApp(cb, n.hash, cb.store.getDef(n.hash)!, placement), ) .map((n) => ({ path: n.path, hash: n.hash })) .sort((a, b) => a.path.localeCompare(b.path)); }
uses
- tcmts.cli.codebase.Codebase
- tcmts.cli.pages.isApp
- tcmts.cli.placement.Placement
- tcmts.cli.testing.isTestPath