fix(parsers/js): discover and resolve .mjs/.cjs modules in context_assembler#92
Open
gadievron wants to merge 1 commit into
Open
fix(parsers/js): discover and resolve .mjs/.cjs modules in context_assembler#92gadievron wants to merge 1 commit into
gadievron wants to merge 1 commit into
Conversation
…sembler context_assembler.js omitted .mjs (ESM) and .cjs (CommonJS) from both its source-discovery glob (findSourceFiles) and its import-resolution extension lists. So .mjs/.cjs files were never loaded into the TypeScript program (getSourceFile -> undefined) and imports targeting them were silently unresolved -- dropped call-graph edges. The sibling repository_scanner.js already includes .mjs/.cjs in its sourceExtensions; this brings context_assembler to the same canonical set (.js/.ts/.jsx/.tsx/.mjs/.cjs). Three sites updated: - findSourceFiles discovery glob: add mjs|cjs. - import-resolution extensions: add .mjs/.cjs + /index.mjs / /index.cjs. - resolveModuleFunctionDefinition extensions (the sibling site -- it omitted even .jsx/.tsx): bring to the canonical set. Tests: tests/test_context_assembler_mjs.py (ContextAssembler.findSourceFiles discovers .mjs/.cjs; skips portably where the JS parser's node deps aren't installed). RED 1 failed (['main.js']) -> GREEN 1 passed; JS parser suite 10 passed; full venv suite 218 passed, 22 skipped, 0 failed (with node deps installed, which unlocks the otherwise-skipped JS tests). node --check clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
context_assembler.js omitted .mjs (ESM) and .cjs (CommonJS) from both its source-discovery glob
(findSourceFiles) and its import-resolution extension lists. So .mjs/.cjs files were never loaded into
the TypeScript program (getSourceFile -> undefined) and imports targeting them were silently unresolved --
dropped call-graph edges. The sibling repository_scanner.js already includes .mjs/.cjs in its
sourceExtensions; this brings context_assembler to the same canonical set (.js/.ts/.jsx/.tsx/.mjs/.cjs).
Three sites updated:
the canonical set.
Tests: tests/test_context_assembler_mjs.py (ContextAssembler.findSourceFiles discovers .mjs/.cjs; skips
portably where the JS parser's node deps aren't installed). RED 1 failed (['main.js']) -> GREEN 1 passed;
JS parser suite 10 passed; full venv suite 218 passed, 22 skipped, 0 failed (with node deps installed,
which unlocks the otherwise-skipped JS tests). node --check clean.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com