Where settings live
Workspace config
The 1.0 contract has no openpress.config.mjs. Document metadata moves to <Press> props; operational settings (deploy) live in package.json. Paths follow convention with sensible defaults.
openpress.config.mjs is deprecated. Its fields move
to three places: <Press> props (document metadata), package.json "openpress" field (operational), and engine conventions (paths). Codemod in v0.10
rewrites existing workspaces automatically.
The three layers
| Name | Type | Default | Description |
|---|---|---|---|
Document metadata | <Press> props | title, page, sources, theme, componentsDir, slug. Display copy beyond title (subtitle / organization / author) lives in your Cover JSX, not in Press props. See <Press>. | |
Operational | package.json "openpress" | Deploy adapter + adapter-specific config. The CLI reads this synchronously without running React, so it's the only place build-time settings can live. | |
Paths | Convention | Hardcoded engine defaults: press/, press/theme/, press/components/, press/media/, public/openpress/, dist-react/. Override only at the <Press> level (theme, componentsDir), not via a separate config file. |
Document metadata — <Press> props
See the <Press> page for the full prop reference. The
fields formerly in openpress.config.mjs map directly:
Migration from openpress.config.mjs to <Press> props
| Name | Type | Default | Description |
|---|---|---|---|
title | → <Press title> | Direct move. Only required metadata prop on Press. | |
subtitle / organization / author | → Cover JSX | Dropped from config — render directly in your Cover component. The codemod inlines the existing values as JSX text by default. | |
page | → <Press page> | Direct move. One page geometry per Press; if you need two sizes in the same project, use multiple <Press> children in <Workspace> (per-<Frame> override is not supported). | |
sourceDir / mediaDir / themeDir / componentsDir | → <Press theme>, <Press componentsDir> | theme and componentsDir are configurable props. sourceDir + mediaDir are now conventions, not configurable. | |
captionNumbering | → <Press captionNumbering> | Direct move. | |
pdf.filename | Convention | Always <slug>.pdf (or document.pdf for single-doc workspaces). Not configurable. |
Operational — package.json "openpress"
Operational config that the CLI reads sync at startup — before any React render. Deploy adapter selection lives here because openpress:deploy must know the adapter before invoking it. Most users only need to fill in the deploy block once.
{
"name": "my-paper",
"openpress": {
"deploy": { "adapter": "...", ... }
}
} Top-level keys
| Name | Type | Default | Description |
|---|---|---|---|
deploy | DeployConfig | Deploy adapter config. Required when running openpress:deploy; optional otherwise (CI / local dev work without it). |
Deploy
Adapter-discriminated union. Each adapter has its own required keys layered on top of the shared keys below.
Shared keys
| Name | Type | Default | Description |
|---|---|---|---|
adapter required | string | Built-in: "cloudflare-pages". Planned: "static-dir". Custom adapters can register their own keys. | |
source | string | ".deploy" | Staging directory (relative to workspace root) where the deploy artifact is assembled before adapter hand-off. |
requiresConfirmation | boolean | true | Require --confirm on the command line. Disable only when the adapter has its own confirmation step. |
commitDirty | boolean | false | Allow deploying with uncommitted changes. Leave false in CI. |
cloudflare-pages adapter
| Name | Type | Default | Description |
|---|---|---|---|
projectName required | string | Cloudflare Pages project. Passed as --project-name= to wrangler. |
{
"name": "open-source-economics",
"version": "0.1.0",
"scripts": { "build": "open-press build", "dev": "open-press dev" },
"openpress": {
"deploy": {
"adapter": "cloudflare-pages",
"source": ".deploy",
"projectName": "open-source-economics",
"requiresConfirmation": true
}
}
} Paths — convention only
The engine hardcodes path conventions. There is intentionally no way to override these from a config file in v1.0 — the conventions are part of the product surface, not a tuning knob.
| Name | Type | Default | Description |
|---|---|---|---|
Content root | press/ | Where index.tsx + content folders live. For multi-doc workspaces, each child <Press> nests in its own subfolder (slug). | |
Theme | press/theme/ (or per-doc) | Default ./theme relative to the document file. Override via <Press theme="..."> if non-standard. | |
Components | press/components/ | Override via <Press componentsDir="...">. | |
Media | press/media/ | Workspace-level via <Workspace media="...">. Not per-Press configurable. | |
Build output (engine) | public/openpress/ | Engine writes document.json and synced assets here. Not configurable. | |
Build output (Vite) | dist-react/ | Production deploy bundle. Not configurable. | |
Deploy stage | .deploy/ | Configurable via package.json openpress.deploy.source; default .deploy/. |
Deprecated — openpress.config.mjs
The v0.x config file. Single-doc workspaces had this at root; nested-doc workspaces had a root pointer to press/openpress.config.mjs. Works until v1.0. v0.10 codemod migrates to the new shape.
// openpress.config.mjs (v0.x — deprecated)
export default { title: "...", page: "a4", deploy: {...} }; The codemod will:
- Move metadata fields (
title,subtitle,organization,author,page,captionNumbering) into<Press>props on the default export ofpress/index.tsx. - Convert the existing
export const sourcesobject to an array on<Press sources>. - Move
deploy.*intopackage.json "openpress". - Drop
pdf.filename,publicDir,outputDir,documentDir, and the root pointer — these become convention. - Delete the
.mjsfile when the migration is clean.