Skip to content

FSHSP-107 refactor(ui-kit)!: reorganize projects/ui-kit/ by component category - #31

Merged
LBU4SH merged 1 commit into
mainfrom
breaking/fshsp-107-reorganize-ui-kit-by-category
Aug 13, 2026
Merged

FSHSP-107 refactor(ui-kit)!: reorganize projects/ui-kit/ by component category#31
LBU4SH merged 1 commit into
mainfrom
breaking/fshsp-107-reorganize-ui-kit-by-category

Conversation

@LBU4SH

@LBU4SH LBU4SH commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Restaure le regroupement par catégorie (actions/, forms/, informative/, layout/, navigation/, table/, base/) perdu lors de la migration vers le package npm (FSHSP-83). Mapping repris de storybook/docs/Overview.mdx, déjà la taxonomie publique en ligne.

⚠️ BREAKING CHANGE — découvert en cours de route, validé avec l'utilisateur

Le ticket supposait "pas de changement d'API, déplacement filesystem pur". C'est techniquement impossible avec ng-packagr : le chemin public d'un entry point secondaire est calculé à partir de son chemin disque relatif à l'entry point primaire, sans aucune option pour le découpler (vérifié dans son code source — secondaryModuleId = primary.moduleId + '/' + relativeSourcePath, et un package.json avec un name explicite dans le dossier du composant est ignoré pour un entry point secondaire).

Conséquence : chaque import change, ex. @4sh/ui-kit/ui-button@4sh/ui-kit/actions/ui-button, pour les 53 composants. 223 imports croisés mis à jour dans le repo en conséquence.

Un projet consommant @4sh/ui-kit doit mettre à jour tous ses imports de composants. Documenté au CHANGELOG. Reste MINOR au sens de notre politique 0.x (FSHSP-89 : une MINOR peut porter des ruptures tant qu'on est en 0.x), mais correspond à la case MAJOR de la grille de bump — à traiter comme tel dès le passage en 1.0.

Autres décisions prises en cours de route

  • ui-field (coquille interne sans story, absente d'Overview.mdx) → rangé dans forms/, seul consommateur de sa logique.
  • forms/ reste à la fois un entry point transverse (base-control-value-accessor.ts, mask-engine.ts...) ET le dossier de catégorie pour les 20 composants Forms — renommer l'un des deux aurait été une seconde rupture non liée à ce ticket.

Bug annexe corrigé

scripts/components.check.mjs supposait une structure à plat (projects/ui-kit/ui-*/) pour découvrir les entry points — après ce déplacement, il n'en aurait plus trouvé aucun. entryPointsOnDisk() descend maintenant récursivement jusqu'à trouver un ng-package.json, et componentsInOverview() lit le nom du composant sur le fichier de story importé plutôt que sur le chemin du dossier (insensible à la profondeur).

Vérifié

Lint, 80 tests unitaires, build du kit (les 53 entry points redécouverts sous leur nouveau chemin), build-storybook, docs:config:check — tout vert.

… category

Restores the actions/forms/informative/layout/navigation/table/base grouping
lost when the kit moved to the npm package (FSHSP-83) — mapping taken from
storybook/docs/Overview.mdx, already the live public taxonomy.

BREAKING CHANGE: ng-packagr derives a secondary entry point's public sub-path
from its filesystem location relative to the primary entry point, with no way
to override it (verified against its source — a per-entry package.json 'name'
field is only honored for the primary entry point). Physically relocating each
ui-* folder therefore renames its npm import path, e.g.
@4sh/ui-kit/ui-button -> @4sh/ui-kit/actions/ui-button, for all 53 components.
223 cross-entry-point imports updated across the repo accordingly.

ui-field (no story, so absent from Overview.mdx's categories) goes under
forms/ — the only consumer of its shell is other Forms components. forms/
itself stays put as BOTH a cross-cutting entry point (base-control-value-
accessor.ts, mask-engine.ts...) and the forms/ category folder: renaming it to
avoid the overlap would have been a second, unrelated breaking change.

Every relative path one level deeper now: ng-package.json's $schema and
styleIncludePaths, and each .mdx's ConfigTable import.

scripts/components.check.mjs no longer assumes a flat projects/ui-kit/ui-*/
layout — entryPointsOnDisk() recurses to find ng-package.json at any depth,
and componentsInOverview() reads the component name from the story import's
basename instead of the immediately-following path segment.

Full verification: lint, 80 unit tests, ui-kit build (all 53 entry points
rediscovered under their new paths), build-storybook, docs:config:check —
all green.
@LBU4SH
LBU4SH merged commit 948949f into main Aug 13, 2026
2 of 3 checks passed
@LBU4SH
LBU4SH deleted the breaking/fshsp-107-reorganize-ui-kit-by-category branch August 13, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant