lfe-rebar3 / templates

A collection of LFE flavoured templates for rebar3.
1 stars 0 forks source link

Decide on a final home for these templates #3

Open yurrriq opened 8 years ago

yurrriq commented 8 years ago

Having the templates in a separate repository like this enables users to install them manually in their ~/.config/rebar3/templates/. We could provide a make target for convenience. According to the rebar3 docs, we could put the templates in the priv directory of a plugin, e.g. lfe-compile and they would be visible to users of the plugin.

There are pros and cons to both approaches. Let's discuss.

oubiwann commented 8 years ago

What about just making this a plugin? That's where I thought you were going with this repo :-)

E.g.:

$ rebar3 lfe new lib my-lib

ltool will add the repo to its deps, so users of ltool will be able to run rebar3 lfe commands like the above ...

ltool will eventually have a cli alias so that all rebar3 lfe ... commands will just be ltool ... commands, e.g.:

$ ltool new lib my-lib
yurrriq commented 8 years ago

Yeah, that could be cool. I wonder what the minimum plugin looks like. Do we need to provide a provider or can we just refer to this repo as a plugin and have its templates become available to users?

yurrriq commented 8 years ago

If we must provide a provider maybe we can just have a rebar3 lfe install-templates command instead of the make target described above.

oubiwann commented 8 years ago

1) One of the most minimal lfe rebar3 plugins:

2) I'd prefer we kept to the same namespace as the other LFE plugins -- that will make life easier for ltool (the ulimate replacement for lfetool) ... ltool will be replacing all ltool commands with rebar3 lfe commands ... it would be a shame to have a series of cases, each with a different potential set of commands that ltool will have to parse and replace ...

3) What make target are you referring to?

yurrriq commented 8 years ago

1) I'll have to check it out. 2) Agreed. I edited my comment shortly after posting. 3) Just the hypothetical make install-templates that would copy them to ~/.config/rebar3/templates.

oubiwann commented 8 years ago

Ah, I see (#3).

So it looks like we're talking about two different and equally valid use cases (among potentially more):

  1. Updating a user's set of templates (without requiring a user to install a tool)
  2. Using the templates as part of a CLI (without requiring a user to install them ahead of time)
oubiwann commented 8 years ago

Also, you might want to checkout the work that @arpunk did here: