diff --git a/docs/adr/0002-monorepo-conversion.md b/docs/adr/0002-monorepo-conversion.md new file mode 100644 index 0000000000..d1ada909e4 --- /dev/null +++ b/docs/adr/0002-monorepo-conversion.md @@ -0,0 +1,50 @@ +# 2. Restructure ComfyUI_frontend as a monorepo + +Date: 2025-08-25 + +## Status + +Proposed + + + +## Context + +[Most of the context is in here](https://github.com/Comfy-Org/ComfyUI_frontend/issues/4661) + +TL;DR: As we're merging more subprojects like litegraph, devtools, and soon a fork of PrimeVue, + a monorepo structure will help a lot with code sharing and organization. + +For more information on Monorepos, check out [monorepo.tools](https://monorepo.tools/) + +## Decision + +- Swap out NPM for PNPM +- Add a workspace for the PrimeVue fork +- Move the frontend code into its own app workspace +- Longer term: Extract and reorganize common infrastructure to take advantage of the new monorepo tooling + +### Tools proposed + +[PNPM](https://pnpm.io/) and [PNPM workspaces](https://pnpm.io/workspaces) + +For monorepo management, I'd probably go with [Nx](https://nx.dev/), but I could be conviced otherwise. +There's a [whole list here](https://monorepo.tools/#tools-review) if you're interested. + +## Consequences + +### Positive + +- Adding new projects with shared dependencies becomes really easy +- Makes the process of forking and customizing projects more structured, if not strictly easier +- It *could* speed up the build and development process (not guaranteed) +- It would let us cleanly organize and release packages like `comfyui-frontend-types` + +### Negative + +- Monorepos take some getting used to +- Reviews and code contribution management has to account for the different projects' situations and constraints + + \ No newline at end of file diff --git a/docs/adr/README.md b/docs/adr/README.md index 67ef529de1..3ebf340d5d 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -11,6 +11,7 @@ An Architecture Decision Record captures an important architectural decision mad | ADR | Title | Status | Date | |-----|-------|--------|------| | [0001](0001-merge-litegraph-into-frontend.md) | Merge LiteGraph.js into ComfyUI Frontend | Accepted | 2025-08-05 | +| [0002](0002-monorepo-conversion.md) | Restructure as a Monorepo | Proposed | 2025-08-25 | ## Creating a New ADR