walmartlabs / generator-thorax

Thorax yeoman generator
MIT License
87 stars 27 forks source link

Helpers command not found? #77

Closed mulderp closed 10 years ago

mulderp commented 10 years ago

A small observation, the command from the README:

yo thorax:helper myhelper

results into

 [?] Would you like to generate the app in a new directory? (Y/n)

also, the help from the generator:

yo thorax -h
Usage:
  yeoman init  [options]

Options:
  -h,   --help  # Print generator's options and usage  Default: false

looks empty. Maybe the functions from the generator could be included there too?

eriktrom commented 10 years ago

nice catch @mulderp, I'll probably just add a generator for helpers since that seems to be a common need...

mulderp commented 10 years ago

it was working already with the previous merge. maybe something got removed by accident?

eriktrom commented 10 years ago

good to know, lots have things have been shuffled around recently so that's likely the case(and i wasn't aware, crap)

eriktrom commented 10 years ago

@mulderp I looked into this

I believe the intent was to merge all helpers into one file, thereby removing the need for a generator... I have no comment on whether this was a good or bad idea(seems fine). Regardless, thanks for spotting it, I will update the README

For reference, the helpers generator was removed in #30, specifically, the removed changes are here https://github.com/walmartlabs/generator-thorax/commit/863d0f403ab3e5920e1b93a3acf30a5681f8253e#commitcomment-4696274

@eastridge was this intentional? I think it was, but perhaps the original intent of #30 was to remove cognitive load when making a new app but perhaps(?) not remove ability to generate new helper files... Adding it back in would require helpers live in their own directory...(cause where would they go when generated).

@mulderp fell free to express your thoughts as well, we welcome the open discussion. Did you use the helper generator and did you find it's use beneficial? (cause if so, maybe we should re-consider the removal of it)

I am closing this for now, but feel free to re-open it if further discussion is of interest

mulderp commented 10 years ago

My original problem was that the helper did not work as expected, and there was no file yet.

Well, it's not critical, as long as there is a place where to put the helpers. A global "application" like helper would be fine for me, and could come out of the box.

eriktrom commented 10 years ago

@mulderp check out this file(pre-generated form) which now comes with new apps. Does this solve the problem? Also make sure to require it in the array of files within js/main.js (doesn't need to be injected into function though)

https://github.com/walmartlabs/generator-thorax/blob/master/app/templates/seed/js/helpers.js