I'm always in favor of not duplicating code.

As long as we don't break functionality, I say move forward.

In terms of setting it up, this might be a good time for us to try out our
original plan with cordova-lib, which was for that one repo to host
multiple modules. Our original intention to do this was so we didn't keep
getting more and more repos.

cordova-lib has a sub-directory right now named cordova-lib where the
cordova-lib npm module lives. We could add new sub-directory named
cordova-serve with its own package.json

Directory structure could look like:
|Cordova-lib
|---cordova-lib
|------package.json
|------cordova-lib files
|---cordova-serve
|------package.json
|------cordova-serve files
|---README.md
|---.travis.ym
|---etc

Testing:
Both modules would have to share the same appvoyer and travis files. This
could be annoying.

Issue:
We have seen a issue where npm can't install subdirectories from git.
https://github.com/npm/npm/issues/2974. This might be a good reason not to
have multiple npm modules in one repo. It would only affect use cases where
you are grabbing the modules from git instead of npm.

Alternative:
request a new repo from infra for cordova-serve.

Since the module will live at Apache, we would have to vote on it like we
do with all of our other releases.




On Thu, May 28, 2015 at 9:00 AM, Tim Barham <tim.bar...@microsoft.com>
wrote:

> A while back we duplicated a bunch of 'cordova serve' code in
> cordova-browser so that 'cordova run browser' launched from a server rather
> than the local file system. At the time, the desire was expressed that
> ultimately we should avoid the duplicated code and have a separate
> 'cordova-serve' module. Since this module would also be useful for the
> plugin simulation stuff I've been working on, I've been taking a look at it
> recently.
>
> I have an initial implementation [1], and also updates to cordova-browser
> [2] and cordova-lib [3] that would make use of it.
>
> I have two questions:
>
> 1. Do we agree this is the right thing to do (cost of maintaining an
> additional Cordova module versus the benefit)? It's certainly something
> *I'd* like to have (for the plugin simulation stuff if nothing else :) ).
> 2. If the answer to question 1 is yes, how do I go about setting it up?
>
> [1] https://github.com/TimBarham/cordova-serve
> [2]
> https://github.com/MSOpenTech/cordova-lib/compare/bddcc8f2d709a55df2d91c14def61212843a14e8...tb-cordova-serve
> [3]
> https://github.com/MSOpenTech/cordova-browser/compare/42bd8f1985041ba26b33408372b218218f7c6183...tb-cordova-serve
>
> Thanks!
>
> Tim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> For additional commands, e-mail: dev-h...@cordova.apache.org
>
>

Reply via email to