ktx/packages/cli/src/cli-project.ts

21 lines
652 B
TypeScript
Raw Normal View History

import { loadKtxProject, type KtxLocalProject } from '@ktx/context/project';
export interface LoadKtxCliProjectOptions {
projectDir: string;
}
export interface LoadKtxCliProjectDeps {
loadProject?: typeof loadKtxProject;
}
/**
* Thin wrapper around `loadKtxProject`. Kept as a single entrypoint so the CLI can grow shared
* pre-load behavior later (telemetry, project lock, etc.). Today it does no extra work.
*/
export async function loadKtxCliProject(
options: LoadKtxCliProjectOptions,
deps: LoadKtxCliProjectDeps = {},
): Promise<KtxLocalProject> {
return (deps.loadProject ?? loadKtxProject)({ projectDir: options.projectDir });
}