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
- "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)
โ 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."