Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Diffmerge Package (@lapis-notes/diffmerge)

@lapis-notes/diffmerge provides Svelte 5 diff and three-way merge UI: DiffMerge2 (two-pane) and DiffMerge3 (three-pane), plus line/block diff helpers, editor chrome, and themed CSS.

Source: packages/diffmerge/src/lib/

Provenance

The implementation is vendored from the mismerge / mergeweave core library (MIT). This monorepo keeps a single package that combines former core sources with the former adapter-svelte packaging model (plain Svelte components, not custom elements). React and Solid adapters are not included.

Exports

The package is built with @sveltejs/package. Consumers should depend on workspace:* and use:

ExportPurpose
@lapis-notes/diffmergeDiffMerge2, DiffMerge3, types, and colors helpers from the root entry
@lapis-notes/diffmerge/styles.cssBase styles
@lapis-notes/diffmerge/light.css / dark.cssTheme variants
@lapis-notes/diffmerge/colorsEditor color constants

Import the CSS entry that matches the host app’s theme in the same way other packages expose side-effect CSS (see Plugin CSS Contract).

Boundary Rules

  • Peer: svelte ^5.0.0.
  • Runtime deps: diff, esm-env, nanoid (aligned with other packages using diff 9.x).
  • Components are ordinary Svelte exports: hosts mount <DiffMerge2 … /> / <DiffMerge3 … /> like other local components; there is no custom-element bundle in this package.

Integration status

The package is buildable and tested in isolation. No active product surface currently depends on it; the History compare tab uses CodeMirror’s unified merge extension instead.

Package-local summary

For a short index maintained next to the code, see packages/diffmerge/spec.md.