Skip to main content

Module config

Module config 

Source
Expand description

Per-app lumen.toml configuration model. Per-app lumen.toml config loader.

  • Reads an optional file at <app-dir>/lumen.toml.
  • Sets runtime defaults; CLI flags supplied on top take precedence.
  • Unknown top-level keys are rejected; section fields default when absent.
[app]
entry = "main.lmn"          # default
locale = "de-DE"            # default: the OS locale, else en-US
fallback_locale = "de-DE"   # default: en-US; the language the source strings are in
single_instance = true      # default: false; second launch forwards argv and exits

[window]
title = "My App"            # default: app directory name
size  = [1280, 720]         # default: [960, 720]

[skin]
name = "default"            # default: none (bare framework)

[mcp]
port = 7878                 # default when absent; 0 disables the server

[profile]
mode = "off"                # off | chrome | tracy | stderr

[asset_roots]
paths = ["icons", "../shared"]   # extra dirs scanned for relative src=

[dependencies]                   # runtime modules + portable plugins, sorted-name order
lumen-audio = { bundled = true }
shape-tools = { path = "modules/shape-tools", config = { units = "mm" } }
weather-feed = "1.2"             # registry package, fetched by lpm and pinned in lumen.lock

[target.web.dependencies]        # laid over [dependencies] for a `lumenc web` build
chart = { path = "modules/chart" }  # a module with only a web half: chart/web/lumen-addon.toml

[[hooks]]                        # project build/setup commands; see `crate::hooks`
when    = "prebuild"             # "prebuild" | "prerun"
os      = "linux"                # optional: "linux" | "macos" | "windows"
run     = "mkdir -p lib && cc -shared -fPIC -O2 -o lib/libmd.so md.c"
inputs  = ["md.c"]
outputs = ["lib/libmd.so"]

[[plugins]]                      # compiler plugins, run in declaration order
name    = "markdown"             # must match what the cdylib reports
path    = "plugins/markdown"     # built cdylib; extensionless probes lib*.so/.dylib/.dll
config  = { flavor = "gfm" }     # optional, handed to the plugin verbatim

Parse failures surface as ConfigError; the caller decides whether to abort or fall back to defaults.

Structs§

AppCfg
[app] block.
AssetRootsCfg
[asset_roots] block.
BundleCapabilities
The resolved per-app capability set for a static --bundle, produced by merging explicit [capabilities] / [runtime] config with a conservative source scan, then mapped to the cargo --features list the trimmed runtime seam is built with.
CapabilitiesCfg
[capabilities] block: which optional subsystems a build of this app carries, keyed by capability name (os-tray, http-fetch, mcp, …).
HookCfg
One [[hooks]] entry: an app-declared build/setup command.
LumenToml
Parsed lumen.toml config, all fields optional.
McpCfg
[mcp] block.
PagesCfg
[pages] block - file-based multi-page navigation.
PerfCfg
[perf] block carrying per-cache memory caps.
ProfileCfg
[profile] block.
RenderCfg
[render] block: which render backend draws the app.
RuntimeCfg
[runtime] block - per-app overrides for the startup subsystem-gating (measured startup quick-wins). Every field is Option: None keeps the automatic behaviour (run-mode gating for MCP / hot-reload; min(cores, 4) for threads), while Some(v) forces it.
ScriptCfg
[script] block - an override that forces every script in the app onto one language. Without it each script file belongs to the language its extension names, as the installed host modules declare it, and an app that ships more than one language runs one host per language. Set engine when the per-file answer is not the one you want, most often because the app keeps its script inline in the markup, where there is no extension to read.
SignalsCfg
[signals] table - typed signal schema for the lumenc lint --signals mode. Each entry maps a signal name to its expected SignalType. Authors hand-write this; the lint subcommand uses it to flag untyped writes and schema mismatches.
SkinCfg
[skin] block.
WebCfg
[web] block - how lumenc web emits the app as a static site.
WebPageCfg
[web.pages.<key>] block - what one page says about itself.
WebSsrCfg
[web.ssr] block - what the app allows a render to reach.
WindowCfg
[window] block.

Enums§

ConfigError
Errors returned by LumenToml::load_or_default.
HookOs
[[hooks]] os value: restricts a hook to one platform, matched against std::env::consts::OS ("linux", "macos", "windows").
HookWhen
[[hooks]] when value: the trigger point a hook fires at.
RenderBackendChoice
The value of [render] backend.
SignalType
Declared signal type for a SignalsCfg entry.
WebCssMode
[web] css - how a page’s styling reaches the browser.
WebHost
[web] host - where the site is deployed, and so which rewrite file lets a deep path reach the app.
WebMenubar
[web] menubar - what an app menu bar becomes in a document.
WebNavigation
[web] navigation - how a link to another page of the same site is followed.
WebPrerender
[web] prerender - where the state a page is rendered with comes from.
WebRender
[web] render - where a page’s document comes from.
WebSeedValue
One [web.seed] value.
WebWidgets
[web] widgets - which shape a composed widget is emitted as.

Functions§

app_sources
The app’s markup, scripts, styles and config read into one haystack, for a build that asks whether the app uses a subsystem. Bounded, so a large asset tree cannot turn the question into a slow directory crawl.