@descent-vtt/spec-brief 0.1.0 → 0.2.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.
- package/CHANGELOG.md +301 -0
- package/README.md +92 -22
- package/dist/archive.d.ts +52 -2
- package/dist/archive.js +205 -37
- package/dist/archive.js.map +1 -1
- package/dist/brief.d.ts +2 -0
- package/dist/brief.js +5 -1
- package/dist/brief.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +48 -14
- package/dist/cli.js.map +1 -1
- package/dist/collisions.d.ts +43 -12
- package/dist/collisions.js +90 -58
- package/dist/collisions.js.map +1 -1
- package/dist/config.d.ts +18 -0
- package/dist/config.js +66 -11
- package/dist/config.js.map +1 -1
- package/dist/corpus.d.ts +21 -1
- package/dist/corpus.js +51 -2
- package/dist/corpus.js.map +1 -1
- package/dist/engine.d.ts +33 -3
- package/dist/engine.js +112 -9
- package/dist/engine.js.map +1 -1
- package/dist/frontmatter.d.ts +18 -61
- package/dist/frontmatter.js +31 -300
- package/dist/frontmatter.js.map +1 -1
- package/dist/glob.d.ts +77 -54
- package/dist/glob.js +104 -433
- package/dist/glob.js.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/links.d.ts +1 -1
- package/dist/links.js +3 -4
- package/dist/links.js.map +1 -1
- package/dist/lint.d.ts +33 -2
- package/dist/lint.js +9 -2
- package/dist/lint.js.map +1 -1
- package/dist/markdown.d.ts +27 -23
- package/dist/markdown.js +66 -235
- package/dist/markdown.js.map +1 -1
- package/dist/plugins.d.ts +14 -0
- package/dist/plugins.js +142 -6
- package/dist/plugins.js.map +1 -1
- package/dist/report.d.ts +40 -3
- package/dist/report.js +227 -11
- package/dist/report.js.map +1 -1
- package/dist/rules.d.ts +22 -4
- package/dist/rules.js +175 -45
- package/dist/rules.js.map +1 -1
- package/dist/scaffold.d.ts +1 -1
- package/dist/scaffold.js +10 -9
- package/dist/scaffold.js.map +1 -1
- package/dist/schedule.d.ts +133 -0
- package/dist/schedule.js +265 -0
- package/dist/schedule.js.map +1 -0
- package/dist/scope.d.ts +52 -0
- package/dist/scope.js +56 -0
- package/dist/scope.js.map +1 -0
- package/dist/text.d.ts +13 -0
- package/dist/text.js +23 -0
- package/dist/text.js.map +1 -1
- package/dist/trigger.d.ts +17 -0
- package/dist/trigger.js +49 -0
- package/dist/trigger.js.map +1 -0
- package/dist/types.d.ts +14 -5
- package/dist/types.js.map +1 -1
- package/dist/vendor/spec-core/markdown/frontmatter.d.ts +103 -0
- package/dist/vendor/spec-core/markdown/frontmatter.js +459 -0
- package/dist/vendor/spec-core/markdown/frontmatter.js.map +1 -0
- package/dist/vendor/spec-core/markdown/headings.d.ts +45 -0
- package/dist/vendor/spec-core/markdown/headings.js +199 -0
- package/dist/vendor/spec-core/markdown/headings.js.map +1 -0
- package/dist/vendor/spec-core/markdown/index.d.ts +5 -0
- package/dist/vendor/spec-core/markdown/index.js +4 -0
- package/dist/vendor/spec-core/markdown/index.js.map +1 -0
- package/dist/vendor/spec-core/markdown/layout.d.ts +39 -0
- package/dist/vendor/spec-core/markdown/layout.js +28 -0
- package/dist/vendor/spec-core/markdown/layout.js.map +1 -0
- package/dist/vendor/spec-core/markdown/links.d.ts +25 -0
- package/dist/vendor/spec-core/markdown/links.js +394 -0
- package/dist/vendor/spec-core/markdown/links.js.map +1 -0
- package/dist/vendor/spec-core/markdown/lists.d.ts +22 -0
- package/dist/vendor/spec-core/markdown/lists.js +127 -0
- package/dist/vendor/spec-core/markdown/lists.js.map +1 -0
- package/dist/vendor/spec-core/markdown/scan.d.ts +36 -0
- package/dist/vendor/spec-core/markdown/scan.js +463 -0
- package/dist/vendor/spec-core/markdown/scan.js.map +1 -0
- package/dist/vendor/spec-core/markdown/syntax.d.ts +75 -0
- package/dist/vendor/spec-core/markdown/syntax.js +181 -0
- package/dist/vendor/spec-core/markdown/syntax.js.map +1 -0
- package/dist/vendor/spec-core/markdown/tables.d.ts +18 -0
- package/dist/vendor/spec-core/markdown/tables.js +86 -0
- package/dist/vendor/spec-core/markdown/tables.js.map +1 -0
- package/dist/vendor/spec-core/markdown/types.d.ts +290 -0
- package/dist/vendor/spec-core/markdown/types.js +9 -0
- package/dist/vendor/spec-core/markdown/types.js.map +1 -0
- package/dist/vendor/spec-core/path/index.d.ts +1 -0
- package/dist/vendor/spec-core/path/index.js +2 -0
- package/dist/vendor/spec-core/path/index.js.map +1 -0
- package/dist/vendor/spec-core/path/posix.d.ts +83 -0
- package/dist/vendor/spec-core/path/posix.js +150 -0
- package/dist/vendor/spec-core/path/posix.js.map +1 -0
- package/dist/vendor/spec-core/pattern/automaton.d.ts +129 -0
- package/dist/vendor/spec-core/pattern/automaton.js +340 -0
- package/dist/vendor/spec-core/pattern/automaton.js.map +1 -0
- package/dist/vendor/spec-core/pattern/charset.d.ts +58 -0
- package/dist/vendor/spec-core/pattern/charset.js +116 -0
- package/dist/vendor/spec-core/pattern/charset.js.map +1 -0
- package/dist/vendor/spec-core/pattern/glob.d.ts +121 -0
- package/dist/vendor/spec-core/pattern/glob.js +481 -0
- package/dist/vendor/spec-core/pattern/glob.js.map +1 -0
- package/dist/vendor/spec-core/pattern/index.d.ts +6 -0
- package/dist/vendor/spec-core/pattern/index.js +4 -0
- package/dist/vendor/spec-core/pattern/index.js.map +1 -0
- package/dist/vendor/spec-core/pattern/regex.d.ts +67 -0
- package/dist/vendor/spec-core/pattern/regex.js +813 -0
- package/dist/vendor/spec-core/pattern/regex.js.map +1 -0
- package/dist/vendor/spec-core/text/index.d.ts +2 -0
- package/dist/vendor/spec-core/text/index.js +2 -0
- package/dist/vendor/spec-core/text/index.js.map +1 -0
- package/dist/vendor/spec-core/text/lines.d.ts +72 -0
- package/dist/vendor/spec-core/text/lines.js +156 -0
- package/dist/vendor/spec-core/text/lines.js.map +1 -0
- package/package.json +4 -3
- package/schema.json +17 -0
- package/src/vendor/spec-core/LICENSE +21 -0
- package/src/vendor/spec-core/README.md +8 -0
package/dist/frontmatter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoCH,MAAM,IAAI,GAAG,aAAa,CAAC;AAC3B,MAAM,KAAK,GAAG,wBAAwB,CAAC;AACvC,MAAM,GAAG,GAAG,4CAA4C,CAAC;AACzD,MAAM,aAAa,GAAG,4BAA4B,CAAC;AACnD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,KAAwB;IACtD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC;QAAE,OAAO,IAAI,CAAC;IACtE,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC,EAAE,CAAC;YACnC,KAAK,GAAG,CAAC,CAAC;YACV,MAAM;QACR,CAAC;IACH,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO;YACL,KAAK,EAAE,CAAC,CAAC;YACT,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,mDAAmD,EAAE,CAAC;SACtF,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAuB,EAAE,CAAC;IACvC,MAAM,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AM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAC5F,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC1C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,KAAK,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACjG,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,WAAW,CAAC,KAAwB,EAAE,WAA+B,EAAE,GAAW;IAChG,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC1C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/**\n * A front-matter reader and editor for the flat subset of YAML briefs use.\n *\n * Supported: `key: value` at the top level; plain, single-quoted and\n * double-quoted scalars; inline `[a, b]` sequences; block `- item` sequences;\n * `#` comments. Plain scalars follow the YAML 1.2 core schema, so `yes` is a\n * word and `035` keeps its leading zero for whoever reads it as text.\n *\n * Anything richer - nested mappings, block scalars, anchors, tags, a value\n * continued onto the next line - is recognised and reported as unsupported\n * rather than guessed at. A YAML library would parse more, and would be the\n * largest dependency of a package that has none; it would also not give back\n * the line of every value, and an edit that must leave every other line of a\n * file untouched needs exactly that.\n */\n\nexport interface YamlScalar {\n readonly text: string;\n readonly quoted: boolean;\n}\n\nexport type YamlValue =\n | { readonly kind: 'scalar'; readonly scalar: YamlScalar }\n | { readonly kind: 'list'; readonly items: readonly YamlScalar[] }\n | { readonly kind: 'unsupported'; readonly reason: string };\n\nexport interface FrontMatterEntry {\n /** The key as written. */\n readonly key: string;\n /** The key compared: lower case, without `-` or `_`, so `depends-on` is `dependsOn`. */\n readonly name: string;\n /** 0-based line of the key. */\n readonly line: number;\n /** 0-based line after the entry's last line. */\n readonly end: number;\n readonly value: YamlValue;\n}\n\nexport interface FrontMatterProblem {\n readonly line: number;\n readonly message: string;\n}\n\nexport interface FrontMatter {\n /** 0-based line of the closing delimiter, or -1 when the block is never closed. */\n readonly close: number;\n readonly entries: readonly FrontMatterEntry[];\n readonly problems: readonly FrontMatterProblem[];\n}\n\nconst OPEN = /^---[ \\t]*$/;\nconst CLOSE = /^(?:---|\\.\\.\\.)[ \\t]*$/;\nconst KEY = /^([A-Za-z_][\\w.-]*)[ \\t]*:(?:[ \\t]+(.*))?$/;\nconst SEQUENCE_ITEM = /^([ \\t]*)-(?:[ \\t]+(.*))?$/;\nconst BLANK_OR_COMMENT = /^[ \\t]*(?:#.*)?$/;\n\nexport function keyName(key: string): string {\n return key.toLowerCase().replace(/[-_]/g, '');\n}\n\n/** Reads the front matter at the top of `lines`, or `null` when there is none. */\nexport function readFrontMatter(lines: readonly string[]): FrontMatter | null {\n if (lines.length === 0 || !OPEN.test(lines[0] as string)) return null;\n let close = -1;\n for (let i = 1; i < lines.length; i += 1) {\n if (CLOSE.test(lines[i] as string)) {\n close = i;\n break;\n }\n }\n if (close < 0) {\n return {\n close: -1,\n entries: [],\n problems: [{ line: 0, message: 'the front matter opened on line 1 is never closed' }],\n };\n }\n\n const entries: FrontMatterEntry[] = [];\n const problems: FrontMatterProblem[] = [];\n const seen = new Map<string, number>();\n let i = 1;\n while (i < close) {\n const line = lines[i] as string;\n if (BLANK_OR_COMMENT.test(line)) {\n i += 1;\n continue;\n }\n const match = KEY.exec(line);\n if (!match) {\n problems.push({\n line: i,\n message: /^\\s/.test(line) ? 'an indented line belongs to no key' : 'not a \"key: value\" line',\n });\n i += 1;\n continue;\n }\n const key = match[1] as string;\n const inline = stripLeadingComment((match[2] ?? '').trim());\n let end = i + 1;\n while (end < close && belongsToBlock(lines[end] as string)) end += 1;\n while (end > i + 1 && BLANK_OR_COMMENT.test(lines[end - 1] as string)) end -= 1;\n const block = lines.slice(i + 1, end);\n\n let value: YamlValue;\n if (inline.length > 0) {\n value = block.some((l) => !BLANK_OR_COMMENT.test(l))\n ? unsupported('the value continues on the next line; keep it on one line, or quote it')\n : parseInline(inline);\n } else {\n value = parseBlock(block);\n }\n\n const name = keyName(key);\n const previous = seen.get(name);\n if (previous !== undefined) {\n problems.push({ line: i, message: `\"${key}\" is declared twice (first on line ${previous + 1})` });\n } else {\n seen.set(name, i);\n }\n entries.push({ key, name, line: i, end, value });\n i = end;\n }\n return { close, entries, problems };\n}\n\n/** A line under a key is part of its value when it is indented or starts a sequence item. */\nfunction belongsToBlock(line: string): boolean {\n return /^[ \\t]/.test(line) || /^-(?:[ \\t]|$)/.test(line) || line.trim() === '';\n}\n\nfunction stripLeadingComment(text: string): string {\n return text.startsWith('#') ? '' : text;\n}\n\nfunction unsupported(reason: string): YamlValue {\n return { kind: 'unsupported', reason };\n}\n\nfunction parseBlock(block: readonly string[]): YamlValue {\n const content = block.filter((l) => !BLANK_OR_COMMENT.test(l));\n if (content.length === 0) return { kind: 'scalar', scalar: { text: '', quoted: false } };\n const first = SEQUENCE_ITEM.exec(content[0] as string);\n if (!first) {\n return KEY.test((content[0] as string).trim())\n ? unsupported('nested mappings are not supported; flatten the key')\n : unsupported('the value continues on the next line; keep it on one line, or quote it');\n }\n const indent = (first[1] as string).length;\n const items: YamlScalar[] = [];\n for (const line of content) {\n const item = SEQUENCE_ITEM.exec(line);\n if (!item || (item[1] as string).length !== indent) {\n return unsupported('a list item is continued or nested; keep each item on one line');\n }\n const text = stripLeadingComment((item[2] ?? '').trim());\n if (text.length === 0) return unsupported('a list item is empty');\n const parsed = parseInline(text);\n if (parsed.kind !== 'scalar') {\n return parsed.kind === 'list' ? unsupported('nested lists are not supported') : parsed;\n }\n items.push(parsed.scalar);\n }\n return { kind: 'list', items };\n}\n\n/** Parses a value written on the key's own line. `text` is trimmed and non-empty. */\nexport function parseInline(text: string): YamlValue {\n const head = text.charAt(0);\n if (head === '\"' || head === \"'\") {\n const quoted = head === '\"' ? readDoubleQuoted(text) : readSingleQuoted(text);\n if (typeof quoted === 'string') return unsupported(quoted);\n return trailingIsComment(text.slice(quoted.next))\n ? { kind: 'scalar', scalar: { text: quoted.text, quoted: true } }\n : unsupported('text follows a closing quote');\n }\n if (head === '[') return parseFlowSequence(text);\n if (head === '{') return unsupported('inline mappings are not supported');\n if (head === '|' || head === '>') return unsupported('block scalars are not supported; keep the value on one line');\n if (head === '&' || head === '*' || head === '!') return unsupported('anchors, aliases and tags are not supported');\n if (head === '@' || head === '`') return unsupported(`a plain value cannot start with \"${head}\"; quote it`);\n const plain = stripTrailingComment(text);\n if (/:(?:\\s|$)/.test(plain)) return unsupported('a plain value cannot contain \": \"; quote it');\n if (/^-(?:\\s|$)/.test(plain)) return unsupported('a list must start on the line after its key');\n return { kind: 'scalar', scalar: { text: plain, quoted: false } };\n}\n\nfunction stripTrailingComment(text: string): string {\n const hash = text.search(/\\s#/);\n return (hash < 0 ? text : text.slice(0, hash)).trim();\n}\n\nfunction trailingIsComment(rest: string): boolean {\n return /^\\s*(?:#.*)?$/.test(rest) && (rest.trim() === '' || /^\\s/.test(rest));\n}\n\ninterface Quoted {\n readonly text: string;\n /** Index just past the closing quote. */\n readonly next: number;\n}\n\nconst ESCAPES: Readonly<Record<string, string>> = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n '0': '\\0',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t',\n};\n\nconst HEX_ESCAPE_LENGTH: Readonly<Record<string, number>> = { x: 2, u: 4, U: 8 };\n\n/** Reads a double-quoted scalar starting at index 0, or returns why it cannot. */\nfunction readDoubleQuoted(text: string): Quoted | string {\n let out = '';\n for (let i = 1; i < text.length; i += 1) {\n const ch = text.charAt(i);\n if (ch === '\"') return { text: out, next: i + 1 };\n if (ch !== '\\\\') {\n out += ch;\n continue;\n }\n const code = text.charAt(i + 1);\n const simple = ESCAPES[code];\n if (simple !== undefined) {\n out += simple;\n i += 1;\n continue;\n }\n const width = HEX_ESCAPE_LENGTH[code];\n const hex = width === undefined ? '' : text.slice(i + 2, i + 2 + width);\n if (width === undefined || hex.length !== width || !/^[0-9A-Fa-f]+$/.test(hex)) {\n return `\"\\\\${code}\" is not an escape this reader knows`;\n }\n const point = Number.parseInt(hex, 16);\n if (point > 0x10ffff) return `\"\\\\${code}${hex}\" is not a character`;\n out += String.fromCodePoint(point);\n i += 1 + width;\n }\n return 'a double-quoted value is never closed';\n}\n\nfunction readSingleQuoted(text: string): Quoted | string {\n let out = '';\n for (let i = 1; i < text.length; i += 1) {\n const ch = text.charAt(i);\n if (ch !== \"'\") {\n out += ch;\n continue;\n }\n if (text.charAt(i + 1) === \"'\") {\n out += \"'\";\n i += 1;\n continue;\n }\n return { text: out, next: i + 1 };\n }\n return 'a single-quoted value is never closed';\n}\n\nfunction parseFlowSequence(text: string): YamlValue {\n const items: YamlScalar[] = [];\n let i = 1;\n for (;;) {\n while (i < text.length && /\\s/.test(text.charAt(i))) i += 1;\n if (i >= text.length) return unsupported('an inline list is never closed; keep it on one line');\n const ch = text.charAt(i);\n if (ch === ']') {\n return trailingIsComment(text.slice(i + 1))\n ? { kind: 'list', items }\n : unsupported('text follows the end of an inline list');\n }\n if (ch === '[' || ch === '{') return unsupported('nested lists and mappings are not supported');\n if (ch === ',') return unsupported('an inline list has an empty item');\n let item: YamlScalar;\n if (ch === '\"' || ch === \"'\") {\n const rest = text.slice(i);\n const quoted = ch === '\"' ? readDoubleQuoted(rest) : readSingleQuoted(rest);\n if (typeof quoted === 'string') return unsupported(quoted);\n item = { text: quoted.text, quoted: true };\n i += quoted.next;\n } else {\n let j = i;\n while (j < text.length && !',]'.includes(text.charAt(j))) j += 1;\n const plain = text.slice(i, j).trim();\n if (/[[{]/.test(plain) || /:(?:\\s|$)/.test(plain) || plain.includes(' #')) {\n return unsupported(`\"${plain}\" needs quoting inside an inline list`);\n }\n item = { text: plain, quoted: false };\n i = j;\n }\n items.push(item);\n while (i < text.length && /\\s/.test(text.charAt(i))) i += 1;\n if (i >= text.length) return unsupported('an inline list is never closed; keep it on one line');\n // After a comma the next pass reads an item or, legally in YAML, the bracket.\n if (text.charAt(i) === ',') i += 1;\n else if (text.charAt(i) !== ']') return unsupported('inline list items must be separated by commas');\n }\n}\n\n/** Null in the YAML 1.2 core schema: empty, `~` or `null` in any of its three spellings. */\nexport function isNull(scalar: YamlScalar): boolean {\n return !scalar.quoted && ['', '~', 'null', 'Null', 'NULL'].includes(scalar.text);\n}\n\n/** Renders a string as a scalar that reads back as the same string. */\nexport function renderScalar(value: string): string {\n const reserved = /^(?:true|false|null|yes|no|on|off|~)$/i.test(value);\n const plain = /^[A-Za-z][A-Za-z0-9 ._/+-]*$/.test(value) && !value.endsWith(' ');\n return plain && !reserved ? value : JSON.stringify(value);\n}\n\nexport function findEntry(frontMatter: FrontMatter | null, key: string): FrontMatterEntry | undefined {\n const name = keyName(key);\n return frontMatter?.entries.find((entry) => entry.name === name);\n}\n\n/**\n * Sets one key, leaving every other line as it was. An existing entry keeps the\n * spelling of its key; a new one goes last. A file with no front matter gains\n * a block.\n */\nexport function setEntry(\n lines: readonly string[],\n frontMatter: FrontMatter | null,\n key: string,\n rendered: string,\n): string[] {\n if (frontMatter === null) return ['---', `${key}: ${rendered}`, '---', ...lines];\n if (frontMatter.close < 0) throw new Error('cannot edit front matter that is never closed');\n const entry = findEntry(frontMatter, key);\n if (entry === undefined) {\n return [...lines.slice(0, frontMatter.close), `${key}: ${rendered}`, ...lines.slice(frontMatter.close)];\n }\n return [...lines.slice(0, entry.line), `${entry.key}: ${rendered}`, ...lines.slice(entry.end)];\n}\n\n/** Removes one key and its value lines; a key that is absent changes nothing. */\nexport function removeEntry(lines: readonly string[], frontMatter: FrontMatter | null, key: string): string[] {\n const entry = findEntry(frontMatter, key);\n if (entry === undefined) return [...lines];\n return [...lines.slice(0, entry.line), ...lines.slice(entry.end)];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,IAAI,QAAQ,EAAE,QAAQ,EAAoB,MAAM,sCAAsC,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EACL,SAAS,EACT,MAAM,EACN,OAAO,EACP,WAAW,EACX,WAAW,EACX,YAAY,EACZ,QAAQ,GAMT,MAAM,sCAAsC,CAAC;AAE9C,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,KAAwB;IACtD,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAwB,EAAE,WAA+B,EAAE,GAAW,EAAE,QAAgB;IAC7H,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC1C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,IAAI,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IACvE,2DAA2D;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7F,MAAM,IAAI,GAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAC7E,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IAC1C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,QAAQ,CAAC,WAAwB;IAC/C,OAAO,WAAW,CAAC,IAAI,KAAK,MAAM,IAAI,WAAW,CAAC,KAAK,IAAI,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["/**\n * A brief's front matter: spec-core's reader and editor, copied into\n * `src/vendor/spec-core/`, over a brief's lines.\n *\n * The flat subset of YAML briefs use: `key: value` lines, plain and quoted\n * scalars, inline and block lists, comments. Anything richer is reported as\n * unsupported rather than guessed at, TOML between `+++` lines included, and\n * every value keeps its line, so an edit leaves every other line of the file\n * as it was (ADR-0001). Offsets in what it reads count in the lines joined by\n * `\\n`, which for a brief are its `lines`, not its `text`.\n */\n\nimport { findEntry, readFrontMatter as readText, setEntry, type FrontMatter } from './vendor/spec-core/markdown/index.js';\nimport { textOfLines } from './text.js';\n\nexport {\n findEntry,\n isNull,\n keyName,\n parseInline,\n removeEntry,\n renderScalar,\n setEntry,\n type FrontMatter,\n type FrontMatterEntry,\n type FrontMatterProblem,\n type YamlScalar,\n type YamlValue,\n} from './vendor/spec-core/markdown/index.js';\n\n/** Reads the front matter at the top of `lines`, or `null` when there is none. */\nexport function readFrontMatter(lines: readonly string[]): FrontMatter | null {\n return readText(textOfLines(lines));\n}\n\n/**\n * Sets one key as `setEntry` does, and keeps a comment that followed the old\n * value on its line: `wave: 2 # after the review` becomes `wave: 3 # after\n * the review`. spec-core's editor writes the key and the value alone, and a\n * comment beside a value is often the only record of why it was chosen. A\n * value over several lines is rewritten as `setEntry` rewrites it.\n */\nexport function setEntryKeepingComment(lines: readonly string[], frontMatter: FrontMatter | null, key: string, rendered: string): string[] {\n const edited = setEntry(lines, frontMatter, key, rendered);\n const entry = findEntry(frontMatter, key);\n if (entry === undefined || entry.end !== entry.line + 1) return edited;\n // Offsets count in the lines joined by one character each.\n const lineStart = lines.slice(0, entry.line).reduce((sum, line) => sum + line.length + 1, 0);\n const rest = (lines[entry.line] as string).slice(entry.valueEnd - lineStart);\n if (!/^[ \\t]+#/.test(rest)) return edited;\n return edited.map((line, i) => (i === entry.line ? `${line}${rest}` : line));\n}\n\n/** Front matter an edit can be written into: YAML, and closed. */\nexport function editable(frontMatter: FrontMatter): boolean {\n return frontMatter.kind === 'yaml' && frontMatter.close >= 0;\n}\n"]}
|
package/dist/glob.d.ts
CHANGED
|
@@ -1,46 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Scopes as globs: spec-core's `path` dialect, read the way spec-brief reads a
|
|
3
|
+
* brief.
|
|
3
4
|
*
|
|
4
|
-
* The
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* an extension, which matches only itself. A trailing `/` always means a
|
|
9
|
-
* directory. Paths
|
|
10
|
-
* are repository-relative and POSIX, and matching is case-sensitive on every
|
|
11
|
-
* host, because git's paths are and a result should not depend on who ran it.
|
|
12
|
-
* `*` matches a leading dot; a scope that forgot its dotfiles is not a scope
|
|
13
|
-
* that excludes them.
|
|
5
|
+
* The syntax, the automaton and the witness search are spec-core's, copied
|
|
6
|
+
* into `src/vendor/` and verified by hash, so the family's tools read one
|
|
7
|
+
* pattern the same way (spec-core ADR-0003). What is decided here is what
|
|
8
|
+
* spec-brief adds around it:
|
|
14
9
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
10
|
+
* - A pattern is relative to the repository root, so a leading `/` is refused
|
|
11
|
+
* rather than rooted at the filesystem; and a list entry's `!` has no list to
|
|
12
|
+
* belong to in a scope, so it is refused rather than read.
|
|
13
|
+
* - Paths compare case-sensitively on every host, as git's do.
|
|
14
|
+
* - A path with no glob syntax is read as the tree reads it: a file the tree
|
|
15
|
+
* holds is that file, a directory it holds is everything beneath it, and a
|
|
16
|
+
* path it does not hold is a file, unless it is written with a trailing `/`.
|
|
17
|
+
* The tree, not the spelling, knows that `Dockerfile` is a file and
|
|
18
|
+
* `docs/v1.2` a directory (ADR-0005, amended 2026-09-26).
|
|
19
|
+
* - A trailing `/**` is at least one segment, so `docs/**` is the directory's
|
|
20
|
+
* contents and a collision witness is always a file.
|
|
21
|
+
*
|
|
22
|
+
* Nothing here compiles to a `RegExp`. Matching costs at most the pattern's
|
|
23
|
+
* size times the path's length, and a question about two scopes that cannot be
|
|
24
|
+
* answered within the search's budget answers `undecided`, never a guess.
|
|
20
25
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
readonly
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} | {
|
|
29
|
-
readonly kind: 'class';
|
|
30
|
-
readonly negated: boolean;
|
|
31
|
-
readonly ranges: readonly (readonly [number, number])[];
|
|
32
|
-
};
|
|
33
|
-
export type Segment = {
|
|
34
|
-
readonly kind: 'globstar';
|
|
35
|
-
} | {
|
|
36
|
-
readonly kind: 'pattern';
|
|
37
|
-
readonly tokens: readonly CharToken[];
|
|
38
|
-
readonly literal: boolean;
|
|
39
|
-
};
|
|
26
|
+
import { isGlobSyntax, type Glob as CoreGlob, type LiteralReading, WITNESS_BUDGET, type Witness } from './vendor/spec-core/pattern/index.js';
|
|
27
|
+
export { isGlobSyntax, type LiteralReading, WITNESS_BUDGET, type Witness };
|
|
28
|
+
/** A literal path a pattern names, and how it was read. */
|
|
29
|
+
export interface Literal {
|
|
30
|
+
readonly path: string;
|
|
31
|
+
readonly reading: LiteralReading;
|
|
32
|
+
}
|
|
40
33
|
export interface Glob {
|
|
41
34
|
readonly source: string;
|
|
42
|
-
/**
|
|
43
|
-
readonly
|
|
35
|
+
/** The compiled pattern: spec-core's `path` dialect, case-sensitive. */
|
|
36
|
+
readonly compiled: CoreGlob;
|
|
37
|
+
/** Each path the pattern names with no glob syntax, one per brace alternative; empty when it has none. */
|
|
38
|
+
readonly literals: readonly Literal[];
|
|
44
39
|
}
|
|
45
40
|
export type GlobParse = {
|
|
46
41
|
readonly ok: true;
|
|
@@ -49,31 +44,59 @@ export type GlobParse = {
|
|
|
49
44
|
readonly ok: false;
|
|
50
45
|
readonly error: string;
|
|
51
46
|
};
|
|
52
|
-
/** More alternatives than this is a pattern nobody meant. */
|
|
53
|
-
export declare const MAX_ALTERNATIVES = 256;
|
|
54
47
|
export interface ParseOptions {
|
|
55
|
-
/**
|
|
56
|
-
|
|
48
|
+
/**
|
|
49
|
+
* How a path with no glob syntax is read: `file`, that path alone;
|
|
50
|
+
* `directory`, everything beneath it; `either`, both. A function is asked
|
|
51
|
+
* per literal path, as {@link readingIn} answers for a tree. `file` when
|
|
52
|
+
* unset: a path nothing says is a directory is not read as one.
|
|
53
|
+
*/
|
|
54
|
+
readonly literal?: LiteralReading | ((path: string) => LiteralReading) | undefined;
|
|
57
55
|
}
|
|
56
|
+
/** Parses a scope pattern, or says why it cannot. */
|
|
58
57
|
export declare function parseGlob(source: string, options?: ParseOptions): GlobParse;
|
|
58
|
+
/**
|
|
59
|
+
* Whether a path matches. The path is read as a repository path: empty and
|
|
60
|
+
* `.` segments are dropped, so `./src//a.ts` is `src/a.ts`.
|
|
61
|
+
*/
|
|
59
62
|
export declare function matchGlob(glob: Glob, path: string): boolean;
|
|
60
63
|
/**
|
|
61
|
-
* A path
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
+
* A shortest path every glob in `include` matches and none in `exclude` does,
|
|
65
|
+
* `none` as a proof that there is no such path, or `undecided` when the search
|
|
66
|
+
* met its budget first.
|
|
64
67
|
*/
|
|
65
|
-
export declare function
|
|
68
|
+
export declare function globWitness(include: readonly Glob[], exclude?: readonly Glob[], budget?: number): Witness;
|
|
69
|
+
/** Whether every path `inner` matches is matched by one of `outer`, or `undecided`. */
|
|
70
|
+
export declare function globCovers(outer: readonly Glob[], inner: Glob, budget?: number): boolean | 'undecided';
|
|
66
71
|
/**
|
|
67
|
-
* A
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* character is absorbed by a star on both sides at once (dropping it would
|
|
71
|
-
* leave a shorter one), so every character advances at least one sequence,
|
|
72
|
-
* and the five moves below are all the ways that can happen.
|
|
72
|
+
* A path both globs match, or `null` when there is none: the 0.1 interface,
|
|
73
|
+
* kept for the library's callers. It cannot say `undecided`, so a search that
|
|
74
|
+
* meets its budget throws; {@link globWitness} answers in three ways.
|
|
73
75
|
*/
|
|
74
|
-
export declare function
|
|
76
|
+
export declare function intersectGlobs(a: Glob, b: Glob, budget?: number): string | null;
|
|
75
77
|
/**
|
|
76
|
-
* The
|
|
77
|
-
*
|
|
78
|
+
* The directories a walk must enter to find every match, one per brace
|
|
79
|
+
* alternative: the leading literal segments, or a literal file's directory.
|
|
80
|
+
* `''` for an alternative that can match at the root.
|
|
78
81
|
*/
|
|
82
|
+
export declare function globBases(glob: Glob): readonly string[];
|
|
83
|
+
/** The first of {@link globBases}: the 0.1 interface, kept for the library's callers. */
|
|
79
84
|
export declare function globBase(glob: Glob): string;
|
|
85
|
+
/** A name with an extension, `login.ts` or `.eslintrc.json`, and not a dot-name such as `.github`. */
|
|
86
|
+
export declare function hasExtension(name: string): boolean;
|
|
87
|
+
/** The files a tree holds, and every directory above one. */
|
|
88
|
+
export interface Tree {
|
|
89
|
+
readonly files: ReadonlySet<string>;
|
|
90
|
+
readonly directories: ReadonlySet<string>;
|
|
91
|
+
}
|
|
92
|
+
/** The tree a list of files describes. Built once per list, which every brief of a run shares. */
|
|
93
|
+
export declare function treeOf(files: readonly string[]): Tree;
|
|
94
|
+
/** What the tree holds at a path: a file, a directory, or nothing. */
|
|
95
|
+
export declare function held(tree: Tree, path: string): 'file' | 'directory' | null;
|
|
96
|
+
/**
|
|
97
|
+
* How a tree reads a literal path: a directory it holds is a directory, and
|
|
98
|
+
* anything else is a file. Without a tree nothing is known to be a directory,
|
|
99
|
+
* so every literal is a file; a trailing `/` says otherwise, and never reaches
|
|
100
|
+
* this question.
|
|
101
|
+
*/
|
|
102
|
+
export declare function readingIn(files: readonly string[] | null): (path: string) => LiteralReading;
|