jondot / hygen-add

hygen-add is one of the tools in the Hygen toolbelt which allows you to add pre-made generator packages to your project.
MIT License
14 stars 4 forks source link

ideas for improving ux #5

Open anithri opened 5 years ago

anithri commented 5 years ago

I just tried to setup a repo to use with hygen-add. It was not a good experience.

I have 2 constraints that take me away from the happy path of hygen-add cra,

  1. I don't want to publish as npm package.
  2. The git source is private and via ssh.

In the end the only ways I could get it to work were to put it on github or to use the bit eco system.

The command line is clunky only because the core problem is hard. Where is the source directory I'm supposed to get the templates from? And it's clunky because it's trying to do yarn's job. And because it expects the source to be an npm package.

I'm not going to address backward compatibly. It's gotta be a tiny factor, but it's still you might feel strongly about it.

File system $ hygen-add ~/.local/templates

Installed npm packages # searches node_modules and ~/.npm-global/lib/node_modules for package name $ hygen-add cra

There are also arguments to be made for a url to download some git or gist or tar or some type. But just putting that on the user to do and the reading it as a path is so much easier. Ditto with a git url.

use curl or git to grab repos or gists. Use your favorite package manager to install hygen-woot package like you would any other package.

Then just let hygen-add search the places and copy the templates. that and the renaming are the sweet spot of this util.