Repository navigation
chore(cli,crawler): remove dead link-analysis and csr-detect code, one CrawlerEvent declaration, notices bundler guard (#261, #700, #251, #657) - #888
Conversation
|
Reviewed the diff. The removals look clean: I found no remaining references to the deleted link-analysis module,
No blocking issues. |
|
Review triage, no code change:
|
apps/cli/src/links/index.ts (extractEnhancedLinks, analyzeInternalLinks, analyzeAnchorText, validateInternalLinks, validateAnchorText) had no production caller: only its own test imported it. Removed with that test, its two HTML fixtures and the three types only it used (EnhancedLinkData, InternalLinkAnalysis, AnchorTextAnalysis). PageAudit.links stays unpopulated as #1938 left it; the report's link findings come from packages/rules/src/links. Signed-off-by: Nik Cubrilovic <[email protected]>
…tures (#700) pub#782 already removed the CLI's legacy crawl/sitemaps, robots and index modules. Left: apps/cli/src/crawl/csr-detect.ts, a re-export of @squirrelscan/fetchers that only its test imported. The test now imports the fetchers module directly. The robots/sitemap fixtures those removed modules' tests read are gone too; nothing referenced them. hybrid-fetcher.ts, imported by the audit controller, is the only file left under src/crawl. Signed-off-by: Nik Cubrilovic <[email protected]>
#251) The crawler kept a second, hand-maintained CrawlerEvent union that had already drifted: its page:fetched lacked ttfbMs, fetcherId and rendered, which core-contracts declares and the cloud's debug events read. core-contracts now declares the named per-event interfaces (CrawlerStartedEvent ... CrawlerErrorEvent) and the union of them; packages/crawler re-exports them instead of restating them, so an event added in one place compiles everywhere or fails everywhere. completed.stats is CrawlStats, which the crawler already emitted. Signed-off-by: Nik Cubrilovic <[email protected]>
…ed packages (#657) The bundled-package scan moves to scripts/third-party-bundled.ts. notices:generate and notices:check now fail, naming the dependency and what to check by hand, when @modelcontextprotocol/server (the one runtime dependency known to bundle packages) yields nothing from the marker scan, instead of silently dropping its bundled packages from THIRD_PARTY_NOTICES.md. Tested on fixtures and on the installed package. Signed-off-by: Nik Cubrilovic <[email protected]>
08306ea to
849fccb
Compare
|
Review of #888: dead-code removal, event-type dedup, and a third-party-notices guard. I found no blocking problems. A grep of the repo found no remaining references to the deleted
The new |
Four small chores. Each has its own commit.
Closes #261, closes #700, closes #251, closes #657.
#261: unreachable link-analysis module
apps/cli/src/links/index.ts(extractEnhancedLinks,analyzeInternalLinks,analyzeAnchorText,validateInternalLinks,validateAnchorText) had no production caller: onlytests/link-analysis.test.tsimported it. This PR removes it, along with:EnhancedLinkData,InternalLinkAnalysis,AnchorTextAnalysis.PageAudit.linksstays unpopulated, as #1938 left it. The report's link findings come frompackages/rules/src/linksand are untouched.#700: legacy crawl modules
#782 had already removed
crawl/sitemaps.ts,robots.tsandindex.ts. What was left:apps/cli/src/crawl/csr-detect.ts: a 7-line re-export of@squirrelscan/fetchers, imported only by its test. Removed. The test now imports@squirrelscan/fetchersdirectly.src/crawl/hybrid-fetcher.ts, whichcontrollers/audit.tsimports, is the only file left undersrc/crawl/.#251: one CrawlerEvent
The crawler's hand-kept copy had already drifted. Its
page:fetchedlackedttfbMs,fetcherIdandrendered, which core-contracts declares and the cloud's debug events read.packages/core-contractsnow declares the named per-event interfaces (CrawlerStartedEventthroughCrawlerErrorEvent) and the union of them.packages/crawler/src/core/types.tsre-exports them instead of restating them. Existing importers of the named types, such ascrawler.ts'sCrawlerPageUnchangedEvent, resolve as before.completed.statsisCrawlStats, which the crawler already emitted. It replaces a narrower inline copy and every field consumers read is still there.Not changed here: the crawler still does not emit
ttfbMsorfetcherIdonpage:fetched, although its page record has both. Wiring them into the event would change what the cloud records, so that is left for its own change.#657: notices guard for bundled packages
The bundled-package scan moves to
scripts/third-party-bundled.ts.notices:generateandnotices:checknow fail when@modelcontextprotocol/server, the one runtime dependency known to bundle packages, yields nothing from the marker scan. The error names the dependency and says to check its dist by hand, then update the scan orscripts/third-party-embedded/.A dependency that is not installed is never visited, so it cannot trip the guard.
scripts/third-party-bundled.test.tscovers:node_modules,@modelcontextprotocol/server, which still carries markers.Checks
tsgo --noEmit: packages/core-contracts, packages/crawler, packages/audit-engine and apps/cli are all clean. The scripts were type-checked strict.bun test:tests/crawler/csr-detect.test.tsandtests/crawler/hybrid-fetcher.test.ts: 14 pass.tests/seed-base-collapse.test.tsandtests/preamble-budget.test.ts: 32 pass.scripts/third-party-bundled.test.ts: 3 pass.bun run notices:check: up to date (67 packages).Docs: no user-facing change. Agent skill: no change needed.