Skip to main content

Module schema

Module schema 

Source
Expand description

fdl schema sub-command: discover every cache under the project, report fresh / stale / orphan states, and clear or refresh on demand. The Schema type itself lives in config. fdl schema — inspect, clear, and refresh cached --fdl-schema outputs across the project.

Caches live at <cmd_dir>/.fdl/schema-cache/<cmd-name>.json (see crate::schema_cache for the per-command mechanics). This module walks the project tree to find every cache, reports staleness, and exposes clear / refresh operations. It’s intentionally a filesystem scan rather than a command-graph walk: any layout that ends up writing a cache file gets discovered, regardless of how the commands: tree is shaped.

Structs§

CacheEntry
One cached schema discovered on disk.
RefreshResult

Enums§

CacheStatus
Freshness of a cache file relative to its source fdl.yml.

Functions§

clear_caches
Delete cache files. filter restricts the operation to a single command name; None clears all discovered caches. Empty parent .fdl/schema-cache/ and .fdl/ dirs are removed when nothing else lives inside them. Returns the list of removed cache paths.
discover_caches
Scan project_root recursively for .fdl/schema-cache/*.json files. Skips common noise dirs (SKIP_DIRS). Results are sorted by cache path for stable fdl schema list output.
refresh_caches
Probe each cached command’s entry and rewrite its cache file. filter scopes to a single command name. Returns per-cache results so the caller can print a summary.