Metadata-Version: 2.3
Name: mcms-core
Version: 0.1.0
Summary: Provides shared infrastructure and foundational abstractions used across the Modular CMS packages
Author: MikemathuKE
Author-email: MikemathuKE <michaelmathu6@gmail.com>
Requires-Dist: django>=6.0
Requires-Python: >=3.13
Description-Content-Type: text/markdown

# MCMS Core

`mcms_core` provides shared infrastructure and foundational abstractions used across the Modular CMS packages. It is intended to contain cross-cutting primitives rather than features belonging to a specific CMS domain.

## Responsibilities

The ADRs establish the following shared concerns:

- Common exception hierarchy.
- Shared registry abstraction and its registration contract.
- Foundational infrastructure used by higher-level packages.

Package-specific behaviour should remain in the package that owns that domain.

## Registry contract

MCMS registries follow the shared registration convention:

```python
registry.register(name, item)
```

A registry associates a name with an item. Package-specific registries may extend the common registry, but should not introduce incompatible registration conventions or assume singleton behaviour unless a separate decision explicitly establishes it.

## Exception hierarchy

The exception ADR defines `MCMSError` as the common MCMS exception base and identifies these categories:

| Exception | Purpose |
|---|---|
| `MCMSError` | Base exception for MCMS errors |
| `ConfigurationError` | Invalid or unusable configuration |
| `RegistryError` | Registry-related failures |
| `ValidationError` | Invalid domain or input data |
| `SerializationError` | Serialization and deserialization failures |
| `DependencyError` | Missing or invalid dependencies |

Use the package's actual exported names and constructor signatures as defined by the implementation.

## Architectural integrations

`mcms_core` is a foundational package. Other MCMS packages may depend on it for shared abstractions such as registries and exceptions. It should not depend on higher-level packages such as the editor, pages, templates, or rendering implementation.

```text
Higher-level MCMS packages
       |
       v
   mcms_core
```

## Application configuration

The ADRs do not define a global application setting or path for `mcms_core`. It should not require the host `apps/` directory merely to use its foundational Python abstractions. Add application-specific references only if the implementation introduces a documented integration.

## Dependencies

### Architectural integrations

This package is intended to be a low-level dependency for other MCMS packages. Avoid introducing dependencies on domain-specific packages.

### Python distribution dependencies

All MCMS Packages rely on django

## Development

```bash
uv run pytest packages/mcms-core/tests
```

Run Ruff and mypy using the repository's configured commands.
