New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recursive template listing and execution #24

Closed
jfols opened this Issue Feb 28, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@jfols

jfols commented Feb 28, 2018

This is just a nice to have ;)

It'd be great to have hygen at the top level of a project recursively search and list all actions spread throughout the project, current behavior only searches the current directory's _templates directory.

Here's a hasty hack I used in npm scripts:

"templates": "find . -path ./node_modules -prune -o -type d | grep '_templates/[A-z_\\-]*/[A-z_\\-]*'",

Then npm run templates yields:

> find . -path ./node_modules -prune -o -type d | grep '_templates/[A-z_\-]*/[A-z_\-]*'

./_templates/component/new-connected
./_templates/component/new
./_templates/generator/with-prompt
./_templates/generator/new
./_templates/generator/help
./_templates/icon/new
./imports/both/collections/_templates/new/collection
./imports/server/fixtures/_templates/new/fixture
./imports/server/cron/_templates/new/cron
./imports/client/atoms/_templates/new/atom
./imports/client/layouts/_templates/new/layout
./imports/client/redux/_templates/new/reducer
./imports/client/redux/_templates/new/action
./imports/client/routes/_templates/new/route
./imports/client/organisms/_templates/new/organism

The ability to execute hygen new atom from the top level of the project would be awesome.

@jondot

This comment has been minimized.

Owner

jondot commented Mar 5, 2018

That's awsome!
There's at least one person I know of who's working on such a thing to contribute. Let's see what he comes up with and align to your idea 👍

@jondot jondot referenced this issue Mar 5, 2018

Closed

Roadmap #31

3 of 3 tasks complete
@jondot

This comment has been minimized.

Owner

jondot commented Mar 5, 2018

Moved this to Roadmap, thanks!

@jondot jondot closed this Mar 5, 2018

@jfols

This comment has been minimized.

jfols commented Mar 6, 2018

I've come up with a pretty simple solution to this--just write npm scripts. It would be cool if hygen worked like this out of the box.

    "new.action": "cd imports/client/redux; hygen new action",
    "new.reducer": "cd imports/client/redux; hygen new reducer",
    "new.atom": "cd imports/client/____atoms; hygen new atom",
    "new.molecule": "cd imports/client/___molecules; hygen new molecule",
    "new.organism": "cd imports/client/__organisms; hygen new organism",
    "new.layout": "cd imports/client/_layouts; hygen new",
@jondot

This comment has been minimized.

Owner

jondot commented Mar 8, 2018

That's brilliant! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment