@hawkeyexl/manni 3.0.0 → 4.0.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/README.md CHANGED
@@ -49,7 +49,7 @@ The metadata tool used to be the whole package. Three things changed:
49
49
  - **The config file.** `manni.config.yaml`, shared by every tool in the
50
50
  family, with the metadata tool's keys under `meta:`. A `docmeta.config.yaml`
51
51
  is still read, with a warning.
52
- - **The GitHub Action.** `uses: hawkeyexl/manni@v3`, same inputs.
52
+ - **The GitHub Action.** `uses: hawkeyexl/manni@v4`, same inputs.
53
53
 
54
54
  The rename changed nothing else. The exit codes, the output formats and the
55
55
  programmatic API carry over, and so do the built-in schemas and their published
@@ -83,7 +83,7 @@ defaults to inline PR annotations:
83
83
 
84
84
  ```yaml
85
85
  - uses: actions/checkout@v7
86
- - uses: hawkeyexl/manni@v3
86
+ - uses: hawkeyexl/manni@v4
87
87
  with:
88
88
  paths: "docs/**/*.md"
89
89
  ```
@@ -102,7 +102,7 @@ actually reads rather than hand-written:
102
102
  ```yaml
103
103
  repos:
104
104
  - repo: https://github.com/hawkeyexl/manni
105
- rev: v3.0.0
105
+ rev: v4.0.0
106
106
  hooks:
107
107
  - id: manni-meta
108
108
  ```
@@ -63,7 +63,7 @@ import {
63
63
  terminalConfirm,
64
64
  toJsonText,
65
65
  warn
66
- } from "./chunk-I6PYC7EP.js";
66
+ } from "./chunk-O7RMPQZ4.js";
67
67
 
68
68
  // src/meta/cli.ts
69
69
  import { existsSync } from "node:fs";
@@ -1533,4 +1533,4 @@ export {
1533
1533
  reportConfig,
1534
1534
  buildProgram
1535
1535
  };
1536
- //# sourceMappingURL=chunk-G7INFKNJ.js.map
1536
+ //# sourceMappingURL=chunk-J3KIKNWZ.js.map
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "@hawkeyexl/manni",
11
- version: "3.0.0",
11
+ version: "4.0.0",
12
12
  description: "One command line for documentation that is meant to be checked. `manni meta` validates the presence and format of document metadata (Markdown frontmatter and more) against JSON Schema, built for CI. Formerly docmeta.",
13
13
  type: "module",
14
14
  bin: {
@@ -26,7 +26,9 @@ var package_default = {
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  files: [
29
- "dist"
29
+ "dist",
30
+ "schemas",
31
+ "templates"
30
32
  ],
31
33
  repository: {
32
34
  type: "git",
@@ -55,6 +57,8 @@ var package_default = {
55
57
  lint: "eslint .",
56
58
  "check:deps": "node scripts/check-deps.mjs",
57
59
  "query:ui": "npm run build && node dist/cli.js meta query --db .manni/meta/query.db && node scripts/query-ui.mjs .manni/meta/query.db",
60
+ "check:tgdp-pin": "node scripts/lint-check-tgdp-pin.mjs",
61
+ "smoke:lint": "npm run build && node scripts/lint-smoke.mjs",
58
62
  "docs:check-cli": "node scripts/check-cli-reference.mjs",
59
63
  "docs:check-action": "node scripts/check-action-reference.mjs",
60
64
  "docs:check-api": "node scripts/check-api-reference.mjs",
@@ -85,6 +89,8 @@ var package_default = {
85
89
  esbuild: "^0.28.2"
86
90
  },
87
91
  dependencies: {
92
+ "@apidevtools/json-schema-ref-parser": "^11.9.3",
93
+ "@asciidoctor/core": "^3.0.4",
88
94
  "@axe-core/playwright": "^4.13.0",
89
95
  "@hawkeyexl/inference": "^0.3.2",
90
96
  "@xmldom/xmldom": "^0.9.12",
@@ -94,11 +100,18 @@ var package_default = {
94
100
  commander: "^15.0.0",
95
101
  "fast-glob": "^3.3.2",
96
102
  "github-slugger": "^2.0.0",
103
+ "mdast-util-to-string": "^4.0.0",
97
104
  parse5: "^8.0.1",
98
105
  picocolors: "^1.1.1",
99
106
  picomatch: "^4.0.7",
100
107
  "playwright-core": "^1.63.0",
108
+ "remark-frontmatter": "^5.0.0",
109
+ "remark-gfm": "^4.0.1",
110
+ "remark-mdx": "^3.1.1",
111
+ "remark-parse": "^11.0.0",
101
112
  "smol-toml": "^1.8.0",
113
+ unified: "^11.0.5",
114
+ "unist-util-visit": "^5.1.0",
102
115
  yaml: "^2.6.1"
103
116
  },
104
117
  devDependencies: {
@@ -111,8 +124,10 @@ var package_default = {
111
124
  "@semantic-release/github": "^12.0.8",
112
125
  "@semantic-release/npm": "^13.1.5",
113
126
  "@semantic-release/release-notes-generator": "^14.1.1",
127
+ "@types/mdast": "^4.0.4",
114
128
  "@types/node": "^26.3.0",
115
129
  "@types/picomatch": "^4.0.3",
130
+ "@types/unist": "^3.0.3",
116
131
  "@vitest/coverage-v8": "^4.1.11",
117
132
  eslint: "^10.9.1",
118
133
  globals: "^17.11.0",
@@ -9294,8 +9309,9 @@ function searchPath(cwd) {
9294
9309
 
9295
9310
  // src/shared/tools.ts
9296
9311
  import { isAbsolute as isAbsolute3, resolve as resolve5 } from "node:path";
9297
- var TOOL_KEYS = ["vale"];
9312
+ var TOOL_KEYS = ["vale", "dita-ot"];
9298
9313
  var VALE_KEYS = ["config"];
9314
+ var DITA_OT_KEYS = ["home"];
9299
9315
  function isMapping2(value) {
9300
9316
  return typeof value === "object" && value !== null && !Array.isArray(value);
9301
9317
  }
@@ -9318,6 +9334,9 @@ function parseTools(raw, source, toError) {
9318
9334
  if (Object.hasOwn(raw, "vale")) {
9319
9335
  tools.vale = parseVale(raw["vale"], source, toError);
9320
9336
  }
9337
+ if (Object.hasOwn(raw, "dita-ot")) {
9338
+ tools["dita-ot"] = parseDitaOt(raw["dita-ot"], source, toError);
9339
+ }
9321
9340
  return tools;
9322
9341
  }
9323
9342
  function parseVale(raw, source, toError) {
@@ -9335,11 +9354,31 @@ function parseVale(raw, source, toError) {
9335
9354
  }
9336
9355
  return vale;
9337
9356
  }
9357
+ function parseDitaOt(raw, source, toError) {
9358
+ if (!isMapping2(raw)) {
9359
+ throw toError(`${source}: tools.dita-ot must be a mapping.`);
9360
+ }
9361
+ rejectUnknownKeys2(raw, DITA_OT_KEYS, "tools.dita-ot", source, toError);
9362
+ const ditaOt = {};
9363
+ if (Object.hasOwn(raw, "home")) {
9364
+ const home = raw["home"];
9365
+ if (typeof home !== "string" || home.trim() === "") {
9366
+ throw toError(`${source}: tools.dita-ot.home must be a non-empty string.`);
9367
+ }
9368
+ ditaOt.home = home;
9369
+ }
9370
+ return ditaOt;
9371
+ }
9338
9372
  function valeConfigPath(tools, configDir) {
9339
9373
  const config = tools.vale?.config;
9340
9374
  if (config === void 0) return void 0;
9341
9375
  return isAbsolute3(config) ? config : resolve5(configDir, config);
9342
9376
  }
9377
+ function ditaOtHome(tools, configDir) {
9378
+ const home = tools["dita-ot"]?.home;
9379
+ if (home === void 0) return void 0;
9380
+ return isAbsolute3(home) ? home : resolve5(configDir, home);
9381
+ }
9343
9382
 
9344
9383
  // src/shared/warn.ts
9345
9384
  var said = /* @__PURE__ */ new Set();
@@ -10623,6 +10662,42 @@ async function statOrNull(p) {
10623
10662
  return null;
10624
10663
  }
10625
10664
  }
10665
+ var UP = "^^";
10666
+ function cwdFrame(posix7) {
10667
+ let rest = posix7.startsWith("./") ? posix7.slice(2) : posix7;
10668
+ const steps = [];
10669
+ while (rest === ".." || rest.startsWith("../")) {
10670
+ steps.push(UP);
10671
+ rest = rest === ".." ? "" : rest.slice(3);
10672
+ }
10673
+ if (steps.length === 0) return rest;
10674
+ return rest === "" ? steps.join("/") : `${steps.join("/")}/${rest}`;
10675
+ }
10676
+ function ignoredByGlobs(file, framed) {
10677
+ return matchesFileGlob(cwdFrame(file), framed);
10678
+ }
10679
+ async function walkDirectory(cwd, abs, ignore, framed) {
10680
+ const base = toPosix(relative6(cwd, abs));
10681
+ const escapes = base === ".." || base.startsWith("../");
10682
+ const anchorAtDir = base === "" || escapes;
10683
+ const root = anchorAtDir ? abs : cwd;
10684
+ const found = await fg2(anchorAtDir ? "**/*" : `${fg2.escapePath(base)}/**/*`, {
10685
+ cwd: root,
10686
+ // Anchored at the directory, these entries are in *its* frame, and a user's
10687
+ // exclude is not - so only the structural defaults go down, which mean the
10688
+ // same thing in any frame. Where the two frames coincide the whole list
10689
+ // prunes, exactly as it always did.
10690
+ ignore: escapes ? DEFAULT_IGNORE : ignore,
10691
+ onlyFiles: true,
10692
+ dot: false
10693
+ });
10694
+ const files = [];
10695
+ for (const file of found) {
10696
+ const rel = toPosix(relative6(cwd, resolve10(root, file)));
10697
+ if (!ignoredByGlobs(rel, framed)) files.push(rel);
10698
+ }
10699
+ return files;
10700
+ }
10626
10701
  function gitignoreOptions(opts) {
10627
10702
  const asked = opts.flag === true || opts.flag === void 0 && opts.configured === true;
10628
10703
  const notice2 = opts.onNotice;
@@ -10641,6 +10716,7 @@ async function resolveTargetSet(opts) {
10641
10716
  (e) => e.toLowerCase().startsWith(".") ? e.toLowerCase() : `.${e.toLowerCase()}`
10642
10717
  );
10643
10718
  const ignore = [...DEFAULT_IGNORE, ...opts.exclude ?? []];
10719
+ const framed = ignore.map((pattern) => cwdFrame(toPosix(pattern)));
10644
10720
  const named = /* @__PURE__ */ new Set();
10645
10721
  const walked = /* @__PURE__ */ new Set();
10646
10722
  const keepByExt = (file) => exts.includes(extname(file).toLowerCase());
@@ -10655,13 +10731,9 @@ async function resolveTargetSet(opts) {
10655
10731
  continue;
10656
10732
  }
10657
10733
  if (st?.isDirectory()) {
10658
- const found2 = await fg2(`${posixInput}/**/*`, {
10659
- cwd,
10660
- ignore,
10661
- onlyFiles: true,
10662
- dot: false
10663
- });
10664
- for (const f of found2) if (keepByExt(f)) walked.add(f);
10734
+ for (const f of await walkDirectory(cwd, abs, ignore, framed)) {
10735
+ if (keepByExt(f)) walked.add(f);
10736
+ }
10665
10737
  continue;
10666
10738
  }
10667
10739
  if (!picomatch3.scan(posixInput).isGlob) {
@@ -10674,7 +10746,10 @@ async function resolveTargetSet(opts) {
10674
10746
  onlyFiles: true,
10675
10747
  dot: false
10676
10748
  });
10677
- for (const f of found) if (keepByExt(f)) walked.add(f);
10749
+ for (const f of found) {
10750
+ if (ignoredByGlobs(toPosix(f), framed)) continue;
10751
+ if (keepByExt(f)) walked.add(f);
10752
+ }
10678
10753
  }
10679
10754
  if (missing.length > 0 && !opts.allowEmpty) {
10680
10755
  const names = missing.map((m) => `"${m}"`).join(", ");
@@ -24830,6 +24905,7 @@ export {
24830
24905
  decryptValue,
24831
24906
  findGitRoot,
24832
24907
  valeConfigPath,
24908
+ ditaOtHome,
24833
24909
  programName,
24834
24910
  warn,
24835
24911
  notice,
@@ -24865,6 +24941,7 @@ export {
24865
24941
  toFileLines,
24866
24942
  toBodyLines,
24867
24943
  splitPageArgument,
24944
+ writeTextAtomic,
24868
24945
  ENCRYPTION_KEY_ENV,
24869
24946
  resolveEncryptionKey,
24870
24947
  writeEncryptionKey,
@@ -25033,4 +25110,4 @@ export {
25033
25110
  renderQuery,
25034
25111
  renderQueryCsv
25035
25112
  };
25036
- //# sourceMappingURL=chunk-I6PYC7EP.js.map
25113
+ //# sourceMappingURL=chunk-O7RMPQZ4.js.map