Skip to content
Svartz v2.6.0

@svartz/config

54 exported symbols.

Classes

c ConfigDecodeFailed
c ConfigImportFailed
c ConfigNotFound
c VaultBuildRootConflict
c VaultBuildRootResolutionFailed
c VaultIdConflict
c VaultIdNotFound
c VaultMountConflict
c VaultPathInvalid
c VaultPluginInvalidA plugin's `forVault` refused the site, such as an `auth` whose `callbackVault` names no vault with auth.

Interfaces

i ResolvedConfigSetInternal multi-vault resolved config set used by config resolution helpers. Defaults are merged into each vault, while build defaults remain available here.

Types

t AnalyticsConfig
t ConfigError
t DiscoveryConfig
t FrontmatterFields
t LinkResolutionStrategy
t ResolvedConfigCanonical single-vault resolved build config re-exported from @svartz/core.
t ResolvedSvartzConfigCompatibility alias for code that still refers to the multi-vault bundle.
t ResolvedVaultConfigCompatibility alias for code that still refers to a resolved vault.
t SiteConfig
t SvartzConfig
t SvartzDefaults
t TargetConfig
t VaultConfig
t VaultOptions
t VaultThemeConfig

Functions

f defineConfig
f getPackageVersionGet the `version` from a package.json. Accepts either: - A module URL (e.g. `import.meta.url`): finds the package.json for that module's package by walking up from the file. - A path to package.json (e.g. `resolve(__dirname, "../package.json")`): reads that file directly.
f getVault
f listVaults
f loadConfig
f loadConfigEffectLoad, import, and parse a svartz config file. Returns the parsed SvartzConfig and the directory containing the config file.
f parseConfig
f parseConfigEffectParse (validate) a raw JS object against the config schema, then check that the major version matches the config format this package reads.
f resolveConfig
f resolveConfigEffect
f runEffect

Variables

v AnalyticsConfigSchema
v BuildOptionsSchema
v DiscoveryConfigSchema
v FrontmatterFieldsSchema
v GiscusConfigSchema
v IndexConfigSchemaWhat the published index carries beyond its defaults.
v LinkResolutionStrategySchema
v PasswordGroupsSchema
v PluginEntrySchemaShallow plugin placeholder; plugin interface/standard TBD.
v SemverSchema
v SiteConfigSchema
v SvartzConfigSchema
v SvartzDefaultsSchemaDefaults are vault options at top level (no nested .vault).
v TargetConfigSchema
v VaultConfigSchemaVault config: required id, path, target + optional vault options (same shape as defaults; merged with defaults).
v VaultOptionsSchemaShared vault options; defaults and VaultConfig both use this shape.
v VaultThemeConfigSchemaShared keys are checked here. Anything else is the theme's own setting (routes, footer, infobox defaults…) and passes through for the theme to validate.