@goflag/cli 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1144,6 +1144,7 @@ async function crawl(options) {
1144
1144
  const pages = [];
1145
1145
  const errors = [];
1146
1146
  let truncated = false;
1147
+ const seenFinal = /* @__PURE__ */ new Set();
1147
1148
  while (queue.length > 0) {
1148
1149
  if (options.inspectOptions?.signal?.aborted) break;
1149
1150
  const wave = queue.splice(0, concurrency);
@@ -1165,6 +1166,9 @@ async function crawl(options) {
1165
1166
  errors.push({ url: result.item.url, message: result.error });
1166
1167
  continue;
1167
1168
  }
1169
+ const finalUrl = canonicaliseUrl(result.page.fetch.finalUrl) ?? result.page.fetch.finalUrl;
1170
+ if (seenFinal.has(finalUrl)) continue;
1171
+ seenFinal.add(finalUrl);
1168
1172
  pages.push(result.page);
1169
1173
  if (options.onPage) {
1170
1174
  options.onPage(result.page, { visited: pages.length, queued: queue.length });
@@ -3532,11 +3536,18 @@ async function runAudit(inputUrl, options = {}) {
3532
3536
  const okPages = pages.filter((p) => isOkStatus(p.fetch.status));
3533
3537
  const documents = okPages.filter(isHtmlPage);
3534
3538
  const { kept: htmlPages, dropped: duplicatePages } = dropCanonicalDuplicates(documents);
3535
- const unreachablePages = pages.filter((p) => !isOkStatus(p.fetch.status)).map((p) => ({
3536
- id: fingerprint("page", routeKey(p.fetch.finalUrl)),
3537
- url: p.fetch.finalUrl,
3538
- status: p.fetch.status
3539
- }));
3539
+ const unreachablePages = [
3540
+ ...pages.filter((p) => !isOkStatus(p.fetch.status)).map((p) => ({
3541
+ id: fingerprint("page", routeKey(p.fetch.finalUrl)),
3542
+ url: p.fetch.finalUrl,
3543
+ status: p.fetch.status
3544
+ })),
3545
+ ...crawlResult.errors.map((e) => ({
3546
+ id: fingerprint("page", routeKey(e.url)),
3547
+ url: e.url,
3548
+ status: 0
3549
+ }))
3550
+ ];
3540
3551
  const seoIssues = [];
3541
3552
  const conformanceRows = [];
3542
3553
  const advisories = [];
@@ -3629,7 +3640,7 @@ async function runAudit(inputUrl, options = {}) {
3629
3640
  allowInsecureTls: options.allowInsecureTls,
3630
3641
  checkExternal,
3631
3642
  timeoutMs: options.timeoutMs,
3632
- maxPages,
3643
+ maxPages: effectiveMaxPages,
3633
3644
  signal: options.signal,
3634
3645
  onProgress: (p) => options.onProgress?.({
3635
3646
  phase: p.phase === "scan" ? "scan" : "links",
@@ -4403,4 +4414,4 @@ export {
4403
4414
  summarize,
4404
4415
  Logger
4405
4416
  };
4406
- //# sourceMappingURL=chunk-F74SRZVM.js.map
4417
+ //# sourceMappingURL=chunk-5FO2Q3II.js.map