On Mon, Mar 9, 2015 at 6:20 PM, Jesse <purplecabb...@gmail.com> wrote:
> What does `npm i -g cordova-plugin-device` do? Just because things are > similar does not mean you should force them to be the same. I don't really > see a benefit in doing this though, and I think we are going to end up with > circular unresolvable dependencies. or at least greatly increased > complexity in dependency resolution. > > I figure the post install script would fail if the plugin gets installed globally. I'd like to figure out exactly what dependency issues we would run into. Having 2 ways to do things just makes it harder for us .... > > Thinking outloud ... isn't the post install really just something like: > > ../../cordova plugin add npm_modules/cordova-plugin-device/ > That assumes no dependency resolution ... which would make it explode. > > This could potentially be one way of doing it. Another way would be to move install logic into the script itself. Just thinking outloud. > Overall, I don't think the feature is worth the complexity it would add, > and I don't even think it makes things easier for users. > What is the benefit of typing 'npm i cordova-plugin-device' vs 'cordova > plugin add cordova-plugin-device' ? Character count? > > It is definitely early for me to bring up this suggestion. I don't see a reason why current cordova devs would use `npm install cordova-plugin-device` over cordova plugin add. I see it being more useful in a world where cordova projects are node projects. CLI created projects would have a package.json, and I could see users installing plugins via npm install. Also, I see cordova JSAPI based projects becoming more popular once we break cordova-lib into smaller scripts and offer alternative ways to build and manage projects using npm/gulp/grunt/etc. This should be beneficial to our many downstreams as well. Just wanting to start fleshing out what all of this will look like. If we do decide to go down this route, it would be nice to figure it out soon so we could start getting plugin authors to make updates while we wait for tooling. > > > @purplecabbage > risingj.com > > On Mon, Mar 9, 2015 at 5:36 PM, Steven Gill <stevengil...@gmail.com> > wrote: > > > I think it is worth exploring a generic post install script plugin > authors > > could include that would install the plugin into a cordova project after > a > > npm install. I haven't had any time to actually explore this yet though. > > > > My initial reaction was that it would be hard to get right. After some > > thought and discussion with the npm people & Anis, it might be a really > > nice way of doing it. > > > > It would be pretty sweet if people could just go `npm i > > cordova-plugin-device` and have it install the plugin into their cordova > > projects. > > > > The script would have to: > > * detect if it is a cordova project and what version > > * do everything plugin install does now > > > > Just wanted to collect some feedback, advice, and concerns people have > > before I attempt to build it. > > >