Re: [DISCUSS] Copying node_modules during platform install

2015-10-29 Thread Dmitry Blotsky
Gotcha. I’m now thoroughly convinced that shipping node_modules directly is the 100% way to go. I guess having out of date dependencies is just an unavoidable side effect of shipping software as-is. We’ll just have to be diligent in updating cordova-common in platforms quickly enough to unblock

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Carlos Santana
Sorry for being late to the party. +1 to conclusion But leaving 2 cents - Using "npm install" or "npm link" is a development time (i.e. cordova contributors) only, When a product is shipped we should not rely on using this process to satisfy dependencies - The way dependencies are manage in

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Jesse
They are safe to copy. However, I don't see why anyone would have run npm link in the template folder of a platform, or why anyone would need to. We should probably just document that if you do this, it will break. Can anyone think of a reason why they would 'need' to npm link those modules?

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Dmitry Blotsky
Right now there is a difference between the cordova-common that’s in master, the cordova-common that’s released on NPM, and the cordova-common that comes with a platform. If we’re fine with these differences, then there isn’t really an issue. Are we fine with them? Kindly, Dmitry > On Oct 28,

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Dmitry Blotsky
This use case does mostly affect Cordova contributors. Usually the platforms will come packaged, you’re right. The discussion of packaged-vs-installed is separate, but just as a nod to it: I don’t see a reason we can’t just automatically call “npm install” in platforms/ios/cordova. Copying over

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Dmitry Blotsky
Follow-up: the reason we link them is so that we test master with master at all times. As of right now, that workflow breaks because my version of "npm link” makes relative links. Kindly, Dmitry > On Oct 28, 2015, at 1:28 PM, Jesse wrote: > > They are safe to copy. >

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Jesse
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

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Dmitry Blotsky
Is it possible to do “npm install” in those directories 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

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Steven Gill
Currently, those modules ship with the platform. Example, cordova-ios will have all necessary modules bundled in. When you create a cordova project and add a platform, it takes those modules and moves them into your newly created cordova project. To have the cordova project run `npm install` and

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Dmitry Blotsky
> trust that each platform will be updated > with a newer cordova-common when it makes sense That sounds reasonable to me. I’m removing the link step for cordova-common in platforms. Last question: the cordova-common used by cordova-lib should still be linked, yes? Kindly, Dmitry > On Oct

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Jesse
Yes, I believe the cordova-lib case should be linked, and definitely this is where a relative link makes sense, since it's all in the same repo. @purplecabbage risingj.com On Wed, Oct 28, 2015 at 5:28 PM, Dmitry Blotsky wrote: > > trust that each platform will be

Re: [DISCUSS] Copying node_modules during platform install

2015-10-28 Thread Steven Gill
+1 nice conclusion. On Wed, Oct 28, 2015 at 5:30 PM, Jesse wrote: > Yes, I believe the cordova-lib case should be linked, and definitely this > is where a relative link makes sense, since it's all in the same repo. > > > @purplecabbage > risingj.com > > On Wed, Oct 28,

Re: [DISCUSS] Copying node_modules during platform install

2015-10-27 Thread Dmitry Blotsky
Ping. Anyone have any information on this? Is it safe to "cp -r” a node_modules directory? Kindly, Dmitry > On Oct 26, 2015, at 3:06 PM, Dmitry Blotsky wrote: > > Hey folks, > > I’ve come across a bug with symlinks and platform installation recently. The > point of

Re: [DISCUSS] Copying node_modules during platform install

2015-10-27 Thread Steven Gill
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

[DISCUSS] Copying node_modules during platform install

2015-10-26 Thread Dmitry Blotsky
Hey folks, I’ve come across a bug with symlinks and platform installation recently. The point of interest is this line: https://github.com/apache/cordova-ios/blob/4039aeb6f87c6803df5814b8cdefb8c2058504a0/bin/lib/create.js#L93. Is copying node_modules a safe operation? In my case there was a