Skip to content

--sitemap: take routes from the reference's sitemap.xml #46

Closed

Description

@tmashara

What
--sitemap [url]: read the reference side's sitemap.xml (default <right>/sitemap.xml, following sitemap indexes) and use its paths as the route list. Add --include / --exclude globs to narrow it.

Why
A migration usually touches the whole site, and today every route has to be listed by hand ("no crawler" is on the Don't-use list). Percy's snapshot command and Visual Scanner take a sitemap; it's the cheapest way to get full coverage without building a crawler.

How
Fetch and parse the XML in cli.ts before the run (no new dependency: the <loc> elements are enough). Keep the paths, drop other hosts, dedupe, and apply the globs. Globs stay rejected as routes; they only filter the sitemap. --dry-run prints the expanded list. Routes given explicitly are added to it. Say how many routes the sitemap gave, and refuse an empty result.

Prior art

  • No sitemap fallback: testivai-oss collects same-origin links from the start page instead (packages/witness/src/standalone/crawl.ts, filterCrawledLinks). It is one level deep, drops download extensions and # hashes, dedupes, and caps the count. Worth doing as --sitemap's fallback when /sitemap.xml is missing, saying so in the output.
  • Percy takes percy snapshot <url>/sitemap.xml with include/exclude globs; its Visual Scanner caps at 1,000 pages.
  • Drop non-HTML URLs (by extension) before the run; see Name non-HTML routes instead of a raw ERR_ABORTED #57.

Activity

  1. added
    enhancement
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions