Skip to content

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 '@mnaoumov/obsidian-dev-toolkit/demo-vault-coverage';

Signature:

export class DemoVaultCoverageChecker

Constructor

new DemoVaultCoverageChecker(params: DemoVaultCoverageCheckerConstructorParams)

Creates a checker rooted at a plugin repo.

Methods

MethodReturnsDescription
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 this package 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 [Docs](…) 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 exemptions are not doing any work — a wikilink allowance or an inline directive for any rule declared without a reason, misspelled, or covering nothing that breaks its rule. All of them are drift: an exemption nobody can justify, and one nothing needs any more, which would go on hiding the next mistake somebody makes 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).
findTryItSectionsWithoutCodeButton()string[]Finds Try it sections with no code-button in them. A Try it section is a heading of any level starting Try it, up to the next heading of the same or a higher level; the setup it asks for is what a button is for, so a section that leaves the reader to do it by hand is the shape this check rejects. A section whose heading a demo-vault-validation/try-it-code-button directive covers has stated why it cannot be scripted, and is skipped — see the file overview.
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 [Text](<./NN Name.md>) 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)InterfaceMembersParses the members of an export interface, export class, or export enum declared in a source file.
readCorpus()stringReads and caches the demo corpus — every *.md note in the demo vault joined into one string.

Links to this page: