trails icon indicating copy to clipboard operation
trails copied to clipboard

Camel Case trailpack names

Open jaumard opened this issue 9 years ago • 6 comments

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 ?

jaumard avatar Aug 21 '16 11:08 jaumard

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]?

scott-wyatt avatar Aug 21 '16 19:08 scott-wyatt

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 ^^

jaumard avatar Aug 21 '16 19:08 jaumard

so getTrailpack should probably be able to handle any case then or something.

scott-wyatt avatar Aug 21 '16 22:08 scott-wyatt

Is this worth the v3 milestone? @trailsjs/maintainers

scott-wyatt avatar Oct 17 '17 06:10 scott-wyatt

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...

jaumard avatar Oct 17 '17 06:10 jaumard

Let’s add it to the v3 milestone then and make it a priority :-)

scott-wyatt avatar Oct 17 '17 06:10 scott-wyatt