@hawkeyexl/manni 2.5.1 → 2.6.0

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.
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  readStdin,
8
8
  reportConfig,
9
9
  splitList
10
- } from "./chunk-KZDTVSFK.js";
10
+ } from "./chunk-J5YKHZDB.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-NFCH7HCA.js";
43
+ } from "./chunk-TQUTQD7J.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-22WVCFP4.js";
81
+ } from "./chunk-5RJVKWFZ.js";
82
82
 
83
83
  // src/cli.ts
84
84
  import { Command as Command5 } from "commander";
@@ -921,6 +921,18 @@ function positiveInteger(value, flag) {
921
921
  }
922
922
  return Number(value);
923
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
+ }
924
936
  function assertSeverity(value) {
925
937
  if (!isSeverity(value)) {
926
938
  throw new A11yError(`Unknown --severity "${value}". Use ${SEVERITY_LIST}.`);
@@ -933,10 +945,10 @@ function buildProgram2() {
933
945
  program.command("check").description("Crawl from the given URLs and check every page with axe-core").argument(
934
946
  "[urls...]",
935
947
  "http(s) seed URLs; falls back to a collection's url: or a11y.urls in manni.config.yaml"
936
- ).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(
937
949
  "--max-pages <n>",
938
950
  "cap on pages checked; the rest are reported as skipped (default: no cap)"
939
- ).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(
940
952
  "--severity <level>",
941
953
  `minimum severity reported: ${SEVERITY_LIST}`,
942
954
  CHECK_DEFAULTS.severity
@@ -958,7 +970,7 @@ function buildProgram2() {
958
970
  throw new A11yError(`Unknown --format "${format}". Use ${A11Y_FORMAT_LIST}.`);
959
971
  }
960
972
  const severity = assertSeverity(options.severity);
961
- const maxPages = options.maxPages === void 0 ? void 0 : positiveInteger(options.maxPages, "--max-pages");
973
+ const maxPages = parseMaxPages(options.maxPages);
962
974
  const timeout = positiveInteger(options.timeout, "--timeout");
963
975
  const loaded = options.config === false ? { config: {}, source: null, collections: [] } : await loadA11yConfig(process.cwd(), options.config);
964
976
  const cfg = loaded.config;
@@ -975,9 +987,10 @@ function buildProgram2() {
975
987
  const run = await runCheck2(
976
988
  {
977
989
  urls: seeds,
978
- crawl: typed("crawl") ? options.crawl : cfg.crawl ?? CHECK_DEFAULTS.crawl,
979
- // Typed flag > config key > no cap. There is no default to fall to.
980
- 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),
981
994
  tags: options.tags !== void 0 ? splitList2(options.tags) : cfg.tags ?? CHECK_DEFAULTS.tags,
982
995
  severity: typed("severity") ? severity : cfg.severity ?? CHECK_DEFAULTS.severity,
983
996
  timeout: typed("timeout") ? timeout : cfg.timeout ?? CHECK_DEFAULTS.timeout
@@ -1013,6 +1026,7 @@ var RULE_DESCRIPTIONS = {
1013
1026
  "source-missing": "The cited source file is not tracked under the root, or cannot be decrypted.",
1014
1027
  "claim-moved": "The cited sentence moved to other lines of the page.",
1015
1028
  "claim-moved-ambiguous": "The cited sentence now appears at several places on the page.",
1029
+ "claim-reanchored": "The cited sentence's words are unchanged since the claim's baseline, and only its layout moved.",
1016
1030
  "claim-changed": "The cited sentence was edited since the citation pinned it.",
1017
1031
  "marker-orphan": "A marker names an id no citation has.",
1018
1032
  "marker-invalid": "A marker is malformed, or the page has too many markers.",