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 readsapp.jsonand 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.relativerather thanabsoluteso 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.
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| BuildArchivedDemoVaultAppJsonContentParams | Parameters for buildArchivedDemoVaultAppJsonContent. |
| FindOwnedDemoVaultAppJsonSettingsParams | Parameters for findOwnedDemoVaultAppJsonSettings. |
| ParseDemoVaultAppJsonParams | Parameters for parseDemoVaultAppJson. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| buildArchivedDemoVaultAppJsonContent | Builds the app.json content for the archived copy of a demo vault: the committed settings with the owned ones merged over them. |
| findOwnedDemoVaultAppJsonSettings | Finds 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. |
| parseDemoVaultAppJson | Parses a demo vault’s committed app.json. |
| Type | Description |
|---|---|
| DemoVaultAppJson | A parsed .obsidian/app.json. Only the settings in DEMO_VAULT_APP_JSON_SETTINGS are interpreted; every other setting is carried through untouched. |
Variables
Section titled “Variables”| Variable | Description |
|---|---|
| DEMO_VAULT_APP_JSON_SETTINGS | The .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. |