You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2016/02/27 10:39:18 UTC
cordova-lib git commit: CB-10462 Get rid of npmconf in favor of npm.
This closes #401
Repository: cordova-lib
Updated Branches:
refs/heads/master cda2b72b8 -> 0aef8928e
CB-10462 Get rid of npmconf in favor of npm. This closes #401
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/0aef8928
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/0aef8928
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/0aef8928
Branch: refs/heads/master
Commit: 0aef8928e19cc32051fcda9afb66364022ab9c5f
Parents: cda2b72
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Fri Feb 26 14:20:14 2016 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Sat Feb 27 12:38:51 2016 +0300
----------------------------------------------------------------------
cordova-lib/package.json | 1 -
cordova-lib/spec-cordova/lazy_load.spec.js | 12 +++++-------
cordova-lib/src/cordova/lazy_load.js | 9 ++++-----
3 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/0aef8928/cordova-lib/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/package.json b/cordova-lib/package.json
index 0be249d..1d452fa 100644
--- a/cordova-lib/package.json
+++ b/cordova-lib/package.json
@@ -53,7 +53,6 @@
"init-package-json": "^1.2.0",
"nopt": "^3.0.6",
"npm": "^2.10.x",
- "npmconf": "^2.1.x",
"opener": "1.4.1",
"plist": "^1.2.0",
"properties-parser": "0.2.3",
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/0aef8928/cordova-lib/spec-cordova/lazy_load.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/lazy_load.spec.js b/cordova-lib/spec-cordova/lazy_load.spec.js
index a986f27..410c99c 100644
--- a/cordova-lib/spec-cordova/lazy_load.spec.js
+++ b/cordova-lib/spec-cordova/lazy_load.spec.js
@@ -22,7 +22,7 @@
var lazy_load = require('../src/cordova/lazy_load'),
config = require('../src/cordova/config'),
shell = require('shelljs'),
- npmconf = require('npmconf'),
+ npm = require('npm'),
path = require('path'),
HooksRunner = require('../src/hooks/HooksRunner'),
request = require('request'),
@@ -113,9 +113,7 @@ describe('lazy_load module', function() {
});
describe('remote URLs for libraries', function() {
- var npmConfProxy;
var req,
- load_spy,
events = {},
fakeRequest = {
on: jasmine.createSpy().andCallFake(function(event, cb) {
@@ -125,7 +123,6 @@ describe('lazy_load module', function() {
pipe: jasmine.createSpy().andCallFake(function() { return fakeRequest; })
};
beforeEach(function() {
- npmConfProxy = null;
events = {};
fakeRequest.on.reset();
fakeRequest.pipe.reset();
@@ -136,7 +133,8 @@ describe('lazy_load module', function() {
}, 10);
return fakeRequest;
});
- load_spy = spyOn(npmconf, 'load').andCallFake(function(cb) { cb(null, { get: function() { return npmConfProxy; }}); });
+ spyOn(npm, 'load').andCallFake(function(cb) { cb(); });
+ spyOn(npm.config, 'get').andReturn(null);
});
it('should call request with appropriate url params', function(done) {
@@ -158,7 +156,7 @@ describe('lazy_load module', function() {
});
it('should take into account https-proxy npm configuration var if exists for https:// calls', function(done) {
var proxy = 'https://somelocalproxy.com';
- npmConfProxy = proxy;
+ npm.config.get.andReturn(proxy);
var url = 'https://github.com/apache/someplugin';
var with_android_platform = {
'android': {
@@ -178,7 +176,7 @@ describe('lazy_load module', function() {
});
it('should take into account proxy npm config var if exists for http:// calls', function(done) {
var proxy = 'http://somelocalproxy.com';
- npmConfProxy = proxy;
+ npm.config.get.andReturn(proxy);
var url = 'http://github.com/apache/someplugin';
var with_android_platform = {
'android': {
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/0aef8928/cordova-lib/src/cordova/lazy_load.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/lazy_load.js b/cordova-lib/src/cordova/lazy_load.js
index 9079329..bdd01c9 100644
--- a/cordova-lib/src/cordova/lazy_load.js
+++ b/cordova-lib/src/cordova/lazy_load.js
@@ -25,7 +25,6 @@ var path = require('path'),
fs = require('fs'),
shell = require('shelljs'),
platforms = require('../platforms/platforms'),
- npmconf = require('npmconf'),
events = require('cordova-common').events,
request = require('request'),
config = require('./config'),
@@ -216,15 +215,15 @@ function custom(platforms, platform) {
}).then(function() {
var uri = URL.parse(url);
var d = Q.defer();
- npmconf.load(function(err, conf) {
+ npm.load(function(err) {
// Check if NPM proxy settings are set. If so, include them in the request() call.
var proxy;
if (uri.protocol == 'https:') {
- proxy = conf.get('https-proxy');
+ proxy = npm.config.get('https-proxy');
} else if (uri.protocol == 'http:') {
- proxy = conf.get('proxy');
+ proxy = npm.config.get('proxy');
}
- var strictSSL = conf.get('strict-ssl');
+ var strictSSL = npm.config.get('strict-ssl');
// Create a tmp dir. Using /tmp is a problem because it's often on a different partition and sehll.mv()
// fails in this case with "EXDEV, cross-device link not permitted".
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org