symfony / stimulus-bridge

Stimulus integration bridge for Symfony projects
https://symfony.com/ux
75 stars 15 forks source link

Making it possible to add a "default" import for shorter controller name #69

Closed weaverryan closed 2 years ago

weaverryan commented 2 years ago

Right now, the UX controller names have the form symfony/ux-typed/typed (well, technically symfony--ux-typed--typed, but stimulus_controller() normalizes for you).

Anyways, most UX components only ship with 1 controller... and symfony/ux-typed/typed seems unnecessarily long. This PR allows for a package to define a controller called default in its package.json - e.g. right here: https://github.com/symfony/ux/blob/09c9effcc2582d4de0907c9e12c35afa313433ae/src/Typed/Resources/assets/package.json#L8

When this happens, the final package name would be just the package name: symfony/ux-typed

Cheers!