import { createValidator } from "../schema-loader.js";
import { validateFiles } from "../validate.js";
import { formatReport } from "../report.js";
export async function validateAllCommand(opts) {
    const ajv = createValidator();
    const coreResult = await validateFiles(ajv, "core/**/*.json");
    const enrichmentResult = await validateFiles(ajv, "enrichment/**/*.json");
    const combined = {
        totalFiles: coreResult.totalFiles + enrichmentResult.totalFiles,
        totalItems: coreResult.totalItems + enrichmentResult.totalItems,
        passed: coreResult.passed + enrichmentResult.passed,
        failed: coreResult.failed + enrichmentResult.failed,
        errors: [...coreResult.errors, ...enrichmentResult.errors],
    };
    const output = formatReport(combined, opts.reporter);
    console.log(output);
    if (combined.failed > 0) {
        process.exit(1);
    }
}
//# sourceMappingURL=validate-all.js.map