cnumr / cnumr/best-practices

fix: corriger le champ tiers (string → array) dans les fiches MDX

Open Beginner friendly
#601 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
496
Forks
69
PR merge metrics
No merged PRs in 30d

Description

## Contexte

Identifié depuis cnumr/gen-referentiel-core#43.

Le schéma de validation (`content/fiche.schema.yaml` dans `gen-referentiel-core`) définit le champ `tiers` comme un tableau (`type: array, minItems: 1`). Or **119 fiches** dans ce repo ont `tiers` défini comme une simple chaîne de caractères, ce qui génère des warnings `remark-lint-frontmatter-schema` à chaque `pnpm lint:md`.

## Exemple

\`\`\`yaml
# ❌ actuel (string)
tiers: user-device

# ✅ attendu (array)
tiers:
- user-device
\`\`\`

## Étendue

119 fiches concernées dans `src/content/fiches/fr/` (et probablement autant en `en/` et `es/`).

Pour lister les fichiers concernés :
\`\`\`bash
grep -rn "^tiers: [a-z]" src/content/fiches/ | wc -l
\`\`\`

## Correction

Un script peut automatiser la migration :
\`\`\`bash
# macOS / BSD sed
find src/content/fiches -name "*.mdx" -exec \
sed -i '' 's/^tiers: \(.*\)$/tiers:\n - \1/' {} +

# GNU sed (Linux)
find src/content/fiches -name "*.mdx" -exec \
sed -i 's/^tiers: \(.*\)$/tiers:\n - \1/' {} +
\`\`\`

Valider ensuite avec `pnpm lint:md` dans `gen-referentiel-core`.

## Issue liée

cnumr/gen-referentiel-core#43

Contributor guide

Open the contributing guide

Research direction

Search src/content/fiches/ with the provided grep command and inspect the affected MDX frontmatter, including the fr/, en/, and es/ directories. Convert each scalar tiers value to the array form shown in the issue, then run pnpm lint:md in gen-referentiel-core and confirm the frontmatter-schema warnings are gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, yaml
Domain
content
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.