You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2019/11/15 08:36:27 UTC
[cordova-electron] 03/03: chore: update development dependencies
(#67)
This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-electron.git
commit c5df1de68979447179534ed3d410a8451865b05b
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Fri Sep 13 11:25:37 2019 +0900
chore: update development dependencies (#67)
* Drop devDependencies tmp
* Update devDependencies
* eslint@^6.1.0
* eslint-config-semistandard@^14.0.0
* eslint-config-standard@^13.0.1
* eslint-plugin-import@^2.18.2
* eslint-plugin-promise@^4.2.1
* fix: eslint errors from dependency update
---
bin/templates/cordova/Api.js | 10 +-
bin/templates/cordova/handler.js | 2 +-
bin/templates/cordova/lib/build.js | 4 +-
bin/templates/cordova/lib/prepare.js | 10 +-
bin/templates/cordova/parser.js | 2 +-
package-lock.json | 201 +++++++++++++--------
package.json | 15 +-
tests/spec/unit/Api.spec.js | 10 +-
tests/spec/unit/create.spec.js | 2 +-
.../cordova/lib/ManifestJsonParser.spec.js | 10 +-
.../cordova/lib/PackageJsonParser.spec.js | 4 +-
.../spec/unit/templates/cordova/lib/build.spec.js | 26 +--
.../unit/templates/cordova/lib/prepare.spec.js | 25 +--
tests/spec/unit/templates/cordova/lib/util.spec.js | 6 +-
tests/spec/unit/templates/parser.spec.js | 24 +--
15 files changed, 200 insertions(+), 151 deletions(-)
diff --git a/bin/templates/cordova/Api.js b/bin/templates/cordova/Api.js
index 5c337ef..0cdab8c 100644
--- a/bin/templates/cordova/Api.js
+++ b/bin/templates/cordova/Api.js
@@ -237,15 +237,15 @@ class Api {
* should be written to.
*/
_addModulesInfo (platform, plugin, targetDir) {
- let installedModules = this._platformJson.root.modules || [];
+ const installedModules = this._platformJson.root.modules || [];
const installedPaths = installedModules.map((installedModule) => installedModule.file);
- let modulesToInstall = plugin.getJsModules(platform)
+ const modulesToInstall = plugin.getJsModules(platform)
.filter((moduleToInstall) => installedPaths.indexOf(moduleToInstall.file) === -1)
.map((moduleToInstall) => {
const moduleName = plugin.id + '.' + (moduleToInstall.name || moduleToInstall.src.match(/([^\/]+)\.js/)[1]);
- let obj = {
+ const obj = {
file: ['plugins', plugin.id, moduleToInstall.src].join('/'),
id: moduleName,
pluginId: plugin.id
@@ -348,8 +348,8 @@ Api.updatePlatform = () => Promise.resolve();
Api.createPlatform = function (dest, config, options, events) {
events = setupEvents(events);
- let name = config ? config.name() : 'HelloCordova';
- let id = config ? config.packageName() : 'io.cordova.hellocordova';
+ const name = config ? config.name() : 'HelloCordova';
+ const id = config ? config.packageName() : 'io.cordova.hellocordova';
try {
// we create the project using our scripts in this platform
diff --git a/bin/templates/cordova/handler.js b/bin/templates/cordova/handler.js
index 40ede40..c0fec63 100644
--- a/bin/templates/cordova/handler.js
+++ b/bin/templates/cordova/handler.js
@@ -101,7 +101,7 @@ module.exports = {
events.emit('verbose', 'resource-file.uninstall is not supported for electron');
}
},
- 'framework': {
+ framework: {
install: (obj, plugin_dir, project_dir, plugin_id, options) => {
events.emit('verbose', 'framework.install is not supported for electron');
},
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 6dd6ab9..c5d1e97 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -139,7 +139,7 @@ class ElectronBuilder {
* If the arch value is identified, we will update each default package with the correct arch.
*/
const platformDefaults = this.fetchPlatformDefaults(PLATFORM_MAPPING[platform]);
- let platformTargetPackages = platformDefaults.config[platform].target;
+ const platformTargetPackages = platformDefaults.config[platform].target;
if (platformConfigs.arch) {
platformTargetPackages.forEach((pkg, i) => {
@@ -207,7 +207,7 @@ class ElectronBuilder {
]
};
- for (let option in platformConfigs) {
+ for (const option in platformConfigs) {
if (
PLATFORM_TOP_LEVEL_OPTIONS['allPlatforms'].includes(option)
|| PLATFORM_TOP_LEVEL_OPTIONS[platform].includes(option)
diff --git a/bin/templates/cordova/lib/prepare.js b/bin/templates/cordova/lib/prepare.js
index 718c545..351fdeb 100644
--- a/bin/templates/cordova/lib/prepare.js
+++ b/bin/templates/cordova/lib/prepare.js
@@ -130,7 +130,7 @@ function prepareSplashScreens (splashScreens) {
// iterate over remaining icon elements to find the icons for the app and installer
for (let i = 0; i < splashScreens.length; i++) {
- let image = splashScreens[i];
+ const image = splashScreens[i];
image.extension = path.extname(image.src);
splashScreen = splashScreen ? chooseOne(splashScreen, image) : image;
@@ -220,7 +220,7 @@ function prepareIcons (icons) {
// iterate over remaining icon elements to find the icons for the app and installer
for (let i = 0; i < remainingIcons.length; i++) {
// if (fs.existsSync(icons[i].src)) {
- let icon = remainingIcons[i];
+ const icon = remainingIcons[i];
const size = icon.width || icon.height;
icon.extension = path.extname(icon.src);
@@ -254,7 +254,7 @@ function findHighResIcons (icons) {
: false
);
- let highResIcons = icons.filter(icon => {
+ const highResIcons = icons.filter(icon => {
if (icon.src.includes('@')) {
const extension = path.extname(icon.src);
const suffix = icon.src.split('@').pop().slice(0, -extension.length);
@@ -291,7 +291,7 @@ function findHighResIcons (icons) {
* Map resources to the appropriate target directory and name.
*/
function createResourceMap (cordovaProject, locations, resources) {
- let resourceMap = [];
+ const resourceMap = [];
for (const key in resources) {
const resource = resources[key];
@@ -339,7 +339,7 @@ function createResourceMap (cordovaProject, locations, resources) {
* Get a map containing resources of a specified name (or directory) to the target directory.
*/
function mapResources (rootDir, sourcePath, targetPath) {
- let pathMap = {};
+ const pathMap = {};
shell.ls(path.join(rootDir, sourcePath)).forEach(() => {
pathMap[sourcePath] = targetPath;
});
diff --git a/bin/templates/cordova/parser.js b/bin/templates/cordova/parser.js
index cf137db..4910e2b 100644
--- a/bin/templates/cordova/parser.js
+++ b/bin/templates/cordova/parser.js
@@ -58,7 +58,7 @@ class Parser {
const platform_www = path.join(this.path, 'platform_www');
const my_www = this.www_dir();
// add cordova www and platform_www to sourceDirs
- let sourceDirs = [
+ const sourceDirs = [
path.relative(cordovaProject.root, cordovaProject.locations.www),
path.relative(cordovaProject.root, platform_www)
];
diff --git a/package-lock.json b/package-lock.json
index 505a8cc..8fe32b6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -173,9 +173,9 @@
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"acorn": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz",
- "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz",
+ "integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==",
"dev": true
},
"acorn-jsx": {
@@ -1304,53 +1304,54 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"eslint": {
- "version": "5.16.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz",
- "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==",
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.3.0.tgz",
+ "integrity": "sha512-ZvZTKaqDue+N8Y9g0kp6UPZtS4FSY3qARxBs7p4f0H0iof381XHduqVerFWtK8DPtKmemqbqCFENWSQgPR/Gow==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
- "ajv": "^6.9.1",
+ "ajv": "^6.10.0",
"chalk": "^2.1.0",
"cross-spawn": "^6.0.5",
"debug": "^4.0.1",
"doctrine": "^3.0.0",
- "eslint-scope": "^4.0.3",
- "eslint-utils": "^1.3.1",
- "eslint-visitor-keys": "^1.0.0",
- "espree": "^5.0.1",
+ "eslint-scope": "^5.0.0",
+ "eslint-utils": "^1.4.2",
+ "eslint-visitor-keys": "^1.1.0",
+ "espree": "^6.1.1",
"esquery": "^1.0.1",
"esutils": "^2.0.2",
"file-entry-cache": "^5.0.1",
"functional-red-black-tree": "^1.0.1",
- "glob": "^7.1.2",
+ "glob-parent": "^5.0.0",
"globals": "^11.7.0",
"ignore": "^4.0.6",
"import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4",
- "inquirer": "^6.2.2",
- "js-yaml": "^3.13.0",
+ "inquirer": "^6.4.1",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.3.0",
- "lodash": "^4.17.11",
+ "lodash": "^4.17.14",
"minimatch": "^3.0.4",
"mkdirp": "^0.5.1",
"natural-compare": "^1.4.0",
"optionator": "^0.8.2",
- "path-is-inside": "^1.0.2",
"progress": "^2.0.0",
"regexpp": "^2.0.1",
- "semver": "^5.5.1",
- "strip-ansi": "^4.0.0",
- "strip-json-comments": "^2.0.1",
+ "semver": "^6.1.2",
+ "strip-ansi": "^5.2.0",
+ "strip-json-comments": "^3.0.1",
"table": "^5.2.3",
- "text-table": "^0.2.0"
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
},
"dependencies": {
"ansi-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
- "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
"debug": {
@@ -1362,27 +1363,39 @@
"ms": "^2.1.1"
}
},
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ },
"strip-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
- "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
- "ansi-regex": "^3.0.0"
+ "ansi-regex": "^4.1.0"
}
+ },
+ "strip-json-comments": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz",
+ "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==",
+ "dev": true
}
}
},
"eslint-config-semistandard": {
- "version": "13.0.0",
- "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-13.0.0.tgz",
- "integrity": "sha512-ZuImKnf/9LeZjr6dtRJ0zEdQbjBwXu0PJR3wXJXoQeMooICMrYPyD70O1tIA9Ng+wutgLjB7UXvZOKYPvzHg+w==",
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-14.0.0.tgz",
+ "integrity": "sha512-m01m2BQzG7nrrLVIG2Wr+htnfhc5RjzeXFESvSsh24uE8uLSrxo8nbcu6RAShfulrsv7Gp850Gct/oMaLHXUkg==",
"dev": true
},
"eslint-config-standard": {
- "version": "12.0.0",
- "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz",
- "integrity": "sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==",
+ "version": "13.0.1",
+ "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-13.0.1.tgz",
+ "integrity": "sha512-zLKp4QOgq6JFgRm1dDCVv1Iu0P5uZ4v5Wa4DTOkg2RFMxdCX/9Qf7lz9ezRj2dBRa955cWQF/O/LWEiYWAHbTw==",
"dev": true
},
"eslint-import-resolver-node": {
@@ -1587,17 +1600,17 @@
}
},
"eslint-plugin-node": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.1.tgz",
- "integrity": "sha512-ZjOjbjEi6jd82rIpFSgagv4CHWzG9xsQAVp1ZPlhRnnYxcTgENUVBvhYmkQ7GvT1QFijUSo69RaiOJKhMu6i8w==",
+ "version": "9.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-9.2.0.tgz",
+ "integrity": "sha512-2abNmzAH/JpxI4gEOwd6K8wZIodK3BmHbTxz4s79OIYwwIt2gkpEXlAouJXu4H1c9ySTnRso0tsuthSOZbUMlA==",
"dev": true,
"requires": {
- "eslint-plugin-es": "^1.3.1",
- "eslint-utils": "^1.3.1",
- "ignore": "^5.0.2",
+ "eslint-plugin-es": "^1.4.1",
+ "eslint-utils": "^1.4.2",
+ "ignore": "^5.1.1",
"minimatch": "^3.0.4",
- "resolve": "^1.8.1",
- "semver": "^5.5.0"
+ "resolve": "^1.10.1",
+ "semver": "^6.1.0"
},
"dependencies": {
"ignore": {
@@ -1605,6 +1618,12 @@
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz",
"integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==",
"dev": true
+ },
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
}
}
},
@@ -1621,9 +1640,9 @@
"dev": true
},
"eslint-scope": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
- "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
+ "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==",
"dev": true,
"requires": {
"esrecurse": "^4.1.0",
@@ -1646,14 +1665,14 @@
"dev": true
},
"espree": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz",
- "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==",
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.1.tgz",
+ "integrity": "sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ==",
"dev": true,
"requires": {
- "acorn": "^6.0.7",
- "acorn-jsx": "^5.0.0",
- "eslint-visitor-keys": "^1.0.0"
+ "acorn": "^7.0.0",
+ "acorn-jsx": "^5.0.2",
+ "eslint-visitor-keys": "^1.1.0"
}
},
"esprima": {
@@ -1691,32 +1710,6 @@
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
"dev": true
},
- "execa": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
- "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
- "requires": {
- "cross-spawn": "^5.0.1",
- "get-stream": "^3.0.0",
- "is-stream": "^1.1.0",
- "npm-run-path": "^2.0.0",
- "p-finally": "^1.0.0",
- "signal-exit": "^3.0.0",
- "strip-eof": "^1.0.0"
- },
- "dependencies": {
- "cross-spawn": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
- "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
- "requires": {
- "lru-cache": "^4.0.1",
- "shebang-command": "^1.2.0",
- "which": "^1.2.9"
- }
- }
- }
- },
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@@ -2012,6 +2005,15 @@
"path-is-absolute": "^1.0.0"
}
},
+ "glob-parent": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz",
+ "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
"global-dirs": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz",
@@ -2303,6 +2305,12 @@
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
},
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "dev": true
+ },
"is-finite": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
@@ -2319,6 +2327,15 @@
"number-is-nan": "^1.0.0"
}
},
+ "is-glob": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
"is-installed-globally": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz",
@@ -4299,6 +4316,32 @@
"integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=",
"requires": {
"execa": "^0.7.0"
+ },
+ "dependencies": {
+ "cross-spawn": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
+ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
+ "requires": {
+ "lru-cache": "^4.0.1",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ }
+ },
+ "execa": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
+ "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
+ "requires": {
+ "cross-spawn": "^5.0.1",
+ "get-stream": "^3.0.0",
+ "is-stream": "^1.1.0",
+ "npm-run-path": "^2.0.0",
+ "p-finally": "^1.0.0",
+ "signal-exit": "^3.0.0",
+ "strip-eof": "^1.0.0"
+ }
+ }
}
},
"test-exclude": {
@@ -4579,6 +4622,12 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
},
+ "v8-compile-cache": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz",
+ "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==",
+ "dev": true
+ },
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
diff --git a/package.json b/package.json
index a78d9cc..9f47bcf 100644
--- a/package.json
+++ b/package.json
@@ -31,17 +31,16 @@
"shelljs": "^0.5.3"
},
"devDependencies": {
- "eslint": "^5.16.0",
- "eslint-config-semistandard": "^13.0.0",
- "eslint-config-standard": "^12.0.0",
- "eslint-plugin-import": "^2.17.3",
- "eslint-plugin-node": "^8.0.1",
- "eslint-plugin-promise": "^4.1.1",
+ "eslint": "^6.1.0",
+ "eslint-config-semistandard": "^14.0.0",
+ "eslint-config-standard": "^13.0.1",
+ "eslint-plugin-import": "^2.18.2",
+ "eslint-plugin-node": "^9.1.0",
+ "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"jasmine": "^3.4.0",
"nyc": "^14.1.1",
- "rewire": "^4.0.1",
- "tmp": "^0.0.33"
+ "rewire": "^4.0.1"
},
"author": "Apache Software Foundation",
"contributors": [
diff --git a/tests/spec/unit/Api.spec.js b/tests/spec/unit/Api.spec.js
index 98f9ee3..d596297 100644
--- a/tests/spec/unit/Api.spec.js
+++ b/tests/spec/unit/Api.spec.js
@@ -236,8 +236,8 @@ describe('Api class', () => {
itemType: 'js-module',
name: 'testmodule',
src: 'www/plugin.js',
- clobbers: [ 'ModulePlugin.clobbers' ],
- merges: [ 'ModulePlugin.merges' ],
+ clobbers: ['ModulePlugin.clobbers'],
+ merges: ['ModulePlugin.merges'],
runs: true
}];
},
@@ -369,7 +369,7 @@ describe('Api class', () => {
it('asset plugin', () => {
fs.ensureDirSync(path.resolve(testProjectDir, 'www', 'js'));
- writeJson(path.resolve(testProjectDir, 'www', 'js', 'sample.json'), { 'title': 'sample' });
+ writeJson(path.resolve(testProjectDir, 'www', 'js', 'sample.json'), { title: 'sample' });
return api.removePlugin({
id: 'empty_plugin',
dir: pluginFixture,
@@ -410,8 +410,8 @@ describe('Api class', () => {
itemType: 'js-module',
name: 'testmodule',
src: 'www/plugin.js',
- clobbers: [ 'ModulePlugin.clobbers' ],
- merges: [ 'ModulePlugin.merges' ],
+ clobbers: ['ModulePlugin.clobbers'],
+ merges: ['ModulePlugin.merges'],
runs: true
}];
},
diff --git a/tests/spec/unit/create.spec.js b/tests/spec/unit/create.spec.js
index 85cd03d..aba039b 100644
--- a/tests/spec/unit/create.spec.js
+++ b/tests/spec/unit/create.spec.js
@@ -36,7 +36,7 @@ function createAndVerify (projectname, projectid) {
fs.ensureDirSync(tmpDir);
// create the project
- let command = util.format('"%s" "%s/%s" "%s" "%s"', createScriptPath, tmpDir, projectname, projectid, projectname);
+ const command = util.format('"%s" "%s/%s" "%s" "%s"', createScriptPath, tmpDir, projectname, projectid, projectname);
return_code = shell.exec(command).code;
expect(return_code).toBe(0);
diff --git a/tests/spec/unit/templates/cordova/lib/ManifestJsonParser.spec.js b/tests/spec/unit/templates/cordova/lib/ManifestJsonParser.spec.js
index 7212557..45169a8 100644
--- a/tests/spec/unit/templates/cordova/lib/ManifestJsonParser.spec.js
+++ b/tests/spec/unit/templates/cordova/lib/ManifestJsonParser.spec.js
@@ -92,7 +92,7 @@ describe('Testing ManifestJsonParser.js:', () => {
display: 'standalone',
orientation: 'any',
start_url: undefined,
- icons: [ ]
+ icons: []
};
expect(manifestJsonParser.manifest).toEqual(manifestJsonObj);
@@ -112,7 +112,7 @@ describe('Testing ManifestJsonParser.js:', () => {
version: 'whatever',
description: 'A sample Apache Cordova application.',
author: 'Cordova Team',
- icons: [ { src: 'res/electron/cordova.png', type: 'image/png', sizes: '16x16' } ]
+ icons: [{ src: 'res/electron/cordova.png', type: 'image/png', sizes: '16x16' }]
};
expect(manifestJsonParser.manifest).toEqual(manifestJsonObj);
});
@@ -132,7 +132,7 @@ describe('Testing ManifestJsonParser.js:', () => {
version: 'whatever',
description: 'A sample Apache Cordova application.',
author: 'Cordova Team',
- icons: [ ]
+ icons: []
};
expect(manifestJsonParser.manifest).toEqual(manifestJsonObj);
});
@@ -176,7 +176,7 @@ describe('Testing ManifestJsonParser.js:', () => {
background_color: '#FFF',
display: 'standalone',
orientation: 'any',
- icons: [ ]
+ icons: []
};
const manifestPath = writeFileSyncSpy.calls.argsFor(0)[0];
@@ -217,7 +217,7 @@ describe('Testing ManifestJsonParser.js:', () => {
version: 'whatever',
description: 'A sample Apache Cordova application.',
author: 'Cordova Team',
- icons: [ { src: 'res/electron/cordova.png', type: 'image/png', sizes: '16x16' } ]
+ icons: [{ src: 'res/electron/cordova.png', type: 'image/png', sizes: '16x16' }]
};
const manifestPath = writeFileSyncSpy.calls.argsFor(0)[0];
diff --git a/tests/spec/unit/templates/cordova/lib/PackageJsonParser.spec.js b/tests/spec/unit/templates/cordova/lib/PackageJsonParser.spec.js
index 811b76a..a823c1a 100644
--- a/tests/spec/unit/templates/cordova/lib/PackageJsonParser.spec.js
+++ b/tests/spec/unit/templates/cordova/lib/PackageJsonParser.spec.js
@@ -146,7 +146,7 @@ describe('PackageJsonParser class', () => {
it('should not warn that cordova-electron is defined as dev dependency.', () => {
// Fix defaultMockProjectPackageJson where cordova-* is devDependency
- let mockProjectPackageJson = Object.assign({}, defaultMockProjectPackageJson);
+ const mockProjectPackageJson = Object.assign({}, defaultMockProjectPackageJson);
mockProjectPackageJson.devDependencies = Object.assign({}, defaultMockProjectPackageJson.dependencies);
mockProjectPackageJson.dependencies = {};
@@ -156,7 +156,7 @@ describe('PackageJsonParser class', () => {
});
it('should not set package dependencies when project dependencies is missing.', () => {
- let mockProjectPackageJson = Object.assign({}, defaultMockProjectPackageJson);
+ const mockProjectPackageJson = Object.assign({}, defaultMockProjectPackageJson);
mockProjectPackageJson.devDependencies = Object.assign({}, defaultMockProjectPackageJson.dependencies);
delete mockProjectPackageJson.dependencies;
diff --git a/tests/spec/unit/templates/cordova/lib/build.spec.js b/tests/spec/unit/templates/cordova/lib/build.spec.js
index 1bb695e..50f600b 100644
--- a/tests/spec/unit/templates/cordova/lib/build.spec.js
+++ b/tests/spec/unit/templates/cordova/lib/build.spec.js
@@ -381,9 +381,9 @@ describe('Testing build.js:', () => {
it('should set configureUserBuildSettings for all 3 platforms without package.', () => {
// mock platformConfig, buildConfig and buildOptions Objects
const platformConfig = {
- mac: { arch: [ 'arch1', 'arch2' ], signing: { debug: 'debug', release: 'release', store: 'store' } },
- windows: { arch: [ 'arch1', 'arch2' ], signing: { debug: 'debug', release: 'release' } },
- linux: { arch: [ 'arch1', 'arch2' ] }
+ mac: { arch: ['arch1', 'arch2'], signing: { debug: 'debug', release: 'release', store: 'store' } },
+ windows: { arch: ['arch1', 'arch2'], signing: { debug: 'debug', release: 'release' } },
+ linux: { arch: ['arch1', 'arch2'] }
};
const buildConfig = {
@@ -425,7 +425,7 @@ describe('Testing build.js:', () => {
target: [
{
target: 'tar.gz',
- arch: [ 'arch1', 'arch2' ]
+ arch: ['arch1', 'arch2']
}
]
},
@@ -435,11 +435,11 @@ describe('Testing build.js:', () => {
target: [
{
target: 'dmg',
- arch: [ 'arch1', 'arch2' ]
+ arch: ['arch1', 'arch2']
},
{
target: 'zip',
- arch: [ 'arch1', 'arch2' ]
+ arch: ['arch1', 'arch2']
}
]
},
@@ -448,7 +448,7 @@ describe('Testing build.js:', () => {
target: [
{
target: 'nsis',
- arch: [ 'arch1', 'arch2' ]
+ arch: ['arch1', 'arch2']
}
]
}
@@ -520,16 +520,16 @@ describe('Testing build.js:', () => {
const expectedMac = {
target: [
- { target: 'package', arch: [ 'x64' ] },
- { target: 'package2', arch: [ 'x64' ] }
+ { target: 'package', arch: ['x64'] },
+ { target: 'package2', arch: ['x64'] }
],
type: '${BUILD_TYPE}',
icon: '${APP_INSTALLER_ICON}'
};
const expectedLinux = {
target: [
- { target: 'package', arch: [ 'x64' ] },
- { target: 'package2', arch: [ 'x64' ] }
+ { target: 'package', arch: ['x64'] },
+ { target: 'package2', arch: ['x64'] }
],
icon: '${APP_INSTALLER_ICON}'
};
@@ -1666,7 +1666,7 @@ describe('Testing build.js:', () => {
it('should have called configure and build.', () => {
const api = new Api(null);
const platformConfig = {
- mac: { arch: [ 'x64' ] }
+ mac: { arch: ['x64'] }
};
const buildConfig = {
electron: platformConfig,
@@ -1735,7 +1735,7 @@ describe('Testing build.js:', () => {
describe('Module exports help', () => {
it('should display help usage.', () => {
- let help = build.__get__('module.exports.help');
+ const help = build.__get__('module.exports.help');
const argv = { binPath: 'bin' };
diff --git a/tests/spec/unit/templates/cordova/lib/prepare.spec.js b/tests/spec/unit/templates/cordova/lib/prepare.spec.js
index 7c2eaaa..f39cbd8 100644
--- a/tests/spec/unit/templates/cordova/lib/prepare.spec.js
+++ b/tests/spec/unit/templates/cordova/lib/prepare.spec.js
@@ -157,6 +157,7 @@ class FakeParser {
constructor () {
fakeParserConstructorSpy();
}
+
write () {
fakeParserWriteSpy();
return this;
@@ -1073,7 +1074,7 @@ describe('Testing prepare.js:', () => {
width: 512,
height: 512
});
- const icons = [ app, installer ];
+ const icons = [app, installer];
const actual = prepareIcons(icons);
const expected = {
@@ -1111,7 +1112,7 @@ describe('Testing prepare.js:', () => {
width: 512,
height: 512
});
- const icons = [ app1, app2, installer, installer2 ];
+ const icons = [app1, app2, installer, installer2];
let actual = prepareIcons(icons);
let expected = {
@@ -1142,7 +1143,7 @@ describe('Testing prepare.js:', () => {
const highRes40 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@4x.png') });
const highRes80 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@8x.png') });
- const icons = [ highRes10, highRes15, highRes20, highRes40, highRes80 ];
+ const icons = [highRes10, highRes15, highRes20, highRes40, highRes80];
const actual = prepareIcons(icons);
const expected = {
@@ -1174,7 +1175,7 @@ describe('Testing prepare.js:', () => {
const highRes40 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@4x.png') });
const highRes80 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@8x.png') });
- const icons = [ installer, highRes10, highRes15, highRes20, highRes40, highRes80 ];
+ const icons = [installer, highRes10, highRes15, highRes20, highRes40, highRes80];
const actual = prepareIcons(icons);
const expected = {
@@ -1276,7 +1277,7 @@ describe('Testing prepare.js:', () => {
width: 512,
height: 512
});
- const icons = [ app, installer ];
+ const icons = [app, installer];
const actual = findHighResIcons(icons);
const expected = {
@@ -1306,7 +1307,7 @@ describe('Testing prepare.js:', () => {
width: 512,
height: 512
});
- const icons = [ app, installer, installer2 ];
+ const icons = [app, installer, installer2];
const actual = findHighResIcons(icons);
const expected = {
@@ -1323,7 +1324,7 @@ describe('Testing prepare.js:', () => {
const highRes40 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@4x.png') });
const highRes80 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@8x.png') });
- const icons = [ highRes15, highRes20, highRes40, highRes80 ];
+ const icons = [highRes15, highRes20, highRes40, highRes80];
expect(() => {
findHighResIcons(icons);
@@ -1339,7 +1340,7 @@ describe('Testing prepare.js:', () => {
const highRes40 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@4x.png') });
const highRes80 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@8x.png') });
- const icons = [ highRes10, highRes15, highRes20, highRes40, highRes80 ];
+ const icons = [highRes10, highRes15, highRes20, highRes40, highRes80];
const actual = findHighResIcons(icons);
const expected = {
@@ -1369,7 +1370,7 @@ describe('Testing prepare.js:', () => {
const highRes40 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@4x.png') });
const highRes80 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@8x.png') });
- const icons = [ installer, highRes10, highRes15, highRes20, highRes40, highRes80 ];
+ const icons = [installer, highRes10, highRes15, highRes20, highRes40, highRes80];
const actual = findHighResIcons(icons);
const expected = {
@@ -1393,7 +1394,7 @@ describe('Testing prepare.js:', () => {
const highRes40 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@4x.png') });
const highRes80 = mockGetImageItem({ src: path.join('res', 'electron', 'cordova@8x.png'), target: 'installer' });
- const icons = [ highRes10, highRes15, highRes20, highRes40, highRes80 ];
+ const icons = [highRes10, highRes15, highRes20, highRes40, highRes80];
const actual = findHighResIcons(icons);
const expected = {
@@ -1435,7 +1436,7 @@ describe('Testing prepare.js:', () => {
src: path.join('res', 'logo.png'),
platform: undefined
});
- let data = {
+ const data = {
customIcon: Object.assign(icon, { extension: '.png' }),
appIcon: undefined,
installerIcon: undefined,
@@ -1593,7 +1594,7 @@ describe('Testing prepare.js:', () => {
src: path.join('res', 'electron', 'splash.png'),
platform: 'electron'
});
- let data = {
+ const data = {
splashScreen: Object.assign(icon, { extension: '.png' })
};
diff --git a/tests/spec/unit/templates/cordova/lib/util.spec.js b/tests/spec/unit/templates/cordova/lib/util.spec.js
index 2f4fa2f..3825ddf 100644
--- a/tests/spec/unit/templates/cordova/lib/util.spec.js
+++ b/tests/spec/unit/templates/cordova/lib/util.spec.js
@@ -22,14 +22,14 @@ const util = require('../../../../../../bin/templates/cordova/lib/util');
describe('Testing util.js:', () => {
describe('deepMerge method', () => {
it('should deep merge objects and arrays.', () => {
- const mergeTo = { foo: 'bar', abc: [ 1, 2, 3 ] };
- const mergeWith = { food: 'candy', abc: [ 5 ] };
+ const mergeTo = { foo: 'bar', abc: [1, 2, 3] };
+ const mergeWith = { food: 'candy', abc: [5] };
const actual = util.deepMerge(mergeTo, mergeWith);
const expected = {
foo: 'bar',
food: 'candy',
- abc: [ 1, 2, 3, 5 ]
+ abc: [1, 2, 3, 5]
};
expect(actual).toEqual(expected);
diff --git a/tests/spec/unit/templates/parser.spec.js b/tests/spec/unit/templates/parser.spec.js
index 85427d2..0062cc0 100644
--- a/tests/spec/unit/templates/parser.spec.js
+++ b/tests/spec/unit/templates/parser.spec.js
@@ -37,7 +37,7 @@ describe('Parser class', () => {
it('should have valid electron project and set path', () => {
Parser.__set__('dirExists', jasmine.createSpy('dirExists').and.returnValue(true));
- let parser = new Parser(mockProjectPath);
+ const parser = new Parser(mockProjectPath);
expect(parser.path).toBe(mockProjectPath);
});
@@ -49,7 +49,7 @@ describe('Parser class', () => {
it('should return a resolved promise.', () => {
Parser.__set__('dirExists', jasmine.createSpy('dirExists').and.returnValue(true));
- let parser = new Parser(mockProjectPath);
+ const parser = new Parser(mockProjectPath);
const actual = parser.update_from_config();
expect(typeof actual).toBe(typeof Promise.resolve());
@@ -62,7 +62,7 @@ describe('Parser class', () => {
it('should return the projects www dir path.', () => {
Parser.__set__('dirExists', jasmine.createSpy('dirExists').and.returnValue(true));
- let parser = new Parser(mockProjectPath);
+ const parser = new Parser(mockProjectPath);
const actual = parser.www_dir();
expect(actual).toBe(path.join(mockProjectPath, 'www'));
@@ -90,7 +90,7 @@ describe('Parser class', () => {
mergeAndUpdateDir: mergeAndUpdateDirSpy
});
- let parser = new Parser(mockProjectPath);
+ const parser = new Parser(mockProjectPath);
const cordovaProject = {
root: 'mock',
@@ -113,12 +113,12 @@ describe('Parser class', () => {
let expectedEmit = 'Found "merges/electron" folder. Copying its contents into the electron project.';
expect(actualEmit).toBe(expectedEmit);
- let expectedSourceDirs = [
+ const expectedSourceDirs = [
'www',
path.join('..', mockProjectPath, 'platform_www'),
path.join('merges', 'electron')
];
- let expectedTargetDir = path.join('..', mockProjectPath, 'www');
+ const expectedTargetDir = path.join('..', mockProjectPath, 'www');
actualEmit = emitSpy.calls.argsFor(1)[1];
expectedEmit = `Merging and updating files from [${expectedSourceDirs.join(', ')}] to ${expectedTargetDir}`;
expect(actualEmit).toBe(expectedEmit);
@@ -144,7 +144,7 @@ describe('Parser class', () => {
mergeAndUpdateDir: mergeAndUpdateDirSpy
});
- let parser = new Parser(mockProjectPath);
+ const parser = new Parser(mockProjectPath);
const cordovaProject = {
root: 'mock',
@@ -167,11 +167,11 @@ describe('Parser class', () => {
let expectedEmit = 'Found "merges/electron" folder. Copying its contents into the electron project.';
expect(actualEmit).not.toBe(expectedEmit);
- let expectedSourceDirs = [
+ const expectedSourceDirs = [
'www',
path.join('..', mockProjectPath, 'platform_www')
];
- let expectedTargetDir = path.join('..', mockProjectPath, 'www');
+ const expectedTargetDir = path.join('..', mockProjectPath, 'www');
actualEmit = emitSpy.calls.argsFor(0)[1];
expectedEmit = `Merging and updating files from [${expectedSourceDirs.join(', ')}] to ${expectedTargetDir}`;
expect(actualEmit).toBe(expectedEmit);
@@ -186,7 +186,7 @@ describe('Parser class', () => {
it('should return the projects config.xml file path.', () => {
Parser.__set__('dirExists', jasmine.createSpy('dirExists').and.returnValue(true));
- let parser = new Parser(mockProjectPath);
+ const parser = new Parser(mockProjectPath);
const actual = parser.config_xml();
expect(actual).toBe(path.join(mockProjectPath, 'config.xml'));
@@ -204,7 +204,7 @@ describe('Parser class', () => {
Parser.__set__('dirExists', jasmine.createSpy('dirExists').and.returnValue(true));
- let parser = new Parser(mockProjectPath);
+ const parser = new Parser(mockProjectPath);
parser.update_project().then(() => {
expect(fsCopySyncSpy).toHaveBeenCalled();
@@ -229,7 +229,7 @@ describe('Parser class', () => {
logFileOp(msg);
// The emit message was.
- let actualEmit = emitSpy.calls.argsFor(0)[1];
+ const actualEmit = emitSpy.calls.argsFor(0)[1];
expect(emitSpy).toHaveBeenCalled();
expect(actualEmit).toBe(` ${msg}`);
});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org