Compare commits

...

9 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
3ef1dc2801 Merge pull request 'fix(annotations): fail-open when src/annotations missing + keep dir tracked' (#203) from chore/remove-test-anno-media-20260304-204810 into main
All checks were successful
SMOKE / smoke (push) Successful in 13s
CI / build-and-anchors (push) Successful in 44s
Deploy staging+live (annotations) / deploy (push) Successful in 8m47s
Reviewed-on: #203
2026-03-04 21:39:04 +01:00
435e41ed4d fix(annotations): fail-open when src/annotations missing + keep dir tracked
All checks were successful
SMOKE / smoke (push) Successful in 7s
CI / build-and-anchors (push) Successful in 43s
CI / build-and-anchors (pull_request) Successful in 41s
2026-03-04 21:31:53 +01:00
8825932159 Merge pull request 'chore: keep public/media directory (gitkeep)' (#202) from chore/remove-test-anno-media-20260304-204810 into main
All checks were successful
SMOKE / smoke (push) Successful in 10s
Deploy staging+live (annotations) / deploy (push) Successful in 34s
CI / build-and-anchors (push) Successful in 45s
Reviewed-on: #202
2026-03-04 21:06:45 +01:00
b55decbea4 chore: keep public/media directory (gitkeep)
All checks were successful
SMOKE / smoke (push) Successful in 4s
CI / build-and-anchors (push) Successful in 46s
CI / build-and-anchors (pull_request) Successful in 38s
2026-03-04 21:03:55 +01:00
414a848db3 Merge pull request 'chore: keep src/annotations directory (gitkeep)' (#201) from chore/remove-test-anno-media-20260304-204810 into main
All checks were successful
SMOKE / smoke (push) Successful in 5s
Deploy staging+live (annotations) / deploy (push) Successful in 39s
CI / build-and-anchors (push) Successful in 44s
Reviewed-on: #201
2026-03-04 21:03:39 +01:00
cbd4f3a57f chore: keep src/annotations directory (gitkeep)
All checks were successful
SMOKE / smoke (push) Successful in 5s
CI / build-and-anchors (push) Successful in 36s
CI / build-and-anchors (pull_request) Successful in 36s
2026-03-04 21:02:19 +01:00
3 changed files with 19 additions and 2 deletions

0
public/media/.gitkeep Normal file
View File

0
src/annotations/.gitkeep Normal file
View File

View File

@@ -103,10 +103,16 @@ export const GET: APIRoute = async () => {
const errors: Array<{ file: string; error: string }> = [];
let files: string[] = [];
let missingRoot = false;
try {
files = await walk(ANNO_ROOT);
} catch (e: any) {
throw new Error(`Missing annotations root: ${ANNO_ROOT} (${e?.message || e})`);
// ✅ FAIL-OPEN : pas dannotations => index vide (ne casse pas la build)
missingRoot = true;
console.warn(`[annotations-index] Missing annotations root: ${ANNO_ROOT} (${e?.message || e})`);
files = [];
// ✅ surtout PAS d'errors.push ici
}
for (const fp of files) {
@@ -177,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(),
@@ -186,10 +200,13 @@ export const GET: APIRoute = async () => {
paras: Object.values(pages).reduce((n, p) => n + Object.keys(p.paras || {}).length, 0),
errors: errors.length,
},
warnings,
errors,
};
if (errors.length) {
// ✅ FAIL-OPEN uniquement si le dossier manque.
// Si le dossier existe mais quun YAML est cassé -> fail-closed.
if (errors.length && !missingRoot) {
throw new Error(`${errors[0].file}: ${errors[0].error}`);
}