build.mjs and thumbs.mjs trust `meta.id` for file paths, and the id regex lives in three copies
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
- 52/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript, node.js
- Domínio
- build-system, security
Direção de pesquisa
Read site/build.mjs around lines 104 and 446, then inspect site/thumbs.mjs, site/validate.mjs, site/lib/scaffold.mjs, and site/checks.mjs for the repeated ID checks and file writes. The issue suggests a shared loader in site/lib/entry-files.mjs and pairing the change with #85. Done means one ID regex definition remains in site/, and a fixture with id: ../x makes node site/build.mjs exit 1 naming the file without touching disk.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Why it matters
validate is the only place that enforces the id charset and id === filename. npm run build on its own, and thumbs.yml (which runs thumbs.mjs before validate), write files whose names come straight from frontmatter. CI order protects main, but a local node site/build.mjs with a bad id writes outside site/dist/.
Evidence (at 69387df)
site/build.mjs:446:writeOut(path.join("entry", entry.id, "index.html"), html)withentry.id = String(meta.id)(build.mjs:104).path.join("entry", "../../x", "index.html")resolves under the parent ofDIST(build.mjs:292), andproduced/pruneDistnever see it.site/thumbs.mjs:123-124, 244:${entry.id}.src,${entry.id}.webpin the temp dir and insite/public/thumbs/.- The same regex is written three times:
site/validate.mjs:65,site/lib/scaffold.mjs:30(exportedID_RE),site/checks.mjs:806(inline).
Suggested approach
Give site/lib/entry-files.mjs one loader that reads the file, parses frontmatter, and refuses an entry whose id fails ID_RE or differs from the basename; have build, thumbs, check-links and reverify-batch use it. Export ID_RE from one module and import it everywhere. This pairs naturally with #85.
Done when
One definition of the id regex in site/; a fixture entry with id: ../x makes node site/build.mjs exit 1 naming the file, without touching the disk.
- Linguagem predominante
- JavaScript
- Estrelas
- 58
- Forks
- 15
- Merge médio
- 18h 42min
- PRs com merge (30d)
- 11
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
-
correction
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 57/100
TMHSDigital/Free-Game-Dev-Assets#162 ·
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
Todas as issues de TMHSDigital/Free-Game-Dev-Assets
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 12 dias
-
[Bug]: Payment providers removed from config are never disabled in payment_providerTalvez já em andamento @medusa-os-bot assumiu hoje. Abertatype: bug
Dificuldade 2/5 Meio dia Facilidade para iniciantes 82/100
medusajs/medusa#17544 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:cli good first issue priority:medium type:feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
PicadoLabs/build-with-ai#199 ·
Mantenedores costumam responder em até 1 dia
-
Cookies with valid Max-Age are omitted when Expires is in the pastTalvez já em andamento @Max-Reisinger assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
sagemathinc/sagebrush#252 ·
Mantenedores costumam responder em até 1 dia