trails
trails copied to clipboard
Camel Case trailpack names
Issue Description
Currently all trailpack are named trailpack-NAME witch then become NAME into trails instance.
But if we name the trailpack something like trailpack-NAME-COMPOSITE then the name become NAME-COMPOSITE witch become more verbose to call.
I think we should transform trailpack names into camel case before loading them. Like this composite name will become nameComposite.
I currently have the "problem" with my lisa-plugins-manager trailpacks witch I have to call this.app.packs['lisa-plugins-manager'] where this.app.packs.lisaPluginsManager will be more appreciate ^^
I fix this by override the get name() method of the trailpack but I think this should be done natively
Thoughts ?
I also ran into this issue with trailpack-js-data. So I would agree, but I would say to make it a setting like format: [ki-ba-ab, camelCase, etc]?
Set a config for this is too much I think, and it will be harder for trailpacks to depend on each other. A trailpack that would call a method from another will have to first look this settings to know how retrieve it... Or trails have to provide a getTrailpack(npmName) that do this job... Don't think it will worth the work ^^
so getTrailpack should probably be able to handle any case then or something.
Is this worth the v3 milestone? @trailsjs/maintainers
As it's a breaking change of the api I'll say it's better to do it with the v3 as it as some breaking change already like i18n, map as config...
Let’s add it to the v3 milestone then and make it a priority :-)