The Loader verifier matched docs/cordis-primer.i18n.yaml solely because its basename contained cordis. Centralize file discovery, exclude i18n sidecars, and cover Loader YAML plus excluded trees with a regression test.
19 lines
582 B
TypeScript
19 lines
582 B
TypeScript
/** Cordis Loader configuration file discovery. */
|
|
|
|
import { globSync } from 'node:fs'
|
|
|
|
/**
|
|
* Return repository-relative Cordis Loader YAML paths under `root`.
|
|
*
|
|
* Translation consistency records are YAML sidecars, never Loader inputs.
|
|
*
|
|
* @param root Repository root to scan.
|
|
* @returns Sorted repository-relative Loader configuration paths.
|
|
*/
|
|
export function cordisConfigFiles(root: string): string[] {
|
|
return globSync(['**/*cordis*.yml', '**/*cordis*.yaml'], {
|
|
cwd: root,
|
|
exclude: ['.claude/**', 'node_modules/**', 'vendor/**', '**/*.i18n.yaml'],
|
|
}).sort()
|
|
}
|