# va-themes/protera

Viartas CMS — **Protera public web theme** (`Protera`), packaged as a Composer
path-package. This is the public storefront theme (tyres / wheels / batteries):
layouts, components, per-route JS/CSS and view overrides for the `web`
environment.

> **Wave 7 migration — in progress.** This package is being migrated out of the
> host `themes/Web/Protera/` directory in 4 atomic chunks:
>
> | Task | Chunk |
> |---|---|
> | **116a** | Skeleton + composer wire-up + `bootstrap/providers.php` cleanup (Protera registration → composer auto-discovery). Tema NEsiliečia. |
> | 116b | Asset move + images move + per-package Vite build + publish + blade `@vite`→`@assets` cut-over. |
> | 116c | Views move + DB `themes.path` cut-over + Paginator override preserved. |
> | 116d | Old `themes/Web/Protera/` cleanup + docs + ThemeSeeder + CmsBootSeeder. |
>
> After **116a** the public web works **identically** — `Resources/views`,
> `Resources/assets` and `public/` are still empty here; the live theme is still
> served from `themes/Web/Protera/`.

## Install path

Wired into the host via a Composer `path` repository (`symlink: true`):

```jsonc
// host composer.json
"repositories": [
    { "type": "path", "url": "packages/va-themes/protera", "options": { "symlink": true } }
],
"require": { "va-themes/protera": "^1.0" }
```

The provider (`ViartasThemes\Protera\Providers\ThemeServiceProvider`) is
auto-discovered via `extra.laravel.providers`. It extends
`ViartasCore\Core\Providers\BaseThemeServiceProvider` and only registers its
overrides when `Protera` is the active web theme.

### Paginator override + boot order contract

The provider keeps Protera's `Paginator::defaultView('theme::components.pagination')`
override (migrated from `themes/Web/Protera/Providers/ThemeServiceProvider.php`).
Composer auto-discovery providers register **after** `bootstrap/providers.php`
providers, so this provider's `boot()` runs **after**
`AppServiceProvider::boot()`'s `Paginator::useBootstrapFive()`. Since
`Paginator::$defaultView` is a static (last-set wins), the override is preserved
naturally — no explicit ordering needed.

## Structure

```
packages/va-themes/protera/
├── composer.json
├── package.json
├── vite.config.js
├── README.md
├── src/Providers/ThemeServiceProvider.php   ← extends BaseThemeServiceProvider + Paginator override
├── Resources/{views,lang/{lt,en},assets/{css,js,images}}/   ← empty until 116b/116c
└── public/                                  ← build output (116b)
```

**No `Database/Migrations/`.** The task-116c `themes.path` cut-over moved to
`va-core/themes` in `PackageStructure/task-22` — it writes the `themes` table, and that
table belongs to the package that creates it (`.claude/module-structure.md` §5). The file
name is unchanged, so the `migrations` ledger still sees it as ran; a `migrate:status`
after the update must show **no new Pending**.

## Requires

- `va-core/core` (HARD) — `BaseThemeServiceProvider`, `AssetRegistry`, `ThemeManager`
- `va-core/themes` (HARD) — theme management module (`Theme` model + runtime resolution)
