-
Notifications
You must be signed in to change notification settings - Fork 29
refactor: integrate estree-walker using meriyah ESTree types #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: d31d13d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactor JS-Xray and Tracer workspaces to remove the external estree-walker
dependency and introduce a native synchronous walker built on Meriyah’s ESTree types.
- Remove
estree-walker
from production dependencies and add it only as a devDependency where needed. - Add
WalkerBase
andSyncWalker
implementations along withwalk
/walkEnter
entrypoints. - Update all source files and tests to import and use the new walker and tighten type annotations.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
workspaces/tracer/package.json | Add estree-walker to devDependencies |
workspaces/js-x-ray/package.json | Remove estree-walker from dependencies |
workspaces/js-x-ray/src/walker/walker.base.ts | Introduce WalkerBase for core AST node operations |
workspaces/js-x-ray/src/walker/walker.sync.ts | Implement SyncWalker for synchronous AST traversal |
workspaces/js-x-ray/src/walker/index.ts | Provide public walk and walkEnter helper functions |
workspaces/js-x-ray/src/types/estree.ts | Refine type guard signatures from any to unknown |
workspaces/js-x-ray/src/probes/isRequire/RequireCallExpressionWalker.ts | Swap external walker import for walkEnter usage |
workspaces/js-x-ray/src/AstAnalyser.ts | Update AST analysis to use new walker API |
workspaces/js-x-ray/test/walker.spec.ts | Update tests to cover new walker behaviors |
workspaces/js-x-ray/test/utils/index.ts | Import walk from new walker and remove old import |
workspaces/js-x-ray/test/NodeCounter.spec.ts | Switch to walkEnter and improve type annotations |
workspaces/js-x-ray/test/Deobfuscator.spec.ts | Replace external walker with local walk and tighten types |
workspaces/js-x-ray/test/AstAnalyser.spec.ts | Minor formatting tweaks and new walker import |
.changeset/open-lines-own.md | Bump package version and add PR summary |
Comments suppressed due to low confidence (3)
workspaces/js-x-ray/src/walker/index.ts:9
- [nitpick] Add JSDoc comments for
walk
andwalkEnter
to explain their parameters, return type, and when to use each helper function.
export function walk(
workspaces/js-x-ray/src/walker/walker.sync.ts:20
- [nitpick] Consider adding JSDoc to the
SyncWalker
class and itsvisit
method to clarify how handlers (enter
/leave
), skipping, replacement, and removal work.
export class SyncWalker extends WalkerBase {
workspaces/js-x-ray/test/walker.spec.ts:145
- Add a test case to verify that calling
this.skip()
in anenter
handler correctly prevents recursion into child nodes.
}
14d534b
to
d31d13d
Compare
d31d13d
to
77efae1
Compare
No description provided.