You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2014/10/23 22:04:00 UTC

git commit: Expose cordova-lib and the cli from cordova-cli

Repository: cordova-cli
Updated Branches:
  refs/heads/master f33f41678 -> 24449c789


Expose cordova-lib and the cli from cordova-cli

This replaces commit 9ab51c2ce43547df35e9cc32ceadb4dc6af05b94

Downstream packages that depend on both cordova-lib and cordova-cli have two
copies of cordova-lib. One as direct dependency in node-modules/cordova-lib
and the other as cordova-cli's dep in
node_modules/cordova/node_modules/corodva-lib.
The two copies might end up being of different versions, but even if they are
identical it still results in two separate instances of the EventEmitter and
breaks event registration and handling in some cases.


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/24449c78
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/24449c78
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/24449c78

Branch: refs/heads/master
Commit: 24449c78973c69803caa3229d6b6dc255184896c
Parents: f33f416
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Thu Oct 23 16:01:16 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Thu Oct 23 16:03:46 2014 -0400

----------------------------------------------------------------------
 cordova.js | 11 +++++++++--
 src/cli.js |  4 ----
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/24449c78/cordova.js
----------------------------------------------------------------------
diff --git a/cordova.js b/cordova.js
index ece0b87..687d74c 100644
--- a/cordova.js
+++ b/cordova.js
@@ -17,8 +17,15 @@
     under the License.
 */
 
-// All cordova js API moved to cordova-lib. This is a temporary shim for
-// dowstream packages that use cordova-cli for the API.
+// All cordova js API moved to cordova-lib. If you don't need the cordova CLI,
+// use cordova-lib directly.
 
 var cordova_lib = require('cordova-lib');
 module.exports = cordova_lib.cordova;
+
+// Also export the cordova-lib so that downstream consumers of cordova lib and
+// CLI will be able to use CLI's cordova-lib and avoid the risk of having two
+// different versions of cordova-lib which would result in two instances of
+// "events" and can cause bad event handling.
+module.exports.cordova_lib = cordova_lib;
+module.exports.cli = require('./src/cli');

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/24449c78/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index b2f42ea..cc6fc0e 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -57,10 +57,6 @@ function init() {
 };
 
 module.exports = cli
-// Also export the cordova-lib so that downstream consumers of cordova lib and
-// CLI will be able to use CLI's cordova-lib and avoid the risk of having two
-// different versions of cordova-lib.
-module.exports.cordova_lib = cordova_lib
 function cli(inputArgs) {
     // When changing command line arguments, update doc/help.txt accordingly.
     var knownOpts =


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org