Skip to content

demo-vault-bootstrap

Installs a demo vault’s injected community plugins headlessly, by downloading their published GitHub release assets straight into demo-vault/.obsidian/plugins/<id>/.

buildDemoVaultPopulate requires each injected plugin’s main.js / manifest.json to already be on disk, and throws when they are not. Until this module existed the only documented remedy was a GUI step — open demo-vault/ in Obsidian once and let demo-vault-helper install the plugin at runtime. .obsidian/plugins/* is gitignored in a plugin repo, so that state exists on exactly the one machine that did it and is invisible to a fresh clone, a new machine, or CI. Since a plugin repo’s release preflight runs its integration tests, that made cutting a release from a clean clone impossible without a human opening a GUI.

Downloading the release assets is the exact headless equivalent: the resulting folder is what Obsidian itself would have installed, so the shipped *-demo-vault.zip — which unzips into a single *-demo-vault-<version> folder — stays the standard demo-vault artifact.

Two entry points, plus the bootstrap-demo-vault CLI subcommand:

The sync buildDemoVaultPopulate deliberately keeps throwing: fetch has no synchronous form, so auto-healing can only live on an async sibling. Its message now names both remedies above instead of the GUI step.

InterfaceDescription
BootstrapDemoVaultPluginsParamsParameters for bootstrapDemoVaultPlugins.
BootstrapDemoVaultPluginsResultThe outcome of a bootstrapDemoVaultPlugins run.
InstalledPluginInfoOne plugin installed by bootstrapDemoVaultPlugins.
FunctionDescription
bootstrapDemoVaultPluginsInstalls every injected community plugin whose built files are missing from the demo vault, by downloading its published release assets into demo-vault/.obsidian/plugins/<id>/. Each plugin’s repository comes from its InjectPluginParams.repo when given, otherwise from Obsidian’s own community plugin registry — the same idrepo table the in-app community browser installs from, so no plugin-specific mapping is hardcoded.
buildDemoVaultPopulateAsyncThe self-healing counterpart of buildDemoVaultPopulate: installs any injected community plugin whose binaries are missing (see bootstrapDemoVaultPlugins), then builds the populate map exactly as the synchronous builder does. Use this from a global setup’s populate thunk — both the Vitest and Jest adapters accept a thunk returning a promise — so a fresh clone, a new machine, or CI needs no manual install step.
TypeDescription
BuildDemoVaultPopulateAsyncParamsParameters for buildDemoVaultPopulateAsync — the same bag buildDemoVaultPopulate takes, under the name the asynchronous builder derives. One declaration serves both builders. It keeps the synchronous builder’s name, and this alias gives the asynchronous one its own, so neither has to be spelled after the other.