Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Export status is answered in three places, two of them hand-mirrored regexes

Abierto
#1,721 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@johnhldiver-beep ya está trabajando en esto.

Desde el 25/10/2026.

  • #2896 de @johnhldiver-beep — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, rust, typescript
Área
devtools

Línea de trabajo

Read the TypeScript and JavaScript extraction entry points at src/extraction/languages/typescript.ts:110-116 and javascript.ts:68, then compare src/extraction/tree-sitter.ts:2368, 2843 with codegraph-kernel/src/tsjs/extractors.rs:301 and the resolver change in #1720. The issue calls for export status to cover the listed ES and CommonJS forms and for the resolver's per-file fact to derive from it. Done should include corpus measurement; no specific test file is named.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Three places in the codebase answer "is this name exported from this file", none of them shares an implementation, and they disagree about what counts.

isExported — the AST one. src/extraction/languages/typescript.ts:110-116 and javascript.ts:68 walk the parent chain for an export_statement ancestor. That is exact for export function f, and blind to everything else: const x = …; export { x } and every CommonJS form (module.exports, exports.x, exports["x"]) leave isExported false on the declaration's node.

isExportedLater — a regex, written because of that blindness. src/extraction/tree-sitter.ts:2368 runs one anchored regex over the file source for export default NAME / export { NAME }, and codegraph-kernel/src/tsjs/extractors.rs:301 mirrors it in Rust — two implementations that must be kept in step by hand, with only a doc comment saying so. Its single call site is the store-extraction condition at tree-sitter.ts:2843, so the fix it represents is scoped to Zustand stores rather than available generally.

A third, per-file, in the resolver. #1720 needs "does this file export anything at all" and cannot use either of the above — isExported would answer no for a CommonJS module, and isExportedLater answers a per-name question, not a per-file one. So it adds another source regex.

The result is that a CommonJS module's exports are invisible to the graph as exports, export { x } is visible only to store extraction, and the resolver re-derives a coarser version of the same fact from the same file text. Each site is individually defensible; together they mean the question has no single answer to point at, and the two regexes drift independently across a language boundary.

Worth considering: compute export status once during extraction — covering the export_statement ancestor, later export { … } / export default, and the CommonJS forms — and persist it on the node, with the per-file "exports nothing" fact derived from it. That would let #1720's guard read a stored fact instead of the file text, make CommonJS exports visible generally, and leave one implementation per language rather than two hand-mirrored regexes plus an AST walk.

Raising it as an issue rather than a PR because it touches extraction, the kernel and the resolver at once, changes what is persisted, and would want to be measured on a corpus the way the resolution changes have been — not something to fold into a PR already under review.

Lenguaje dominante
C
Estrellas
73.2k
Forks
4.7k
Merge medio
4 h 53 min
PR fusionados (30 d)
626

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de colbymchenry/codegraph

Todos los issues de colbymchenry/codegraph

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.