Skip to content

script-utils/demo-vault-app-json

The .obsidian/app.json settings obsidian-dev-utils owns in every demo vault.

A demo vault is documentation first and an editing surface second, so four Obsidian settings have to be the same in every one of them. They are not committed: a vault that wrote them itself would drift (measured 2026-08-13, only 3 of 23 vaults had the first pair and 1 of 23 the second), so this package owns them instead — archivePluginDemoVault merges them into the app.json of the archived copy at release time, and the demo-vault coverage suite fails a vault that commits any of them.

  • defaultViewMode: 'preview' + livePreview: false — a note opens as a reader sees it rather than as raw markup. Obsidian-only: GitHub never reads app.json and renders every note as HTML regardless. - useMarkdownLinks: true + newLinkFormat: 'relative' — what Obsidian writes when a link is created inside the vault. Left at Obsidian’s defaults (false / 'shortest') every new link comes out as a shortest-path [[wikilink]], the form the coverage suite rejects and GitHub renders as literal brackets. relative rather than absolute so notes keep resolving once the vault is extracted to an arbitrary folder.

All four are written explicitly, never left to an Obsidian default: a vault leaning on a default changes behavior when that default does.

Kept free of both vitest and adm-zip on purpose — the coverage suite pulls in the former and the archiver the latter, and neither may reach the other’s environment.

InterfaceDescription
BuildArchivedDemoVaultAppJsonContentParamsParameters for buildArchivedDemoVaultAppJsonContent.
FindOwnedDemoVaultAppJsonSettingsParamsParameters for findOwnedDemoVaultAppJsonSettings.
ParseDemoVaultAppJsonParamsParameters for parseDemoVaultAppJson.
FunctionDescription
buildArchivedDemoVaultAppJsonContentBuilds the app.json content for the archived copy of a demo vault: the committed settings with the owned ones merged over them.
findOwnedDemoVaultAppJsonSettingsFinds the owned settings a demo vault has committed. They belong to this package, which injects them at release time, so a committed one is drift waiting to happen rather than a local preference.
parseDemoVaultAppJsonParses a demo vault’s committed app.json.
TypeDescription
DemoVaultAppJsonA parsed .obsidian/app.json. Only the settings in DEMO_VAULT_APP_JSON_SETTINGS are interpreted; every other setting is carried through untouched.
VariableDescription
DEMO_VAULT_APP_JSON_SETTINGSThe .obsidian/app.json settings this package writes into every archived demo vault, and that a demo vault must therefore never commit. See the file overview for what each one buys.