ConfigProblemtypeno test imports ittype ConfigProblem = { readonly code: "E-CONFIG-LOAD" | "E-CONFIG-INVALID"; readonly message: string };Why a configuration could not be had.
How the program finds and loads its configuration (commons anyfs-cli 0004-anyfs-cli-surfaces FR-004): --config FILE, else the first anyfs.config.ts from the working folder up to the root of the checkout (the first folder that holds .git, which is searched too), else the one in the user's configuration folder. The file is imported as TypeScript (which Bun and Node 26 both run), its default export, or its export config, is read by parseConfig, and every way it can fail is a typed problem with its code. No file is not a problem: the program works on plain paths and addresses without one.
import { findConfigFile } from "./config-load.ts";
findConfigFile("/nowhere/at/all", undefined, () => undefined); // undefinedConfigProblemtypeno test imports ittype ConfigProblem = { readonly code: "E-CONFIG-LOAD" | "E-CONFIG-INVALID"; readonly message: string };Why a configuration could not be had.
findConfigFilefunctionfunction findConfigFile(from: string, explicit: string | undefined, env: (name: string) => string | undefined): string | undefinedThe configuration's file: the one --config names, else the first from a folder up to the root of the checkout, else the user's.
loadConfigFilefunctionno test imports itfunction loadConfigFile(file: string): Promise<Result<Config, ConfigProblem>>Loads a configuration file, or says why it could not be. Each load is a fresh import of the file, so that a file that changed is read again in the same process.