From e2b9ead8bddb927d6065636e750e6f5078a90d58 Mon Sep 17 00:00:00 2001 From: Imani Manyara Date: Thu, 5 Nov 2026 04:00:05 -0500 Subject: [PATCH] Remove moving a set between packs (package.replaces) It existed only so icon-sets-emoji's openmoji-* ids kept resolving after OpenMoji moved to icon-sets-openmoji. The owner removed the emoji copies, so nothing declares it. Removes PackAliases, the replaces and deprecated marker readers, canonicalId/isReplaced/packAliases, the deprecation log method, the seeder and watcher skips, and doctor's alias checks. --- CHANGELOG.md | 6 +- docs/architecture.md | 2 +- docs/kinds.md | 15 -- resources/lang/en/commands.php | 28 ++-- src/Facades/IchavaFacade.php | 1 - src/Ichava.php | 12 -- src/Jobs/SeedIconsJob.php | 12 -- src/Services/IchavaLogger.php | 17 --- src/Services/IconRegistry.php | 78 +--------- src/Services/IconWatcherService.php | 7 - src/Services/KindDoctor.php | 115 +-------------- src/Support/PackAliases.php | 106 -------------- src/Support/PackConfigData.php | 65 --------- tests/Feature/KindDoctorTest.php | 2 +- tests/Feature/PackAliasTest.php | 134 ------------------ tests/Feature/PackConfigShapeTest.php | 10 ++ tests/fixtures/AliasNewPack/config.json | 15 -- .../files/openmoji-color/1f600.svg | 1 - tests/fixtures/AliasOldPack/config.json | 22 --- .../files/openmoji-color/1f600.svg | 1 - .../AliasOldPack/files/smileys/grin.svg | 1 - tests/fixtures/AliasScan/app/IconUses.php | 8 -- tests/fixtures/AliasScanClean/app/.gitkeep | 0 23 files changed, 35 insertions(+), 623 deletions(-) delete mode 100644 src/Support/PackAliases.php delete mode 100644 tests/Feature/PackAliasTest.php delete mode 100644 tests/fixtures/AliasNewPack/config.json delete mode 100644 tests/fixtures/AliasNewPack/files/openmoji-color/1f600.svg delete mode 100644 tests/fixtures/AliasOldPack/config.json delete mode 100644 tests/fixtures/AliasOldPack/files/openmoji-color/1f600.svg delete mode 100644 tests/fixtures/AliasOldPack/files/smileys/grin.svg delete mode 100644 tests/fixtures/AliasScan/app/IconUses.php delete mode 100644 tests/fixtures/AliasScanClean/app/.gitkeep diff --git a/CHANGELOG.md b/CHANGELOG.md index b98443f1..5fdb52e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,11 @@ All notable changes to `ichava/core` follow [Keep a Changelog](https://keepachan - **`IchavaConstants::PACK_COMPOSER_TYPE`** (`ichava-icon-set`), the composer `type` a pack declares so discovery can find it. - **Kind resolution covers every D6 row** (K1, contract §1–2). Besides a category's `kind` and `package.kind`, a pack can now declare kind per item (`metadata.data.items..kind`) and by ordered glob rule (`metadata.data.kinds.rules[]`, first match wins), and a host can override any of it in `ichava.ichava-core.kinds.overrides` (`'::' => kind`, exact keys before globs). The order is host, item, rule, category, pack, then `icon`. New `Support\KindGlob` (`*`, `?`, whole-segment `**`; the contract's vector table is its test), `Support\KindResolver`, `Enums\KindSource` and the `final readonly` DTO `Data\KindResolution`; `PackConfigData::items()`/`kindRules()` read the new keys from the documented shape and the top level. `IconRegistry::kindOf()`, the renderer's size budget and `IconClassifier::kind()` all resolve through `KindResolver`; `IconRegistry::kindFor()` keeps its category/pack behaviour for its callers. A v0.1 `config.json` with no kind keys loads exactly as before. `tests/Unit/KindGlobTest.php`, `tests/Feature/KindResolutionTest.php`. - **Each row records which rule decided its kind.** Migration `2026_11_04_000001_add_kind_source_to_ichava_icons` adds `kind_source` (string(16), default `default`) and `kind_rule` (string(255), nullable), additive on all four drivers and reversible. The seeder and the watcher write both from `IconClassifier::resolution()`, and both join change detection, so a new override re-files unchanged files without `--force`. `Icon::kindSource()` and the `kind_source` cast. `transformIcon()` adds `kind_source`; `kind_rule` stays out of the API because it can carry host config. -- **`Ichava::kindOf()`, `Ichava::kindResolution()` and `Ichava::canonicalId()`** on the facade (K5). +- **`Ichava::kindOf()` and `Ichava::kindResolution()`** on the facade (K5). - **Per-kind counts per pack** (contract §5.2): `getStatistics()['by_package_kind']` (`[]` when nothing is seeded) and `by_kind` on each package in `getFilters()`, within the current filters. `getIcons()` takes several kinds (`'kind' => ['icon', 'illustration']`), OR-ed, duplicates collapsed. - **`artisan about` reports kinds** (K3/D4): `Icons by kind`, `Default kind` (the first reader of `IconKind::default()`, K2/D3), `Kind sources` and `Kind overrides`. -- **Doctor kind and alias checks** (contract §7): `kind.invalid_value`, `kind.invalid_glob`, `kind.override_invalid`, `kind.rule_unused`, `kind.item_missing`, `kind.drift` (with the seed command to run), `kind.non_default`, `alias.deprecated_ids` and `alias.replacement_missing`, all warnings. `--format=json` now prints every doctor check as `{id, status, count, detail}`. New `Services\KindDoctor`. `tests/Feature/KindDoctorTest.php`. +- **Doctor kind checks** (contract §7): `kind.invalid_value`, `kind.invalid_glob`, `kind.override_invalid`, `kind.rule_unused`, `kind.item_missing`, `kind.drift` (with the seed command to run), and `kind.non_default`, all warnings. `--format=json` now prints every doctor check as `{id, status, count, detail}`. New `Services\KindDoctor`. `tests/Feature/KindDoctorTest.php`. - **A kind heuristic that suggests and never applies** (D6 row 7, contract §3). `doctor --suggest-kinds[=default|all]` reads every SVG and suggests `illustration` for a default-row icon when three of `aspect`, `palette`, `bytes`, `elements` and `canvas` fire, one of them `bytes` or `elements`; a mostly suggested folder becomes one `/**` rule. Thresholds are `IchavaConstants::KIND_HEURISTIC_*`, shared with icon-sets-sync. Nothing writes a suggestion anywhere. -- **A set can move to another pack** (D9, contract §8). A pack declaring `package.replaces` takes over the listed item paths of another pack: with it installed, the old id resolves in the new pack wherever an id is parsed, each rewritten id is logged once per process as `[DEPRECATED]`, and the old pack's moved categories are not seeded. Without it nothing changes. New `Support\PackAliases` and `PackConfigData::replaces()`/`deprecatedCategories()`. `tests/Feature/PackAliasTest.php`. - **``, the vendor-scoped spelling of the icon component** (V-B11). Core registers the `ichava-core` Blade prefix over the same component classes, plus the `ichava-core::icon` alias, so `` and `` resolve the same class and render the same bytes. Additive: the bare `ichava` prefix and alias are unchanged. `IchavaServiceProvider::SCOPED_COMPONENT_PREFIX`. `tests/Feature/ComponentNamespaceDeferralTest.php` reads Blade's live namespace and alias maps, and fails on any new unscoped core alias. - **A `dark` twin on the icon component** (V-B10). `` renders both SVGs in a ``, with `ichava-theme-light`/`ichava-theme-dark` classes and a nonce-carrying `