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 C7ED618D37 for ; Wed, 28 Oct 2015 21:44:51 +0000 (UTC) Received: (qmail 61368 invoked by uid 500); 28 Oct 2015 21:44:17 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 61330 invoked by uid 500); 28 Oct 2015 21:44:17 -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 61318 invoked by uid 99); 28 Oct 2015 21:44:17 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2015 21:44:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 97378180976 for ; Wed, 28 Oct 2015 21:44:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.881 X-Spam-Level: ** X-Spam-Status: No, score=2.881 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id DsEDBQCjuKCt for ; Wed, 28 Oct 2015 21:44:04 +0000 (UTC) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 4FD74439B6 for ; Wed, 28 Oct 2015 21:44:04 +0000 (UTC) Received: by oiao187 with SMTP id o187so13086981oia.3 for ; Wed, 28 Oct 2015 14:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/gn6KIweE9fIfEtZTbaZolOZMSIMR4XIS1LEKLk/Cgc=; b=rs++Vb6RxkzBluHM7sWegq+3GebYgJu3IVdgT4ySB3AMnL+92ffEkiQmeN/SpL7WGm N5062VITBDOX9R0/wqmgq8uBCE3SOnHUw7PvKbQWuAwfgjr2kX7G3LXszCzJ0azQPQWY +g6hQCf9wprLxC881GvR18z+OSOBU1dG7IrGjMV8hIpsqjJ7ZGp4F/BoDTyxU5H7fgB4 sxOJCvS5kYtXsE9381o4AeAjtFZkcWQnSdLum0g7trj+BZnI+fhG/vMXt1NbryiAEzq3 H2toV+JWMsMM6p0TruxembFH5YySzkedSPch+EWA/SVOo+bVVhGk7XtpJi9um48uGrrc D49A== MIME-Version: 1.0 X-Received: by 10.202.168.129 with SMTP id r123mr33184031oie.44.1446068643708; Wed, 28 Oct 2015 14:44:03 -0700 (PDT) Received: by 10.76.40.74 with HTTP; Wed, 28 Oct 2015 14:44:03 -0700 (PDT) In-Reply-To: <4E2B1123-B381-4145-871E-04DD688DB87A@microsoft.com> References: <7FFAF618-A6E5-4929-AA57-5AE49A3380E4@microsoft.com> <135087D2-1721-4132-A23C-361B39D0F56E@microsoft.com> <4E2B1123-B381-4145-871E-04DD688DB87A@microsoft.com> Date: Wed, 28 Oct 2015 14:44:03 -0700 Message-ID: Subject: Re: [DISCUSS] Copying node_modules during platform install From: Jesse To: "dev@cordova.apache.org" Content-Type: multipart/alternative; boundary=001a113ccffcd455db05233117ed --001a113ccffcd455db05233117ed Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It is completely likely, and maybe even expected that the specific version of cordova-common that sits in any particular platform template can be different than what is used by cordova-lib. They may even be different amongst platforms in a single project. As long as the lib->platform api is consistent, this is not an issue. We use cordova-common solely to reduce duplicated code in our repos; We do not use cordova-common to reduce the duplicated code on app developers' machines between multiple projects. re: >> Follow-up: the reason we link them is so that we test master with master at all times. I would change this so that a platform is tested as a complete entity. Test what is in platform-master and trust that each platform will be updated with a newer cordova-common when it makes sense. @purplecabbage risingj.com On Wed, Oct 28, 2015 at 1:42 PM, Dmitry Blotsky wrote: > This use case does mostly affect Cordova contributors. Usually the > platforms will come packaged, you=E2=80=99re right. The discussion of > packaged-vs-installed is separate, but just as a nod to it: I don=E2=80= =99t see a > reason we can=E2=80=99t just automatically call =E2=80=9Cnpm install=E2= =80=9D in > platforms/ios/cordova. Copying over a package.json with fixed versions is > no more complex than copying over node_modules. > > Kindly, > Dmitry > > > On Oct 28, 2015, at 1:33 PM, Steven Gill wrote= : > > > > Currently, those modules ship with the platform. Example, cordova-ios > will > > have all necessary modules bundled in. When you create a cordova projec= t > > and add a platform, it takes those modules and moves them into your new= ly > > created cordova project. To have the cordova project run `npm install` > and > > install those modules would require us include those modules in a proje= ct > > level `package.json` file for every cordova project that adds that > > platform. This would confuse developers for sure. I don't think we woul= d > > have to modify requires to have this work. > > > > To run `npm install` on those directories would also be very poor > practice. > > By those directories, I assume you mean > > `MYCORDOVAPROJECT/platforms/ios/cordova` (this is where necessary > > node_modules from cordova-ios get copied). It would mean we would have = to > > have a `package.json` be copied from `cordova-ios` into > > `MyCordovaProject/platforms/ios/cordova`. A cordova project would then = at > > least have as many package.json files as platforms have been added. I > think > > this is poor practice. > > > > Your usecase of npm linking modules in platforms > (cordova-ios/node_modules) > > that then get copied into `MYCORDOVAPROJECT/platforms/ios/cordova` is > > unique. I still think the best solution is to add some sort of check to > > make sure you haven't npm linked or handle the npm linked case when > > copying. Guess this problem will arise more often with cordova-common. > That > > usecase pretty much only affects cordova contributors. > > > > -Steve > > > > On Wed, Oct 28, 2015 at 1:18 PM, Dmitry Blotsky > > wrote: > > > >> Is it possible to do =E2=80=9Cnpm install=E2=80=9D in those directorie= s instead? Or to > >> adjust the path so that require() works with the original node_modules > >> directory? > >> > >> Kindly, > >> Dmitry > >> > >>> On Oct 27, 2015, at 10:31 PM, Steven Gill > >> wrote: > >>> > >>> I don't think we thought of symlinks in this usecase. Probably worth > >> adding > >>> in code that checks for symlinks before the copy. I don't see us > removing > >>> this copy as the cordova scripts (build, run, install, etc) require > those > >>> modules. > >>> > >>> On Tue, Oct 27, 2015 at 9:24 PM, Dmitry Blotsky < > dblotsky@microsoft.com> > >>> wrote: > >>> > >>>> Ping. Anyone have any information on this? Is it safe to "cp -r=E2= =80=9D a > >>>> node_modules directory? > >>>> > >>>> Kindly, > >>>> Dmitry > >>>> > >>>>> On Oct 26, 2015, at 3:06 PM, Dmitry Blotsky > >>>> wrote: > >>>>> > >>>>> Hey folks, > >>>>> > >>>>> I=E2=80=99ve come across a bug with symlinks and platform installat= ion > >> recently. > >>>> The point of interest is this line: > >>>> > >> > https://na01.safelinks.protection.outlook.com/?url=3Dhttps%3a%2f%2fgithub= .com%2fapache%2fcordova-ios%2fblob%2f4039aeb6f87c6803df5814b8cdefb8c2058504= a0%2fbin%2flib%2fcreate.js%23L93.&data=3D01%7c01%7cdblotsky%40microsoft.com= %7c2b31253a23cc4d165ed808d2de51c9ef%7c72f988bf86f141af91ab2d7cd011db47%7c1&= sdata=3DcyXGPBQPr9v46gc6DMDeC9zZkzda8bSCIoinEyAmKrs%3d > >>>>> > >>>>> Is copying node_modules a safe operation? In my case there was a > >>>> relative symlink inside it when it was copied and as a result some > >>>> dependencies broke. The symlink was created by a previous invocation > of > >>>> =E2=80=9Cnpm link=E2=80=9D. > >>>>> > >>>>> Kindly, > >>>>> Dmitry > >>>> > >>>> > >> > >> > > --001a113ccffcd455db05233117ed--