apache / cordova-discuss

Discussions on features and the future
19 stars 28 forks source link

Proposal: Create Cordova projects from templates #5

Closed axemclion closed 8 years ago

axemclion commented 9 years ago

When creating a new cordova project, we can today do a cordova create --copy-from to create the project based on another project. However, --copy-from only copies from folders, not from HTTP/Git URLs. The proposal is to allow --copy-from to use git and http URLs.

The advantage would be that folks from the community could create starter Cordova projects (using frameworks like Ionic, Angular, OnseenUI) or specify default plugins that come pre-installed, etc. This would be a quick way to start a new Cordova project, based on templates created by the community and hosted on git or on the web.

stevengill commented 9 years ago

template support would be great in cordova-cli. I'd also suggest adding them from npm.

axemclion commented 9 years ago

+1 to npm. Should be similar to how we pick up platforms and plugins - from local folder, git, npm or tarball.

mlynch commented 9 years ago

We (Ionic) love the idea and are always on board :)

mmocny commented 9 years ago

npm idea is interesting, though begs the question of bootstrapping (where does the npm package go? Into global, into local, or into temp?).

For git, I've always thought the process should be git clone && cd && cordova prepare and not cordova create --copy-from git-url.

cfjedimaster commented 9 years ago

+1

axemclion commented 9 years ago

I think the idea of npm is to make alternate templates available, just like cordova-app-hello-world.

Today, we pick up the default template as it is a Cordova dependency - maybe we treat the cordova-app-hello-world like platforms and plugins, and place it in the cordova cache.

After the git clone, cordova prepare, you may also have to change your git remote (or use another source control system) - was just hoping to make all of that simpler.

I was hoping we could mirror where templates can be picked up similar to the locations where platforms/plugins can be picked up. Ideally, all "dependency loaders" in cordova should share the same logic.

cfjedimaster commented 9 years ago

Agreed - while using a npm asset via create is cool, having Cordova "sign off" on some would be nice for new users. I've been asking for a "blank" template forever. :) (To be clear, not empty, but blank like Ionic's blank

On Wed, Apr 29, 2015 at 3:59 PM, Parashuram N notifications@github.com wrote:

I think the idea of npm is to make alternate templates available, just like cordova-app-hello-world https://www.npmjs.com/package/cordova-app-hello-world.

Today, we pick up the default template as it is a Cordova dependency https://github.com/apache/cordova-lib/blob/cc596a37d77a92665292a5370d660a898217e0cb/cordova-lib/src/cordova/create.js#L99

  • maybe we treat the cordova-app-hello-world like platforms and plugins, and place it in the cordova cache.

After the git clone, cordova prepare, you may also have to change your git remote (or use another source control system) - was just hoping to make all of that simpler.

I was hoping we could mirror where templates can be picked up similar to the locations where platforms/plugins can be picked up. Ideally, all "dependency loaders" in cordova should share the same logic.

— Reply to this email directly or view it on GitHub https://github.com/cordova/cordova-discuss/issues/5#issuecomment-97584297 .

Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: raymondcamden

axemclion commented 9 years ago

@cfjedimaster Not sure what "sign off" by Cordova means ? The templates would be created by folks in the community, and rated/tested by them.
The template signed off by Cordova would be the hello-world-app that we use now. Do we need to sign off and support more ?

cfjedimaster commented 9 years ago

Oh I was kinda thinking about how Ionic's CLI will mention their templates. Not really important - just thinking out loud.

On Wed, Apr 29, 2015 at 5:51 PM, Parashuram N notifications@github.com wrote:

@cfjedimaster https://github.com/cfjedimaster Not sure what "sign off" by Cordova means ? The templates would be created by folks in the community, and rated/tested by them.

The template signed off by Cordova would be the hello-world-app that we use now. Do we need to sign off and support more ?

— Reply to this email directly or view it on GitHub https://github.com/cordova/cordova-discuss/issues/5#issuecomment-97608955 .

Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: raymondcamden

nikhilkh commented 8 years ago

Closing this one as this has already been implemented.