@descent-vtt/spec-graph 0.8.0 → 0.9.1

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +483 -38
  2. package/README.md +134 -49
  3. package/dist/cli.d.ts +2 -2
  4. package/dist/cli.js +38 -19
  5. package/dist/cli.js.map +1 -1
  6. package/dist/directives.d.ts +9 -2
  7. package/dist/directives.js +15 -4
  8. package/dist/directives.js.map +1 -1
  9. package/dist/extract.d.ts +1 -1
  10. package/dist/extract.js +50 -16
  11. package/dist/extract.js.map +1 -1
  12. package/dist/glob.d.ts +44 -44
  13. package/dist/glob.js +152 -116
  14. package/dist/glob.js.map +1 -1
  15. package/dist/index.d.ts +3 -3
  16. package/dist/index.js +4 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/lifecycle.js +10 -2
  19. package/dist/lifecycle.js.map +1 -1
  20. package/dist/markdown.d.ts +53 -161
  21. package/dist/markdown.js +42 -864
  22. package/dist/markdown.js.map +1 -1
  23. package/dist/report.d.ts +23 -0
  24. package/dist/report.js +80 -0
  25. package/dist/report.js.map +1 -1
  26. package/dist/rules.js +48 -14
  27. package/dist/rules.js.map +1 -1
  28. package/dist/sections.d.ts +1 -1
  29. package/dist/sections.js +7 -3
  30. package/dist/sections.js.map +1 -1
  31. package/dist/select.d.ts +2 -2
  32. package/dist/select.js +3 -3
  33. package/dist/select.js.map +1 -1
  34. package/dist/source.d.ts +6 -19
  35. package/dist/source.js +4 -70
  36. package/dist/source.js.map +1 -1
  37. package/dist/types.d.ts +23 -3
  38. package/dist/types.js +1 -1
  39. package/dist/types.js.map +1 -1
  40. package/dist/vendor/spec-core/markdown/frontmatter.d.ts +103 -0
  41. package/dist/vendor/spec-core/markdown/frontmatter.js +459 -0
  42. package/dist/vendor/spec-core/markdown/frontmatter.js.map +1 -0
  43. package/dist/vendor/spec-core/markdown/headings.d.ts +45 -0
  44. package/dist/vendor/spec-core/markdown/headings.js +199 -0
  45. package/dist/vendor/spec-core/markdown/headings.js.map +1 -0
  46. package/dist/vendor/spec-core/markdown/index.d.ts +5 -0
  47. package/dist/vendor/spec-core/markdown/index.js +4 -0
  48. package/dist/vendor/spec-core/markdown/index.js.map +1 -0
  49. package/dist/vendor/spec-core/markdown/layout.d.ts +39 -0
  50. package/dist/vendor/spec-core/markdown/layout.js +28 -0
  51. package/dist/vendor/spec-core/markdown/layout.js.map +1 -0
  52. package/dist/vendor/spec-core/markdown/links.d.ts +25 -0
  53. package/dist/vendor/spec-core/markdown/links.js +394 -0
  54. package/dist/vendor/spec-core/markdown/links.js.map +1 -0
  55. package/dist/vendor/spec-core/markdown/lists.d.ts +22 -0
  56. package/dist/vendor/spec-core/markdown/lists.js +127 -0
  57. package/dist/vendor/spec-core/markdown/lists.js.map +1 -0
  58. package/dist/vendor/spec-core/markdown/scan.d.ts +36 -0
  59. package/dist/vendor/spec-core/markdown/scan.js +463 -0
  60. package/dist/vendor/spec-core/markdown/scan.js.map +1 -0
  61. package/dist/vendor/spec-core/markdown/syntax.d.ts +75 -0
  62. package/dist/vendor/spec-core/markdown/syntax.js +181 -0
  63. package/dist/vendor/spec-core/markdown/syntax.js.map +1 -0
  64. package/dist/vendor/spec-core/markdown/tables.d.ts +18 -0
  65. package/dist/vendor/spec-core/markdown/tables.js +86 -0
  66. package/dist/vendor/spec-core/markdown/tables.js.map +1 -0
  67. package/dist/vendor/spec-core/markdown/types.d.ts +290 -0
  68. package/dist/vendor/spec-core/markdown/types.js +9 -0
  69. package/dist/vendor/spec-core/markdown/types.js.map +1 -0
  70. package/dist/vendor/spec-core/path/index.d.ts +1 -0
  71. package/dist/vendor/spec-core/path/index.js +2 -0
  72. package/dist/vendor/spec-core/path/index.js.map +1 -0
  73. package/dist/vendor/spec-core/path/posix.d.ts +83 -0
  74. package/dist/vendor/spec-core/path/posix.js +150 -0
  75. package/dist/vendor/spec-core/path/posix.js.map +1 -0
  76. package/dist/vendor/spec-core/pattern/automaton.d.ts +129 -0
  77. package/dist/vendor/spec-core/pattern/automaton.js +340 -0
  78. package/dist/vendor/spec-core/pattern/automaton.js.map +1 -0
  79. package/dist/vendor/spec-core/pattern/charset.d.ts +58 -0
  80. package/dist/vendor/spec-core/pattern/charset.js +116 -0
  81. package/dist/vendor/spec-core/pattern/charset.js.map +1 -0
  82. package/dist/vendor/spec-core/pattern/glob.d.ts +121 -0
  83. package/dist/vendor/spec-core/pattern/glob.js +481 -0
  84. package/dist/vendor/spec-core/pattern/glob.js.map +1 -0
  85. package/dist/vendor/spec-core/pattern/index.d.ts +6 -0
  86. package/dist/vendor/spec-core/pattern/index.js +4 -0
  87. package/dist/vendor/spec-core/pattern/index.js.map +1 -0
  88. package/dist/{regex.d.ts → vendor/spec-core/pattern/regex.d.ts} +20 -29
  89. package/dist/{regex.js → vendor/spec-core/pattern/regex.js} +40 -49
  90. package/dist/vendor/spec-core/pattern/regex.js.map +1 -0
  91. package/dist/vendor/spec-core/text/index.d.ts +2 -0
  92. package/dist/vendor/spec-core/text/index.js +2 -0
  93. package/dist/vendor/spec-core/text/index.js.map +1 -0
  94. package/dist/vendor/spec-core/text/lines.d.ts +72 -0
  95. package/dist/vendor/spec-core/text/lines.js +156 -0
  96. package/dist/vendor/spec-core/text/lines.js.map +1 -0
  97. package/dist/yaml.d.ts +44 -12
  98. package/dist/yaml.js +115 -206
  99. package/dist/yaml.js.map +1 -1
  100. package/package.json +4 -3
  101. package/src/vendor/spec-core/LICENSE +21 -0
  102. package/src/vendor/spec-core/README.md +8 -0
  103. package/dist/regex.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,eAAe,EAAkB,MAAM,aAAa,CAAC;AAgK9D,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,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AAI,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC1D,CAAC,IAAI,CAAC,CAAC;IACT,CAAC;IACD,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IAC/C,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACnF,CAAC;AAED,8EAA8E;AAC9E,SAAS,UAAU,CAAC,GAAW;IAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACzD,CAAC","sourcesContent":["/**\n * A structural Markdown scanner.\n *\n * This is deliberately **not** a CommonMark implementation. spec-graph needs six\n * things from a document - front matter, headings, list items with their\n * continuations, HTML comments, links, and a reliable map of what is code - and\n * a full parser would cost a dependency tree, an AST walk, and a position\n * mapping layer to get back the offsets we want in the first place.\n *\n * What the scanner does guarantee is the part that makes regex-based spec\n * linters lie:\n *\n * - **Code never counts.** Fenced blocks, indented blocks and inline spans are\n * masked before a single link is extracted, so an example in a code sample\n * never becomes a graph edge.\n * - **Items are blocks, not lines.** A list item owns its wrapped continuation\n * lines and its nested content, so a resolution written on the second line of\n * a bullet is found instead of missed.\n * - **Everything carries absolute offsets.** No re-scanning, no drift between\n * the text a rule matched and the position it reports.\n */\n\nimport { createLineIndex, type LineIndex } from './source.js';\n\n/* -------------------------------------------------------------------------- */\n/* Shapes */\n/* -------------------------------------------------------------------------- */\n\nexport interface Range {\n readonly start: number;\n readonly end: number;\n}\n\nexport interface FrontMatter {\n /** The body between the delimiters, exclusive. */\n readonly raw: string;\n /** Offset of the first character of `raw`. */\n readonly start: number;\n readonly end: number;\n /** Offset just past the closing delimiter line. */\n readonly bodyStart: number;\n}\n\nexport interface ScannedLine {\n /** 1-based. */\n readonly line: number;\n /** Offset of the raw line start. */\n readonly start: number;\n /** Offset just past the line, excluding its terminator. */\n readonly end: number;\n /** Offset of the first character after any block-quote markers. */\n readonly contentStart: number;\n /** Line text after block-quote markers, indentation intact. */\n readonly content: string;\n /** Indentation of `content`, tabs counted as four columns. */\n readonly indent: number;\n readonly blank: boolean;\n readonly quoteDepth: number;\n /** Inside a fenced or indented code block, fence delimiters included. */\n readonly code: boolean;\n}\n\nexport interface Heading {\n readonly level: number;\n readonly text: string;\n /** GitHub-compatible anchor slug. */\n readonly slug: string;\n readonly start: number;\n readonly end: number;\n readonly line: number;\n}\n\nexport interface ListItem {\n /** The whole block: marker line plus continuations and nested content. */\n readonly start: number;\n readonly end: number;\n /** Offset of the list marker itself. */\n readonly markerStart: number;\n readonly marker: string;\n /** Offset where the item text begins, after marker and any checkbox. */\n readonly textStart: number;\n /** The character inside `[ ]`, or `null` when the item has no checkbox. */\n readonly checkbox: string | null;\n readonly checkboxStart: number | null;\n /** First line of item text, trimmed. */\n readonly firstLine: string;\n /** Full item text including continuations and nested content. */\n readonly body: string;\n /**\n * `body` with code and comments blanked out, same length and offsets.\n *\n * Anything that searches item text for meaning - resolution markers above\n * all - must read this rather than `body`, or a fenced example nested under\n * the item will close it.\n */\n readonly maskedBody: string;\n readonly line: number;\n /** How many list items enclose this one. Top-level items are `0`. */\n readonly depth: number;\n readonly indent: number;\n}\n\nexport interface HtmlComment {\n readonly start: number;\n readonly end: number;\n /** Text between `<!--` and `-->`. */\n readonly inner: string;\n readonly innerStart: number;\n readonly line: number;\n}\n\nexport type LinkForm = 'inline' | 'reference' | 'shortcut' | 'autolink' | 'wiki' | 'definition';\n\nexport interface Link {\n /** Visible label. Empty for autolinks and definitions. */\n readonly text: string;\n /** Destination as written: a path or a URL. */\n readonly target: string;\n /** Offset of the whole construct. */\n readonly start: number;\n readonly end: number;\n /**\n * Offset of `target` inside the source, for precise diagnostics.\n *\n * For a reference link this is inside the definition, not inside the use:\n * `[design][one]` has no destination of its own, and the line a human edits\n * to fix it is the one that says what `one` points at.\n */\n readonly targetStart: number;\n /**\n * The reference label, for the two forms written with one.\n *\n * `null` everywhere else. Kept because `target` is the destination the label\n * stands for, and a report quoting `[design][docs/gone.md]` would be quoting\n * something the author never wrote.\n */\n readonly label: string | null;\n readonly form: LinkForm;\n readonly line: number;\n}\n\nexport interface TableCell {\n /** Cell text as written, trimmed. */\n readonly text: string;\n /** Offset of the trimmed text, so a finding can point at the cell itself. */\n readonly start: number;\n readonly end: number;\n}\n\nexport interface TableRow {\n readonly cells: readonly TableCell[];\n readonly start: number;\n readonly end: number;\n readonly line: number;\n}\n\nexport interface Table {\n readonly start: number;\n readonly end: number;\n /** Header cells, trimmed. A table without a header row is not a table. */\n readonly headers: readonly TableCell[];\n readonly rows: readonly TableRow[];\n}\n\nexport interface ScannedDocument {\n readonly text: string;\n readonly index: LineIndex;\n readonly frontMatter: FrontMatter | null;\n /** Offset where the body starts, after any front matter. */\n readonly bodyStart: number;\n readonly lines: readonly ScannedLine[];\n readonly headings: readonly Heading[];\n readonly listItems: readonly ListItem[];\n readonly comments: readonly HtmlComment[];\n readonly links: readonly Link[];\n readonly tables: readonly Table[];\n /** Code and comments blanked out, offsets and line breaks preserved. */\n readonly masked: string;\n /** True when the offset falls inside code, a comment, or front matter. */\n isMasked(offset: number): boolean;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Entry point */\n/* -------------------------------------------------------------------------- */\n\nexport function scanMarkdown(source: string): ScannedDocument {\n const text = source.charCodeAt(0) === 0xfeff ? source.slice(1) : source;\n const index = createLineIndex(text);\n const frontMatter = readFrontMatter(text, index);\n const bodyStart = frontMatter ? frontMatter.bodyStart : 0;\n\n const lines = scanLines(text, index, bodyStart);\n // Raw-text HTML joins the code ranges rather than sitting beside them: what\n // both have in common is that their content is not Markdown, and every reader\n // downstream - comments, links, tables - already asks that one question.\n const codeRanges = mergeRanges([...collectCodeRanges(lines, bodyStart), ...collectRawTextHtml(lines, bodyStart)]);\n const comments = scanComments(text, index, bodyStart, codeRanges);\n\n const inlineCode = scanInlineCode(text, bodyStart, codeRanges, comments);\n const maskRanges = [\n ...(frontMatter ? [{ start: 0, end: frontMatter.bodyStart }] : []),\n ...codeRanges,\n ...inlineCode,\n ...comments.map((c) => ({ start: c.start, end: c.end })),\n ];\n const masked = applyMask(text, maskRanges);\n const sortedMask = mergeRanges(maskRanges);\n\n const headings = scanHeadings(lines);\n const listItems = scanListItems(lines, text, masked);\n const links = scanLinks(masked, text, index);\n const tables = scanTables(lines, text, masked);\n\n return {\n text,\n index,\n frontMatter,\n bodyStart,\n lines,\n headings,\n listItems,\n comments,\n links,\n tables,\n masked,\n isMasked: (offset) => containsOffset(sortedMask, offset),\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* Front matter */\n/* -------------------------------------------------------------------------- */\n\nconst FENCE_FM = /^(-{3,}|\\+{3,})[ \\t]*$/;\n\nfunction readFrontMatter(text: string, index: LineIndex): FrontMatter | null {\n if (index.lineCount === 0) return null;\n const first = index.lineText(1);\n const open = FENCE_FM.exec(first);\n if (!open) return null;\n const closer = (open[1] as string).startsWith('-') ? /^(-{3,}|\\.{3,})[ \\t]*$/ : /^\\+{3,}[ \\t]*$/;\n\n for (let line = 2; line <= index.lineCount; line += 1) {\n if (closer.test(index.lineText(line))) {\n const start = index.lineStart(2);\n const end = index.lineStart(line);\n const bodyStart = line < index.lineCount ? index.lineStart(line + 1) : text.length;\n return { raw: text.slice(start, end), start, end, bodyStart };\n }\n }\n // An unterminated opener is a horizontal rule, not front matter.\n return null;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Line classification */\n/* -------------------------------------------------------------------------- */\n\nconst LIST_MARKER = /^([ \\t]*)([-*+]|\\d{1,9}[.)])([ \\t]+|$)/;\nconst ATX_HEADING = /^ {0,3}(#{1,6})(?:[ \\t]+(.*?))?[ \\t]*(?:#+[ \\t]*)?$/;\nconst SETEXT_UNDERLINE = /^ {0,3}(=+|-+)[ \\t]*$/;\nconst THEMATIC_BREAK = /^ {0,3}(?:(?:\\*[ \\t]*){3,}|(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,})$/;\nconst FENCE_OPEN = /^([ \\t]*)(`{3,}|~{3,})(.*)$/;\n\n/** Counts indentation in columns, expanding tabs to the next multiple of four. */\nfunction measureIndent(line: string): number {\n let width = 0;\n for (const ch of line) {\n if (ch === ' ') width += 1;\n else if (ch === '\\t') width += 4 - (width % 4);\n else break;\n }\n return width;\n}\n\n/** Strips `>` block-quote markers, returning the offset and text of the content. */\nfunction stripQuotes(raw: string, lineStart: number): { contentStart: number; content: string; depth: number } {\n let i = 0;\n let depth = 0;\n for (;;) {\n let j = i;\n let spaces = 0;\n while (j < raw.length && (raw[j] === ' ' || raw[j] === '\\t') && spaces < 3) {\n spaces += 1;\n j += 1;\n }\n if (raw[j] !== '>') break;\n j += 1;\n if (raw[j] === ' ') j += 1;\n depth += 1;\n i = j;\n }\n return { contentStart: lineStart + i, content: raw.slice(i), depth };\n}\n\nfunction scanLines(text: string, index: LineIndex, bodyStart: number): ScannedLine[] {\n const out: ScannedLine[] = [];\n const firstLine = index.positionAt(bodyStart).line;\n\n let fence: { char: string; length: number; indent: number } | null = null;\n let inList = false;\n let listIndent = 0;\n let previousBlank = true;\n let indentedCode = false;\n\n for (let line = firstLine; line <= index.lineCount; line += 1) {\n const start = index.lineStart(line);\n const end = index.lineEnd(line);\n if (end < bodyStart) continue;\n const raw = text.slice(start, end);\n const { contentStart, content, depth } = stripQuotes(raw, start);\n const indent = measureIndent(content);\n const blank = content.trim().length === 0;\n\n let code = false;\n\n if (fence) {\n code = true;\n const close = FENCE_OPEN.exec(content);\n if (\n close &&\n (close[2] as string)[0] === fence.char &&\n (close[2] as string).length >= fence.length &&\n (close[3] as string).trim().length === 0 &&\n measureIndent(close[1] as string) <= fence.indent + 3\n ) {\n fence = null;\n }\n } else {\n const open = FENCE_OPEN.exec(content);\n if (open && (open[3] as string).indexOf('`') === -1) {\n fence = {\n char: (open[2] as string)[0] as string,\n length: (open[2] as string).length,\n indent: measureIndent(open[1] as string),\n };\n code = true;\n indentedCode = false;\n } else if (blank) {\n code = indentedCode;\n } else {\n // Indented code is only recognised outside list containers. Inside a\n // list, four-space indentation is ordinary continuation far more often\n // than it is a code block, and masking a continuation would silently\n // drop the links and resolutions written there.\n if (!inList && indent >= 4 && (previousBlank || indentedCode)) {\n code = true;\n indentedCode = true;\n } else {\n indentedCode = false;\n }\n }\n }\n\n if (!code && !blank) {\n const marker = LIST_MARKER.exec(content);\n if (marker) {\n inList = true;\n listIndent = indent;\n } else if (inList && indent === 0 && previousBlank) {\n inList = false;\n listIndent = 0;\n } else if (inList && indent <= listIndent && previousBlank && ATX_HEADING.test(content)) {\n inList = false;\n listIndent = 0;\n }\n if (ATX_HEADING.test(content) && indent < 4) {\n inList = false;\n listIndent = 0;\n }\n }\n\n out.push({ line, start, end, contentStart, content, indent, blank, quoteDepth: depth, code });\n previousBlank = blank;\n }\n\n return out;\n}\n\n/**\n * `<script>`, `<style>`, `<pre>` and `<textarea>` blocks.\n *\n * These four are the only HTML elements whose content is not Markdown - the\n * CommonMark spec calls them out by name for exactly that reason - and the\n * distinction is load-bearing here rather than pedantic. A page explaining how\n * to annotate a document puts `<!-- @spec-node id=\"...\" -->` inside a script\n * sample or a `<pre>` block, and reading that as a directive lets a worked\n * example rename the document it appears in.\n *\n * `<div>` and `<details>` are deliberately not on the list. Their content *is*\n * Markdown, and a decision written inside a collapsed `<details>` section is\n * still a decision.\n */\nconst RAW_TEXT_OPEN = /^<(script|pre|style|textarea)(?:[\\s>]|$)/i;\nconst RAW_TEXT_CLOSE = /<\\/(?:script|pre|style|textarea)>/i;\n\nfunction collectRawTextHtml(lines: readonly ScannedLine[], bodyStart: number): Range[] {\n const ranges: Range[] = [];\n let open: { start: number; end: number } | null = null;\n for (const line of lines) {\n if (line.code) continue;\n if (open === null) {\n if (!RAW_TEXT_OPEN.test(line.content.trimStart())) continue;\n open = { start: Math.max(line.start, bodyStart), end: line.end };\n } else {\n open.end = line.end;\n }\n // The close tag ends the block on the line that carries it, whichever of\n // the four it names. An unclosed block runs to the end of the document,\n // which is what a browser does with it too.\n if (RAW_TEXT_CLOSE.test(line.content)) {\n ranges.push(open);\n open = null;\n }\n }\n if (open) ranges.push(open);\n return ranges;\n}\n\nfunction collectCodeRanges(lines: readonly ScannedLine[], bodyStart: number): Range[] {\n const ranges: Range[] = [];\n let open: { start: number; end: number } | null = null;\n for (const line of lines) {\n if (line.code) {\n const start = Math.max(line.start, bodyStart);\n if (open && open.end >= line.start - 2) open.end = line.end;\n else {\n if (open) ranges.push(open);\n open = { start, end: line.end };\n }\n } else if (open) {\n ranges.push(open);\n open = null;\n }\n }\n if (open) ranges.push(open);\n return ranges;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Headings */\n/* -------------------------------------------------------------------------- */\n\nexport function slugify(text: string): string {\n return text\n .trim()\n .toLowerCase()\n .replace(/[`*_~[\\]()<>#!|]/g, '')\n .replace(/[^\\p{L}\\p{N}\\s-]/gu, '')\n .trim()\n // GitHub hyphenates every whitespace character, so a run of two spaces left\n // behind by stripped punctuation becomes two hyphens, not one.\n .replace(/\\s/g, '-');\n}\n\nfunction scanHeadings(lines: readonly ScannedLine[]): Heading[] {\n const out: Heading[] = [];\n for (let i = 0; i < lines.length; i += 1) {\n const line = lines[i] as ScannedLine;\n if (line.code || line.blank) continue;\n\n const atx = ATX_HEADING.exec(line.content);\n if (atx && line.indent < 4) {\n const body = (atx[2] ?? '').trim();\n out.push({\n level: (atx[1] as string).length,\n text: body,\n slug: slugify(body),\n start: line.contentStart,\n end: line.end,\n line: line.line,\n });\n continue;\n }\n\n // Setext: an underline of `=` or `-` directly below a paragraph line. The\n // preceding line must not itself be a heading, a list item or a fence.\n const next = lines[i + 1];\n if (!next || next.code || next.blank) continue;\n const under = SETEXT_UNDERLINE.exec(next.content);\n if (!under) continue;\n if (LIST_MARKER.test(line.content) || THEMATIC_BREAK.test(line.content)) continue;\n if (line.indent >= 4) continue;\n const body = line.content.trim();\n if (body.length === 0) continue;\n out.push({\n level: (under[1] as string)[0] === '=' ? 1 : 2,\n text: body,\n slug: slugify(body),\n start: line.contentStart,\n end: next.end,\n line: line.line,\n });\n }\n return out;\n}\n\n/* -------------------------------------------------------------------------- */\n/* List items */\n/* -------------------------------------------------------------------------- */\n\nconst CHECKBOX = /^\\[([ xX~\\-?!*/+])\\](?=[ \\t]|$)/;\n\nfunction scanListItems(lines: readonly ScannedLine[], text: string, masked: string): ListItem[] {\n const out: ListItem[] = [];\n // Indents of the list items currently enclosing the cursor, outermost first.\n const stack: number[] = [];\n\n for (let i = 0; i < lines.length; i += 1) {\n const line = lines[i] as ScannedLine;\n if (line.code || line.blank) continue;\n const marker = LIST_MARKER.exec(line.content);\n if (!marker) continue;\n\n const indent = measureIndent(marker[1] as string);\n while (stack.length > 0 && indent <= (stack[stack.length - 1] as number)) stack.pop();\n const depth = stack.length;\n stack.push(indent);\n\n const markerStart = line.contentStart + (marker[1] as string).length;\n let textStart = markerStart + (marker[2] as string).length + (marker[3] as string).length;\n\n const rest = text.slice(textStart, line.end);\n const box = CHECKBOX.exec(rest);\n let checkbox: string | null = null;\n let checkboxStart: number | null = null;\n if (box) {\n checkbox = box[1] as string;\n checkboxStart = textStart;\n textStart += (box[0] as string).length;\n while (text[textStart] === ' ' || text[textStart] === '\\t') textStart += 1;\n }\n\n const end = findItemEnd(lines, i, indent);\n const firstLine = text.slice(textStart, line.end).trim();\n const body = text.slice(textStart, end);\n\n out.push({\n start: line.contentStart,\n end,\n markerStart,\n marker: marker[2] as string,\n textStart,\n checkbox,\n checkboxStart,\n firstLine,\n body,\n maskedBody: masked.slice(textStart, end),\n line: line.line,\n depth,\n indent,\n });\n }\n\n return out;\n}\n\n/**\n * Finds where a list item block ends.\n *\n * The item owns its wrapped continuation lines and everything nested under it.\n * It gives up ownership at the next sibling or shallower marker, at any\n * heading, and at the first non-indented line after a blank one.\n */\nfunction findItemEnd(lines: readonly ScannedLine[], startIndex: number, indent: number): number {\n let end = (lines[startIndex] as ScannedLine).end;\n let sawBlank = false;\n\n for (let i = startIndex + 1; i < lines.length; i += 1) {\n const line = lines[i] as ScannedLine;\n if (line.blank) {\n sawBlank = true;\n continue;\n }\n if (!line.code) {\n if (line.indent < 4 && ATX_HEADING.test(line.content)) break;\n if (line.indent <= indent) {\n if (sawBlank) break;\n if (LIST_MARKER.test(line.content)) break;\n if (THEMATIC_BREAK.test(line.content)) break;\n }\n }\n if (line.indent <= indent && sawBlank) break;\n end = line.end;\n sawBlank = false;\n }\n\n return end;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Tables */\n/* -------------------------------------------------------------------------- */\n\n/** `| :--- | ---: | :-: |` - the row that makes the line above it a header. */\nconst TABLE_DELIMITER = /^\\|?(?:\\s*:?-+:?\\s*\\|)+\\s*:?-*:?\\s*\\|?$/;\n\n/**\n * Finds pipe tables, with an offset for every cell.\n *\n * Cell offsets are the point: a register kept as a table needs findings that\n * name the cell declaring the relation, not the row and not the file.\n *\n * Splitting happens on the masked copy so a pipe inside inline code cannot\n * invent a column, while the text comes from the original.\n */\nfunction scanTables(lines: readonly ScannedLine[], text: string, masked: string): Table[] {\n const out: Table[] = [];\n\n for (let i = 0; i < lines.length - 1; i += 1) {\n const header = lines[i] as ScannedLine;\n const delimiter = lines[i + 1] as ScannedLine;\n if (header.code || header.blank || delimiter.code) continue;\n if (!header.content.includes('|')) continue;\n if (!TABLE_DELIMITER.test(delimiter.content.trim())) continue;\n\n const headers = splitRow(header, text, masked);\n if (headers.length === 0) continue;\n\n const rows: TableRow[] = [];\n let end = delimiter.end;\n for (let j = i + 2; j < lines.length; j += 1) {\n const line = lines[j] as ScannedLine;\n if (line.blank || line.code || !line.content.includes('|')) break;\n const cells = splitRow(line, text, masked);\n if (cells.length === 0) break;\n rows.push({ cells, start: line.contentStart, end: line.end, line: line.line });\n end = line.end;\n }\n\n out.push({ start: header.contentStart, end, headers, rows });\n i += rows.length + 1;\n }\n\n return out;\n}\n\n/** Splits one row into cells, keeping each cell's offset in the source. */\nfunction splitRow(line: ScannedLine, text: string, masked: string): TableCell[] {\n const from = line.contentStart;\n const to = line.end;\n const bounds: number[] = [];\n for (let i = from; i < to; i += 1) {\n if (masked[i] !== '|') continue;\n // A pipe escaped with a backslash is content, not a column edge.\n if (i > from && text[i - 1] === '\\\\') continue;\n bounds.push(i);\n }\n if (bounds.length === 0) return [];\n\n const cells: TableCell[] = [];\n // A leading pipe opens the first cell; without one the row starts at `from`.\n let cursor = (bounds[0] as number) === from ? from + 1 : from;\n for (const bound of bounds) {\n if (bound < cursor) continue;\n cells.push(makeCell(text, cursor, bound));\n cursor = bound + 1;\n }\n // Trailing content after the last pipe is a final cell unless the row ended\n // with a border pipe.\n if (cursor < to && text.slice(cursor, to).trim().length > 0) cells.push(makeCell(text, cursor, to));\n\n return cells;\n}\n\nfunction makeCell(text: string, start: number, end: number): TableCell {\n const raw = text.slice(start, end);\n const leading = raw.length - raw.trimStart().length;\n const trimmed = raw.trim();\n return { text: trimmed, start: start + leading, end: start + leading + trimmed.length };\n}\n\n/* -------------------------------------------------------------------------- */\n/* HTML comments */\n/* -------------------------------------------------------------------------- */\n\nfunction scanComments(text: string, index: LineIndex, bodyStart: number, code: readonly Range[]): HtmlComment[] {\n const out: HtmlComment[] = [];\n const merged = mergeRanges(code);\n let from = bodyStart;\n for (;;) {\n const open = text.indexOf('<!--', from);\n if (open === -1) break;\n if (containsOffset(merged, open)) {\n from = open + 4;\n continue;\n }\n const close = text.indexOf('-->', open + 4);\n if (close === -1) break;\n out.push({\n start: open,\n end: close + 3,\n inner: text.slice(open + 4, close),\n innerStart: open + 4,\n line: index.positionAt(open).line,\n });\n from = close + 3;\n }\n return out;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Inline code */\n/* -------------------------------------------------------------------------- */\n\nfunction scanInlineCode(\n text: string,\n bodyStart: number,\n code: readonly Range[],\n comments: readonly HtmlComment[],\n): Range[] {\n const blocked = mergeRanges([...code, ...comments.map((c) => ({ start: c.start, end: c.end }))]);\n const out: Range[] = [];\n let i = bodyStart;\n\n while (i < text.length) {\n if (text[i] !== '`') {\n i += 1;\n continue;\n }\n if (containsOffset(blocked, i)) {\n i += 1;\n continue;\n }\n let runStart = i;\n while (text[i] === '`') i += 1;\n const runLength = i - runStart;\n // An escaped backtick does not open a span.\n if (runStart > 0 && text[runStart - 1] === '\\\\') continue;\n\n let j = i;\n let closed = -1;\n while (j < text.length) {\n if (text[j] !== '`') {\n j += 1;\n continue;\n }\n const closeStart = j;\n while (text[j] === '`') j += 1;\n if (j - closeStart === runLength && !containsOffset(blocked, closeStart)) {\n closed = j;\n break;\n }\n }\n if (closed === -1) continue;\n out.push({ start: runStart, end: closed });\n i = closed;\n }\n\n return out;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Masking */\n/* -------------------------------------------------------------------------- */\n\nfunction mergeRanges(ranges: readonly Range[]): Range[] {\n if (ranges.length === 0) return [];\n const sorted = [...ranges].sort((a, b) => a.start - b.start || a.end - b.end);\n const out: Range[] = [{ ...(sorted[0] as Range) }];\n for (let i = 1; i < sorted.length; i += 1) {\n const next = sorted[i] as Range;\n const last = out[out.length - 1] as { start: number; end: number };\n if (next.start <= last.end) last.end = Math.max(last.end, next.end);\n else out.push({ ...next });\n }\n return out;\n}\n\nfunction containsOffset(sorted: readonly Range[], offset: number): boolean {\n let lo = 0;\n let hi = sorted.length - 1;\n while (lo <= hi) {\n const mid = (lo + hi) >> 1;\n const range = sorted[mid] as Range;\n if (offset < range.start) hi = mid - 1;\n else if (offset >= range.end) lo = mid + 1;\n else return true;\n }\n return false;\n}\n\n/**\n * Blanks out the given ranges.\n *\n * Line terminators survive so every offset, line and column in the masked copy\n * still matches the original. Callers slice the original text for content and\n * search the masked copy for structure.\n */\nfunction applyMask(text: string, ranges: readonly Range[]): string {\n const merged = mergeRanges(ranges);\n if (merged.length === 0) return text;\n\n // Built from slices rather than a per-character array. Masking runs over every\n // byte of every document, and a `split('')`/`join('')` round trip allocates an\n // array entry per character - on a large corpus that was the single most\n // expensive thing the scanner did.\n let out = '';\n let cursor = 0;\n for (const range of merged) {\n const start = Math.max(range.start, cursor);\n const end = Math.min(range.end, text.length);\n if (end <= start) continue;\n out += text.slice(cursor, start);\n // The character class is deliberately not Unicode-aware: a surrogate pair\n // must become two spaces so that every later offset still lines up.\n out += text.slice(start, end).replace(NON_TERMINATOR, ' ');\n cursor = end;\n }\n return out + text.slice(cursor);\n}\n\nconst NON_TERMINATOR = /[^\\n\\r]/g;\n\n/* -------------------------------------------------------------------------- */\n/* Links */\n/* -------------------------------------------------------------------------- */\n\nconst DEFINITION = /^ {0,3}\\[([^\\]\\n]+)\\]:[ \\t]*(<[^>\\n]*>|\\S+)/;\nconst AUTOLINK = /<((?:https?|ftp|mailto):[^>\\s]+)>/g;\n\n/** How far a bracket construct may run before we call it unbalanced prose. */\nconst MAX_LINK_SPAN = 4096;\n\nfunction scanLinks(masked: string, text: string, index: LineIndex): Link[] {\n const out: Link[] = [];\n const definitions = new Map<string, { target: string; targetStart: number }>();\n const definitionRanges: Range[] = [];\n\n // Pass 1: reference definitions. These are the destination table the other\n // two written-with-a-label forms are read through, which is why the whole\n // document is swept for them before a single use is looked at: a definition\n // is conventionally written at the foot of the file, long after the links\n // that use it.\n for (let line = 1; line <= index.lineCount; line += 1) {\n const start = index.lineStart(line);\n const content = masked.slice(start, index.lineEnd(line));\n const match = DEFINITION.exec(content);\n if (!match) continue;\n const label = (match[1] as string).trim().toLowerCase();\n const rawTarget = match[2] as string;\n const targetStart = start + content.indexOf(rawTarget, (match[1] as string).length);\n const target = unwrapAngle(rawTarget);\n // First definition wins, as in CommonMark.\n if (!definitions.has(label)) definitions.set(label, { target, targetStart });\n definitionRanges.push({ start, end: start + (match[0] as string).length });\n out.push({\n text: (match[1] as string).trim(),\n target,\n start,\n end: start + (match[0] as string).length,\n targetStart,\n label: (match[1] as string).trim(),\n form: 'definition',\n line,\n });\n }\n\n // Pass 2: autolinks.\n AUTOLINK.lastIndex = 0;\n for (let m = AUTOLINK.exec(masked); m !== null; m = AUTOLINK.exec(masked)) {\n const start = m.index;\n out.push({\n text: '',\n target: m[1] as string,\n start,\n end: start + (m[0] as string).length,\n targetStart: start + 1,\n label: null,\n form: 'autolink',\n line: index.positionAt(start).line,\n });\n }\n\n // Pass 3: bracket constructs, left to right.\n const definedAt = mergeRanges(definitionRanges);\n let i = 0;\n while (i < masked.length) {\n const ch = masked[i];\n if (ch !== '[') {\n i += 1;\n continue;\n }\n // The label of a definition is not itself a shortcut link to anything.\n if (containsOffset(definedAt, i)) {\n i += 1;\n continue;\n }\n const isImage = i > 0 && masked[i - 1] === '!';\n\n if (masked[i + 1] === '[') {\n const close = masked.indexOf(']]', i + 2);\n if (close !== -1 && close - i <= MAX_LINK_SPAN && masked.slice(i + 2, close).indexOf('\\n') === -1) {\n const target = text.slice(i + 2, close).trim();\n if (target.length > 0) {\n out.push({\n text: target,\n target: wikiTarget(target),\n start: i,\n end: close + 2,\n targetStart: i + 2,\n label: null,\n form: 'wiki',\n line: index.positionAt(i).line,\n });\n i = close + 2;\n continue;\n }\n }\n }\n\n const labelEnd = matchBracket(masked, i);\n if (labelEnd === -1) {\n i += 1;\n continue;\n }\n const label = text.slice(i + 1, labelEnd);\n const after = masked[labelEnd + 1];\n\n if (after === '(') {\n const dest = readDestination(masked, labelEnd + 2);\n if (dest) {\n if (!isImage) {\n out.push({\n text: label.trim(),\n target: unwrapAngle(text.slice(dest.start, dest.end).trim()),\n start: isImage ? i - 1 : i,\n end: dest.close + 1,\n targetStart: dest.start,\n label: null,\n form: 'inline',\n line: index.positionAt(i).line,\n });\n }\n i = dest.close + 1;\n continue;\n }\n } else if (after === '[') {\n const refEnd = matchBracket(masked, labelEnd + 1);\n if (refEnd !== -1) {\n const ref = text.slice(labelEnd + 2, refEnd).trim();\n const written = ref.length > 0 ? ref : label.trim();\n const defined = definitions.get(written.toLowerCase());\n // A label with no definition is not a link. Every renderer prints\n // `[design][one]` verbatim when nothing says what `one` is, so reading\n // it as a citation invents a reference the author never made - and\n // then reports it as broken.\n if (!isImage && defined) {\n out.push({\n text: label.trim(),\n target: defined.target,\n start: i,\n end: refEnd + 1,\n targetStart: defined.targetStart,\n label: written,\n form: 'reference',\n line: index.positionAt(i).line,\n });\n }\n i = refEnd + 1;\n continue;\n }\n } else if (!isImage) {\n const written = label.trim();\n const defined = definitions.get(written.toLowerCase());\n if (defined) {\n out.push({\n text: written,\n target: defined.target,\n start: i,\n end: labelEnd + 1,\n targetStart: defined.targetStart,\n label: written,\n form: 'shortcut',\n line: index.positionAt(i).line,\n });\n i = labelEnd + 1;\n continue;\n }\n }\n\n i = labelEnd + 1;\n }\n\n out.sort((a, b) => a.start - b.start);\n return out;\n}\n\n/** Finds the `]` matching the `[` at `open`, honouring nesting and escapes. */\nfunction matchBracket(text: string, open: number): number {\n let depth = 0;\n const limit = Math.min(text.length, open + MAX_LINK_SPAN);\n for (let i = open; i < limit; i += 1) {\n const ch = text[i];\n if (ch === '\\\\') {\n i += 1;\n continue;\n }\n if (ch === '\\n' && text[i + 1] === '\\n') return -1;\n if (ch === '[') depth += 1;\n else if (ch === ']') {\n depth -= 1;\n if (depth === 0) return i;\n }\n }\n return -1;\n}\n\n/** Reads a link destination starting just after `(`. */\nfunction readDestination(text: string, from: number): { start: number; end: number; close: number } | null {\n let i = from;\n const limit = Math.min(text.length, from + MAX_LINK_SPAN);\n while (i < limit && (text[i] === ' ' || text[i] === '\\t' || text[i] === '\\n')) i += 1;\n\n const start = i;\n if (text[i] === '<') {\n const close = text.indexOf('>', i + 1);\n if (close === -1 || close > limit) return null;\n const paren = text.indexOf(')', close);\n if (paren === -1 || paren > limit) return null;\n return { start, end: close + 1, close: paren };\n }\n\n let depth = 0;\n while (i < limit) {\n const ch = text[i];\n if (ch === '\\\\') {\n i += 2;\n continue;\n }\n if (ch === '(') depth += 1;\n else if (ch === ')') {\n if (depth === 0) break;\n depth -= 1;\n } else if (ch === ' ' || ch === '\\t' || ch === '\\n') break;\n i += 1;\n }\n const end = i;\n // Skip an optional title, then require the closing paren.\n let j = i;\n while (j < limit && text[j] !== ')') {\n if (text[j] === '\\n' && text[j + 1] === '\\n') return null;\n j += 1;\n }\n if (j >= limit || text[j] !== ')') return null;\n if (end === start) return null;\n return { start, end, close: j };\n}\n\nfunction unwrapAngle(value: string): string {\n return value.startsWith('<') && value.endsWith('>') ? value.slice(1, -1) : value;\n}\n\n/** `[[0007-thing|Display]]` and `[[0007-thing]]` both target `0007-thing`. */\nfunction wikiTarget(raw: string): string {\n const pipe = raw.indexOf('|');\n return (pipe === -1 ? raw : raw.slice(0, pipe)).trim();\n}\n"]}
1
+ {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAoB7E;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAiB;IAC9C,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,OAAwB,EAAE,IAAiB;IACvE,OAAO,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;AACxG,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,OAAwB;IACrD,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,QAA4B;IACpD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/**\n * What spec-graph reads out of a Markdown document.\n *\n * The scan is spec-core's, copied into `src/vendor/spec-core/markdown/`: one\n * pass that is exact about code and comments, as CommonMark is, and simple about\n * the rest (ADR-0001). It started as this file, and the guarantees it was\n * written for came with it: code never counts, items are blocks and not lines,\n * and everything carries absolute offsets.\n *\n * What stays here is what spec-graph decides about the scan, which no other\n * tool has to agree with: which links cite something, which anchors a heading\n * answers to, and which lines are Markdown at all.\n */\n\nimport type { FrontMatterBlock, Heading, Link, MarkdownScan, ScannedLine } from './vendor/spec-core/markdown/index.js';\n\nexport { scanMarkdown, slugify } from './vendor/spec-core/markdown/index.js';\nexport type {\n Heading,\n HtmlComment,\n Link,\n LinkForm,\n ListItem,\n ScannedLine,\n Table,\n TableCell,\n TableRow,\n} from './vendor/spec-core/markdown/index.js';\nexport type { Range } from './vendor/spec-core/text/index.js';\n\n/** A scanned document, under the name the API has always given it. */\nexport type ScannedDocument = MarkdownScan;\n\n/** The front-matter block at the top of a document, under the name the API has always given it. */\nexport type FrontMatter = FrontMatterBlock;\n\n/**\n * Whether a line's content is Markdown.\n *\n * Code, the four raw-text HTML elements and front matter are not, for the same\n * reason: a heading, a status or an item written in one is an example or data,\n * and never a statement the document makes.\n */\nexport function isMarkdownLine(line: ScannedLine): boolean {\n return !line.code && !line.html && !line.frontMatter;\n}\n\n/**\n * Whether a line holds a comment and nothing else.\n *\n * For a reader that takes the first line of a section as its value, which is\n * what a status section is. A template's hint written above the value - `<!--\n * proposed | accepted -->` - is not the value, and neither is a directive. A\n * line that goes on past its comment, `<!-- hint --> Accepted`, is still read.\n */\nexport function isOnlyComment(scanned: ScannedDocument, line: ScannedLine): boolean {\n return line.comment && scanned.masks.structure.slice(line.contentStart, line.end).trim().length === 0;\n}\n\n/**\n * The links that cite something.\n *\n * An image shows a file and cites nothing: a diagram of a decision is not a\n * dependency on it, and a missing picture is a broken page, not a broken\n * relation. So images are not references, as they never were. A wiki embed,\n * `![[0007-sharding]]`, is the exception - it transcludes the note it names,\n * which is the strongest citation a wiki can write - and spec-graph has always\n * read it as one.\n */\nexport function referenceLinks(scanned: ScannedDocument): Link[] {\n return scanned.links.filter((link) => !link.image || link.form === 'wiki');\n}\n\n/**\n * The anchors a set of headings answers to.\n *\n * Each heading's slug, and the anchor GitHub gives it, which is the slug with\n * `-1`, `-2` and so on for the second and later headings that slug alike. A\n * link written against the rendered page uses the anchor; one written by hand\n * uses the slug, and for any heading but a repeat the two are one.\n */\nexport function anchorsOf(headings: readonly Heading[]): Set<string> {\n const out = new Set<string>();\n for (const heading of headings) {\n out.add(heading.slug);\n out.add(heading.anchor);\n }\n return out;\n}\n"]}
package/dist/report.d.ts CHANGED
@@ -119,6 +119,29 @@ export declare function formatSarif(result: AnalysisResult, graph: SpecGraph, op
119
119
  escalated?: ReadonlySet<AnyRuleId> | undefined;
120
120
  projectRules?: readonly ProjectRule[] | undefined;
121
121
  }): string;
122
+ /**
123
+ * GitLab's Code Quality report, which a merge request reads to show the
124
+ * findings a change introduced and the ones it resolved - what SARIF is to
125
+ * GitHub, so the family is not GitHub's alone.
126
+ *
127
+ * The format is GitLab's and carries no version of its own: a JSON array with
128
+ * the five fields GitLab reads and nothing else.
129
+ *
130
+ * `fingerprint` is how GitLab matches a finding in the merge request to the
131
+ * same finding on the target branch, so it holds what the finding is about and
132
+ * nothing that moves when something else changes: the rule, the specification
133
+ * and what within it, hashed - the identity a baseline counts by. Not the line,
134
+ * so a paragraph moved above a finding does not make it new. Not the message,
135
+ * which carries counts: ticking one of three boxes turned "holds 3 open
136
+ * obligations" into "holds 2", and GitLab showed one finding resolved and one
137
+ * introduced. Two findings that agree on all three - one broken link written
138
+ * twice in a document - are told apart by their order, the second hashed with a
139
+ * `2`: GitLab tells issues apart by fingerprint, and two that shared one would
140
+ * be read as one.
141
+ */
142
+ export declare function formatGitlab(result: AnalysisResult, options?: {
143
+ escalated?: ReadonlySet<AnyRuleId> | undefined;
144
+ }): string;
122
145
  export declare function formatJson(result: AnalysisResult, options?: {
123
146
  escalated?: ReadonlySet<AnyRuleId>;
124
147
  baseline?: ReporterOptions['baseline'];
package/dist/report.js CHANGED
@@ -10,6 +10,7 @@
10
10
  * Colour is opt-out and auto-detected, and the glyphs degrade to ASCII when the
11
11
  * terminal cannot render them.
12
12
  */
13
+ import { createHash } from 'node:crypto';
13
14
  import { fingerprintOf } from './baseline.js';
14
15
  import { formatRef } from './source.js';
15
16
  import { DEFAULT_SEVERITIES, RULE_DESCRIPTIONS, RULE_IDS } from './rules.js';
@@ -91,6 +92,10 @@ export function formatReport(result, options = {}) {
91
92
  }
92
93
  lines.push('');
93
94
  }
95
+ const unread = options.verbose ? 0 : unreadFrontMatter(result);
96
+ if (unread > 0) {
97
+ lines.push(`${paint.warn(marks.warn)} ${unreadNotice(unread)}`, '');
98
+ }
94
99
  // What the repository told spec-graph to stop looking at. Only under
95
100
  // --verbose, and never as a finding: these are not defects, they are the one
96
101
  // place a configuration can make the check quieter, and a single over-broad
@@ -175,6 +180,20 @@ function plural(count, word, plural) {
175
180
  return word;
176
181
  return plural ?? `${word}s`;
177
182
  }
183
+ /**
184
+ * How many front-matter values the graph is built from went unread.
185
+ *
186
+ * Parse problems are listed only under `--verbose`, and most of them can wait
187
+ * there. These cannot: `status: Superseded by ADR-3: see notes` is not read,
188
+ * the document reads as unknown, and a failing check reports that the graph is
189
+ * consistent. So a default run says how many there are, and where to look.
190
+ */
191
+ function unreadFrontMatter(result) {
192
+ return result.problems.filter((problem) => problem.unread === true).length;
193
+ }
194
+ function unreadNotice(count) {
195
+ return `${count} front-matter ${plural(count, 'value')} not read - see --verbose`;
196
+ }
178
197
  /* -------------------------------------------------------------------------- */
179
198
  /* Markdown */
180
199
  /* -------------------------------------------------------------------------- */
@@ -256,6 +275,9 @@ export function formatMarkdown(result, options = {}) {
256
275
  lines.push('');
257
276
  }
258
277
  }
278
+ const unread = options.verbose ? 0 : unreadFrontMatter(result);
279
+ if (unread > 0)
280
+ lines.push(`${unreadNotice(unread)}.`, '');
259
281
  if (options.verbose && result.problems.length > 0) {
260
282
  lines.push('<details><summary>Problems with the input</summary>', '');
261
283
  for (const problem of result.problems) {
@@ -430,6 +452,64 @@ function sarifLocation(at) {
430
452
  },
431
453
  };
432
454
  }
455
+ /**
456
+ * GitLab's Code Quality report, which a merge request reads to show the
457
+ * findings a change introduced and the ones it resolved - what SARIF is to
458
+ * GitHub, so the family is not GitHub's alone.
459
+ *
460
+ * The format is GitLab's and carries no version of its own: a JSON array with
461
+ * the five fields GitLab reads and nothing else.
462
+ *
463
+ * `fingerprint` is how GitLab matches a finding in the merge request to the
464
+ * same finding on the target branch, so it holds what the finding is about and
465
+ * nothing that moves when something else changes: the rule, the specification
466
+ * and what within it, hashed - the identity a baseline counts by. Not the line,
467
+ * so a paragraph moved above a finding does not make it new. Not the message,
468
+ * which carries counts: ticking one of three boxes turned "holds 3 open
469
+ * obligations" into "holds 2", and GitLab showed one finding resolved and one
470
+ * introduced. Two findings that agree on all three - one broken link written
471
+ * twice in a document - are told apart by their order, the second hashed with a
472
+ * `2`: GitLab tells issues apart by fingerprint, and two that shared one would
473
+ * be read as one.
474
+ */
475
+ export function formatGitlab(result, options = {}) {
476
+ const escalated = options.escalated ?? EMPTY_RULES;
477
+ const occurrences = new Map();
478
+ const issues = result.diagnostics.map((diagnostic) => {
479
+ const { document, subject } = fingerprintOf(result.graph, diagnostic);
480
+ const identity = [diagnostic.rule, document, subject];
481
+ const key = JSON.stringify(identity);
482
+ const occurrence = (occurrences.get(key) ?? 0) + 1;
483
+ occurrences.set(key, occurrence);
484
+ return {
485
+ description: `${diagnostic.message}. ${diagnostic.hint}`,
486
+ check_name: diagnostic.rule,
487
+ fingerprint: createHash('sha256')
488
+ .update(occurrence === 1 ? key : JSON.stringify([...identity, occurrence]))
489
+ .digest('hex'),
490
+ severity: gitlabSeverity(diagnostic.severity, escalated.has(diagnostic.rule)),
491
+ location: { path: diagnostic.at.file, lines: { begin: diagnostic.at.span.start.line } },
492
+ };
493
+ });
494
+ return `${JSON.stringify(issues, null, 2)}\n`;
495
+ }
496
+ /**
497
+ * spec-graph's three severities on GitLab's five. An error is critical: it
498
+ * fails the build. One that is only an error because `--strict` raised it is
499
+ * major, which is the one place the report can say so. A warning is minor,
500
+ * and a note is information. `blocker` is left to tools that know more about
501
+ * what cannot ship than a documentation linter does.
502
+ */
503
+ function gitlabSeverity(severity, escalated) {
504
+ switch (severity) {
505
+ case 'error':
506
+ return escalated ? 'major' : 'critical';
507
+ case 'warn':
508
+ return 'minor';
509
+ default:
510
+ return 'info';
511
+ }
512
+ }
433
513
  export function formatJson(result, options = {}) {
434
514
  const escalated = options.escalated ?? EMPTY_RULES;
435
515
  return `${JSON.stringify({