refactor: move build.mjs helpers into lib/ and cover the untested paths (frontmatter types, duplicate ids, link schemes, check-links args)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Refatoração
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript, node.js
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- JavaScript
- Estrelas
- 58
- Forks
- 15
- Merge médio
- 16h 53min
- PRs com merge (30d)
- 14
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TMHSDigital/Free-Game-Dev-Assets
-
community marketing priority: low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
TMHSDigital/Free-Game-Dev-Assets#151 ·
Mantenedores costumam responder em até 1 dia
-
documentation priority: medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
TMHSDigital/Free-Game-Dev-Assets#72 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 68/100
TMHSDigital/Free-Game-Dev-Assets#3 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
marketing priority: low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 55/100
TMHSDigital/Free-Game-Dev-Assets#152 ·
Mantenedores costumam responder em até 1 dia
-
feature priority: medium
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
TMHSDigital/Free-Game-Dev-Assets#144 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de TMHSDigital/Free-Game-Dev-Assets
Issues semelhantes
-
Clinic sharing: fast sync refusal message suggests Delete Data, which only developer builds haveAbertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
avniproject/avni-client#2228 ·
-
bug confirmed issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
open-webui/open-webui#33196 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
`printf "%o"` prints decimalAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
fable-compiler/Fable#5157 ·
Mantenedores costumam responder em até 1 dia
-
New tool: PaperBananaTalvez já em andamento @github-actions assumiu hoje. Abertasubmission triage
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
kausalflow/tools#243 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area: apple-music area: build-release bug effort: small priority: high
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
ChristianTabor/Argon#32 ·
Mantenedores costumam responder em até 1 dia