demo-vault-populate
Builds a complete PopulateFilesParams map for a plugin’s in-repo demo-vault/, ready to seed into the temp vault before Obsidian opens it. Composes readDemoVaultTree (the note tree) with the two pieces it deliberately omits: selected .obsidian/* config files, and the built binaries (+ data.json) of any extra community plugins the demo vault depends on (e.g. CodeScript Toolkit, demo-vault-helper).
Pairs with the enableCommunityPlugins option of the global-setup createSetup: this seeds the binaries, that turns them on. It intentionally does NOT write community-plugins.json — the harness owns that file (it lists the plugin-under-test), and enabling the extras persists them.
Stays synchronous, so an injected plugin whose binaries are absent is a throw rather than a download. demo-vault-bootstrap.ts owns the headless install the throw’s message points at — including buildDemoVaultPopulateAsync, the self-healing sibling of buildDemoVaultPopulate. The missing-plugin detection (resolveMissingInjectedPlugins) lives here and is shared with it, so the two paths cannot disagree about what “not installed” means.
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| BuildDemoVaultPopulateParams | Parameters for buildDemoVaultPopulate. |
| InjectPluginParams | A community plugin to seed into the demo vault alongside the note tree. |
| ResolveMissingInjectedPluginsParams | Parameters for resolveMissingInjectedPlugins. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| buildDemoVaultPopulate | Builds the full populate map for a plugin’s demo-vault/: the note tree, the selected .obsidian/* config files, and every injected plugin’s binaries (+ optional data.json). |
| resolveMissingInjectedPlugins | Selects the injected plugins whose binaries are missing from the demo vault and can therefore be installed headlessly — the exact set buildDemoVaultPopulate would otherwise throw on. Plugins carrying an explicit InjectPluginParams.sourceDirectory are excluded: that names a local build output, not somewhere to download a published release into. Shared with the bootstrap so “missing” has one definition rather than two that can drift apart. |