You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dp...@apache.org on 2018/06/02 06:28:41 UTC

[cordova-common] branch 2.2.x updated (e98283d -> 6530ce7)

This is an automated email from the ASF dual-hosted git repository.

dpogue pushed a change to branch 2.2.x
in repository https://gitbox.apache.org/repos/asf/cordova-common.git.


    from e98283d  CB-14112: Updated version and RELEASENOTES.md for release 2.2.2
     new 6d4193c  Revert "Use .includes and .startsWith instead of .indexOf"
     new 027e96a  Keep testing against node 4 on 2.2.x
     new 6530ce7  CB-14112: Updated version and RELEASENOTES.md for release 2.2.3

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis.yml                                         | 1 +
 RELEASENOTES.md                                     | 3 +++
 appveyor.yml                                        | 1 +
 package.json                                        | 2 +-
 spec/fixtures/projects/windows/www/cordova-2.6.0.js | 4 ++--
 src/ConfigChanges/ConfigFile.js                     | 6 +++---
 src/ConfigParser/ConfigParser.js                    | 2 +-
 src/CordovaLogger.js                                | 6 +++---
 src/PlatformJson.js                                 | 4 ++--
 src/superspawn.js                                   | 2 +-
 src/util/xml-helpers.js                             | 6 +++---
 11 files changed, 21 insertions(+), 16 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
dpogue@apache.org.

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


[cordova-common] 01/03: Revert "Use .includes and .startsWith instead of .indexOf"

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dpogue pushed a commit to branch 2.2.x
in repository https://gitbox.apache.org/repos/asf/cordova-common.git

commit 6d4193c27bc00507f618bc45a76a53a24a72a429
Author: Darryl Pogue <da...@dpogue.ca>
AuthorDate: Fri Jun 1 23:18:27 2018 -0700

    Revert "Use .includes and .startsWith instead of .indexOf"
    
    This reverts commit 3e9a4efdcc8670c015cf6fd5419ef9bbb9f9cf40.
    This restores compatibility with nodeJS 4.x.
---
 spec/fixtures/projects/windows/www/cordova-2.6.0.js | 4 ++--
 src/ConfigChanges/ConfigFile.js                     | 6 +++---
 src/ConfigParser/ConfigParser.js                    | 2 +-
 src/CordovaLogger.js                                | 6 +++---
 src/PlatformJson.js                                 | 4 ++--
 src/superspawn.js                                   | 2 +-
 src/util/xml-helpers.js                             | 6 +++---
 7 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/spec/fixtures/projects/windows/www/cordova-2.6.0.js b/spec/fixtures/projects/windows/www/cordova-2.6.0.js
index f8c32b2..bb99ae6 100644
--- a/spec/fixtures/projects/windows/www/cordova-2.6.0.js
+++ b/spec/fixtures/projects/windows/www/cordova-2.6.0.js
@@ -2611,7 +2611,7 @@ function getBasicAuthHeader(urlString) {
         var origin = protocol + url.host;
 
         // check whether there are the username:password credentials in the url
-        if (!url.href.startsWith(origin)) { // credentials found
+        if (url.href.indexOf(origin) != 0) { // credentials found
             var atIndex = url.href.indexOf("@");
             credentials = url.href.substring(protocol.length, atIndex);
         }
@@ -6266,7 +6266,7 @@ module.exports = {
 
         var name = "unknown";
         hostNames.some(function (nm) {
-            if (nm.displayName.includes(".local")) {
+            if (nm.displayName.indexOf(".local") > -1) {
                 name = nm.displayName.split(".local")[0];
                 return true;
             }
diff --git a/src/ConfigChanges/ConfigFile.js b/src/ConfigChanges/ConfigFile.js
index 54353ef..2e5ed5f 100644
--- a/src/ConfigChanges/ConfigFile.js
+++ b/src/ConfigChanges/ConfigFile.js
@@ -168,16 +168,16 @@ function resolveConfigFilePath (project_dir, platform, file) {
 
     file = path.normalize(file);
 
-    if (file.includes('*')) {
+    if (file.indexOf('*') > -1) {
         // handle wildcards in targets using glob.
         matches = modules.glob.sync(path.join(project_dir, '**', file));
         if (matches.length) filepath = matches[0];
 
         // [CB-5989] multiple Info.plist files may exist. default to $PROJECT_NAME-Info.plist
-        if (matches.length > 1 && file.includes('-Info.plist')) {
+        if (matches.length > 1 && file.indexOf('-Info.plist') > -1) {
             var plistName = getIOSProjectname(project_dir) + '-Info.plist';
             for (var i = 0; i < matches.length; i++) {
-                if (matches[i].includes(plistName)) {
+                if (matches[i].indexOf(plistName) > -1) {
                     filepath = matches[i];
                     break;
                 }
diff --git a/src/ConfigParser/ConfigParser.js b/src/ConfigParser/ConfigParser.js
index a393755..1a98c3a 100644
--- a/src/ConfigParser/ConfigParser.js
+++ b/src/ConfigParser/ConfigParser.js
@@ -57,7 +57,7 @@ function getCordovaNamespacePrefix (doc) {
     var rootAtribs = Object.getOwnPropertyNames(doc.getroot().attrib);
     var prefix = 'cdv';
     for (var j = 0; j < rootAtribs.length; j++) {
-        if (rootAtribs[j].startsWith('xmlns:') &&
+        if (rootAtribs[j].indexOf('xmlns:') === 0 &&
             doc.getroot().attrib[rootAtribs[j]] === 'http://cordova.apache.org/ns/1.0') {
             var strings = rootAtribs[j].split(':');
             prefix = strings[1];
diff --git a/src/CordovaLogger.js b/src/CordovaLogger.js
index b5c3564..4d77608 100644
--- a/src/CordovaLogger.js
+++ b/src/CordovaLogger.js
@@ -161,9 +161,9 @@ CordovaLogger.prototype.setLevel = function (logLevel) {
  * @return  {CordovaLogger}     Current instance, to allow calls chaining.
  */
 CordovaLogger.prototype.adjustLevel = function (opts) {
-    if (opts.verbose || (Array.isArray(opts) && opts.includes('--verbose'))) {
+    if (opts.verbose || (Array.isArray(opts) && opts.indexOf('--verbose') !== -1)) {
         this.setLevel('verbose');
-    } else if (opts.silent || (Array.isArray(opts) && opts.includes('--silent'))) {
+    } else if (opts.silent || (Array.isArray(opts) && opts.indexOf('--silent') !== -1)) {
         this.setLevel('error');
     }
 
@@ -209,7 +209,7 @@ function formatError (error, isVerbose) {
         message = error;
     }
 
-    if (typeof message === 'string' && !message.toUpperCase().startsWith('ERROR:')) {
+    if (typeof message === 'string' && message.toUpperCase().indexOf('ERROR:') !== 0) {
         // Needed for backward compatibility with external tools
         message = 'Error: ' + message;
     }
diff --git a/src/PlatformJson.js b/src/PlatformJson.js
index 86dace3..7eaf1a2 100644
--- a/src/PlatformJson.js
+++ b/src/PlatformJson.js
@@ -111,7 +111,7 @@ PlatformJson.prototype.addPluginMetadata = function (pluginInfo) {
         })
         .filter(function (metadata) {
             // Filter out modules which are already added to metadata
-            return !installedPaths.includes(metadata.file);
+            return installedPaths.indexOf(metadata.file) === -1;
         });
 
     this.root.modules = installedModules.concat(modulesToInstall);
@@ -151,7 +151,7 @@ PlatformJson.prototype.removePluginMetadata = function (pluginInfo) {
     this.root.modules = installedModules
         .filter(function (installedModule) {
             // Leave only those metadatas which 'file' is not in removed modules
-            return !modulesToRemove.includes(installedModule.file);
+            return (modulesToRemove.indexOf(installedModule.file) === -1);
         });
 
     if (this.root.plugin_metadata) {
diff --git a/src/superspawn.js b/src/superspawn.js
index 99e3057..8051184 100644
--- a/src/superspawn.js
+++ b/src/superspawn.js
@@ -30,7 +30,7 @@ var iswin32 = process.platform === 'win32';
 function resolveWindowsExe (cmd) {
     var winExtensions = ['.exe', '.bat', '.cmd', '.js', '.vbs'];
     function isValidExe (c) {
-        return winExtensions.includes(path.extname(c)) && fs.existsSync(c);
+        return winExtensions.indexOf(path.extname(c)) !== -1 && fs.existsSync(c);
     }
     if (isValidExe(cmd)) {
         return cmd;
diff --git a/src/util/xml-helpers.js b/src/util/xml-helpers.js
index ca65bfa..31922be 100644
--- a/src/util/xml-helpers.js
+++ b/src/util/xml-helpers.js
@@ -254,7 +254,7 @@ var BLACKLIST = ['platform', 'feature', 'plugin', 'engine'];
 var SINGLETONS = ['content', 'author', 'name'];
 function mergeXml (src, dest, platform, clobber) {
     // Do nothing for blacklisted tags.
-    if (BLACKLIST.includes(src.tag)) return;
+    if (BLACKLIST.indexOf(src.tag) !== -1) return;
 
     // Handle attributes
     Object.getOwnPropertyNames(src.attrib).forEach(function (attribute) {
@@ -286,9 +286,9 @@ function mergeXml (src, dest, platform, clobber) {
         var query = srcTag + '';
         var shouldMerge = true;
 
-        if (BLACKLIST.includes(srcTag)) return;
+        if (BLACKLIST.indexOf(srcTag) !== -1) return;
 
-        if (SINGLETONS.includes(srcTag)) {
+        if (SINGLETONS.indexOf(srcTag) !== -1) {
             foundChild = dest.find(query);
             if (foundChild) {
                 destChild = foundChild;

-- 
To stop receiving notification emails like this one, please contact
dpogue@apache.org.

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


[cordova-common] 02/03: Keep testing against node 4 on 2.2.x

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dpogue pushed a commit to branch 2.2.x
in repository https://gitbox.apache.org/repos/asf/cordova-common.git

commit 027e96a3a15da275ad5f38c6f27ea94ddda01705
Author: Darryl Pogue <da...@dpogue.ca>
AuthorDate: Fri Jun 1 23:19:27 2018 -0700

    Keep testing against node 4 on 2.2.x
---
 .travis.yml  | 1 +
 appveyor.yml | 1 +
 2 files changed, 2 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 25b631d..b4e310d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,7 @@ sudo: false
 git:
   depth: 10
 node_js:
+  - "4"
   - "6"
   - "8"
   - "10"
diff --git a/appveyor.yml b/appveyor.yml
index f34dfbd..5302ae0 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -3,6 +3,7 @@
 
 environment:
   matrix:
+  - nodejs_version: "4"
   - nodejs_version: "6"
   - nodejs_version: "8"
   - nodejs_version: "10"

-- 
To stop receiving notification emails like this one, please contact
dpogue@apache.org.

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


[cordova-common] 03/03: CB-14112: Updated version and RELEASENOTES.md for release 2.2.3

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dpogue pushed a commit to branch 2.2.x
in repository https://gitbox.apache.org/repos/asf/cordova-common.git

commit 6530ce7fd48777e91332754019f516ebc232da1d
Author: Darryl Pogue <da...@dpogue.ca>
AuthorDate: Fri Jun 1 23:22:45 2018 -0700

    CB-14112: Updated version and RELEASENOTES.md for release 2.2.3
---
 RELEASENOTES.md | 3 +++
 package.json    | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 409fc6f..bc4fe14 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -20,6 +20,9 @@
 -->
 # Cordova-common Release Notes
 
+### 2.2.3 (June 1, 2018)
+* Revert a minor refactoring that was incompatible with NodeJS 4.x. No change to functionality.
+
 ### 2.2.2 (May 30, 2018)
 * [CB-13979](https://issues.apache.org/jira/browse/CB-13979) More consistency for `config.xml` lookups
 * [CB-14064](https://issues.apache.org/jira/browse/CB-14064) Remove Node 4 from CI matrix
diff --git a/package.json b/package.json
index 413f21c..6efe5b4 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
   "name": "cordova-common",
   "description": "Apache Cordova tools and platforms shared routines",
   "license": "Apache-2.0",
-  "version": "2.2.2",
+  "version": "2.2.3",
   "repository": {
     "type": "git",
     "url": "https://github.com/apache/cordova-common"

-- 
To stop receiving notification emails like this one, please contact
dpogue@apache.org.

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