cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject cordova-lib git commit: CB-9332 Upgrade npm and semver to actual versions
Date Fri, 17 Jul 2015 13:30:34 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master f70606247 -> bed6d3a20


CB-9332 Upgrade npm and semver to actual versions

This closes #263


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

Branch: refs/heads/master
Commit: bed6d3a201e0193b2ffdb60fa6de74de0c870cec
Parents: f706062
Author: Vladimir Kotikov <v-vlkoti@microsoft.com>
Authored: Fri Jul 17 10:54:52 2015 +0300
Committer: Vladimir Kotikov <v-vlkoti@microsoft.com>
Committed: Fri Jul 17 16:25:26 2015 +0300

----------------------------------------------------------------------
 cordova-lib/package.json                            | 7 +++----
 cordova-lib/spec-plugman/install-browserify.spec.js | 1 +
 cordova-lib/spec-plugman/install.spec.js            | 1 +
 cordova-lib/src/plugman/install.js                  | 8 ++++++++
 cordova-lib/src/plugman/registry/registry.js        | 8 --------
 5 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bed6d3a2/cordova-lib/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/package.json b/cordova-lib/package.json
index 0bafaa7..30153f8 100644
--- a/cordova-lib/package.json
+++ b/cordova-lib/package.json
@@ -22,20 +22,19 @@
     "cordova-js": "4.0.0",
     "cordova-registry-mapper": "1.x",
     "cordova-serve": "^0.1.2",
-    "d8": "0.4.4",
     "dep-graph": "1.1.0",
     "elementtree": "0.1.6",
     "glob": "4.0.6",
     "init-package-json": "^1.2.0",
-    "npm": "1.3.4",
-    "npmconf": "0.1.16",
+    "npm": "^2.10.x",
+    "npmconf": "^2.1.x",
     "osenv": "0.1.0",
     "plist": "1.1.0",
     "properties-parser": "0.2.3",
     "q": "1.0.1",
     "rc": "0.5.2",
     "request": "2.47.0",
-    "semver": "2.1.0",
+    "semver": "^4.3.x",
     "shelljs": "0.3.0",
     "tar": "1.0.2",
     "through2": "0.6.3",

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bed6d3a2/cordova-lib/spec-plugman/install-browserify.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/install-browserify.spec.js b/cordova-lib/spec-plugman/install-browserify.spec.js
index 4e7e0c7..6d94eee 100644
--- a/cordova-lib/spec-plugman/install-browserify.spec.js
+++ b/cordova-lib/spec-plugman/install-browserify.spec.js
@@ -296,6 +296,7 @@ describe('install', function() {
                 // <engine name="mega-boring-plugin" version=">=3.0.0" scriptSrc="megaBoringVersion"
platform="ios|android" />
 
                 var plugmanVersion = require('../package.json').version;
+                plugmanVersion = plugmanVersion.replace(/-dev$/, '');
 
                 expect(spy.calls.length).toBe(4);
                 expect(spy.calls[0].args).toEqual([ null, '>=2.3.0' ]);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bed6d3a2/cordova-lib/spec-plugman/install.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/install.spec.js b/cordova-lib/spec-plugman/install.spec.js
index dc42ba0..c50e907 100644
--- a/cordova-lib/spec-plugman/install.spec.js
+++ b/cordova-lib/spec-plugman/install.spec.js
@@ -298,6 +298,7 @@ describe('install', function() {
                 // <engine name="mega-boring-plugin" version=">=3.0.0" scriptSrc="megaBoringVersion"
platform="ios|android" />
 
                 var plugmanVersion = require('../package.json').version;
+                plugmanVersion = plugmanVersion.replace(/-dev$/, '');
 
                 expect(spy.calls.length).toBe(4);
                 expect(spy.calls[0].args).toEqual([ null, '>=2.3.0' ]);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bed6d3a2/cordova-lib/src/plugman/install.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/install.js b/cordova-lib/src/plugman/install.js
index 8fa35b4..d8c1997 100644
--- a/cordova-lib/src/plugman/install.js
+++ b/cordova-lib/src/plugman/install.js
@@ -110,6 +110,14 @@ function checkEngines(engines) {
     for(var i = 0; i < engines.length; i++) {
         var engine = engines[i];
 
+        // This is a hack to allow plugins with <engine> tag to be installed with
+        // engine with '-dev' suffix. It is required due to new semver range logic,
+        // introduced in semver@3.x. For more details see https://github.com/npm/node-semver#prerelease-tags.
+        //
+        // This may lead to false-positive checks, when engine version with dropped
+        // suffix is equal to one of range bounds, for example: 5.1.0-dev >= 5.1.0.
+        // However this shouldn't be a problem, because this only should happen in dev workflow.
+        engine.currentVersion = engine.currentVersion && engine.currentVersion.replace(/-dev$/,
'');
         if ( semver.satisfies(engine.currentVersion, engine.minVersion) || engine.currentVersion
=== null ) {
             // engine ok!
         } else {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bed6d3a2/cordova-lib/src/plugman/registry/registry.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/registry/registry.js b/cordova-lib/src/plugman/registry/registry.js
index f43edae..bb9c216 100644
--- a/cordova-lib/src/plugman/registry/registry.js
+++ b/cordova-lib/src/plugman/registry/registry.js
@@ -37,14 +37,6 @@ var semver = require('semver'),
     plugmanCacheDir = path.resolve(plugmanConfigDir, 'cache'),
     oneDay = 3600*24;
 
-if (semver.compare(npm.version, '1.3.4') > 0) {
-    throw new Error('Unsupported npm version (' + npm.version + '). ' +
-       'Please downgrade to 1.3.4:\n' +
-       '\t(cd ' + path.dirname(path.dirname(path.dirname(__dirname))) +
-       ' && rm -rf ' + path.join('node_modules', 'npm') +
-       ' && npm install npm@1.3.4)');
-}
-
 module.exports = {
     settings: null,
     /**


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


Mime
View raw message