Skip to content

crawler: sitemap(), report(), keepQuery, seed normalization - #3

Merged
ryansolid merged 4 commits into
mainfrom
sitemap-report-keep-query
Sep 6, 2026
Merged

crawler: sitemap(), report(), keepQuery, seed normalization#3
ryansolid merged 4 commits into
mainfrom
sitemap-report-keep-query

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Three more small, high-leverage features for prerender-crawler ahead of 0.2.0, plus a latent seed bug they surfaced. Folded into the pending 0.2.0 changeset rather than stacking a second minor.

  • sitemap({ hostname }) — every rendered page as a <url>, dynamic routes expanded; excludes redirect stubs, non-HTML, query spellings, and noindex pages (<meta name="robots"> any attribute order, X-Robots-Tag). filename, trailingSlash, filter, entry options. CLI --sitemap <origin>.
  • report() — JSON account of the run: per-page status / duration / output file / written / referrers, redirects, skipped pages with errors, files from earlier integrations, totals. filename: "../…" keeps it out of the deploy. CLI --report, --report-file.
  • keepQuery — render /posts?page=2 apart from /posts (params sorted), follow its links and capture its data, but write it only when the entry names a filename — a static host serves a path the same for every query. CLI --keep-query.
  • Seeds normalized like links — a seed spelled about/, /a#top or /posts?page=2 now dedupes with the crawled link. Previously a seed with a query was fetched verbatim and written to a literal posts?page=2/index.html.
  • RenderedPage.duration (pacing excluded); PrerenderContext.skipped / .files; emitFile filenames resolve against outDir.

Verified: 62 crawler + 19 solid tests, six concurrent full suite runs under load, example app build, and the CLI against the built example (--sitemap --report-file ../r.json).

Made with Cursor

ryansolid and others added 4 commits September 5, 2026 22:57
…r context

Seeds now go through the same URL normalization as crawled links, so
`about/`, `/a#top` and `/posts?page=2` meet the link to the same page in one
queue entry. Previously a seed carrying a query was fetched verbatim and
written to a literal `posts?page=2/index.html`.

`keepQuery` renders each query spelling as its own page (params sorted)
but writes it only when the entry names a filename — a static host serves
a path the same for every query, so there is nothing correct to write by
default.

RenderedPage gains `duration` (pacing excluded); PrerenderContext gains
`skipped` and `files`; emitFile filenames resolve against outDir so
`../` can keep a build artifact out of the deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
A formatter over context.pages: every rendered page becomes a <url>,
minus redirect stubs, non-HTML, query spellings and pages marked noindex
(robots meta in the head, any attribute order, or X-Robots-Tag).

Co-authored-by: Cursor <cursoragent@cursor.com>
JSON account of the run: pages with status, timing, output file, written
flag and referrers; redirects; skipped pages with errors; files emitted by
earlier integrations; totals.

Co-authored-by: Cursor <cursoragent@cursor.com>
--sitemap <origin>, --sitemap-file, --report, --report-file, --keep-query.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ryansolid
ryansolid merged commit 61656f0 into main Sep 6, 2026
4 checks passed
@ryansolid
ryansolid deleted the sitemap-report-keep-query branch September 6, 2026 06:00
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.

1 participant