Skip to content

bpm-core-react: heavy view dependencies are declared nowhere in package.json #8

Description

@fantasywind

Context

views/templates/designer, views/templates/compose and views/forms/builder are documented in docs/api-reference.md as having "heavy peerDeps": @xyflow/react, dagre, @codemirror/*, @hello-pangea/dnd, pdfjs-dist, react-pdf.

Current behaviour

Those packages are externalised by libs/bpm-core-react/vite.config.ts (correctly — they should not be bundled), but they appear in neither dependencies nor peerDependencies of libs/bpm-core-react/package.json. The published manifest only declares:

"dependencies":     { "@ai-sdk/openai", "@ai-sdk/react", "ai", "clsx", "moment" },
"peerDependencies": { "@mezzanine-ui/icons", "@mezzanine-ui/react", "@rytass/bpm-core-client", "@rytass/bpm-core-shared", "react", "react-dom" }

Why this matters

A host that mounts TemplateDesignerView has to discover the missing packages by trial and error, and once installed there is no version constraint linking them to the version of @rytass/bpm-core-react in use. Upgrading the library gives no signal that a peer needs bumping too, and package managers cannot warn about an incompatible pairing.

Suggested fix

Declare them as optional peer dependencies, so hosts that never mount the heavy views are not forced to install them:

"peerDependencies": {
  "@xyflow/react": "^12.0.0",
  "dagre": "^0.8.5",
  "@codemirror/lang-json": "^6.0.0",
  "@codemirror/view": "^6.0.0",
  "@uiw/react-codemirror": "^4.0.0",
  "@hello-pangea/dnd": "^18.0.0",
  "pdfjs-dist": "^5.0.0",
  "react-pdf": "^10.0.0"
},
"peerDependenciesMeta": {
  "@xyflow/react": { "optional": true }
}

(ranges above are illustrative — the versions the monorepo builds against are in the root package.json.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions