ADR-0002 — Depend on upstream packages; do not re-vendor by copy

Context

massing vendors four packages into apps/web/src/vendor/@massingifc/core-kernel, @massingifc/plugin-sdk, @massingifc/project-schema, and @massingcloud/pdf-viewer — 18,192 lines total. It does this for exactly one reason: every package in MassingCloud/massingifc and MassingCloud/massing-pdf is "private": true and unpublished. Not for licensing (both are MIT), and not by preference. The vendoring is a workaround.

MassingViewer could do the same thing, and it is the path of least resistance.

Decision

Publish upstream, then depend. Do not copy.

Four reasons:

  1. A published library cannot ship a copy of another repo's source. These packages go to npm. Either the files field balloons with vendored source, or the path aliases break for consumers — and path aliases do not survive publication at all.
  2. The alias trick only works inside one repo. massing's apps/web/vendorAlias.ts works because Vite, Vitest and tsconfig paths are all under one roof, held in agreement by a dedicated test. A consumer of @massing/core inherits none of that.
  3. The vendored copies are already a known liability. apps/web/vendorAlias.ts says so in its own doc comment: three copies of one fact is the drift shape that codebase keeps paying for. Adding a fourth copy in a new repo repeats a mistake whose cost is already documented.
  4. There is no licensing reason. Both upstreams are MIT and public. The only obstacle is a private flag.

Consequences