/** * Finding the workspace, and the modules inside it. * * The Node half of `telo-workspace.yaml`: walking up from the cwd to find the * marker, and filtering its named subtrees down to actual modules. Finding the * marker is `workspace-marker.ts`'s — its location is a general anchor, not a * release concept — and parsing it is the analyzer's * (`release/workspace-config.ts`), so the editor reads the same file the same * way. * * **Discovery, not registration.** Nothing lists the modules: `modules/sql` is a * module because `modules/sql/telo.yaml` carries a `metadata.version`, and that * one field is both the declaration and the current value. Changie's generated * `projects:` list was the alternative, and it needed a CI check to catch itself * drifting. * * The rule is deliberately the module DOC's version rather than any manifest in * the directory — the looser reading admits `apps/hub/test-suite-e2e.yaml`'s * `version: 1.0.0` as a second module — and a listed directory holding no * manifest simply is not one, which is how `apps/hub-web` and `apps/telo-editor` * fall out. */ import { type ArtifactKind, type ModuleKey, type WorkspaceConfig } from "@telorun/analyzer"; export interface DiscoveredModule { readonly key: ModuleKey; /** Absolute path of the module's directory. */ readonly dir: string; /** Absolute path of its `telo.yaml`. */ readonly manifestPath: string; /** `metadata.name`, for display. */ readonly name: string; readonly version: string; readonly artifactKind: ArtifactKind; } export interface Workspace { /** Absolute path of the directory holding `telo-workspace.yaml` — the anchor * every key, ledger entry and fragment path is relative to. */ readonly root: string; readonly config: WorkspaceConfig; readonly modules: readonly DiscoveredModule[]; } export declare class WorkspaceNotFoundError extends Error { } /** * Load the workspace rooted at or above `from`. * * Absence is an actionable error naming the file to create, never a guess at the * layout: guessing is what the retired scripts did by hardcoding this repo's * `modules/*` and `apps/*` globs into a feature meant to serve any module repo. */ export declare function loadWorkspace(from?: string): Workspace; /** Look a module up by key, with a message that lists what does exist — the * common mistake is a bare name (`sql`) where a path (`modules/sql`) is * wanted. */ export declare function requireModule(workspace: Workspace, key: string): DiscoveredModule; //# sourceMappingURL=workspace.d.ts.map