Monorepo Structure
The workspace is a pnpm monorepo. pnpm-workspace.yaml includes both packages/* and packages/plugins/*, so the nested plugin packages participate in local workspace resolution.
| Path | Role | Notes |
|---|---|---|
package.json | Root orchestration | Defines top-level build, lint, test, and format commands. |
packages/api | Shared runtime | Owns the application model and most Obsidian-like primitives. |
packages/ui | Shared design system | Wraps Bits UI and Tailwind-based components for the rest of the repo. |
packages/diffmerge | Diff / merge UI | Svelte 5 two- and three-pane merge editors and line-diff helpers (vendored from mismerge); consumed as @lapis-notes/diffmerge. See Diffmerge. |
packages/notebook/core | Shared notebook contracts | Owns notebook output protocol types and pure lapis output helpers extracted from the bundled notebook plugin. |
packages/notebook/duckdb | Shared notebook DuckDB contracts | Owns reusable DuckDB runtime contracts, query-result types, DuckDB type mapping, and pure query normalization helpers. |
packages/notebook/duckdb-assets | Shared notebook DuckDB assets | Owns browser/PWA DuckDB-Wasm and DuckDB worker asset URL resolution for notebook DuckDB runtimes. |
packages/notebook/input | Shared notebook input helpers | Owns host-neutral Observable-style viewof transforms, DOM runtime loading, input node binding, and callback-driven view runtime helpers consumed by notebook runtimes. |
packages/notebook/stdlib | Shared notebook builtin contracts | Owns current Lapis builtin names, documented bare notebook globals, dependency-global validation helpers, and source-level runtime feature detection. |
packages/notebook/worker | Shared notebook worker contracts | Owns generic worker transport message contracts for notebook runtimes. |
packages/web | Browser/PWA host | Owns the installable browser host, manifest/service worker generation, cross-origin-isolation headers, and first-load offline shell caching around the shared renderer. |
packages/lapis.md | Public docs site | Owns the static Astro + Starlight site for lapis.md: landing page, user help (/help/), and developer docs (/developers/), styled with shared UI theme tokens. |
packages/workspace | Renderer shell | Owns the shared Svelte renderer, vault bootstrap, layout shell, and bundled-plugin composition that host packages mount. |
packages/plugins/plugin-markdown | First-party feature plugin | Registers markdown, media, properties, and outline views plus editor behavior. |
packages/plugins/plugin-graph | First-party feature plugin | Adds global and local graph views driven by the metadata cache and a D3 force layout. |
packages/plugins/plugin-search | First-party feature plugin | Maintains the search view and routes indexing/query work through AppDatabase and the per-vault SQLite/IndexedDB search state. |
packages/plugins/plugin-bases | First-party feature plugin | Adds .bases and .base views and structured data presentation. |
packages/plugins/plugin-spellchecker | Obsidian-targeted plugin | Harper-based grammar and spell checking plugin for Obsidian. |
packages/desktop-electron | First-party desktop host | Electron desktop shell that mounts @lapis-notes/workspace. First-party native target per ADR-003. |
docs | Miscellaneous documentation | Currently separate from the architecture spec. |
patches | patch-package overrides | Holds dependency patches such as decode-named-character-reference. |
Important split in the repo
There are two plugin ecosystems present at once:
- first-party plugins built against
@lapis-notes/api - colocated plugins that still target the upstream
obsidianpackage directly
That split is important because only the first group participates in the current workspace app boot sequence.
The approved host targets are web/PWA and Electron desktop. The source tree represents the shared browser renderer, the installable web/PWA host, and the first-party Electron desktop shell. See Desktop Host, Desktop Electron Package, and ADR-003: Electron-First Desktop Shell for the authoritative desktop-host direction.
Licensing Model
The repository is multi-licensed. The root LICENSE.md summarizes the current package categories, and each workspace package declares its SPDX license in package.json.
| Area | License |
|---|---|
| Core app packages, host packages, shared UI, notebook support, language service, and bundled first-party plugins | AGPL-3.0-or-later |
Plugin SDK/API package (packages/api) | Apache-2.0 |
Public documentation and website package (packages/lapis.md) | CC-BY-4.0 |
| Vendored diff/merge package and Obsidian-targeted compatibility plugin packages where declared | MIT |
| Lapis Notes name, logos, icons, domains, and related marks | Trademark rights reserved |
Third-party dependencies and vendored files keep their own notices. File-level notices take precedence for the files they cover.