Last year I would've advocated we put our energy into something more magical like grunt/grunt-cli as Michal describes. Nowadays I'm thinking we focus on writing libs and let other ppl figure out glue w/ their Grunt. (Or write the magical way but based on lower level smarter libs.)
On Mon, Sep 9, 2013 at 8:56 AM, Michal Mocny <mmo...@chromium.org> wrote: > I should add that one benefit of what I outlined above is that you only > need to worry about installing cordova-cli once, and it could then > manage/download the various versions of itself. > > The downside is that we would have to write those smarts, instead of just > leveraging npm and forcing the user to take control. > > The grunt way is less magical, which has its benefits and drawbacks. > > -Michal > > > On Mon, Sep 9, 2013 at 11:53 AM, Michal Mocny <mmo...@chromium.org> wrote: > > > Generally, I like it. We've discussed a somewhat variant in the past, > and > > I'm not sure which is better: > > > > Instead of installing locally every time a la grunt, we discussed having > a > > single install base for the different cordova versions (i.e. inside > > ~/.cordova), and then cordova-cli is a short script that forks to launch > > the right version of cordova proper. The right version is (a) the most > > recent version if you are creating a new app, or (b) the version that is > > "tied" to a given workspace when used inside an existing app (and which > you > > must explicitly upgrade). > > > > -Michal > > > > > > On Mon, Sep 9, 2013 at 11:48 AM, Carlos Santana <csantan...@gmail.com > >wrote: > > > >> What does the community think of installing cordova only locally and not > >> globally? > >> > >> # Installing Cordova locally will provide: > >> > >> - A way to use different versions of cordova on the same system/os. > >> - A way to specify cordova as a dependency in package.json for an App > >> project > >> - A way to sandbox cordova and checking into source control for an App > >> project > >> > >> # [GruntJS](http://gruntjs.com/getting-started) is a project that > already > >> takes this approach: > >> > >> 1. User installs `grunt-cli` globally instead of grunt > >> npm -g install grunt-cli` > >> > >> 2. User installs `grunt` locally > >> npm install grunt --save-dev > >> > >> 3. When user runs `grunt` it will run a short script > >> `/usr/local/bin/grunt` > >> (about 40 lines) > >> It will resolve and use grunt from cwd (current working directory) > >> locally > >> > >> # Proposal: > >> > >> 1. Have 2 npm packages > >> - cordova-cli > >> - cordova > >> > >> 2. create cordova-cli package and update docs > >> cordova-cli will be almost indentical to grunt-cli > >> https://github.com/gruntjs/grunt-cli/blob/master/bin/grunt > >> > >> 3. codova package is not longer get's install as `bin\cordova` and > instead > >> run with > >> require(cordovapath).cli(); > >> > >> > >> --- > >> If you want to know more about grunt and why grunt swtiched from being > >> installed globally to now being install locally a podcast came out last > >> Friday where the author of GruntJS (Ben Alman) explains more details > >> http://javascriptjabber.com/074-jsj-grunt-js-with-ben-alman/ > >> > >> > >> -- > >> Carlos Santana > >> <csantan...@gmail.com> > >> > > > > >