Skip to content

Commit f1eda16

Browse files
authored
Merge pull request #70 from erisu/cordova9-prep
Browser Platform Release Preparation (Cordova 9)
2 parents 449c77e + bd9e7fc commit f1eda16

File tree

4 files changed

+38
-22
lines changed

4 files changed

+38
-22
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ temp
55
*.jar
66
.vscode
77
node_modules/
8+
coverage/
9+
.nyc_output/

bin/template/cordova/Api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ Api.prototype.prepare = function (cordovaProject, options) {
211211
"sizes": "128x128"
212212
} ******/
213213
// ?Is it worth looking at file extentions?
214-
return {'src': icon.src,
214+
return { 'src': icon.src,
215215
'type': 'image/png',
216-
'sizes': (icon.width + 'x' + icon.height)};
216+
'sizes': (icon.width + 'x' + icon.height) };
217217
});
218218
manifestJson.icons = manifestIcons;
219219

@@ -230,7 +230,7 @@ Api.prototype.prepare = function (cordovaProject, options) {
230230
}
231231

232232
// get start_url
233-
var contentNode = this.config.doc.find('content') || {'attrib': {'src': 'index.html'}}; // sensible default
233+
var contentNode = this.config.doc.find('content') || { 'attrib': { 'src': 'index.html' } }; // sensible default
234234
manifestJson.start_url = contentNode.attrib.src;
235235

236236
// now we get some values from start_url page ...

bin/template/cordova/lib/run.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,18 @@ module.exports.run = function (args) {
4646
}
4747

4848
var server = cordovaServe();
49-
server.servePlatform('browser', {port: args.port, noServerInfo: true, noLogOutput: args.noLogOutput})
49+
server.servePlatform('browser', { port: args.port, noServerInfo: true, noLogOutput: args.noLogOutput })
5050
.then(function () {
5151
if (!startPage) {
5252
// failing all else, set the default
5353
startPage = 'index.html';
5454
}
55-
var projectUrl = url.resolve('http://localhost:' + server.port + '/', startPage);
55+
56+
var projectUrl = (new url.URL(`http://localhost:${server.port}/${startPage}`)).href;
57+
5658
console.log('startPage = ' + startPage);
5759
console.log('Static file server running @ ' + projectUrl + '\nCTRL + C to shut down');
58-
return server.launchBrowser({'target': args.target, 'url': projectUrl});
60+
return server.launchBrowser({ 'target': args.target, 'url': projectUrl });
5961
})
6062
.catch(function (error) {
6163
console.log(error.message || error.toString());

package.json

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,36 @@
99
"url": "https://github.com/apache/cordova-browser"
1010
},
1111
"bugs": {
12-
"url": "https://issues.apache.org/jira/browse/CB"
12+
"url": "https://github.com/apache/cordova-browser/issues"
1313
},
1414
"keywords": [
1515
"cordova",
1616
"browser",
1717
"apache"
1818
],
1919
"scripts": {
20-
"eslint": "eslint bin && eslint spec",
20+
"cover": "nyc jasmine",
21+
"eslint": "eslint bin spec",
2122
"jasmine": "jasmine",
22-
"test": "npm run eslint && npm run jasmine"
23+
"test": "npm run eslint && npm run cover"
2324
},
2425
"dependencies": {
25-
"cordova-common": "^3.0.0",
26-
"cordova-serve": "^2.0.0",
27-
"nopt": "^3.0.6",
26+
"cordova-common": "^3.1.0",
27+
"cordova-serve": "^3.0.0",
28+
"nopt": "^4.0.1",
2829
"shelljs": "^0.5.3"
2930
},
3031
"devDependencies": {
31-
"eslint": "^4.0.0",
32-
"eslint-config-semistandard": "^11.0.0",
33-
"eslint-config-standard": "^10.2.1",
34-
"eslint-plugin-import": "^2.3.0",
35-
"eslint-plugin-node": "^5.0.0",
36-
"eslint-plugin-promise": "^3.5.0",
37-
"eslint-plugin-standard": "^3.0.1",
38-
"jasmine": "^2.5.3",
39-
"tmp": "^0.0.26"
32+
"eslint": "^5.12.0",
33+
"eslint-config-semistandard": "^13.0.0",
34+
"eslint-config-standard": "^12.0.0",
35+
"eslint-plugin-import": "^2.14.0",
36+
"eslint-plugin-node": "^8.0.1",
37+
"eslint-plugin-promise": "^4.0.1",
38+
"eslint-plugin-standard": "^4.0.0",
39+
"jasmine": "^3.3.1",
40+
"nyc": "^13.1.0",
41+
"tmp": "0.0.33"
4042
},
4143
"author": "Apache Software Foundation",
4244
"contributors": [
@@ -57,5 +59,15 @@
5759
"engines": {
5860
"node": ">=6.0.0"
5961
},
60-
"engineStrict": true
62+
"engineStrict": true,
63+
"nyc": {
64+
"include": [
65+
"bin/lib/**",
66+
"bin/templates/cordova/**"
67+
],
68+
"reporter": [
69+
"lcov",
70+
"text"
71+
]
72+
}
6173
}

0 commit comments

Comments
 (0)