WOD : séance à format, chrono et score (lot 4b, ADR 0010)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-18 14:51:56 +01:00
co-authored by Claude Opus 5.5
parent d9604d43ec
commit ee3f55a515
21 changed files with 887 additions and 13 deletions
+3
View File
@@ -3,6 +3,7 @@
import { EXERCISES } from "./exercises.js";
import { TRACKING_MODES, ZONES, INTENSITIES } from "./vocabulary.js";
import { validateFormat } from "./wod.js";
/**
* Un exercice tel qu'écrit dans le programme : une référence à la bibliothèque
@@ -30,6 +31,7 @@ import { TRACKING_MODES, ZONES, INTENSITIES } from "./vocabulary.js";
* @property {string} [color] #RRGGBB
* @property {string} [tag]
* @property {ProgramExercise[]} exercises
* @property {import("./wod.js").WodFormat} [format] séance WOD (AMRAP, EMOM…), ADR 0010
* @property {WarmupItem[]} [warmup] échauffement propre à la séance ; omis :
* l'échauffement standard (warmup.js) ; liste vide : aucun
*/
@@ -122,6 +124,7 @@ export function validateProgram(program) {
if (e.mistakes !== undefined && !isTextList(e.mistakes)) errors.push(`${ex} : 'mistakes' doit être une liste de phrases.`);
if (e.tutorial !== undefined && !/^https:\/\//.test(e.tutorial)) errors.push(`${ex} : 'tutorial' doit être une adresse https.`);
});
if (s.format !== undefined) errors.push(...validateFormat(s.format, where));
if (s.warmup !== undefined) {
if (!Array.isArray(s.warmup) || s.warmup.length > 12) errors.push(`${where} : 'warmup' doit être une liste de 0 à 12 étapes.`);
else s.warmup.forEach((/** @type {any} */ w, /** @type {number} */ j) => {