BaryoDev / BaryoDev/barakoCMS

Modules: seed, read and hook through barakoCMS interfaces, not Marten types

Open
#948 0 comments 0 reactions 0 assignees View on GitHub
core design
Dominant language
C#
Stars
6
Forks
7
Avg merge
4h 42m
Merged PRs (30d)
307

Description

The module contract names Marten types. `IBarakoModule.SeedAsync` takes an `IDocumentSession` (`barakoCMS/Modules/IBarakoModule.cs:146`), `IContentLifecycleHook` exposes `Session` (`barakoCMS/Core/Interfaces/IContentLifecycleHook.cs:31`), and `ModuleCapabilities`, `IModuleSchema`, `ModuleSchema` and `ModuleSchemaPreflight` use Marten directly. An outside module compiles against Marten, so a Marten major upgrade breaks it.

### Why it matters

D34 says what an outside author compiles against names barakoCMS types only. Inside core, slices keep using Marten directly.

### The general concept

barakoCMS interfaces for what modules need: `IContentWriter` (exists), a content reader, a seed context and a hook context. The Marten-typed members stay, marked `[Obsolete]` with removal in 5.0.0, and call the new ones.

### Where it lives

Core: `Modules/*` and `Core/Interfaces/*`. First-party modules move to the new members in 4.x.

### Compatibility

Package surface under section 6: additive in 4.3.0, removal in 5.0.0. The module contract version moves when the old members go.

### Done when

- A module can seed, read content and run a lifecycle hook with no `using Marten`.
- Every first-party module builds with the obsolete members treated as errors.
- The module template has no Marten reference.

Part of D34 (#947).

Contributor guide

Open the contributing guide

Research direction

Start with barakoCMS/Modules/IBarakoModule.cs:146 and barakoCMS/Core/Interfaces/IContentLifecycleHook.cs:31, then inspect the other Marten-typed contracts under Modules/* and Core/Interfaces/*. Trace the first-party modules and module template; done means modules can seed, read content, and run hooks without using Marten, obsolete members are treated as errors, and the template has no Marten reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.