Skip to content

Migrate the crawler modules to TypeScript - #51

Merged
masahiroid merged 3 commits into
developfrom
feature/core-crawler-typescript
Nov 1, 2026
Merged

masahiroid merged 3 commits into
developfrom
feature/core-crawler-typescript

Conversation

@masahiroid

Copy link
Copy Markdown
Owner

Moves the browser session, form scanner, login handling, crawler and explorer to strict TypeScript. Existing entry points stay as small compatibility files, and output in a real browser matches the recorded results.

… entry points

Browser session, form scanner, login handling, crawler and explorer move to core/crawler/typed with named
timeouts and limits and unknown-safe error handling. Output in a real browser matches the recorded results.
Copilot AI balanced review requested due to automatic review settings November 1, 2026 15:46
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5ed31914-2381-4715-9309-d04e4806bd8e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new test lacks Chromium installation in two CI workflows, blocking clean-runner builds, and registers cleanup too late to prevent server leaks on startup failure.

2 open issues
What changed in this PR

Migrates the crawler subsystem to strict TypeScript while preserving existing CommonJS entry points and adding browser-based characterization tests.

Changes:

  • Moves browser sessions, form scanning, login, crawling, and exploration into typed modules.
  • Extracts shared URL and error helpers and includes crawler modules in the core TypeScript build.
  • Adds a local test site and golden files covering forms, navigation, login, logs, and screenshot filenames.
File Description
tsconfig.core.json Includes typed crawler modules in compilation.
test/​golden/​crawler/​scan-standalone.json Records standalone input scanning.
test/​golden/​crawler/​scan-forms.json Records form fields and constraints.
test/​golden/​crawler/​navigation.json Records home-page navigation candidates.
test/​golden/​crawler/​navigation-about.json Records secondary-page navigation candidates.
test/​golden/​crawler/​login-log.json Records successful login logs.
test/​golden/​crawler/​gate.json Records agreement-gate traversal.
test/​golden/​crawler/​explore.json Records exploration results and skipped controls.
test/​golden/​crawler/​explore-shots.json Records exploration screenshot filenames.
test/​golden/​crawler/​explore-log.json Records exploration logs.
test/​golden/​crawler/​crawl.json Records discovered forms and page snapshots.
test/​golden/​crawler/​crawl-shots.json Records crawler screenshot filenames.
test/​golden/​crawler/​crawl-log.json Records crawl and click-probe logs.
test/​crawlerCharacterization.test.js Adds real-browser characterization tests.
core/​crawler/​typed/​urls.ts Extracts shared URL helpers.
core/​crawler/​typed/​login.ts Migrates login handling to TypeScript.
core/​crawler/​typed/​formScanner.ts Types form and navigation extraction.
core/​crawler/​typed/​explorer.ts Migrates exploration and state capture.
core/​crawler/​typed/​errors.ts Adds a shared error-log formatter.
core/​crawler/​typed/​crawler.ts Migrates crawling, probing, and snapshots.
core/​crawler/​typed/​browser.ts Migrates browser lifecycle and options.
core/​crawler/​login.js Becomes a login compatibility entry point.
core/​crawler/​formScanner.js Becomes a scanner compatibility entry point.
core/​crawler/​explorer.js Becomes an explorer compatibility entry point.
core/​crawler/​crawler.js Becomes a crawler compatibility entry point.
core/​crawler/​browser.js Becomes a browser compatibility entry point.

Review effort: Balanced

const site = await startSite();
const origin = `http://127.0.0.1:${site.address().port}`;
const session = new BrowserSession({ headful: false });
const page = await session.start();
Comment thread test/crawlerCharacterization.test.js Outdated
Comment on lines +77 to +81
const session = new BrowserSession({ headful: false });
const page = await session.start();
const lines = [];
const log = line => lines.push(line.split(origin).join('http://SITE'));
t.after(async () => { await session.stop(); site.close(); });
@masahiroid
masahiroid merged commit ab7c156 into develop Nov 1, 2026
11 checks passed
@masahiroid
masahiroid deleted the feature/core-crawler-typescript branch November 1, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants