Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

refactor: move build.mjs helpers into lib/ and cover the untested paths (frontmatter types, duplicate ids, link schemes, check-links args)

Ouverte
#85 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
38/100
Type d'issue
Refactorisation
Clarté
Plutôt claire
Activité
Active
Stack technique
javascript, node.js
Domaine
testing, tooling

Piste de recherche

Start with build.mjs, checks.test.mjs, and lib.test.mjs; trace the listed helpers and untested paths, then compare the duplicated definitions in the named modules. The issue suggests moving build helpers into site/lib/build-helpers.mjs and adding assertions for each listed case. Done means build.mjs is mostly orchestration, every listed path has an assertion, and duplicated definitions exist once.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement priority: medium tests

Why it matters
checks.test.mjs and lib.test.mjs are quick (under 0.5 s together, 538 assertions) and good, but everything defined inside build.mjs (licenseFamily, loadEntries normalisation, groupedRowsHtml, categoryChipsHtml, headMetaHtml, sitemapXml, notFoundHtml, robotsTxt) is unexported and has no unit test; only CI's full build exercises it. Three of the bugs filed today (string tags, duplicate ids, scheme disagreement) sit exactly in those untested seams, and a test on parseFrontmatter with a trailing comment would have caught the first.

Evidence (grep of both test files on 2026-10-21)
Untested: build.mjs helpers above; repoOf (link-check.mjs:263); the LinkError instanceof gate (build.mjs:422, 477); renderInline bare-URL paren balancing and stop rules (markdown.mjs:316-323); renderBlocks dedent to an intermediate indent (:393-396); checkPage data:/mailto: skip (page-checks.mjs:83); parseFrontmatter with quoted booleans, non-list fields, trailing comments; check-links.mjs arg parsing and run() retry; sync-counts.mjs countEntries.
Duplicated logic that can drift: ID_RE (validate.mjs:59, scaffold.mjs:124); empty() (checks.mjs:64) vs isEmptyField() (validate.mjs:128); count-table regex (checks.mjs:679-681, fragment not regex-escaped) vs scaffold.mjs:106; pickPath (stacks.mjs:59-68) strips # only while makeLinkResolver (links.mjs:12) strips ? and #. Dead code: validate.mjs:98-100 SKIP_WALK contains dist, so the site/dist/ binary prefix can never match.

Suggested approach
Move the build.mjs helpers to site/lib/build-helpers.mjs (or split by concern), export each shared regex/predicate once, delete the dead prefix, and add the listed cases to the two test files. Keep the zero-dependency style.

Done when
build.mjs is mostly orchestration, every listed path has at least one assertion, and the duplicated definitions exist once.

Langage dominant
JavaScript
Étoiles
58
Forks
15
Merge moyen
18 h 42 min
PR mergées (30 j)
11

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Free-Game-Dev-Assets

Toutes les issues de TMHSDigital/Free-Game-Dev-Assets

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.