FSHSP-107 refactor(ui-kit)!: reorganize projects/ui-kit/ by component category - #31
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 destorybook/docs/Overview.mdx, déjà la taxonomie publique en ligne.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 unpackage.jsonavec unnameexplicite 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-kitdoit 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 en0.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é dansforms/, 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.mjssupposait 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 unng-package.json, etcomponentsInOverview()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.