-
Notifications
You must be signed in to change notification settings - Fork 69
A plugin system #67
Comments
This is a good idea generally. I really like to have a solid working plugin system for INIT. I am not sure if using bower for plugins would be the right thing. It would be great if he'd had these plugins as options during install of INIT so you can install INIT already with the given (as parameters in CLI) plugins… Config is a problem which affects our current structure. I think we need to think how we can modify the whole setup and config structure to be easily extendable. |
I think the best solution for this problem are Yeoman sub-generators. The sub-generator can easily take arguments, process a file with variables and copy it to somwhere and then execute npm install grunt-something on the shell. |
So this is how the sub-generator call could look like:
|
I think that plugins can be installed through a prompt menu of only one sub-generator, I don't know, is just a idea. For example:
|
Yes that's a good idea for the project initialization. But we also need sub-generators for after the project has been initialized. And for sub-generator configuration I would like to see if sub-generators can use prompts as well. I guess it should work. |
Thanks for your input, @sergiovilar @kahlil. This is very useful. I think it is the right way to go with yeoman sub-generators somehow. |
Just a FYI I just saw this: http://codeactual.github.io/06/02/2013/introducing-grunt-horde.html might be an optional approach... |
@kahlil you are right, for the project initialization sounds good. But in this case we'll write a sub-generator for each plugin or only one sub-generator with options? |
That's a good question @sergiovilar. Needs to be thought through and discussed. I am leaning towards one sub-generator per plugin. |
Today init have few plugins but I'm looking for a possible future, one sub-generator per plugin will cause mess if a lot of plugins is developed |
That's true. So maybe we just make a generator per plugin. and namespace them |
I don't know if this is the best solution but I have no idea to do this. @anselmh @drublic what you say? Maybe we can create only one sub-generator in the main generator repository and separated them all into independent modules. In this case, only the main file of the sub-generator:plugin, por example, will include the plugin modules. |
So here is a concept for our plugin-system. In general we prefer a Yeoman sub-generator which is a part of the INIT generator. Most INIT plugins won't require a lot of configuration but if they do they might come with some initial config which might be changed manually. The tasks for this generator might be something like this.:
The generator might be called by setting the plugin name as one argument like this:
For the time being the plugin-registry might be the GitHub organization but we might change this later on. Plugins might utilize INIT's default configuration and extend this configuration within the project with the required config from the plugin's Any additional info or stuff that I forgot to talk about? Please let us know! |
Hey @drublic I am not sure if I completely understand. Do you want the sub-generator to pull plugins from Github or do you want the sub-generator to scaffold out boilerplate for new plugins? |
I want the sub-generator to pull plugins from GitHub. Scaffolding new On Tue, Jan 21, 2014 at 8:55 AM, Kahlil Lechelt [email protected]:
|
Hmm that is not really what the generator does. We could make a small command line tool that just clones the plugin repo and copies the files to their respective places and work with conventions. If there is no repo or the expected files are not in the repo => err. |
I just remembered: we can use Bowers programmatic API to install the plugins... I have to think about this. |
@distilledhype is possible to call bower through a Yeoman sub-generator? I think if this is be possible, we can do this in this way. |
Plugin configurations can now be placed in |
@distilledhype wrote:
This is exactly what we should do.
Currently we don't want to utilize Bower for these plugins. I think a decent way would be to clone the plugin to install in a directory, move all the things around and delete the rest of the repo. This would mean that we only need a convention for
Most of this is given: 1. Repos for files can be matched as "use-init/init-" at GitHub. We could later extend this to make it customizable and stuff. 2. I've outlined this above: We need to copy the {taskname}.js file into the folder 3. We need a temporary folder to place the repos in. I'd suggest to name it I will now close this issue in favor of an issue in the generator-init repo (use-init/generator-init#20). We should focus work and discussion over there. Thanks everyone of your input. |
I think we need a better plugin system for INIT. Currently we state:
We could utilize Bower to install plugins which does not resolve the problem that a user needs to install the npm repo. But we could easily detect plugins within all components beginning with
init-
and use the JS file inconfig
ortask
to require in the Gruntfile.Another problematic point is configuration for these plugins. What if you need another directory within your repository? This means there needs be an extendable configuration structure.
More problems: Some tasks should be extendable by plugins. As for example watch in the case of Livereload.
Any more suggestions?
The text was updated successfully, but these errors were encountered: