Skip to content

script-utils/demo-vault

Archives a plugin’s demo vault as a release artifact.

A plugin can ship a curated demo vault at demo-vault/ in its repo root. At release time this module installs the freshly built plugin into that vault’s .obsidian/plugins/<id>/ folder and zips the whole vault into dist/build/<plugin-id>-demo-vault.zip, so the existing GitHub-release step (which uploads every file in dist/build/) attaches it automatically.

The version is deliberately absent from that name and lives INSIDE the archive instead — see obsidian/demo-vault-naming.ts for why — in the two places a person actually meets it: the vault sits under a single <plugin-id>-demo-vault-<version>/ folder, so unzipping several releases by hand into one folder neither collides nor produces anonymous directories, and the vault’s README.md heading gains the version it demonstrates.

The archived copy also carries the .obsidian/app.json settings this package owns (see demo-vault-app-json.ts). Those settings and the README heading are written into the ZIP ENTRY and never into the repo folder: both files are tracked, and updateVersion archives after it has already pushed, so an in-place write would leave an uncommitted change behind a published release.

FunctionDescription
archivePluginDemoVaultArchives the plugin’s demo vault (demo-vault/ in the repo root) as a release artifact. Installs the freshly built plugin from dist/build/ into the vault’s .obsidian/plugins/<id>/ folder, then zips the whole vault to dist/build/<plugin-id>-demo-vault.zip, under a single <plugin-id>-demo-vault-<version>/ folder.