InjectPluginParams
A community plugin to seed into the demo vault alongside the note tree.
Import:
import type { InjectPluginParams } from 'obsidian-integration-testing';Signature:
export interface InjectPluginParamsProperties
| Property | Type | Description |
|---|---|---|
| data? | unknown | Overlay written as .obsidian/plugins/<pluginId>/data.json (JSON, 2-space indent). Omit to keep whatever data.json (if any) already lives in InjectPluginParams.sourceDirectory. |
| minVersion? | string | undefined | The oldest plugin version the demo vault works with, e.g. '13.8.0' for a demo script that imports something only that release serves. A copy already installed in the demo vault whose manifest.json reports an older version (or none) is **stale**: the headless bootstrap re-downloads it, and the synchronous buildDemoVaultPopulate refuses it rather than seeding it.Without it a warm checkout keeps whatever version it first downloaded for good, since the plugin folder is gitignored — so a fresh clone passes while every machine with an old copy fails, under an error that names the demo script rather than the plugin. Ignored for a plugin with an explicit InjectPluginParams.sourceDirectory. |
| pluginId | string | The community plugin's id (its .obsidian/plugins/<pluginId> folder name). |
| repo? | string | undefined | The GitHub repository (owner/name) publishing this plugin, consulted **only** by the headless bootstrap (bootstrapDemoVaultPlugins / buildDemoVaultPopulateAsync / the bootstrap-demo-vault CLI) when the binaries are missing from the demo vault or stale (see InjectPluginParams.minVersion). Supplying it skips the lookup in Obsidian's community plugin registry, which is also the way to bootstrap a plugin that is not listed there at all. Never used when an acceptable copy is already on disk. |
| sourceDirectory? | string | Directory to read the plugin's built files from. Every file directly inside it is copied into .obsidian/plugins/<pluginId>/; main.js and manifest.json are required.Setting this also opts the plugin **out** of the headless bootstrap: an explicit source directory names a local build output, not somewhere to download a published release into. |
| version? | string | undefined | The release tag the headless bootstrap downloads from, pinning the installed version. Omit for the repository's latest release — what the in-app community browser installs. A pin is held, not merely used for the first download: an installed copy whose manifest.json reports a different version is **stale**, exactly as one below InjectPluginParams.minVersion is. A leading v on the tag is ignored for that comparison. Ignored for a plugin with an explicit InjectPluginParams.sourceDirectory. |
Links to this page: