@hawkeyexl/manni 2.5.0 → 2.5.2

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.
@@ -61,7 +61,7 @@ import {
61
61
  supportedExtensions,
62
62
  terminalConfirm,
63
63
  toJsonText
64
- } from "./chunk-SXYSP33V.js";
64
+ } from "./chunk-4ZDL67X6.js";
65
65
 
66
66
  // src/meta/cli.ts
67
67
  import { existsSync } from "node:fs";
@@ -1517,4 +1517,4 @@ export {
1517
1517
  reportConfig,
1518
1518
  buildProgram
1519
1519
  };
1520
- //# sourceMappingURL=chunk-XCZJ25OT.js.map
1520
+ //# sourceMappingURL=chunk-UJWQH3DJ.js.map
@@ -71,7 +71,7 @@ import {
71
71
  withValueAt,
72
72
  writeEncryptionKey,
73
73
  writeFileAtomic
74
- } from "./chunk-SXYSP33V.js";
74
+ } from "./chunk-4ZDL67X6.js";
75
75
 
76
76
  // src/meta/core/reencrypt.ts
77
77
  import { extname } from "node:path";
@@ -5315,4 +5315,4 @@ export {
5315
5315
  runKeyRotate,
5316
5316
  runKeySet
5317
5317
  };
5318
- //# sourceMappingURL=chunk-3V4EIH7H.js.map
5318
+ //# sourceMappingURL=chunk-V22X36RJ.js.map
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  readStdin,
8
8
  reportConfig,
9
9
  splitList
10
- } from "./chunk-XCZJ25OT.js";
10
+ } from "./chunk-UJWQH3DJ.js";
11
11
  import {
12
12
  CiteError,
13
13
  KeyError,
@@ -40,7 +40,7 @@ import {
40
40
  shortPin,
41
41
  shortSrc,
42
42
  spellSource
43
- } from "./chunk-3V4EIH7H.js";
43
+ } from "./chunk-V22X36RJ.js";
44
44
  import {
45
45
  COMMON_FORMAT_LIST,
46
46
  OMITTED_WHEN_CLEAN,
@@ -78,7 +78,7 @@ import {
78
78
  splitPageArgument,
79
79
  terminalConfirm,
80
80
  valeConfigPath
81
- } from "./chunk-SXYSP33V.js";
81
+ } from "./chunk-4ZDL67X6.js";
82
82
 
83
83
  // src/cli.ts
84
84
  import { Command as Command5 } from "commander";
@@ -433,7 +433,7 @@ async function runCheck2(opts, deps) {
433
433
  const results = outcome2.pages.map((page) => finishPage(page, opts.severity));
434
434
  return {
435
435
  results,
436
- summary: summarize(results, outcome2, sitemap.source, opts.crawl)
436
+ summary: summarize(results, outcome2, sitemap, opts.crawl)
437
437
  };
438
438
  } finally {
439
439
  await analyzer.close();
@@ -465,7 +465,10 @@ function summarize(results, { discovered, skipped: skipped2, duplicates }, sitem
465
465
  failed,
466
466
  violations,
467
467
  bySeverity,
468
- sitemap,
468
+ sitemap: sitemap.source,
469
+ // The count the progress line already reported as `(N pages)`, so the
470
+ // report cannot disagree with the narration that preceded it.
471
+ sitemapPages: sitemap.urls.length,
469
472
  crawl: crawl2
470
473
  };
471
474
  }
@@ -723,7 +726,11 @@ function where(run, c) {
723
726
  const { summary } = run;
724
727
  if (!summary.crawl) return "no crawl";
725
728
  if (summary.sitemap === null) return "no sitemap; followed links";
726
- return `sitemap: ${c.cyan(summary.sitemap)}`;
729
+ const found = `sitemap: ${c.cyan(summary.sitemap)}`;
730
+ const n = summary.sitemapPages;
731
+ if (n === 0) return `${found}, 0 pages; followed links`;
732
+ if (n >= summary.discovered) return found;
733
+ return `${found}, ${n} page${n === 1 ? "" : "s"}; followed links for the rest`;
727
734
  }
728
735
  function scoreText(page) {
729
736
  return page.score === null ? "n/a" : String(page.score);
@@ -914,6 +921,18 @@ function positiveInteger(value, flag) {
914
921
  }
915
922
  return Number(value);
916
923
  }
924
+ function parseMaxPages(value) {
925
+ if (value === false) return "uncapped";
926
+ if (value === void 0) return void 0;
927
+ return positiveInteger(value, "--max-pages");
928
+ }
929
+ function resolveMaxPages(flag, configured) {
930
+ if (flag === "uncapped") return void 0;
931
+ return flag ?? configured;
932
+ }
933
+ function resolveCrawl(flag, configured) {
934
+ return flag ?? configured ?? CHECK_DEFAULTS.crawl;
935
+ }
917
936
  function assertSeverity(value) {
918
937
  if (!isSeverity(value)) {
919
938
  throw new A11yError(`Unknown --severity "${value}". Use ${SEVERITY_LIST}.`);
@@ -926,10 +945,10 @@ function buildProgram2() {
926
945
  program.command("check").description("Crawl from the given URLs and check every page with axe-core").argument(
927
946
  "[urls...]",
928
947
  "http(s) seed URLs; falls back to a collection's url: or a11y.urls in manni.config.yaml"
929
- ).option("-f, --format <format>", `output: ${A11Y_FORMAT_LIST}`, "pretty").option("--no-crawl", "check exactly the given URLs: no sitemap, no link following").option(
948
+ ).option("-f, --format <format>", `output: ${A11Y_FORMAT_LIST}`, "pretty").option("--crawl", "crawl from the given URLs: sitemap and link following (default)").option("--no-crawl", "check exactly the given URLs: no sitemap, no link following").option(
930
949
  "--max-pages <n>",
931
950
  "cap on pages checked; the rest are reported as skipped (default: no cap)"
932
- ).option("--tags <list>", "comma-separated axe tags to restrict the rules to").option(
951
+ ).option("--no-max-pages", "check every page found, ignoring a configured maxPages").option("--tags <list>", "comma-separated axe tags to restrict the rules to").option(
933
952
  "--severity <level>",
934
953
  `minimum severity reported: ${SEVERITY_LIST}`,
935
954
  CHECK_DEFAULTS.severity
@@ -951,7 +970,7 @@ function buildProgram2() {
951
970
  throw new A11yError(`Unknown --format "${format}". Use ${A11Y_FORMAT_LIST}.`);
952
971
  }
953
972
  const severity = assertSeverity(options.severity);
954
- const maxPages = options.maxPages === void 0 ? void 0 : positiveInteger(options.maxPages, "--max-pages");
973
+ const maxPages = parseMaxPages(options.maxPages);
955
974
  const timeout = positiveInteger(options.timeout, "--timeout");
956
975
  const loaded = options.config === false ? { config: {}, source: null, collections: [] } : await loadA11yConfig(process.cwd(), options.config);
957
976
  const cfg = loaded.config;
@@ -968,9 +987,10 @@ function buildProgram2() {
968
987
  const run = await runCheck2(
969
988
  {
970
989
  urls: seeds,
971
- crawl: typed("crawl") ? options.crawl : cfg.crawl ?? CHECK_DEFAULTS.crawl,
972
- // Typed flag > config key > no cap. There is no default to fall to.
973
- maxPages: maxPages ?? cfg.maxPages,
990
+ crawl: resolveCrawl(options.crawl, cfg.crawl),
991
+ // Typed flag > config key > no cap. There is no default to fall
992
+ // to, and `--no-max-pages` is the typed way to ask for none.
993
+ maxPages: resolveMaxPages(maxPages, cfg.maxPages),
974
994
  tags: options.tags !== void 0 ? splitList2(options.tags) : cfg.tags ?? CHECK_DEFAULTS.tags,
975
995
  severity: typed("severity") ? severity : cfg.severity ?? CHECK_DEFAULTS.severity,
976
996
  timeout: typed("timeout") ? timeout : cfg.timeout ?? CHECK_DEFAULTS.timeout