refactor: share one headless-Chrome helper between check-render and build-og-card
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
- Área
- tooling
Línea de trabajo
Lee scripts/check-render.mjs y scripts/build-og-card.mjs; después compara su código de descubrimiento, lanzamiento, apagado de Chrome y del cliente CDP. Extrae las partes compartidas a scripts/chrome.mjs, dejando en su lugar el comportamiento específico del renderizado y las decisiones de PAGE_TIMEOUT_MS de los llamadores. Ejecuta npm run check-render y npm run og-card; se considera terminado cuando los fallos de renderizado siguen siendo idénticos y la card sigue siendo comparable byte a byte.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Branch off master and PR into master, not main. This is the v1 site.
scripts/build-og-card.mjs (#130) needs headless Chrome for exactly the same reasons scripts/check-render.mjs does, and it now carries its own copy of the same four pieces of plumbing:
findChrome()— theCHROME_PATHoverride and the per-platform install locationslaunchChrome()— the flag set, and scraping the DevTools URL out of stderrstopChrome()— waiting for the exit rather than the signal, because Windows keeps the user-data-dir locked until Chrome has goneconnect()/withTimeout()— the minimal CDP client over one browser-level socket
The card builder's copy is the smaller of the two: it drives one page, so it drops the event waitFor and the per-target session bookkeeping check-render needs. Nothing about the Chrome handling itself differs.
This is the shape #162 was about. There, check-canonicals and check-render had a static.yml allowlist parser each, and they had already drifted in a way that mattered: the render check read only the first cp ... _site/, so a page added in a later cp deployed but was never rendered. One parser in scripts/static-allowlist.mjs fixed it. The same argument applies here before these two copies drift — a fix to Chrome discovery, or a new flag needed for a future Chrome, currently has to be made twice, and only one of the two runs in CI, so the other can rot unnoticed.
Not urgent: the copies are identical today, and build-og-card.mjs is a manual tool run rarely rather than a check. Filed so it is a decision rather than an accident.
Proposal
Extract the shared parts into scripts/chrome.mjs, alongside scripts/static-allowlist.mjs, and have both scripts import it. check-render.mjs keeps whatever is genuinely specific to rendering every page (the viewport list, the is-loading and image-ratio measurement, the page loop).
Worth deciding as part of it: whether PAGE_TIMEOUT_MS belongs to the module or stays per-caller, since the two have no reason to agree.
Acceptance criteria
- One copy of Chrome discovery, launch, shutdown and the CDP client
-
npm run check-renderbehaves identically — same failures on a broken image, a distorted aspect ratio and a stuckis-loading -
npm run og-cardstill produces a byte-comparable card - Neither script reaches into the other
Refs #130, #162
- Lenguaje dominante
- HTML
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 10 h 2 min
- PR fusionados (30 d)
- 41
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de laywill/laywill.github.io
-
design
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
laywill/laywill.github.io#186 ·
Los mantenedores suelen responder en 1 día
-
design
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
laywill/laywill.github.io#183 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 74/100
laywill/laywill.github.io#135 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
laywill/laywill.github.io#106 ·
Los mantenedores suelen responder en 1 día
-
infra needs-william
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
laywill/laywill.github.io#35 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de laywill/laywill.github.io
Issues similares
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
automation models
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
agent:sonnet-high enhancement priority: P2 ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
shep-pm/shep-kelpie#652 ·
Los mantenedores suelen responder en 1 día
-
install.ps1: Windows PowerShell 5.1 aborts after a successful cosign verification (NativeCommandError on 'Verified OK')Posiblemente ocupada @sly321-pixel la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Kotlin/kotlin-lsp#288 ·