DemoVaultCoverageChecker
Reflects a plugin’s public surface from source and checks its in-repo demo-vault/ stays in sync with it.
Every method is a pure query over files under the repo root (the demo corpus is read once and cached), so the checker is trivially unit-testable against a fixture repo and carries no test-framework dependency.
Import:
import { DemoVaultCoverageChecker } from 'obsidian-dev-utils/script-utils/demo-vault-coverage';Signature:
export class DemoVaultCoverageCheckerConstructor
new DemoVaultCoverageChecker(params: DemoVaultCoverageCheckerConstructorParams)Creates a checker rooted at a plugin repo.
Methods
| Method | Returns | Description |
|---|---|---|
| collectDemoNoteRelativePaths() | string[] | Collects the demo notes as paths relative to the demo vault folder (for a non-trivial-surface guard). |
| collectNotes() | DemoVaultNote[] | Reads and caches every demo note individually — the per-note view the authoring checks work on, as opposed to the concatenated DemoVaultCoverageChecker.readCorpus. |
| findCommittedAppJsonSettings() | string[] | Finds the .obsidian/app.json settings the vault commits that obsidian-dev-utils owns and writes into the archived vault itself. A committed one is a second copy of a setting nothing reconciles, and it is the copy that goes stale — so the convention is that the vault commits none of them. |
| findNotesWithDocsLinks() | string[] | Finds notes carrying a link line. The note IS the documentation, so a line pointing elsewhere for the real explanation is the shape this convention exists to remove. |
| findNotesWithoutH1() | string[] | Finds notes that do not open with an # H1 (frontmatter aside). |
| findNotesWithoutIntroProse() | string[] | Finds notes with no prose paragraph before their first code fence — the 1-3 sentences saying what the feature does and why a reader would want it, without which the note is a button with no lesson. |
| findNotesWithUnjustifiedWikilinkAllowance() | string[] | Finds notes whose wikilink allowance is not doing any work — declared without a reason, or on a note that carries no wikilink at all. Both are drift: an exemption nobody can justify, and one nothing needs any more, which would go on hiding the next wikilink somebody adds by accident. |
| findNotesWithWikilinks() | string[] | Finds notes using an Obsidian [[wikilink]] outside a code fence. The demo vault is also read on GitHub, where a wikilink renders as literal brackets and leads nowhere. A wikilink shown INSIDE a fence is sample text, not navigation, so fenced blocks are skipped, as is a note that declares in its frontmatter why its wikilinks are the point — see the file overview. |
| findStaleReferences(params) | string[] | Finds members that the demo notes reference on a receiver but that no longer exist on it (rename drift). |
| findUndemonstratedMembers(params) | string[] | Finds members that are not demonstrated anywhere in the demo corpus. |
| findUnlinkedFeatureDocs(params) | string[] | Finds feature docs that no demo note links to. |
| findUnreachableNotes(params) | string[] | Finds notes that cannot be reached from the start note by following Markdown links between notes. The walk starts at DemoVaultCoverageCheckerFindUnreachableNotesParams.startNote and follows every link outside a code fence, transitively. A note nothing links to is one a reader can only find by browsing the file list — which is exactly what the grouped index in the start note is meant to replace. When the start note itself is missing, EVERY note is unreachable, because there is nowhere to start from. |
| getExportedFunctionNames(params) | string[] | Parses the names of the export functions (including async and generator declarations) in a source file. |
| getInterfaceMembers(params) | InterfaceMembers | Parses the members of an export interface, export class, or export enum declared in a source file. |
| readCorpus() | string | Reads and caches the demo corpus — every *.md note in the demo vault joined into one string. |
Links to this page: