Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1DA441116C for ; Tue, 3 Jun 2014 02:35:42 +0000 (UTC) Received: (qmail 53177 invoked by uid 500); 3 Jun 2014 02:35:41 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 53138 invoked by uid 500); 3 Jun 2014 02:35:41 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 53126 invoked by uid 99); 3 Jun 2014 02:35:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2014 02:35:41 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mmocny@google.com designates 209.85.128.181 as permitted sender) Received: from [209.85.128.181] (HELO mail-ve0-f181.google.com) (209.85.128.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2014 02:35:37 +0000 Received: by mail-ve0-f181.google.com with SMTP id pa12so6134010veb.40 for ; Mon, 02 Jun 2014 19:35:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=/DbrXtOPzoR0/NycMQcz5xCicMTX3iABiVRCMLi9Un8=; b=DQwvUs9+d7Jya7Vg9FRCCBzjQmL2Rzy5X/bley9+HqaJswFZ8hwWAtngRC2oHKNfAI WpMEvJuqSTq0jS8SMurstNi62lcV4pzD5EZ1pt7qjNDAY2PZDy8mxSHkJIOvewIZlE+R hunzNZHJo2rHOvDd1Rh6DnNABJs0uYNrOU6eu9TyOsyXBobmvY4bSbRZ2Fu/rkp3lreX PV8o6Eq3O6B+1PSecooNWI2J1XrNMA0qmfNJDUuYZ/KcmpvdcvxXSM8PrDgITdNkWydS /MylXFqIAId+PYtAFAoLmvVYrxJ79OE3TfYBMzMUcdgyz+PGVmXStpEGDUp9Md1Po4vG w0CA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=/DbrXtOPzoR0/NycMQcz5xCicMTX3iABiVRCMLi9Un8=; b=Ty+nt03oboIQNh1KPNRc2dOF77FSwQCLHe0uGxEcdM4j6eERYjB8IY9KXsxNtkPEjl aplb+b9z5UL70HAkawLHMv6B7FcNddt86KFTxkX2iGOedxzEGRtxWQJ82PBfZKb0rhMd Na/uvoLXimyt82/EY7Y7GrWaLFUv4+09uDD5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-type; bh=/DbrXtOPzoR0/NycMQcz5xCicMTX3iABiVRCMLi9Un8=; b=gNEIZQjQo6zyFnBZWMdAQvDhoSW0o+t9vSVQATZR8HLnFgqdwO3I+J3JWj1f049Bil O2Ks7z9yh7A78Fg7B+UuHL3E7irn/vytSlTDbxhMMhNdoub79ubE3odaV5FUJecKC8n3 snHeYv5/cED1CDG+Domj1jGOndpBZHd3YN4+a0x9M5PVd/pXtuBiYl4zL1+M5l9dAo9r A2eG0s3Exan8SIN0iilA2NisZTnR+pybTMg3s4sirXPbrrNYnYTs1lL0QzUAojfI9coQ 3Vvp3NQ1Iex6fk6rOvlvAZTaGw+ld3XsTgi0vXgFBKP4BsM+oMxXvvqeHSg+TniltcFN +g6Q== X-Gm-Message-State: ALoCoQla0wg/HSnRBnOU3+DujisG5ZBKk5zhf+cOysSdJnfYBfNIBT8TNz0viF0PULec3pqk/wMr X-Received: by 10.52.12.36 with SMTP id v4mr28921967vdb.20.1401762916913; Mon, 02 Jun 2014 19:35:16 -0700 (PDT) MIME-Version: 1.0 Sender: mmocny@google.com Received: by 10.52.31.101 with HTTP; Mon, 2 Jun 2014 19:34:56 -0700 (PDT) In-Reply-To: References: <538CF20A.8060604@tmbsw.com> From: Michal Mocny Date: Mon, 2 Jun 2014 22:34:56 -0400 X-Google-Sender-Auth: P4bc02uqaj3FRIhbsKmOqvKFYN8 Message-ID: Subject: Re: adding platforms to npm for dependency sanity To: dev Content-Type: multipart/alternative; boundary=485b397dd299b8e9f704fae55c9d X-Virus-Checked: Checked by ClamAV on apache.org --485b397dd299b8e9f704fae55c9d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jun 2, 2014 at 10:14 PM, Andrew Grieve wrote= : > Here's both flows as I understand them: > > Direct NPM flow: > # Downloads platform source into node_modules > npm install cordova-ios@3.4.0 --save > # Runs the create script and installs plugins to create platforms/ios > cordova platform add ios --path=3Dnode_modules/cordova-ios > To be fair, I think with Brian's suggestion, platform add FOO would by default look in node_modules so you wouldn't be explicit about it, and also the default cordova project package.json would depend on all the latest versions of each platform, so the flows would actually be: > cordova create Foo && cd Foo > npm install > npm install cordova-ios@3.4 --save > cordova platform add android > cordova platform add ios > # crazy idea? use npm post-install hooks to auto-run create/upgrade so you usually don't need above two lines? Compared to: > cordova create Foo && cd Foo > cordova platform add android > cordova platform add ios@3.4 I think #2 is enough better that its not worth changing. > Cordova-to-npm flow (as Mark's implemented): > # Runs "npm cache add cordova-ios", then runs create script from > ~/cache/cordova-ios/bin/create > cordova platform add ios@3.4.0 > > - In both flows: we use npm to do all of the heavy lifting > - In both flows: the npm module is cached in your home directory > - In both flows?: we store the plugins & platforms explicitly within > config.xml (Gorkem's added this) > - In flow #1, we have a package.json & a node_modules, in #2 we don't. > > Why put the onus on the user to fetch the platform source when it's as ea= sy > as running "npm cache add" under-the-hood? > > > In regards to the idea of using require() on platform scripts instead of > subshelling: I think this is tangental to the debate of how to fetch the > platform. > In regards to using "npm install" directly when using the plugman workflo= w: > Sounds good to me. > > > > > On Mon, Jun 2, 2014 at 6:05 PM, Brian LeRoux wrote: > > > Eventually, yes. (Sort of how Grunt works now.) > > > > > > On Mon, Jun 2, 2014 at 5:52 PM, Terence M. Bandoian > > wrote: > > > > > Can multiple versions of a platform be installed side-by-side? > > > > > > -Terence > > > > > > > > > > > > On 6/2/2014 3:04 PM, Michal Mocny wrote: > > > > > >> >From original email: "Ideal future CLI uses platforms just like oth= er > > >> deps. > > >> We lose lazy loading but network and disk is cheap so it wasn't real= ly > > >> important anyhow." > > >> Made me think Brian is proposing adding platforms to cli package.jso= n > > >> dependencies, and you would have a single global install > > >> cordova-platforms. > > >> Then you can override the version with an explicit install as he > > >> mentions > > >> "npm i cordova-ios@3.5.0". > > >> > > >> Personally, I think that workflow could work, and has a few benefits= , > > but > > >> I'm not sure that option compares well to the alternative of just la= zy > > >> loading using npm cache add as Mark has already implemented an > > experiment > > >> (anyone interested in this topic should take a look at that patch). > > >> > > >> The steps Brian & Ian outline about how to package platforms for > release > > >> to > > >> npm are possibly an improvement over the old-style platform-centric > > >> workflow. Instead of downloading a tarball and running a create > script, > > >> you npm install and run a create() function, and that can more easil= y > be > > >> bundled into other build scripts/boilerplate. For CLI workflow, not > > sure > > >> that there is any real difference (as Jesse says). One note, though= : > > >> cordova-* platforms are templates for projects, so the package.jso= n > of > > >> the > > >> npm package itself shouldn't end up inside projects that are created > > with > > >> it. I think. > > >> > > >> -Michal > > >> > > >> > > >> On Mon, Jun 2, 2014 at 3:42 PM, Ian Clelland > > >> wrote: > > >> > > >> There seems to be some confusion -- I think people are talking abou= t > > >>> different things here, but perhaps it's just me ;) > > >>> > > >>> I thought that Brian's original suggestion was about being able to > host > > >>> Cordova platforms directly on NPM. That's why each one would requir= e > a > > >>> package.json. (which would probably end up in > > >>> /platforms/ in a project, but that's not the poi= nt > > of > > >>> it). > > >>> > > >>> As an NPM project, we then would have the opportunity (though not t= he > > >>> obligation) to make all of the supporting scripts for each platform > > >>> (create, build, run, etc) part of the node module, for a uniform > > >>> interface > > >>> that doesn't require going through the command line. > > >>> > > >>> It's not about making platforms into CLI dependencies (any more tha= n > > >>> plugins are CLI dependencies right now), or about making a > > cordova-based > > >>> project into a node package. > > >>> > > >>> If that's right, then I support that -- I'd like the platforms to b= e > > >>> installable through npm, and to be versioned separately, installabl= e > > >>> separately, and scriptable without having to spawn subshells. > > >>> > > >>> And if I have it completely wrong, then let me know -- I'll just go > > back > > >>> to > > >>> fixing File bugs ;) > > >>> > > >>> > > >>> On Mon, Jun 2, 2014 at 3:29 PM, Andrew Grieve > > >>> wrote: > > >>> > > >>> Not sure what your question is. > > >>>> > > >>>> > > >>>> On Mon, Jun 2, 2014 at 2:03 PM, Brian LeRoux wrote: > > >>>> > > >>>> *ahem > > >>>>> > > >>>>> > > >>>>> On Wed, May 28, 2014 at 11:20 AM, Brian LeRoux wrote= : > > >>>>> > > >>>>> npm i cordova-ios@3.5.0 > > >>>>>> > > >>>>>> Right? > > >>>>>> On May 27, 2014 11:06 PM, "Andrew Grieve" > > >>>>>> > > >>>>> wrote: > > >>>> > > >>>>> Lazy loading is what will give us the ability to support multiple > > >>>>>>> > > >>>>>> versions > > >>>>> > > >>>>>> of platforms. > > >>>>>>> > > >>>>>>> If we don't support users choosing the version of the platform > they > > >>>>>>> > > >>>>>> want, > > >>>>> > > >>>>>> then they will resist updating their version of CLI (like they d= o > > >>>>>>> > > >>>>>> right > > >>>> > > >>>>> now). > > >>>>>>> > > >>>>>>> I'm very keen to allow users to chose their platform versions, > just > > >>>>>>> > > >>>>>> as > > >>> > > >>>> they > > >>>>>>> are able to choose their plugin versions. > > >>>>>>> > > >>>>>>> > > >>>>>>> > > >>>>>>> On Tue, May 27, 2014 at 5:57 PM, Mark Koudritsky < > > kamrik@google.com > > >>>>>>> wrote: > > >>>>>>> > > >>>>>>> +1 > > >>>>>>>> > > >>>>>>>> Steve published (some of?) the platforms on npm as part of the > > >>>>>>>> > > >>>>>>> latest > > >>>> > > >>>>> release. > > >>>>>>>> https://www.npmjs.org/package/cordova-android > > >>>>>>>> https://www.npmjs.org/package/cordova-ios > > >>>>>>>> > > >>>>>>>> CLI already require()s npm for downloading plugins from the > > >>>>>>>> > > >>>>>>> registry. > > >>>> > > >>>>> Extending this to platforms is on my todo list for this\next week= . > > >>>>>>>> The "lazy" part of the loading was about caching, so we don't > lose > > >>>>>>>> > > >>>>>>> it > > >>>> > > >>>>> since > > >>>>>>> > > >>>>>>>> npm does its own caching. > > >>>>>>>> > > >>>>>>>> > > >>>>>>>> > > >>>>>>>> On Tue, May 27, 2014 at 5:42 PM, Parashuram Narasimhan (MS OPE= N > > >>>>>>>> > > >>>>>>> TECH) > > >>>> > > >>>>> < > > >>>>> > > >>>>>> panarasi@microsoft.com> wrote: > > >>>>>>>> > > >>>>>>>> +1. This will also be a step towards releasing platforms > > >>>>>>>>> > > >>>>>>>> independently. > > >>>>>>> > > >>>>>>>> Will the CLI have a semver like dependency on the platform > > >>>>>>>>> > > >>>>>>>> specified > > >>>> > > >>>>> somewhere ? Would the cli have to require('npm') and do the > > >>>>>>>>> > > >>>>>>>> install? > > >>>> > > >>>>> -----Original Message----- > > >>>>>>>>> From: brian.leroux@gmail.com [mailto:brian.leroux@gmail.com] > On > > >>>>>>>>> > > >>>>>>>> Behalf > > >>>>>>> > > >>>>>>>> Of > > >>>>>>>> > > >>>>>>>>> Brian LeRoux > > >>>>>>>>> Sent: Tuesday, May 27, 2014 2:20 PM > > >>>>>>>>> To: dev@cordova.apache.org > > >>>>>>>>> Subject: adding platforms to npm for dependency sanity > > >>>>>>>>> > > >>>>>>>>> We've discussed this but I'm not sure the whole idea has > > >>>>>>>>> > > >>>>>>>> crystalized. > > >>>>> > > >>>>>> My > > >>>>>>> > > >>>>>>>> proposal (based on previous discussions) below. I'll use iOS a= s > > >>>>>>>>> > > >>>>>>>> an > > >>> > > >>>> example > > >>>>>>>> > > >>>>>>>>> but this applies to all platforms supported by the CLI. > > >>>>>>>>> > > >>>>>>>>> First, we'd add two files: > > >>>>>>>>> > > >>>>>>>>> cordova-ios > > >>>>>>>>> |-package.json > > >>>>>>>>> '-index.js > > >>>>>>>>> > > >>>>>>>>> =E2=80=A6I don't think I need to describe the utility of pack= age.json > > >>>>>>>>> > > >>>>>>>> but > > >>> > > >>>> index.js > > >>>>>>>> > > >>>>>>>>> would expose programatic library apis: > > >>>>>>>>> > > >>>>>>>>> module.exports =3D { create:Function, run:Function, > > >>>>>>>>> > > >>>>>>>> build:Function, > > >>> > > >>>> clean:Function, log:Function} > > >>>>>>>>> > > >>>>>>>>> We then publish to npm. That is it for now. Ideal future CLI > > >>>>>>>>> > > >>>>>>>> uses > > >>> > > >>>> platforms just like other deps. We lose lazy loading but network > > >>>>>>>>> > > >>>>>>>> and > > >>>> > > >>>>> disk > > >>>>>>> > > >>>>>>>> is cheap so it wasn't really important anyhow. > > >>>>>>>>> > > >>>>>>>>> Discuss! > > >>>>>>>>> > > >>>>>>>>> > > > > > > --485b397dd299b8e9f704fae55c9d--