cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Bond-Caron <jbo...@gdesolutions.com>
Subject RE: cordova templates?
Date Fri, 14 Mar 2014 14:39:24 GMT
On Fri Mar 14 10:02 AM, Braden Shepherdson wrote:
> To be clear, you're suggesting that we have templates in the form of
> plugins? I'm
> not sure that's what we really want. At least, if we
> install them like regular plugins
> then there are several values that
> need to be changed, including the directory
> name.

They would ~ fetchPluginAndDeps() the same way as plugins. But at install() time, we just
run install scripts + install() their plugin dependencies.

Ideally the install script could setup config.xml preferences & do some magic.

- Option (a) is we know it's a template because it's in the template.* namespace.
- Option (b) is to call it template.xml instead of plugin.xml

This requires using a plugman.fetchPluginAndDeps() that downloads only into a temp directory.

Right now plugman.fetch() is fetchAndCopyToPluginDir()

> 
> Perhaps cordova template add org.apache.cordova.template.hello-world
> my.new.plugin.id and it does the appropriate renaming at install time?
> 

It's really a one-time operation kind of thing, a way to install plugin dependencies + preferences
in 1 swoop.

The plugin install() logic would need to be tweaked to know it's a template.

> No comment on template.* namespace vs. foo.bar.template.baz or whatever.
> If
> we're going to allow templates as pseudo-plugins, why not allow
> anyone to
> publish a template? Users may have good ideas for templates
> that would be
> useful to themselves, and maybe to others as well.
> 

Yep seems like a win to me.


Mime
View raw message