/** * Commit day (`YYYY-MM-DD`) every tracked file under `dir` last changed, keyed by * absolute path. One history walk rather than a `git log` per file: the per-file * form costs a process each, which is the build's largest single expense once a * site has more than a handful of pages. * * `--relative` makes git print paths relative to `dir`, so they join straight * back onto it with no second call to find the repository root. `--no-renames` * makes a rename list both of its paths, which keeps the answer identical to * asking about one file at a time. * * An empty map for a directory outside a repository, or one git could not read. * That is the same "no date" every caller already handles, and it is deliberately * all-or-nothing: a truncated read would date some pages and not others, which * looks like real data and is not. * * A shallow clone also yields no dates. Its single commit introduces every * tracked file, so a walk would stamp every page with the same day — silent, * plausible, and wrong for both page footers and sitemap ``. Omitting * the date is legitimate; a uniform wrong date is not. Callers that need real * dates should build from a full clone (`fetch-depth: 0` in CI, unshallow on * the host). * * `onFail` fires for a truncated read or a shallow repository: those are the * cases that would otherwise produce dates that look real and are not. A * directory outside a repository, a missing directory, or a machine without git * all yield no dates quietly, which every caller already handles. Reporting is * the caller's to do, which is why this takes a callback rather than writing to * the console itself. */ export declare function commitDates(dir: string, onFail?: (reason: string) => void, /** * Cap on the walk's output. The default is far above any real docs root; it is * a parameter so the truncation path can be exercised without a repository * large enough to produce 256 MB of history. */ maxBuffer?: number): Map; /** * Release dates keyed by version, read from the commit that introduced each * `## ` heading in a changelog. Changesets does not write dates, and a * tag lookup misses versions released before tagging was set up, so the file's * own history is the most reliable source available. */ export declare function changelogDates(file: string): Map;