Architecture

Publishing packages

This repo is pnpm-only. Install, scripts, check, and publish all go through pnpm (pnpm install, pnpm run …, pnpm run release). Do not use the npm CLI in this tree.

pnpm run release does not bump versions. It publishes whatever is already in package.json. Bump + commit + git tag first, then release.

Phase A: low-level packages are published alongside the product tarball. The monolith still bundles kernel/sdk/view/mermaid/hunspell — consumers of on-codemerge do not need the scoped packages for normal editor use.

One command

From the repo root (pnpm login for @codemerge + on-codemerge):

pnpm run release

Runs prepublishOnly then publishes with pnpm in order. prepublishOnly is the release gate:

  • package builds, pnpm run check (format, lint, typecheck, locales, collab tests);
  • product builds plus dist hygiene (check:public-bundle, check:dist-package, check:surfaces);
  • publint --strict for every package;
  • check:pack — packs every package as pnpm publish would and checks the tarball: all exports / main / types targets present, no workspace: / catalog: left, no test files, types resolve for ESM and CJS consumers under node16 and bundler (attw), and a consumer project importing every typed entrypoint of the unpacked tarballs passes tsc with skipLibCheck: false.

After npm shows the new versions, verify them in demo/ (published packages only): bump the versions in demo/package.json, then pnpm install, pnpm typecheck, pnpm build, pnpm test:e2e.

Publish order:

  1. @codemerge/kernel
  2. @codemerge/view
  3. @codemerge/mermaid
  4. @codemerge/sdk
  5. @codemerge/hunspell
  6. @codemerge/collaboration-server
  7. @codemerge/integrate
  8. on-codemerge

Workspace deps

  • Internal packages: workspace:^ (not workspace:*)
  • Shared third-party versions: pnpm catalog: in pnpm-workspace.yaml
  • Package builds: each publishable package has its own vite.config.ts and "build": "vite build"; collaboration-server also runs vite.cli.config.ts for the bin

Consumer guidance

NeedInstall
Editor appon-codemerge only
Headless doc/ops@codemerge/kernel
ViewSpec DOM only@codemerge/view
Mermaid-subset SVG only@codemerge/mermaid
Plugin authoring without monolith@codemerge/sdk (+ kernel/view)
Spell without editor@codemerge/hunspell
Demo / self-hosted collab WS@codemerge/collaboration-server
Host adapters / <ocm-editor>@codemerge/integrate (+ peer on-codemerge)

Warning: do not install on-codemerge and @codemerge/sdk into the same application bundle (duplicate SDK/kernel instances).

See also Mermaid and View runtime.