Metadata-Version: 2.1
Name: wexample-wex-addon-dev-css
Version: 6.0.74
Summary: Plugs a named CSS addon manager into the wex CLI kernel, serving as the registration entry point for CSS development tooling within the wex addon ecosystem
Author-Email: weeger <contact@wexample.com>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Requires-Dist: attrs>=23.1.0
Requires-Dist: cattrs>=23.1.0
Requires-Dist: wexample-wex-addon-app>=30.0.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Description-Content-Type: text/markdown

# wex_addon_dev_css

Version: 6.0.74

`wex_addon_dev_css` registers a `CssAddonManager` — a named subclass of `AbstractAddonManager` — into the wex CLI kernel, making it the entry point for CSS development tooling within the wex addon ecosystem. It carries no commands of its own; its role is to give the kernel a named CSS addon slot that other packages and addons can target. It is intended for developers working inside the wex ecosystem who need CSS tooling exposed through the CLI.

## Table of Contents

- [Installation](#installation)
- [Quickstart](#quickstart)
- [Tests](#tests)
- [Architecture](#architecture)
- [Integration in the Suite](#integration-in-the-suite)
- [Dependencies](#dependencies)
- [Versioning & Compatibility Policy](#versioning--compatibility-policy)
- [License](#license)
- [About us](#about-us)
- [Known Limitations & Roadmap](#known-limitations--roadmap)
- [Status & Compatibility](#status--compatibility)
- [Useful Links](#useful-links)
- [Migration Notes](#migration-notes)

## Installation

```bash
pip install wexample-wex-addon-dev-css
```

Requires Python >=3.10.

## Quickstart

Install the package:

```bash
pip install wexample-wex-addon-dev-css
```

The public entry point is `CssAddonManager`, defined in src/wexample_wex_addon_dev_css/css_addon_manager.py:

```python
from wexample_wex_addon_dev_css.css_addon_manager import CssAddonManager
```

Pass it to the kernel's `setup()` call to register the CSS addon slot:

```python
from wexample_wex_core.common.kernel import Kernel

kernel = Kernel()
kernel.setup(addons=[CssAddonManager])
```

After `setup()` returns, the kernel holds a `css` addon entry (the name is derived from the class by stripping the `AddonManager` suffix). Other packages that target the CSS slot can then resolve it via `kernel.get_addons()["css"]`. The manager itself carries no commands; its presence in the addon list is the registration.

## Tests

This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.

### Installation

First, install the required testing dependencies:
```bash
.venv/bin/python -m pip install pytest pytest-cov
```

### Basic Usage

Run all tests with coverage:
```bash
.venv/bin/python -m pytest --cov --cov-report=html
```

### Common Commands
```bash
# Run tests with coverage for a specific module
.venv/bin/python -m pytest --cov=your_module

# Show which lines are not covered
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing

# Generate an HTML coverage report
.venv/bin/python -m pytest --cov=your_module --cov-report=html

# Combine terminal and HTML reports
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html

# Run specific test file with coverage
.venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
```

### Viewing HTML Reports

After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.

### Coverage Threshold

To enforce a minimum coverage percentage:
```bash
.venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
```

This will cause the test suite to fail if coverage drops below 80%.

## Architecture

The package contains one Python module under `src/wexample_wex_addon_dev_css/`. Its entire public surface is `CssAddonManager`, defined in src/wexample_wex_addon_dev_css/css_addon_manager.py.

### Parts

**`CssAddonManager`** subclasses `AbstractAddonManager` from `wexample_wex_core` and adds nothing — its body is `pass`. All behaviour comes from the base class.

**`AbstractAddonManager`** (in `wexample-wex-core`) carries the registration logic. It inherits from:

- `AbstractKernelChild` — gives the instance a reference to the kernel that owns it.
- `HasSnakeShortClassNameClassMixin` — derives the addon slot name by stripping the `AddonManager` suffix from the class name and snake-casing the result. `CssAddonManager` → `Css` → `css`.
- `WithWorkdirMixin` — sets the addon's workdir to the directory of the class file during `__attrs_post_init__`.
- `HasTwoStepInit` — enforces the two-phase `attrs` initialisation pattern the kernel uses for all its children.

The base class exposes hook methods (`get_command_resolver_classes`, `get_middlewares_classes`, `get_step_guard_classes`, `get_workdir_types`, etc.) that a richer addon would override. `CssAddonManager` inherits all of them and returns their defaults (empty lists/dicts).

### Registration path

1. A caller constructs a kernel and passes `CssAddonManager` in the `addons` list to `kernel.setup()`.
2. The kernel instantiates the class, triggering `__attrs_post_init__`, which calls `_init_workdir` with the directory containing src/wexample_wex_addon_dev_css/css_addon_manager.py as the entrypoint path.
3. The kernel indexes the instance under the key `css` (the result of `CssAddonManager.get_name()`).
4. Any downstream package that needs the CSS slot calls `kernel.get_addons()["css"]` to retrieve the manager.

The package itself issues no CLI commands and registers no resolvers. Its only job is to occupy the `css` slot so that other packages in the ecosystem have a stable, named target to extend or query.

### Package layout

```
src/
└── wexample_wex_addon_dev_css/
    ├── __init__.py          # empty
    ├── py.typed             # PEP 561 marker
    └── css_addon_manager.py # CssAddonManager
```

The build backend is `pdm-backend`. `pyproject.toml` declares one runtime dependency group: `wexample-wex-addon-app`, which pulls in the wex-core base classes; plus `attrs` and `cattrs` for the attrs-based init pattern.

## Integration in the Suite

This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.

### Related Packages

The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.

Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.

## Dependencies

- attrs: >=23.1.0
- cattrs: >=23.1.0
- wexample-wex-addon-app: >=30.0.0

## Versioning & Compatibility Policy

Wexample packages follow **Semantic Versioning** (SemVer):

- **MAJOR**: Breaking changes
- **MINOR**: New features, backward compatible
- **PATCH**: Bug fixes, backward compatible

We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Free to use in both personal and commercial projects.

## About us

[Wexample](https://wexample.com) stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.

This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.

Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.

## Known Limitations & Roadmap

Current limitations and planned features are tracked in the GitHub issues.

See the [project roadmap](https://github.com/wexample/python-wex_addon_dev_css/issues) for upcoming features and improvements.

## Status & Compatibility

**Maturity**: Production-ready

**Python Support**: >=3.10

**OS Support**: Linux, macOS, Windows

**Status**: Actively maintained

## Useful Links

- **Homepage**: https://github.com/wexample/python-wex-addon-dev-css
- **Documentation**: [docs.wexample.com](https://docs.wexample.com)
- **Issue Tracker**: https://github.com/wexample/python-wex-addon-dev-css/issues
- **Discussions**: https://github.com/wexample/python-wex-addon-dev-css/discussions
- **PyPI**: [pypi.org/project/wexample-wex-addon-dev-css](https://pypi.org/project/wexample-wex-addon-dev-css/)

## Migration Notes

When upgrading between major versions, refer to the migration guides in the documentation.

Breaking changes are clearly documented with upgrade paths and examples.
