Compare commits

...

3 Commits

Author SHA1 Message Date
4dfd3b026b chore: merge main into fix branch
All checks were successful
SMOKE / smoke (push) Successful in 5s
CI / build-and-anchors (push) Successful in 41s
CI / build-and-anchors (pull_request) Successful in 38s
2026-03-06 11:14:48 +01:00
c93f274f41 Merge pull request 'fix(annotations): fail-open when src/annotations is missing' (#204) from fix/annotations-index-fail-open-20260304-223909 into main
All checks were successful
SMOKE / smoke (push) Successful in 14s
CI / build-and-anchors (push) Successful in 46s
Deploy staging+live (annotations) / deploy (push) Successful in 8m58s
Reviewed-on: #204
2026-03-04 22:42:13 +01:00
dfa311fb5b fix(annotations): fail-open when src/annotations is missing
All checks were successful
SMOKE / smoke (push) Successful in 18s
CI / build-and-anchors (push) Successful in 40s
CI / build-and-anchors (pull_request) Successful in 41s
2026-03-04 22:39:09 +01:00

View File

@@ -112,7 +112,7 @@ export const GET: APIRoute = async () => {
missingRoot = true;
console.warn(`[annotations-index] Missing annotations root: ${ANNO_ROOT} (${e?.message || e})`);
files = [];
errors.push({ file: "src/annotations", error: `Missing annotations root: ${e?.message || e}` });
// ✅ surtout PAS d'errors.push ici
}
for (const fp of files) {
@@ -183,6 +183,14 @@ export const GET: APIRoute = async () => {
pg.paras = next;
}
const warnings: Array<{ where: string; warning: string }> = [];
if (missingRoot) {
warnings.push({
where: "src/pages/annotations-index.json.ts",
warning: `Missing annotations root "${ANNO_ROOT}" (treated as empty).`,
});
}
const out = {
schema: 1,
generatedAt: new Date().toISOString(),
@@ -192,6 +200,7 @@ export const GET: APIRoute = async () => {
paras: Object.values(pages).reduce((n, p) => n + Object.keys(p.paras || {}).length, 0),
errors: errors.length,
},
warnings,
errors,
};