Repository navigation
Conversation
This branch has not been deployed
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.
Summary
Capture common top-level CommonJS
requireimports and named/defaultexports/module.exportsassignments in the JavaScript and TypeScript structural extractor. Destructuring aliases/defaults, side-effect imports, static template paths, object barrels, and literal export keys are supported; dynamic paths, unrelated member calls, and shadowed CommonJS names are ignored. NodecreateRequirebridges fromnode:module/moduleremain recognized, including aliases and namespace imports. Mixed ES-module extraction is preserved, and the README explains the one-time fingerprint baseline change after upgrading.Linked issue(s)
Closes #615. This fixes the direct extractor API, which still returned empty import/export arrays on current main; the import inventory improvements in #682 are preserved.
How I tested this
The issue's built
TreeSitterPlugin.analyzeFile()reproduction changes from zero imports/exports to two imports and one deduplicatedlistexport. The original 22 grammar-backed regressions include 18 failures on the original extractor and four passing negative controls. Fourteen additional JavaScript/TypeScript regressions cover shadowedrequire/module/exportsand supported Node bridge forms, for 36 focused cases. The supplemental-import incremental fixture now uses a function-body dependency, retaining coverage for cosmetic edits while top-level requires correctly affect fingerprints.pnpm lintpnpm --filter @understand-anything/core test— 1,049 passingpnpm test— 786 passing, 12 skippedInline assigned named functions currently produce an export entry without a function node; that remains a known limitation.
Versioning