Home / processes / DECISION-TREE

Repository Structure Decision Tree

๐Ÿค” Quick Decision Guide

Question 1: Should this be a separate repo?

Is it published to npm as a standalone package?
โ”‚
โ”œโ”€ YES โ†’ Ask Question 2
โ”‚
โ””โ”€ NO โ†’ Consolidate into monorepo

Question 2: Can users want it without other packages?

Can users reasonably want ONLY this package?
โ”‚
โ”œโ”€ YES โ†’ Keep as separate repo
โ”‚   Example: @larcjs/core (just the bus, no components)
โ”‚
โ””โ”€ NO โ†’ Consolidate into monorepo
    Example: @larcjs/core-types (always used WITH core)

๐Ÿ“‹ Applied to Your Repos

core - Keep Separate โœ…

  • โœ… Published to npm: @larcjs/core
  • โœ… Users want it standalone: "Just the messaging bus"
  • โœ… Independent value: 5KB, zero deps
  • Decision: Keep separate

components - Keep Separate โœ…

  • โœ… Published to npm: @larcjs/ui
  • โœ… Users want it standalone: "Components without learning bus internals"
  • โœ… Independent value: UI library
  • โœ… Optional dependency: Works with core, but separate choice
  • Decision: Keep separate

core-types - Consolidate ๐Ÿ”„

  • โœ… Published to npm: @larcjs/core-types
  • โŒ Users want it standalone: No, only with @larcjs/core
  • โŒ Independent value: Just types for core
  • Decision: Move to larc/packages/

components-types - Consolidate ๐Ÿ”„

  • โœ… Published to npm: @larcjs/ui-types
  • โŒ Users want it standalone: No, only with @larcjs/ui
  • โŒ Independent value: Just types for components
  • Decision: Move to larc/packages/

devtools - Consolidate ๐Ÿ”„

  • โš ๏ธ Published to Chrome Store: Maybe
  • โŒ Users want it standalone: Only for development
  • โŒ Independent value: Only useful with LARC
  • Decision: Move to larc/packages/

examples - Consolidate ๐Ÿ”„

  • โŒ Published to npm: No
  • โŒ Users want it standalone: No, examples of using core
  • โŒ Independent value: Educational assets
  • Decision: Move to larc/examples/

apps - Consolidate ๐Ÿ”„

  • โŒ Published to npm: No
  • โŒ Users want it standalone: No, demos of LARC
  • โŒ Independent value: Same as examples
  • Decision: Merge with examples โ†’ larc/examples/

site - Consolidate ๐Ÿ”„

  • โŒ Published to npm: No
  • โŒ Users want it standalone: No, docs for LARC
  • โŒ Independent value: Documentation asset
  • Decision: Move to larc/docs/

larc (meta repo) - Transform ๐Ÿ”„

  • โŒ Published to npm: No (workspace root)
  • โŒ Users want it standalone: No, development hub
  • โœ… Independent value: Becomes the monorepo
  • Decision: Transform into monorepo workspace

.github - Consolidate ๐Ÿ”„

  • โŒ Published to npm: No
  • โŒ Users want it standalone: No, org-level config
  • โŒ Independent value: GitHub metadata
  • Decision: Move to larc/.github/

๐ŸŽฏ Final Count

Before: 10 repositories After: 3 repositories
โœ… github.com/larcjs/core       (Standalone product)
โœ… github.com/larcjs/components (Standalone product)
โœ… github.com/larcjs/larc       (Development monorepo)

๐Ÿ’ญ Mental Model

Think of it like this:

Products (Separate Repos):
  • "Things users install"
  • Clear, focused purpose
  • Can be used alone
Development Assets (Monorepo):
  • "Things that support the products"
  • Types, docs, examples, tools
  • Only useful in context of products

๐Ÿ—๏ธ Architecture Analogy

Think of it like a building:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         LARC Ecosystem                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                         โ”‚
โ”‚  ๐Ÿข Core Product (Separate Building)   โ”‚
โ”‚     @larcjs/core                        โ”‚
โ”‚     - Standalone                        โ”‚
โ”‚     - Minimal                           โ”‚
โ”‚     - Foundation                        โ”‚
โ”‚                                         โ”‚
โ”‚  ๐Ÿข Components Product (Separate)      โ”‚
โ”‚     @larcjs/ui                  โ”‚
โ”‚     - Standalone                        โ”‚
โ”‚     - Optional add-on                   โ”‚
โ”‚     - Builds on core                    โ”‚
โ”‚                                         โ”‚
โ”‚  ๐Ÿ—๏ธ  Development Complex (One Campus)  โ”‚
โ”‚     larc/ (monorepo)                    โ”‚
โ”‚     โ”œโ”€โ”€ Types (blueprints)              โ”‚
โ”‚     โ”œโ”€โ”€ Docs (manuals)                  โ”‚
โ”‚     โ”œโ”€โ”€ Examples (showroom)             โ”‚
โ”‚     โ””โ”€โ”€ Tools (workshop)                โ”‚
โ”‚                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
You wouldn't build a separate building for:
  • The blueprint storage (types)
  • The instruction manuals (docs)
  • The showroom (examples)
  • The tool shed (devtools)
They all belong on the same campus!

โœ… Your Reasoning Applied

"I want to keep all the individual ui components separate from the core larc messaging bus code simply because I don't want to force my web components down peoples throats if all they're looking for is a well defined, page-level communications bus."
This is architecturally correct!
User A: "I just want the message bus"
โ†’ npm install @larcjs/core
โ†’ Gets: 5KB, pure messaging

User B: "I want the bus + components"
โ†’ npm install @larcjs/core @larcjs/ui
โ†’ Gets: Bus + UI library

User C: "I already have React, just want the bus"
โ†’ npm install @larcjs/core
โ†’ Uses bus with React components
Perfect separation of concerns!

๐Ÿšซ What NOT to Do

โŒ Bad: Monolith Package

@larcjs/everything
โ”œโ”€โ”€ core (forced on everyone)
โ””โ”€โ”€ components (forced on everyone)
Problem: Can't use bus without components

โŒ Bad: Too Granular

@larcjs/core
@larcjs/core-types
@larcjs/core-tests
@larcjs/core-examples
@larcjs/core-docs
... (20 repos)
Problem: Management nightmare

โœ… Good: Balanced

Repos:
  @larcjs/core (product)
  @larcjs/ui (product)
  larc (development assets)

User installs:
  npm install @larcjs/core (minimal)
  npm install @larcjs/ui (optional)
Result: Clean, simple, flexible

๐ŸŽฏ Bottom Line

Your instinct is right: Keep core and components separate. The fix: Consolidate everything else into one development monorepo. Result:
  • Users get clean choices
  • Developers get simple workflow
  • Maintainers get fewer headaches

๐Ÿš€ Next Step

Run this to see it in action:

./test-monorepo.sh

Or read the full plan:

cat RECOMMENDED-CONSOLIDATION.md


"Separate the products. Unify the process."