Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#85 1 comentário 0 reações 0 responsáveis Ver no GitHub

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
Domínio
testing, tooling

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

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.

Linguagem predominante
JavaScript
Estrelas
58
Forks
15
Merge médio
16h 53min
PRs com merge (30d)
14

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Free-Game-Dev-Assets

Todas as issues de TMHSDigital/Free-Game-Dev-Assets

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.