Refactor crawl function to Crawler class#19
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This change extracts the logic from the complex `crawl` function in `plugins/core/src/crawler/crawl.ts` into a new `Crawler` class in `plugins/core/src/crawler/crawler.ts`. This improves maintainability and readability by encapsulating the crawler state and logic in a dedicated class while keeping the `crawl` function as a simple facade for backward compatibility. - Created `Crawler` class with methods for initialization, queue management, and page processing. - Moved `CrawlOptions` and `QueueItem` interfaces to `crawler.ts`. - Updated `crawl.ts` to use `Crawler` class. - Verified with existing tests in `plugins/core/tests/crawler.test.ts`.
…ecovery in Crawler
bfff21e to
94190a1
Compare
Refactored the
crawlfunction inplugins/core/src/crawler/crawl.tsto reduce complexity. The logic has been moved to a newCrawlerclass inplugins/core/src/crawler/crawler.ts. This improves code organization and testability while maintaining the existing API and behavior. Confirmed that all tests pass.PR created automatically by Jules for task 889141265657952000 started by @saurabhsharma2u