cordova-serve
Advanced tools
Comparing version 2.0.1 to 3.0.0
{ | ||
"name": "cordova-serve", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Apache Cordova server support for cordova-lib and cordova-browser.", | ||
@@ -27,23 +27,23 @@ "main": "src/main.js", | ||
"dependencies": { | ||
"chalk": "^1.1.1", | ||
"chalk": "^2.4.1", | ||
"compression": "^1.6.0", | ||
"express": "^4.13.3", | ||
"opn": "^5.3.0", | ||
"shelljs": "^0.5.3" | ||
"which": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"jasmine": "^2.5.2", | ||
"eslint": "^4.0.0", | ||
"eslint-config-semistandard": "^11.0.0", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-plugin-import": "^2.3.0", | ||
"eslint-plugin-node": "^5.0.0", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"rewire": "^2.5.2" | ||
"jasmine": "^3.3.0", | ||
"eslint": "^5.0.0", | ||
"eslint-config-semistandard": "^13.0.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"eslint-plugin-node": "^8.0.0", | ||
"eslint-plugin-promise": "^4.0.0", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"rewire": "^4.0.1" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0", | ||
"npm": ">= 2.5.1" | ||
"node": ">= 6", | ||
"npm": ">= 3" | ||
} | ||
} |
@@ -23,2 +23,9 @@ <!-- | ||
### 3.0.0 (Dec 20, 2018) | ||
* [CB-14198](https://issues.apache.org/jira/browse/CB-14198) (all) Fix bug when running simulate --target= under non-US **Windows** 10 (#14) | ||
* Don't restore mocked resource prior to resolution (#15) | ||
* Dependency updates & replacing shelljs with which | ||
* [CB-14069](https://issues.apache.org/jira/browse/CB-14069) Drop Node 4, Add Node 10 Support | ||
* [CB-14191](https://issues.apache.org/jira/browse/CB-14191) (android) Fix bug with module requiring (#10) | ||
### 2.0.1 (Jun 06, 2018) | ||
@@ -25,0 +32,0 @@ * Use `opn` module instead of deprecated `open` |
@@ -21,2 +21,3 @@ /** | ||
var browser = rewire("../src/browser"); | ||
var regItemPattern = browser.__get__("regItemPattern"); | ||
@@ -38,15 +39,22 @@ function expectPromise(obj){ | ||
it('should return a promise', function(done) { | ||
var mockOpen = jasmine.createSpy('mockOpen'); | ||
var origOpen = browser.__get__('open'); // so we can be nice and restore it later | ||
browser.__set__('open',mockOpen); | ||
var result = browser(); | ||
expect(result).toBeDefined(); | ||
expectPromise(result); | ||
result.then(function(res) { | ||
browser.__set__('open', origOpen); | ||
done(); | ||
}) | ||
.catch(function(err) { | ||
browser.__set__('open', origOpen); | ||
done(err); | ||
}); | ||
result.catch(function(err){ | ||
done(); | ||
}); | ||
}); | ||
it('should call open() when target is `default`', function(done) { | ||
var mockOpen = jasmine.createSpy('mockOpen'); | ||
@@ -62,10 +70,31 @@ var origOpen = browser.__get__('open'); // so we can be nice and restore it later | ||
expectPromise(result); | ||
result.then(function(res) { | ||
expect(mockOpen).toHaveBeenCalledWith(mockUrl); | ||
browser.__set__('open', origOpen); | ||
done(); | ||
}) | ||
.catch(function(err) { | ||
browser.__set__('open', origOpen); | ||
done(err); | ||
}); | ||
}); | ||
expect(mockOpen).toHaveBeenCalledWith(mockUrl); | ||
browser.__set__('open', origOpen); | ||
it('should recognize browser from registry with key "Default" on English Windows 10', function(done) { | ||
var result = regItemPattern.exec("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.EXE (Default) REG_SZ C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"); | ||
expect(result[2]).toBe("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe") | ||
done(); | ||
}); | ||
it('should recognize browser from registry with key "Standard" on non-English Windows 10', function(done) { | ||
var result = regItemPattern.exec("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.EXE (Standard) REG_SZ C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"); | ||
expect(result[2]).toBe("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe") | ||
done(); | ||
}); | ||
}); | ||
it('should recognize browser with non-Latin registry key on Russian Windows 10', function(done) { | ||
var result = regItemPattern.exec("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.EXE (�� 㬮�砭��) REG_SZ C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"); | ||
expect(result[2]).toBe("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe") | ||
done(); | ||
}); | ||
}); |
@@ -25,2 +25,3 @@ /** | ||
var open = require('opn'); | ||
var which = require('which'); | ||
var exec = require('./exec'); | ||
@@ -202,3 +203,3 @@ | ||
var regItemPattern = /\s*\(Default\)\s+(REG_SZ)\s+([^\s].*)\s*/; | ||
var regItemPattern = /\s*\([^)]+\)\s+(REG_SZ)\s+([^\s].*)\s*/; | ||
function browserInstalled (browser) { | ||
@@ -211,3 +212,3 @@ // On Windows, the 'start' command searches the path then 'App Paths' in the registry. | ||
var promise = new Promise(function (resolve, reject) { | ||
if (require('shelljs').which(browser)) { | ||
if (which.sync(browser, { nothrow: true })) { | ||
return resolve(); | ||
@@ -214,0 +215,0 @@ } else { |
@@ -33,3 +33,3 @@ /* | ||
try { | ||
var opt = {cwd: opt_cwd, maxBuffer: 1024000}; | ||
var opt = { cwd: opt_cwd, maxBuffer: 1024000 }; | ||
var timerID = 0; | ||
@@ -36,0 +36,0 @@ if (process.platform === 'linux') { |
@@ -81,3 +81,3 @@ /** | ||
try { | ||
var Api = require(path.join(cordovaProjectRoot, 'platforms', platformName, 'cordova/api')); | ||
var Api = require(path.join(cordovaProjectRoot, 'platforms', platformName, 'cordova/Api')); | ||
return new Api().locations.www; | ||
@@ -84,0 +84,0 @@ } catch (e) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
54698
723
+ Addedwhich@^1.3.0
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedwhich@1.3.1(transitive)
- Removedshelljs@^0.5.3
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedshelljs@0.5.3(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
Updatedchalk@^2.4.1