{"action":"opened","issue":{"url":"https://api.github.com/repos/cordova/cordova-discuss/issues/8","labels_url":"https://api.github.com/repos/cordova/cordova-discuss/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/cordova/cordova-discuss/issues/8/comments","events_url":"https://api.github.com/repos/cordova/cordova-discuss/issues/8/events","html_url":"https://github.com/cordova/cordova-discuss/issues/8","id":84733151,"number":8,"title":"Proposal: cordova-serve","user":{"login":"TimBarham","id":9665847,"avatar_url":"https://avatars.githubusercontent.com/u/9665847?v=3","gravatar_id":"","url":"https://api.github.com/users/TimBarham","html_url":"https://github.com/TimBarham","followers_url":"https://api.github.com/users/TimBarham/followers","following_url":"https://api.github.com/users/TimBarham/following{/other_user}","gists_url":"https://api.github.com/users/TimBarham/gists{/gist_id}","starred_url":"https://api.github.com/users/TimBarham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimBarham/subscriptions","organizations_url":"https://api.github.com/users/TimBarham/orgs","repos_url":"https://api.github.com/users/TimBarham/repos","events_url":"https://api.github.com/users/TimBarham/events{/privacy}","received_events_url":"https://api.github.com/users/TimBarham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-03T19:25:44Z","updated_at":"2015-06-03T19:25:44Z","closed_at":null,"body":"I started a thread about this on the dev list, but figured it would be good to have it here.\r\n\r\nA while back we duplicated a bunch of `cordova serve` code in `cordova-browser` so that `cordova run browser` would launch 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.\r\n\r\nI have an initial prototype implementation (which also includes some functionality I need for the plugin simulation work) [here](https://github.com/TimBarham/cordova-serve), changes to `cordova-browser` to use it [here](https://github.com/MSOpenTech/cordova-browser/compare/42bd8f1985041ba26b33408372b218218f7c6183...tb-cordova-serve), and corresponding changes to cordova-lib [here](https://github.com/MSOpenTech/cordova-lib/compare/bddcc8f2d709a55df2d91c14def61212843a14e8...tb-cordova-serve).\r\n\r\nPrimary question is where this module would live. Likely possibilities are:\r\n\r\n1. As a new Cordova repository.\r\n2. Within the `cordova-lib` repository (it would be its own npm module - its source would live in a `cordova-serve` folder next to the `cordova-lib` folder).\r\n\r\nThe advantage of the second approach is that it avoids proliferation of Cordova repositories, particularly for a small helper module that is required by `cordova-lib`, and it starts implementing the whole reason `cordova-lib` is in a folder within the `cordova-lib` repo (so we can have multiple packages in the repo). However, it has some disadvantages:\r\n\r\n* It will have to share `appveyor` and `travis` configuration files with `cordova-lib`.\r\n* It will not be installable via npm from git (since npm requires package.json at the root of the repo).\r\n\r\nI'm interested in opinions on what would be the best approach."}}