@miragon/bpmn-modeler-shared

September 18, 2026 · View on GitHub

The private webview ↔ host message protocol for BPMN, DMN, and Camunda Form modeling: the Query/Command base classes and every concrete message type, HostApi, document-flush plumbing, the async-debounce/resolver helpers, and the process-variable / variable-manifest types the hosts exchange.

Used by the extension host (apps/vscode-plugin), the modeler-bridge, and the webview bootstrap/host-adapter layers. It is not publishable: it encodes the internal transport contract.

The public/protocol split

The publishable, host-agnostic types and browser utilities (engine/lint/settings/scripting/implementation/diff types, canvasResize, the isTextEditingSurface predicate, bpmnFlowOrder) live in @miragon/bpmn-modeler-types. This package imports those types where its message payloads reference them, but never the reverse — a no-restricted-imports eslint rule (BND-PROTOCOL-PRIVATE) keeps the publishable libraries and webview app/ layers off this protocol package.

Alongside the protocol, this package also holds the private webview chrome that is not worth publishing (Architecture and hosts: package boundaries): the properties-panel propertiesPanelFocus / propertiesPanelResizer (DOM-id-coupled page chrome) and the shared hostTheme adapter (hostTheme.ts) — it maps the VS Code <body>-class light/dark signal to a page-level scope attribute on <html> plus each modeler instance's own setTheme, and is used by both the BPMN and DMN webviews.

Reach for @miragon/bpmn-modeler-types for anything a future @miragon/bpmn-modeler npm package could need; reach for this package only from the bootstrap/host layers, modeler-core, and the hosts.

Usage

{
  "dependencies": {
    "@miragon/bpmn-modeler-shared": "workspace:*"
  }
}
import { BpmnFileQuery, HostApi } from "@miragon/bpmn-modeler-shared";

Path resolution is handled by tsconfig.base.json (via paths) plus vite-tsconfig-paths (for webviews) and tsconfig-paths-webpack-plugin (for the extension host). No manual vite.config alias required.