From f7d2a077236eefb9c2c7669ad084798ceaaf4dd2 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 14:56:53 -0400 Subject: [PATCH 001/141] chore(dependencies): add gulp --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c55b0068..5ce33a48 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From 3ac1e2e2b33ee028ac51eea64392a8d3585593b5 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 16:23:05 -0400 Subject: [PATCH 002/141] refactor(plugin.xml): generate ios references based on build target --- gulpfile.js | 49 ++++++++++++++++++++ plugin.template.xml | 108 ++++++++++++++++++++++++++++++++++++++++++++ plugin.xml | 38 ++++++++-------- 3 files changed, 176 insertions(+), 19 deletions(-) create mode 100644 gulpfile.js create mode 100644 plugin.template.xml diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..8303c81d --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,49 @@ +var gulp = require('gulp'); +var fs = require('fs'); + +//generate plugin.xml for use as a cordova plugin +//here we explode the contents of the frameworks +gulp.task('gen-npm-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + var files = []; + var root = 'src/ios/dependencies/'; + files = files.concat(emitFiles(root + 'Fabric/')); + files = files.concat(emitFiles(root + 'Branch-SDK/')); + files = files.concat(emitFiles(root + 'Branch-SDK/Requests/')); + + var newLineIndent = '\n '; + xml = xml.replace('', newLineIndent + + files.join(newLineIndent)); + + fs.writeFileSync('plugin.xml', xml); +}); + +//generate plugin.xml for local development +//here we reference the frameworks instead of all the files directly +gulp.task('gen-dev-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + xml = xml.replace('', + ''); + + fs.writeFileSync('plugin.xml', xml); +}); + +//emit array of cordova file references for all .h/.m files in path +function emitFiles(path){ + var ret = []; + for(filename of fs.readdirSync(path)){ + var fileType = null; + if(filename.match(/\.m$/)){ + fileType = 'source'; + }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + fileType = 'header'; + } + if(fileType){ + ret.push('<' + fileType + '-file src="' + path + filename + '" />'); + } + } + ret.push(''); + return ret; +} \ No newline at end of file diff --git a/plugin.template.xml b/plugin.template.xml new file mode 100644 index 00000000..5165dac0 --- /dev/null +++ b/plugin.template.xml @@ -0,0 +1,108 @@ + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + diff --git a/plugin.xml b/plugin.xml index 17420318..4ab7bb93 100644 --- a/plugin.xml +++ b/plugin.xml @@ -103,24 +103,26 @@ SOFTWARE. - - - - + + + From dbed3cc963f194030c02602f7032652373e80301 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 16:27:34 -0400 Subject: [PATCH 003/141] chore: delete local log file that ended up in repo --- testbed/npm-debug.log | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 testbed/npm-debug.log diff --git a/testbed/npm-debug.log b/testbed/npm-debug.log deleted file mode 100644 index 15585cf1..00000000 --- a/testbed/npm-debug.log +++ /dev/null @@ -1,39 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/Users/alexaustin/.nvm/v0.10.29/bin/node', -1 verbose cli '/Users/alexaustin/.nvm/v0.10.29/bin/npm', -1 verbose cli 'publish' ] -2 info using npm@1.4.14 -3 info using node@v0.10.29 -4 verbose publish [ '.' ] -5 verbose cache add [ '.', null ] -6 verbose cache add name=undefined spec="." args=[".",null] -7 verbose parsed url { protocol: null, -7 verbose parsed url slashes: null, -7 verbose parsed url auth: null, -7 verbose parsed url host: null, -7 verbose parsed url port: null, -7 verbose parsed url hostname: null, -7 verbose parsed url hash: null, -7 verbose parsed url search: null, -7 verbose parsed url query: null, -7 verbose parsed url pathname: '.', -7 verbose parsed url path: '.', -7 verbose parsed url href: '.' } -8 silly lockFile 3a52ce78- . -9 verbose lock . /Users/alexaustin/.npm/3a52ce78-.lock -10 silly lockFile 3a52ce78- . -11 silly lockFile 3a52ce78- . -12 error addLocal Could not install . -13 error Error: ENOENT, open 'package.json' -14 error If you need help, you may report this *entire* log, -14 error including the npm and node versions, at: -14 error -15 error System Darwin 15.5.0 -16 error command "/Users/alexaustin/.nvm/v0.10.29/bin/node" "/Users/alexaustin/.nvm/v0.10.29/bin/npm" "publish" -17 error cwd /Users/alexaustin/Documents/Javascript/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/testbed -18 error node -v v0.10.29 -19 error npm -v 1.4.14 -20 error path package.json -21 error code ENOENT -22 error errno 34 -23 verbose exit [ 34, true ] From aa96258f23a472d218fa0d28af79c9b9d1c83094 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 17:30:28 -0400 Subject: [PATCH 004/141] refactor(ios): automatically set correct header paths based on deployment --- .gitignore | 3 + gulpfile.js | 31 +++++- plugin.template.xml | 6 + plugin.xml | 192 -------------------------------- src/ios/AppDelegate+BranchSdk.m | 9 +- src/ios/BranchSDK.h | 15 ++- 6 files changed, 56 insertions(+), 200 deletions(-) delete mode 100644 plugin.xml diff --git a/.gitignore b/.gitignore index 83631f70..692b8299 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ testbed/hooks node_modules testbed/ul_web_hooks/ .installed + +/plugin.xml +src/ios/BranchNPM.h \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 8303c81d..4bf68ceb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,9 +1,21 @@ var gulp = require('gulp'); var fs = require('fs'); +//setup for development use +gulp.task('setupDev', function(){ + getDevPluginXML(); + setIosNpmOrDev('dev'); +}) + +//setup for npm deployment +gulp.task('setupNpm', function(){ + genNpmPluginXML(); + setIosNpmOrDev('npm'); +}); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks -gulp.task('gen-npm-plugin-xml', function(){ +function genNpmPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); var files = []; @@ -17,18 +29,29 @@ gulp.task('gen-npm-plugin-xml', function(){ + files.join(newLineIndent)); fs.writeFileSync('plugin.xml', xml); -}); +}; //generate plugin.xml for local development //here we reference the frameworks instead of all the files directly -gulp.task('gen-dev-plugin-xml', function(){ +function getDevPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); -}); +}; + +function setIosNpmOrDev(npmOrDev){ + if(npmOrDev === 'npm'){ + content = '#define BRANCH_NPM true'; + }else if(npmOrDev === 'dev'){ + content = '//empty'; + }else{ + throw new Error('expected deployed|local, not ' + deployedOrLocal); + } + fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); +} //emit array of cordova file references for all .h/.m files in path function emitFiles(path){ diff --git a/plugin.template.xml b/plugin.template.xml index 5165dac0..f415dbde 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,3 +1,8 @@ + + + + + - - - branch-cordova-sdk - Branch SDK Plugin - Apache 2.0 - cordova,branch - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $BRANCH_KEY - - - - - CFBundleURLName - io.branch.sdk - CFBundleURLSchemes - - $URI_SCHEME - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ios/AppDelegate+BranchSdk.m b/src/ios/AppDelegate+BranchSdk.m index bd0a480e..7e66c75a 100644 --- a/src/ios/AppDelegate+BranchSdk.m +++ b/src/ios/AppDelegate+BranchSdk.m @@ -7,7 +7,14 @@ // #import "AppDelegate.h" -#import + +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" +#else + #import +#endif @interface AppDelegate (BranchSDK) diff --git a/src/ios/BranchSDK.h b/src/ios/BranchSDK.h index c48f9ee6..020789f7 100644 --- a/src/ios/BranchSDK.h +++ b/src/ios/BranchSDK.h @@ -5,9 +5,18 @@ // Copyright © 2016 Branch Metrics. All rights reserved. // -#import -#import -#import +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" + #import "BranchLinkProperties.h" + #import "BranchUniversalObject.h" +#else + #import + #import + #import +#endif + #import @interface BranchSDK : CDVPlugin From 3353831c4d131f6f3890bbf60b2e33f033648dbd Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:34 -0400 Subject: [PATCH 005/141] fix(gulp): make plugin template comments valid xml --- plugin.template.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugin.template.xml b/plugin.template.xml index f415dbde..bd03c0ef 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,7 +1,4 @@ - - - + + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + + diff --git a/src/ios/BranchNPM.h b/src/ios/BranchNPM.h new file mode 100644 index 00000000..90fe1bcc --- /dev/null +++ b/src/ios/BranchNPM.h @@ -0,0 +1 @@ +//empty From 6acf939c9e01be059336dcf31ce4ca48b7b8f1b5 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:32:12 -0400 Subject: [PATCH 008/141] chore(ios): add script to update ios dependencies --- src/ios/dependencies/update.sh | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 src/ios/dependencies/update.sh diff --git a/src/ios/dependencies/update.sh b/src/ios/dependencies/update.sh new file mode 100755 index 00000000..7a133115 --- /dev/null +++ b/src/ios/dependencies/update.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#update the ios dependencies in this directory to those storied under passed tag on github + +#fail fast on errors +set -e + +#cd into directory containing this script +cd "$(dirname "$0")" + +#check first parameter is set to tag to download +if [ -z ${1+x} ]; then + echo "You must pass this script the tag to download" + exit -1 +else + echo "downloading tag '$1'" +fi + +#this is the git tag that we'll be updating to, +#we expecct it to be the first parameter to this script +tag_name=$1 +tag_url="https://github.com/BranchMetrics/ios-branch-deep-linking/archive/$tag_name.zip" +#extract is where we stick the extracted archive of the tag +tag_extract=ios-branch-deep-linking-$tag_name + + +#check that tag exists +tag_url_status=`curl -L -o /dev/null --silent --head --write-out '%{http_code}\n' $tag_url` +if [ $tag_url_status = "200" ]; then + echo "found tag" +else + echo "could not find '$tag_url'" + echo "curl returned status '$tag_url_status'" + exit -1 +fi + +#this will overwripte existing versions of sdk.zip +curl -L -o sdk.zip $tag_url + +#delete old extracted content or do nothing if we don't have any +rm -rf $tag_extract + +#silently (-q) extract download +unzip -q -x sdk.zip +rm -f sdk.zip + +#copy in new dependencies +rm -rf Branch-SDK +mv $tag_extract/Branch-SDK/Branch-SDK . + +rm -rf Branch.framework +mv $tag_extract/Branch.framework . + +rm -rf Fabric +mv $tag_extract/Branch-SDK/Fabric . + +#clean up +rm -rf $tag_extract + +#replace all instances of '#import "../Fabric/' with '#import "' in .m files +find . -type f -name '*.m' \ + -exec perl -i -pe 's/\#import \"\.\.\/Fabric\//#import "/' '{}' + From 9aed4f2736aa3d6432d74171c646570dfc27d8b6 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:43:40 -0400 Subject: [PATCH 009/141] chore(deployment): remove npmDeployment.txt it is now automated --- NPMdeployment.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 NPMdeployment.txt diff --git a/NPMdeployment.txt b/NPMdeployment.txt deleted file mode 100644 index 0f7bf0ec..00000000 --- a/NPMdeployment.txt +++ /dev/null @@ -1,5 +0,0 @@ -NPM deployment - -1. comment out iOS framework in plugin.xml -2. change header file references of Cordova iOS libs from to "Branch.h" -3. remove "../Fabric" from all Fabric related imports \ No newline at end of file From fcebba4938ca71a7d958b0aee4b70e7a23c88be8 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 13:11:47 -0400 Subject: [PATCH 010/141] chore(gulp): add `npm run commit` command --- package.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.json b/package.json index 5ce33a48..c6dbe4ae 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,9 @@ "ios" ], "license": "MIT", + "scripts": { + "commit": "git-cz" + }, "dependencies": { "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", @@ -38,11 +41,16 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "commitizen": "^2.8.2", + "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", "xml2js": "^0.4.16" + }, + "czConfig": { + "path": "node_modules/cz-conventional-changelog" } } From 04ed411e3f1e9037bd7e2e10473f9cdab08d534b Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 15:59:13 -0400 Subject: [PATCH 011/141] chore(commitizen): use modern commitizen config style --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c6dbe4ae..d70d69dd 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "rimraf": "^2.5.2", "xml2js": "^0.4.16" }, - "czConfig": { - "path": "node_modules/cz-conventional-changelog" + "config": { + "commitizen": { + "path": "node_modules/cz-conventional-changelog" + } } } From 20c41679c0d2b598c3aba584d795b1dddb1da50a Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 14:56:53 -0400 Subject: [PATCH 012/141] chore(dependencies): add gulp --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c55b0068..5ce33a48 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From c5711be53f04e4c0d39e6f6d4d49e1218398fb6c Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 16:23:05 -0400 Subject: [PATCH 013/141] refactor(plugin.xml): generate ios references based on build target --- gulpfile.js | 49 ++++++++++++++++++++ plugin.template.xml | 108 ++++++++++++++++++++++++++++++++++++++++++++ plugin.xml | 38 ++++++++-------- 3 files changed, 176 insertions(+), 19 deletions(-) create mode 100644 gulpfile.js create mode 100644 plugin.template.xml diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..8303c81d --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,49 @@ +var gulp = require('gulp'); +var fs = require('fs'); + +//generate plugin.xml for use as a cordova plugin +//here we explode the contents of the frameworks +gulp.task('gen-npm-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + var files = []; + var root = 'src/ios/dependencies/'; + files = files.concat(emitFiles(root + 'Fabric/')); + files = files.concat(emitFiles(root + 'Branch-SDK/')); + files = files.concat(emitFiles(root + 'Branch-SDK/Requests/')); + + var newLineIndent = '\n '; + xml = xml.replace('', newLineIndent + + files.join(newLineIndent)); + + fs.writeFileSync('plugin.xml', xml); +}); + +//generate plugin.xml for local development +//here we reference the frameworks instead of all the files directly +gulp.task('gen-dev-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + xml = xml.replace('', + ''); + + fs.writeFileSync('plugin.xml', xml); +}); + +//emit array of cordova file references for all .h/.m files in path +function emitFiles(path){ + var ret = []; + for(filename of fs.readdirSync(path)){ + var fileType = null; + if(filename.match(/\.m$/)){ + fileType = 'source'; + }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + fileType = 'header'; + } + if(fileType){ + ret.push('<' + fileType + '-file src="' + path + filename + '" />'); + } + } + ret.push(''); + return ret; +} \ No newline at end of file diff --git a/plugin.template.xml b/plugin.template.xml new file mode 100644 index 00000000..5165dac0 --- /dev/null +++ b/plugin.template.xml @@ -0,0 +1,108 @@ + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + diff --git a/plugin.xml b/plugin.xml index 17420318..4ab7bb93 100644 --- a/plugin.xml +++ b/plugin.xml @@ -103,24 +103,26 @@ SOFTWARE. - - - - + + + From 1684e50c6039b361509cefd8c52f35b1b9a86e87 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 17:30:28 -0400 Subject: [PATCH 014/141] refactor(ios): automatically set correct header paths based on deployment --- .gitignore | 3 + gulpfile.js | 31 +++++- plugin.template.xml | 6 + plugin.xml | 192 -------------------------------- src/ios/AppDelegate+BranchSdk.m | 9 +- src/ios/BranchSDK.h | 15 ++- 6 files changed, 56 insertions(+), 200 deletions(-) delete mode 100644 plugin.xml diff --git a/.gitignore b/.gitignore index 83631f70..692b8299 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ testbed/hooks node_modules testbed/ul_web_hooks/ .installed + +/plugin.xml +src/ios/BranchNPM.h \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 8303c81d..4bf68ceb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,9 +1,21 @@ var gulp = require('gulp'); var fs = require('fs'); +//setup for development use +gulp.task('setupDev', function(){ + getDevPluginXML(); + setIosNpmOrDev('dev'); +}) + +//setup for npm deployment +gulp.task('setupNpm', function(){ + genNpmPluginXML(); + setIosNpmOrDev('npm'); +}); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks -gulp.task('gen-npm-plugin-xml', function(){ +function genNpmPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); var files = []; @@ -17,18 +29,29 @@ gulp.task('gen-npm-plugin-xml', function(){ + files.join(newLineIndent)); fs.writeFileSync('plugin.xml', xml); -}); +}; //generate plugin.xml for local development //here we reference the frameworks instead of all the files directly -gulp.task('gen-dev-plugin-xml', function(){ +function getDevPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); -}); +}; + +function setIosNpmOrDev(npmOrDev){ + if(npmOrDev === 'npm'){ + content = '#define BRANCH_NPM true'; + }else if(npmOrDev === 'dev'){ + content = '//empty'; + }else{ + throw new Error('expected deployed|local, not ' + deployedOrLocal); + } + fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); +} //emit array of cordova file references for all .h/.m files in path function emitFiles(path){ diff --git a/plugin.template.xml b/plugin.template.xml index 5165dac0..f415dbde 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,3 +1,8 @@ + + + + + - - - branch-cordova-sdk - Branch SDK Plugin - Apache 2.0 - cordova,branch - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $BRANCH_KEY - - - - - CFBundleURLName - io.branch.sdk - CFBundleURLSchemes - - $URI_SCHEME - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ios/AppDelegate+BranchSdk.m b/src/ios/AppDelegate+BranchSdk.m index bd0a480e..7e66c75a 100644 --- a/src/ios/AppDelegate+BranchSdk.m +++ b/src/ios/AppDelegate+BranchSdk.m @@ -7,7 +7,14 @@ // #import "AppDelegate.h" -#import + +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" +#else + #import +#endif @interface AppDelegate (BranchSDK) diff --git a/src/ios/BranchSDK.h b/src/ios/BranchSDK.h index c48f9ee6..020789f7 100644 --- a/src/ios/BranchSDK.h +++ b/src/ios/BranchSDK.h @@ -5,9 +5,18 @@ // Copyright © 2016 Branch Metrics. All rights reserved. // -#import -#import -#import +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" + #import "BranchLinkProperties.h" + #import "BranchUniversalObject.h" +#else + #import + #import + #import +#endif + #import @interface BranchSDK : CDVPlugin From f7f537682416be6b9c3a862cb541d56c919154c7 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:34 -0400 Subject: [PATCH 015/141] fix(gulp): make plugin template comments valid xml --- plugin.template.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugin.template.xml b/plugin.template.xml index f415dbde..bd03c0ef 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,7 +1,4 @@ - - - + + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + + diff --git a/src/ios/BranchNPM.h b/src/ios/BranchNPM.h new file mode 100644 index 00000000..90fe1bcc --- /dev/null +++ b/src/ios/BranchNPM.h @@ -0,0 +1 @@ +//empty From 13b8846497275b452191bb5e008f116f5d69f221 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:32:12 -0400 Subject: [PATCH 018/141] chore(ios): add script to update ios dependencies --- src/ios/dependencies/update.sh | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 src/ios/dependencies/update.sh diff --git a/src/ios/dependencies/update.sh b/src/ios/dependencies/update.sh new file mode 100755 index 00000000..7a133115 --- /dev/null +++ b/src/ios/dependencies/update.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#update the ios dependencies in this directory to those storied under passed tag on github + +#fail fast on errors +set -e + +#cd into directory containing this script +cd "$(dirname "$0")" + +#check first parameter is set to tag to download +if [ -z ${1+x} ]; then + echo "You must pass this script the tag to download" + exit -1 +else + echo "downloading tag '$1'" +fi + +#this is the git tag that we'll be updating to, +#we expecct it to be the first parameter to this script +tag_name=$1 +tag_url="https://github.com/BranchMetrics/ios-branch-deep-linking/archive/$tag_name.zip" +#extract is where we stick the extracted archive of the tag +tag_extract=ios-branch-deep-linking-$tag_name + + +#check that tag exists +tag_url_status=`curl -L -o /dev/null --silent --head --write-out '%{http_code}\n' $tag_url` +if [ $tag_url_status = "200" ]; then + echo "found tag" +else + echo "could not find '$tag_url'" + echo "curl returned status '$tag_url_status'" + exit -1 +fi + +#this will overwripte existing versions of sdk.zip +curl -L -o sdk.zip $tag_url + +#delete old extracted content or do nothing if we don't have any +rm -rf $tag_extract + +#silently (-q) extract download +unzip -q -x sdk.zip +rm -f sdk.zip + +#copy in new dependencies +rm -rf Branch-SDK +mv $tag_extract/Branch-SDK/Branch-SDK . + +rm -rf Branch.framework +mv $tag_extract/Branch.framework . + +rm -rf Fabric +mv $tag_extract/Branch-SDK/Fabric . + +#clean up +rm -rf $tag_extract + +#replace all instances of '#import "../Fabric/' with '#import "' in .m files +find . -type f -name '*.m' \ + -exec perl -i -pe 's/\#import \"\.\.\/Fabric\//#import "/' '{}' + From 604c85f5b2384f8afc390379bdf49a86189140fb Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:43:40 -0400 Subject: [PATCH 019/141] chore(deployment): remove npmDeployment.txt it is now automated --- NPMdeployment.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 NPMdeployment.txt diff --git a/NPMdeployment.txt b/NPMdeployment.txt deleted file mode 100644 index 0f7bf0ec..00000000 --- a/NPMdeployment.txt +++ /dev/null @@ -1,5 +0,0 @@ -NPM deployment - -1. comment out iOS framework in plugin.xml -2. change header file references of Cordova iOS libs from to "Branch.h" -3. remove "../Fabric" from all Fabric related imports \ No newline at end of file From 6f054a156658c29cd3cee73f24930ff2e2792fc6 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 13:11:47 -0400 Subject: [PATCH 020/141] chore(gulp): add `npm run commit` command --- package.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.json b/package.json index 5ce33a48..c6dbe4ae 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,9 @@ "ios" ], "license": "MIT", + "scripts": { + "commit": "git-cz" + }, "dependencies": { "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", @@ -38,11 +41,16 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "commitizen": "^2.8.2", + "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", "xml2js": "^0.4.16" + }, + "czConfig": { + "path": "node_modules/cz-conventional-changelog" } } From 9ea986f7123896241d396d37a94d5320536f54aa Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 15:59:13 -0400 Subject: [PATCH 021/141] chore(commitizen): use modern commitizen config style --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c6dbe4ae..d70d69dd 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "rimraf": "^2.5.2", "xml2js": "^0.4.16" }, - "czConfig": { - "path": "node_modules/cz-conventional-changelog" + "config": { + "commitizen": { + "path": "node_modules/cz-conventional-changelog" + } } } From 81b672516b50978b19463411efa660f8a9b92d47 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:08:39 -0400 Subject: [PATCH 022/141] chore(babel): add es6 transpiler to gulpfile --- gulpfile.js | 32 +++++++++++++++++++++++++++++++- package.json | 5 +++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 4bf68ceb..614df6e1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,7 @@ var gulp = require('gulp'); var fs = require('fs'); +var sourcemaps = require('gulp-sourcemaps'); +var babel = require('gulp-babel'); //setup for development use gulp.task('setupDev', function(){ @@ -69,4 +71,32 @@ function emitFiles(path){ } ret.push(''); return ret; -} \ No newline at end of file +} + +//copy resources and compile es6 from corresponding directory +function babelize(taskName, dir){ + if(!dir){ + dir = taskName; + } + var srcDir = dir + '.es6/'; + var srcPattern = dir + '.es6/**/*.js' + var destDir = dir + '/'; + gulp.task(taskName + '-copy', () => { + return gulp.src(srcDir + '**/*.*').pipe(gulp.dest(destDir)); + }); + gulp.task(taskName + '-babel', [taskName + '-copy'], () => { + return gulp.src(srcPattern) + .pipe(sourcemaps.init()) + .pipe(babel({ + presets: ['es2015', 'stage-2'], + plugins: ['transform-runtime'] + })) + .pipe(sourcemaps.write('.')) + .pipe(gulp.dest(destDir)); + }); +} + +babelize('hooks'); +babelize('www'); +babelize('tests'); +babelize('testbed', 'testbed/www/js'); \ No newline at end of file diff --git a/package.json b/package.json index d70d69dd..7790bdb2 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,14 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "babel-plugin-transform-runtime": "^6.12.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-2": "^6.11.0", "commitizen": "^2.8.2", "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", + "gulp-babel": "^6.1.2", + "gulp-sourcemaps": "^1.6.0", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From 482737c8d50af7e11767ae51c8fb7cf01619be56 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:09:15 -0400 Subject: [PATCH 023/141] chore: use arrow functions instead of 'function' --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 614df6e1..94a6c789 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,13 +4,13 @@ var sourcemaps = require('gulp-sourcemaps'); var babel = require('gulp-babel'); //setup for development use -gulp.task('setupDev', function(){ +gulp.task('setupDev', () => { getDevPluginXML(); setIosNpmOrDev('dev'); }) //setup for npm deployment -gulp.task('setupNpm', function(){ +gulp.task('setupNpm', () => { genNpmPluginXML(); setIosNpmOrDev('npm'); }); From 9417503efbf2c9b270d51ef5aaff7c3f9c5efb13 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:13:46 -0400 Subject: [PATCH 024/141] chore(babel): add task to run all babel subtasks in parallel --- gulpfile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 94a6c789..8712f8e0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,8 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); +gulp.task('build-npm', ['setupNpm', 'babel']); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -74,7 +76,9 @@ function emitFiles(path){ } //copy resources and compile es6 from corresponding directory +babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ + babelTasks.push(taskName + '-babel'); if(!dir){ dir = taskName; } @@ -89,7 +93,7 @@ function babelize(taskName, dir){ .pipe(sourcemaps.init()) .pipe(babel({ presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] + plugins: ['transform-runtime'] //needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -99,4 +103,5 @@ function babelize(taskName, dir){ babelize('hooks'); babelize('www'); babelize('tests'); -babelize('testbed', 'testbed/www/js'); \ No newline at end of file +babelize('testbed', 'testbed/www/js'); +gulp.task('babel', babelTasks); \ No newline at end of file From 699ea466dfcc331d01424cd868788a20809846a4 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:19:34 -0400 Subject: [PATCH 025/141] chore(lint): add branch's code style prefs --- .eslintrc | 19 +++++++++++++++++++ .jscs | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .eslintrc create mode 100644 .jscs diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..c22590e4 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +{ + "parser": "babel-eslint", + "env": { "browser": true }, + "rules": { + "quotes": 0, + "strict": 0, + "no-underscore-dangle": 0, + "eqeqeq": 0, + "camelcase": 0, + "consistent-return": 0, + "new-cap": 0 + }, + "globals": { + "module": true, + "require": false, + "mixpanel": false, + "File": false + } +} \ No newline at end of file diff --git a/.jscs b/.jscs new file mode 100644 index 00000000..8385caae --- /dev/null +++ b/.jscs @@ -0,0 +1,42 @@ +{ + "fileExtensions": [".js", ".jsx"], + "esnext": true, + + "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], + "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], + "requireSpaceBeforeBlockStatements": true, + "requireParenthesesAroundIIFE": true, + "requireSpacesInConditionalExpression": { "afterTest": true, "beforeConsequent": true, "afterConsequent": true, "beforeAlternate": true }, + "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunction": { "beforeOpeningRoundBrace": true }, + "disallowSpacesInsideParentheses": true, + "requireSpacesInsideObjectBrackets": "all", + "requireSpacesInsideArrayBrackets": "all", + "disallowSpaceAfterObjectKeys": true, + "requireCommaBeforeLineBreak": true, + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--", ";"], + "disallowSpaceBeforeBinaryOperators": [ "," ], + "requireSpaceBeforeBinaryOperators": [ "=", "+", "-", "/", "*", "==", "===", "!=", "!==" ], + "requireSpaceAfterBinaryOperators": [ "=", ",", "+", "-", "/", "*", "==", "===", "!=", "!==" ], + "disallowMultipleLineStrings": true, + "validateLineBreaks": "LF", + "disallowMixedSpacesAndTabs": "smart", + "disallowTrailingWhitespace": true, + "disallowTrailingComma": true, + "requireKeywordsOnNewLine": [ "else" ], + "requireLineFeedAtFileEnd": true, + "requireCapitalizedConstructors": true, + "safeContextKeyword": [ "self" ], + "disallowYodaConditions": true, + "requireSpaceAfterLineComment": true, + "disallowNewlineBeforeBlockStatements": true +} \ No newline at end of file From 78cd30dcc943cf94680ad6e97855d02ca7fa1001 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:29:15 -0400 Subject: [PATCH 026/141] chore(lint): remove File and mixpanel from eslintrc globals --- .eslintrc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index c22590e4..763a8e94 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,8 +12,6 @@ }, "globals": { "module": true, - "require": false, - "mixpanel": false, - "File": false + "require": false } } \ No newline at end of file From 6b6819c02a0c629c78289fa5290771f38fd07dc1 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:30:51 -0400 Subject: [PATCH 027/141] chore(gulp): add dividers to gulpfile --- gulpfile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8712f8e0..656fb8f4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,6 +3,9 @@ var fs = require('fs'); var sourcemaps = require('gulp-sourcemaps'); var babel = require('gulp-babel'); +gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); + +//------------------------------------------------------------------------------ //setup for development use gulp.task('setupDev', () => { getDevPluginXML(); @@ -15,8 +18,6 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); -gulp.task('build-npm', ['setupNpm', 'babel']); - //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -75,7 +76,8 @@ function emitFiles(path){ return ret; } -//copy resources and compile es6 from corresponding directory +//------------------------------------------------------------------------------ +//copy resources and compile es6 from corresponding directories babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ babelTasks.push(taskName + '-babel'); From ec921f7c19214956af197789e8c649626d1a12ec Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:01:34 -0400 Subject: [PATCH 028/141] chore(lint): implement linting in gulpfile --- .jscs => .jscsrc | 2 -- gulpfile.js | 43 +++++++++++++++++++++++++++++++++++++++---- package.json | 3 +++ 3 files changed, 42 insertions(+), 6 deletions(-) rename .jscs => .jscsrc (99%) diff --git a/.jscs b/.jscsrc similarity index 99% rename from .jscs rename to .jscsrc index 8385caae..d2e9477e 100644 --- a/.jscs +++ b/.jscsrc @@ -1,7 +1,5 @@ { "fileExtensions": [".js", ".jsx"], - "esnext": true, - "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], "requireSpaceBeforeBlockStatements": true, diff --git a/gulpfile.js b/gulpfile.js index 656fb8f4..c333bf75 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,7 +1,9 @@ -var gulp = require('gulp'); -var fs = require('fs'); +var gulp = require('gulp'); +var fs = require('fs'); var sourcemaps = require('gulp-sourcemaps'); -var babel = require('gulp-babel'); +var babel = require('gulp-babel'); +var eslint = require('gulp-eslint'); +var jscs = require('gulp-jscs'); gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); @@ -106,4 +108,37 @@ babelize('hooks'); babelize('www'); babelize('tests'); babelize('testbed', 'testbed/www/js'); -gulp.task('babel', babelTasks); \ No newline at end of file +gulp.task('babel', babelTasks); + +//------------------------------------------------------------------------------ +//linting + +gulp.task('lint', ['eslint', 'jscs-lint']); + +var srcs = [ + '**/*.js', + '!node_modules/**', + '!testbed/platforms/ios/cordova/node_modules/**' +]; + +gulp.task('lint', () => { + return gulp.src(srcs) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + +function jscsTask(fix){ + var ret = gulp.src(srcs) + .pipe(jscs({fix: fix})) + .pipe(jscs.reporter()) + .pipe(jscs.reporter('fail')); + + if(fix){ + ret.pipe(gulp.dest('.')); + } + return ret; +} + +gulp.task('jscs-fix', jscsTask.bind(null, true)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file diff --git a/package.json b/package.json index 7790bdb2..7ace4acc 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "babel-eslint": "^6.1.2", "babel-plugin-transform-runtime": "^6.12.0", "babel-preset-es2015": "^6.9.0", "babel-preset-stage-2": "^6.11.0", @@ -48,6 +49,8 @@ "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", + "gulp-eslint": "^3.0.1", + "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", From b292a53375251a874c8b2d8b705a132d2c79c9d3 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:19:49 -0400 Subject: [PATCH 029/141] chore(gulpfile): fix linting errors --- gulpfile.js | 87 +++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c333bf75..c673f654 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,26 +5,26 @@ var babel = require('gulp-babel'); var eslint = require('gulp-eslint'); var jscs = require('gulp-jscs'); -gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); +gulp.task('build-npm', [ 'setupNpm', 'babel', 'lint' ]); -//------------------------------------------------------------------------------ -//setup for development use +// ----------------------------------------------------------------------------- +// setup for development use gulp.task('setupDev', () => { getDevPluginXML(); setIosNpmOrDev('dev'); }) -//setup for npm deployment +// setup for npm deployment gulp.task('setupNpm', () => { genNpmPluginXML(); setIosNpmOrDev('npm'); }); -//generate plugin.xml for use as a cordova plugin -//here we explode the contents of the frameworks -function genNpmPluginXML(){ +// generate plugin.xml for use as a cordova plugin +// here we explode the contents of the frameworks +function genNpmPluginXML() { var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); - + var files = []; var root = 'src/ios/dependencies/'; files = files.concat(emitFiles(root + 'Fabric/')); @@ -34,43 +34,46 @@ function genNpmPluginXML(){ var newLineIndent = '\n '; xml = xml.replace('', newLineIndent + files.join(newLineIndent)); - + fs.writeFileSync('plugin.xml', xml); }; -//generate plugin.xml for local development -//here we reference the frameworks instead of all the files directly -function getDevPluginXML(){ +// generate plugin.xml for local development +// here we reference the frameworks instead of all the files directly +function getDevPluginXML() { var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); - - xml = xml.replace('', + + xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); }; -function setIosNpmOrDev(npmOrDev){ - if(npmOrDev === 'npm'){ +function setIosNpmOrDev(npmOrDev) { + if (npmOrDev === 'npm') { content = '#define BRANCH_NPM true'; - }else if(npmOrDev === 'dev'){ + } +else if (npmOrDev === 'dev') { content = '//empty'; - }else{ + } +else { throw new Error('expected deployed|local, not ' + deployedOrLocal); } fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); } -//emit array of cordova file references for all .h/.m files in path -function emitFiles(path){ +// emit array of cordova file references for all .h/.m files in path +function emitFiles(path) { var ret = []; - for(filename of fs.readdirSync(path)){ + for (filename of fs.readdirSync(path)) { var fileType = null; - if(filename.match(/\.m$/)){ + if (filename.match(/\.m$/)) { fileType = 'source'; - }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + } +else if (filename.match(/\.h$/) || filename.match(/\.pch$/)) { fileType = 'header'; } - if(fileType){ + if (fileType) { ret.push('<' + fileType + '-file src="' + path + filename + '" />'); } } @@ -78,12 +81,12 @@ function emitFiles(path){ return ret; } -//------------------------------------------------------------------------------ -//copy resources and compile es6 from corresponding directories -babelTasks = []; //list of all babel tasks so we can build all of them -function babelize(taskName, dir){ +// ----------------------------------------------------------------------------- +// copy resources and compile es6 from corresponding directories +babelTasks = []; // list of all babel tasks so we can build all of them +function babelize(taskName, dir) { babelTasks.push(taskName + '-babel'); - if(!dir){ + if (!dir) { dir = taskName; } var srcDir = dir + '.es6/'; @@ -92,12 +95,12 @@ function babelize(taskName, dir){ gulp.task(taskName + '-copy', () => { return gulp.src(srcDir + '**/*.*').pipe(gulp.dest(destDir)); }); - gulp.task(taskName + '-babel', [taskName + '-copy'], () => { + gulp.task(taskName + '-babel', [ taskName + '-copy' ], () => { return gulp.src(srcPattern) .pipe(sourcemaps.init()) .pipe(babel({ - presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] //needed for generators etc + presets: [ 'es2015', 'stage-2' ], + plugins: [ 'transform-runtime' ] // needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -110,35 +113,35 @@ babelize('tests'); babelize('testbed', 'testbed/www/js'); gulp.task('babel', babelTasks); -//------------------------------------------------------------------------------ -//linting +// ----------------------------------------------------------------------------- +// linting + +gulp.task('lint', [ 'eslint', 'jscs-lint' ]); -gulp.task('lint', ['eslint', 'jscs-lint']); - var srcs = [ '**/*.js', '!node_modules/**', '!testbed/platforms/ios/cordova/node_modules/**' ]; -gulp.task('lint', () => { +gulp.task('eslint', () => { return gulp.src(srcs) .pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); }); -function jscsTask(fix){ - var ret = gulp.src(srcs) - .pipe(jscs({fix: fix})) +function jscsTask(fix) { + var ret = gulp.src('gulpfile.js') + .pipe(jscs({ fix: fix })) .pipe(jscs.reporter()) .pipe(jscs.reporter('fail')); - if(fix){ + if (fix) { ret.pipe(gulp.dest('.')); } return ret; } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file +gulp.task('jscs-lint', jscsTask.bind(null, false)); From 07df48dea8334878de3e16bc4416a65490c7a7c5 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 12:17:13 -0400 Subject: [PATCH 030/141] chore(gulpfile): whitespace --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c673f654..0b70f893 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file From f4b2eee49f1d89be453bd9e3194b06bfccb9e830 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 14:56:53 -0400 Subject: [PATCH 031/141] chore(dependencies): add gulp --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c55b0068..5ce33a48 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From 077ce5fc8bf77bcbe6809df5739c5b25f516188f Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 16:23:05 -0400 Subject: [PATCH 032/141] refactor(plugin.xml): generate ios references based on build target --- gulpfile.js | 49 ++++++++++++++++++++ plugin.template.xml | 108 ++++++++++++++++++++++++++++++++++++++++++++ plugin.xml | 38 ++++++++-------- 3 files changed, 176 insertions(+), 19 deletions(-) create mode 100644 gulpfile.js create mode 100644 plugin.template.xml diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..8303c81d --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,49 @@ +var gulp = require('gulp'); +var fs = require('fs'); + +//generate plugin.xml for use as a cordova plugin +//here we explode the contents of the frameworks +gulp.task('gen-npm-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + var files = []; + var root = 'src/ios/dependencies/'; + files = files.concat(emitFiles(root + 'Fabric/')); + files = files.concat(emitFiles(root + 'Branch-SDK/')); + files = files.concat(emitFiles(root + 'Branch-SDK/Requests/')); + + var newLineIndent = '\n '; + xml = xml.replace('', newLineIndent + + files.join(newLineIndent)); + + fs.writeFileSync('plugin.xml', xml); +}); + +//generate plugin.xml for local development +//here we reference the frameworks instead of all the files directly +gulp.task('gen-dev-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + xml = xml.replace('', + ''); + + fs.writeFileSync('plugin.xml', xml); +}); + +//emit array of cordova file references for all .h/.m files in path +function emitFiles(path){ + var ret = []; + for(filename of fs.readdirSync(path)){ + var fileType = null; + if(filename.match(/\.m$/)){ + fileType = 'source'; + }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + fileType = 'header'; + } + if(fileType){ + ret.push('<' + fileType + '-file src="' + path + filename + '" />'); + } + } + ret.push(''); + return ret; +} \ No newline at end of file diff --git a/plugin.template.xml b/plugin.template.xml new file mode 100644 index 00000000..5165dac0 --- /dev/null +++ b/plugin.template.xml @@ -0,0 +1,108 @@ + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + diff --git a/plugin.xml b/plugin.xml index 17420318..4ab7bb93 100644 --- a/plugin.xml +++ b/plugin.xml @@ -103,24 +103,26 @@ SOFTWARE. - - - - + + + From 57ba0c1ed6427021f0df49be54f046d195052074 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 17:30:28 -0400 Subject: [PATCH 033/141] refactor(ios): automatically set correct header paths based on deployment --- .gitignore | 3 + gulpfile.js | 31 +++++- plugin.template.xml | 6 + plugin.xml | 192 -------------------------------- src/ios/AppDelegate+BranchSdk.m | 9 +- src/ios/BranchSDK.h | 15 ++- 6 files changed, 56 insertions(+), 200 deletions(-) delete mode 100644 plugin.xml diff --git a/.gitignore b/.gitignore index 83631f70..692b8299 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ testbed/hooks node_modules testbed/ul_web_hooks/ .installed + +/plugin.xml +src/ios/BranchNPM.h \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 8303c81d..4bf68ceb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,9 +1,21 @@ var gulp = require('gulp'); var fs = require('fs'); +//setup for development use +gulp.task('setupDev', function(){ + getDevPluginXML(); + setIosNpmOrDev('dev'); +}) + +//setup for npm deployment +gulp.task('setupNpm', function(){ + genNpmPluginXML(); + setIosNpmOrDev('npm'); +}); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks -gulp.task('gen-npm-plugin-xml', function(){ +function genNpmPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); var files = []; @@ -17,18 +29,29 @@ gulp.task('gen-npm-plugin-xml', function(){ + files.join(newLineIndent)); fs.writeFileSync('plugin.xml', xml); -}); +}; //generate plugin.xml for local development //here we reference the frameworks instead of all the files directly -gulp.task('gen-dev-plugin-xml', function(){ +function getDevPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); -}); +}; + +function setIosNpmOrDev(npmOrDev){ + if(npmOrDev === 'npm'){ + content = '#define BRANCH_NPM true'; + }else if(npmOrDev === 'dev'){ + content = '//empty'; + }else{ + throw new Error('expected deployed|local, not ' + deployedOrLocal); + } + fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); +} //emit array of cordova file references for all .h/.m files in path function emitFiles(path){ diff --git a/plugin.template.xml b/plugin.template.xml index 5165dac0..f415dbde 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,3 +1,8 @@ + + + + + - - - branch-cordova-sdk - Branch SDK Plugin - Apache 2.0 - cordova,branch - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $BRANCH_KEY - - - - - CFBundleURLName - io.branch.sdk - CFBundleURLSchemes - - $URI_SCHEME - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ios/AppDelegate+BranchSdk.m b/src/ios/AppDelegate+BranchSdk.m index bd0a480e..7e66c75a 100644 --- a/src/ios/AppDelegate+BranchSdk.m +++ b/src/ios/AppDelegate+BranchSdk.m @@ -7,7 +7,14 @@ // #import "AppDelegate.h" -#import + +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" +#else + #import +#endif @interface AppDelegate (BranchSDK) diff --git a/src/ios/BranchSDK.h b/src/ios/BranchSDK.h index c48f9ee6..020789f7 100644 --- a/src/ios/BranchSDK.h +++ b/src/ios/BranchSDK.h @@ -5,9 +5,18 @@ // Copyright © 2016 Branch Metrics. All rights reserved. // -#import -#import -#import +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" + #import "BranchLinkProperties.h" + #import "BranchUniversalObject.h" +#else + #import + #import + #import +#endif + #import @interface BranchSDK : CDVPlugin From 120644257393c1d1b7d9375bb97f6e0fde48f816 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:34 -0400 Subject: [PATCH 034/141] fix(gulp): make plugin template comments valid xml --- plugin.template.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugin.template.xml b/plugin.template.xml index f415dbde..bd03c0ef 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,7 +1,4 @@ - - - + + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + + diff --git a/src/ios/BranchNPM.h b/src/ios/BranchNPM.h new file mode 100644 index 00000000..90fe1bcc --- /dev/null +++ b/src/ios/BranchNPM.h @@ -0,0 +1 @@ +//empty From 893d5fa88721b781151bb23b08f36c7207495e82 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:32:12 -0400 Subject: [PATCH 037/141] chore(ios): add script to update ios dependencies --- src/ios/dependencies/update.sh | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 src/ios/dependencies/update.sh diff --git a/src/ios/dependencies/update.sh b/src/ios/dependencies/update.sh new file mode 100755 index 00000000..7a133115 --- /dev/null +++ b/src/ios/dependencies/update.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#update the ios dependencies in this directory to those storied under passed tag on github + +#fail fast on errors +set -e + +#cd into directory containing this script +cd "$(dirname "$0")" + +#check first parameter is set to tag to download +if [ -z ${1+x} ]; then + echo "You must pass this script the tag to download" + exit -1 +else + echo "downloading tag '$1'" +fi + +#this is the git tag that we'll be updating to, +#we expecct it to be the first parameter to this script +tag_name=$1 +tag_url="https://github.com/BranchMetrics/ios-branch-deep-linking/archive/$tag_name.zip" +#extract is where we stick the extracted archive of the tag +tag_extract=ios-branch-deep-linking-$tag_name + + +#check that tag exists +tag_url_status=`curl -L -o /dev/null --silent --head --write-out '%{http_code}\n' $tag_url` +if [ $tag_url_status = "200" ]; then + echo "found tag" +else + echo "could not find '$tag_url'" + echo "curl returned status '$tag_url_status'" + exit -1 +fi + +#this will overwripte existing versions of sdk.zip +curl -L -o sdk.zip $tag_url + +#delete old extracted content or do nothing if we don't have any +rm -rf $tag_extract + +#silently (-q) extract download +unzip -q -x sdk.zip +rm -f sdk.zip + +#copy in new dependencies +rm -rf Branch-SDK +mv $tag_extract/Branch-SDK/Branch-SDK . + +rm -rf Branch.framework +mv $tag_extract/Branch.framework . + +rm -rf Fabric +mv $tag_extract/Branch-SDK/Fabric . + +#clean up +rm -rf $tag_extract + +#replace all instances of '#import "../Fabric/' with '#import "' in .m files +find . -type f -name '*.m' \ + -exec perl -i -pe 's/\#import \"\.\.\/Fabric\//#import "/' '{}' + From 521b6e5ccf8911206d84940ab4042448b28d0913 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:43:40 -0400 Subject: [PATCH 038/141] chore(deployment): remove npmDeployment.txt it is now automated --- NPMdeployment.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 NPMdeployment.txt diff --git a/NPMdeployment.txt b/NPMdeployment.txt deleted file mode 100644 index 0f7bf0ec..00000000 --- a/NPMdeployment.txt +++ /dev/null @@ -1,5 +0,0 @@ -NPM deployment - -1. comment out iOS framework in plugin.xml -2. change header file references of Cordova iOS libs from to "Branch.h" -3. remove "../Fabric" from all Fabric related imports \ No newline at end of file From c09ab22d0758af75beadd358aa28ed29de0e8b82 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 13:11:47 -0400 Subject: [PATCH 039/141] chore(gulp): add `npm run commit` command --- package.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.json b/package.json index 5ce33a48..c6dbe4ae 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,9 @@ "ios" ], "license": "MIT", + "scripts": { + "commit": "git-cz" + }, "dependencies": { "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", @@ -38,11 +41,16 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "commitizen": "^2.8.2", + "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", "xml2js": "^0.4.16" + }, + "czConfig": { + "path": "node_modules/cz-conventional-changelog" } } From 6124fa026e5c4b5754f87fac9906b546579a307d Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 15:59:13 -0400 Subject: [PATCH 040/141] chore(commitizen): use modern commitizen config style --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c6dbe4ae..d70d69dd 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "rimraf": "^2.5.2", "xml2js": "^0.4.16" }, - "czConfig": { - "path": "node_modules/cz-conventional-changelog" + "config": { + "commitizen": { + "path": "node_modules/cz-conventional-changelog" + } } } From 4031552677a86e98f4befe48cdd07e982411edc8 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:56 -0400 Subject: [PATCH 041/141] fix(testbed/init.sh): make script executable From 1135a60d7a05e07e935bc9f8cb92208de06bf2db Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:08:39 -0400 Subject: [PATCH 042/141] chore(babel): add es6 transpiler to gulpfile --- gulpfile.js | 32 +++++++++++++++++++++++++++++++- package.json | 5 +++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 4bf68ceb..614df6e1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,7 @@ var gulp = require('gulp'); var fs = require('fs'); +var sourcemaps = require('gulp-sourcemaps'); +var babel = require('gulp-babel'); //setup for development use gulp.task('setupDev', function(){ @@ -69,4 +71,32 @@ function emitFiles(path){ } ret.push(''); return ret; -} \ No newline at end of file +} + +//copy resources and compile es6 from corresponding directory +function babelize(taskName, dir){ + if(!dir){ + dir = taskName; + } + var srcDir = dir + '.es6/'; + var srcPattern = dir + '.es6/**/*.js' + var destDir = dir + '/'; + gulp.task(taskName + '-copy', () => { + return gulp.src(srcDir + '**/*.*').pipe(gulp.dest(destDir)); + }); + gulp.task(taskName + '-babel', [taskName + '-copy'], () => { + return gulp.src(srcPattern) + .pipe(sourcemaps.init()) + .pipe(babel({ + presets: ['es2015', 'stage-2'], + plugins: ['transform-runtime'] + })) + .pipe(sourcemaps.write('.')) + .pipe(gulp.dest(destDir)); + }); +} + +babelize('hooks'); +babelize('www'); +babelize('tests'); +babelize('testbed', 'testbed/www/js'); \ No newline at end of file diff --git a/package.json b/package.json index d70d69dd..7790bdb2 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,14 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "babel-plugin-transform-runtime": "^6.12.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-2": "^6.11.0", "commitizen": "^2.8.2", "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", + "gulp-babel": "^6.1.2", + "gulp-sourcemaps": "^1.6.0", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From 305a9d035a04b5082381f206dbc1df6f7b597435 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:09:15 -0400 Subject: [PATCH 043/141] chore: use arrow functions instead of 'function' --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 614df6e1..94a6c789 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,13 +4,13 @@ var sourcemaps = require('gulp-sourcemaps'); var babel = require('gulp-babel'); //setup for development use -gulp.task('setupDev', function(){ +gulp.task('setupDev', () => { getDevPluginXML(); setIosNpmOrDev('dev'); }) //setup for npm deployment -gulp.task('setupNpm', function(){ +gulp.task('setupNpm', () => { genNpmPluginXML(); setIosNpmOrDev('npm'); }); From 5a21afaae8495fac7b8f7a59fe2afc5c0e3b04ed Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:13:46 -0400 Subject: [PATCH 044/141] chore(babel): add task to run all babel subtasks in parallel --- gulpfile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 94a6c789..8712f8e0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,8 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); +gulp.task('build-npm', ['setupNpm', 'babel']); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -74,7 +76,9 @@ function emitFiles(path){ } //copy resources and compile es6 from corresponding directory +babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ + babelTasks.push(taskName + '-babel'); if(!dir){ dir = taskName; } @@ -89,7 +93,7 @@ function babelize(taskName, dir){ .pipe(sourcemaps.init()) .pipe(babel({ presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] + plugins: ['transform-runtime'] //needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -99,4 +103,5 @@ function babelize(taskName, dir){ babelize('hooks'); babelize('www'); babelize('tests'); -babelize('testbed', 'testbed/www/js'); \ No newline at end of file +babelize('testbed', 'testbed/www/js'); +gulp.task('babel', babelTasks); \ No newline at end of file From ad71c87fd8c86b0f43e3b202a0c914439eab61ea Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:19:34 -0400 Subject: [PATCH 045/141] chore(lint): add branch's code style prefs --- .eslintrc | 19 +++++++++++++++++++ .jscs | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .eslintrc create mode 100644 .jscs diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..c22590e4 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +{ + "parser": "babel-eslint", + "env": { "browser": true }, + "rules": { + "quotes": 0, + "strict": 0, + "no-underscore-dangle": 0, + "eqeqeq": 0, + "camelcase": 0, + "consistent-return": 0, + "new-cap": 0 + }, + "globals": { + "module": true, + "require": false, + "mixpanel": false, + "File": false + } +} \ No newline at end of file diff --git a/.jscs b/.jscs new file mode 100644 index 00000000..8385caae --- /dev/null +++ b/.jscs @@ -0,0 +1,42 @@ +{ + "fileExtensions": [".js", ".jsx"], + "esnext": true, + + "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], + "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], + "requireSpaceBeforeBlockStatements": true, + "requireParenthesesAroundIIFE": true, + "requireSpacesInConditionalExpression": { "afterTest": true, "beforeConsequent": true, "afterConsequent": true, "beforeAlternate": true }, + "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunction": { "beforeOpeningRoundBrace": true }, + "disallowSpacesInsideParentheses": true, + "requireSpacesInsideObjectBrackets": "all", + "requireSpacesInsideArrayBrackets": "all", + "disallowSpaceAfterObjectKeys": true, + "requireCommaBeforeLineBreak": true, + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--", ";"], + "disallowSpaceBeforeBinaryOperators": [ "," ], + "requireSpaceBeforeBinaryOperators": [ "=", "+", "-", "/", "*", "==", "===", "!=", "!==" ], + "requireSpaceAfterBinaryOperators": [ "=", ",", "+", "-", "/", "*", "==", "===", "!=", "!==" ], + "disallowMultipleLineStrings": true, + "validateLineBreaks": "LF", + "disallowMixedSpacesAndTabs": "smart", + "disallowTrailingWhitespace": true, + "disallowTrailingComma": true, + "requireKeywordsOnNewLine": [ "else" ], + "requireLineFeedAtFileEnd": true, + "requireCapitalizedConstructors": true, + "safeContextKeyword": [ "self" ], + "disallowYodaConditions": true, + "requireSpaceAfterLineComment": true, + "disallowNewlineBeforeBlockStatements": true +} \ No newline at end of file From 0038dd52d4ea660b88c0748579d0b74508842fe5 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:29:15 -0400 Subject: [PATCH 046/141] chore(lint): remove File and mixpanel from eslintrc globals --- .eslintrc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index c22590e4..763a8e94 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,8 +12,6 @@ }, "globals": { "module": true, - "require": false, - "mixpanel": false, - "File": false + "require": false } } \ No newline at end of file From dcfbb5b53092774c35744c260e5333e21115b9a0 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:30:51 -0400 Subject: [PATCH 047/141] chore(gulp): add dividers to gulpfile --- gulpfile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8712f8e0..656fb8f4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,6 +3,9 @@ var fs = require('fs'); var sourcemaps = require('gulp-sourcemaps'); var babel = require('gulp-babel'); +gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); + +//------------------------------------------------------------------------------ //setup for development use gulp.task('setupDev', () => { getDevPluginXML(); @@ -15,8 +18,6 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); -gulp.task('build-npm', ['setupNpm', 'babel']); - //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -75,7 +76,8 @@ function emitFiles(path){ return ret; } -//copy resources and compile es6 from corresponding directory +//------------------------------------------------------------------------------ +//copy resources and compile es6 from corresponding directories babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ babelTasks.push(taskName + '-babel'); From 18c8664f30eba402114ab79062fef8d07a615923 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:01:34 -0400 Subject: [PATCH 048/141] chore(lint): implement linting in gulpfile --- .jscs => .jscsrc | 2 -- gulpfile.js | 43 +++++++++++++++++++++++++++++++++++++++---- package.json | 3 +++ 3 files changed, 42 insertions(+), 6 deletions(-) rename .jscs => .jscsrc (99%) diff --git a/.jscs b/.jscsrc similarity index 99% rename from .jscs rename to .jscsrc index 8385caae..d2e9477e 100644 --- a/.jscs +++ b/.jscsrc @@ -1,7 +1,5 @@ { "fileExtensions": [".js", ".jsx"], - "esnext": true, - "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], "requireSpaceBeforeBlockStatements": true, diff --git a/gulpfile.js b/gulpfile.js index 656fb8f4..c333bf75 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,7 +1,9 @@ -var gulp = require('gulp'); -var fs = require('fs'); +var gulp = require('gulp'); +var fs = require('fs'); var sourcemaps = require('gulp-sourcemaps'); -var babel = require('gulp-babel'); +var babel = require('gulp-babel'); +var eslint = require('gulp-eslint'); +var jscs = require('gulp-jscs'); gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); @@ -106,4 +108,37 @@ babelize('hooks'); babelize('www'); babelize('tests'); babelize('testbed', 'testbed/www/js'); -gulp.task('babel', babelTasks); \ No newline at end of file +gulp.task('babel', babelTasks); + +//------------------------------------------------------------------------------ +//linting + +gulp.task('lint', ['eslint', 'jscs-lint']); + +var srcs = [ + '**/*.js', + '!node_modules/**', + '!testbed/platforms/ios/cordova/node_modules/**' +]; + +gulp.task('lint', () => { + return gulp.src(srcs) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + +function jscsTask(fix){ + var ret = gulp.src(srcs) + .pipe(jscs({fix: fix})) + .pipe(jscs.reporter()) + .pipe(jscs.reporter('fail')); + + if(fix){ + ret.pipe(gulp.dest('.')); + } + return ret; +} + +gulp.task('jscs-fix', jscsTask.bind(null, true)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file diff --git a/package.json b/package.json index 7790bdb2..7ace4acc 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "babel-eslint": "^6.1.2", "babel-plugin-transform-runtime": "^6.12.0", "babel-preset-es2015": "^6.9.0", "babel-preset-stage-2": "^6.11.0", @@ -48,6 +49,8 @@ "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", + "gulp-eslint": "^3.0.1", + "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", From 9ef4d53620dbfa79267c785541bc93f173d6757e Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:19:49 -0400 Subject: [PATCH 049/141] chore(gulpfile): fix linting errors --- gulpfile.js | 87 +++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c333bf75..c673f654 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,26 +5,26 @@ var babel = require('gulp-babel'); var eslint = require('gulp-eslint'); var jscs = require('gulp-jscs'); -gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); +gulp.task('build-npm', [ 'setupNpm', 'babel', 'lint' ]); -//------------------------------------------------------------------------------ -//setup for development use +// ----------------------------------------------------------------------------- +// setup for development use gulp.task('setupDev', () => { getDevPluginXML(); setIosNpmOrDev('dev'); }) -//setup for npm deployment +// setup for npm deployment gulp.task('setupNpm', () => { genNpmPluginXML(); setIosNpmOrDev('npm'); }); -//generate plugin.xml for use as a cordova plugin -//here we explode the contents of the frameworks -function genNpmPluginXML(){ +// generate plugin.xml for use as a cordova plugin +// here we explode the contents of the frameworks +function genNpmPluginXML() { var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); - + var files = []; var root = 'src/ios/dependencies/'; files = files.concat(emitFiles(root + 'Fabric/')); @@ -34,43 +34,46 @@ function genNpmPluginXML(){ var newLineIndent = '\n '; xml = xml.replace('', newLineIndent + files.join(newLineIndent)); - + fs.writeFileSync('plugin.xml', xml); }; -//generate plugin.xml for local development -//here we reference the frameworks instead of all the files directly -function getDevPluginXML(){ +// generate plugin.xml for local development +// here we reference the frameworks instead of all the files directly +function getDevPluginXML() { var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); - - xml = xml.replace('', + + xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); }; -function setIosNpmOrDev(npmOrDev){ - if(npmOrDev === 'npm'){ +function setIosNpmOrDev(npmOrDev) { + if (npmOrDev === 'npm') { content = '#define BRANCH_NPM true'; - }else if(npmOrDev === 'dev'){ + } +else if (npmOrDev === 'dev') { content = '//empty'; - }else{ + } +else { throw new Error('expected deployed|local, not ' + deployedOrLocal); } fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); } -//emit array of cordova file references for all .h/.m files in path -function emitFiles(path){ +// emit array of cordova file references for all .h/.m files in path +function emitFiles(path) { var ret = []; - for(filename of fs.readdirSync(path)){ + for (filename of fs.readdirSync(path)) { var fileType = null; - if(filename.match(/\.m$/)){ + if (filename.match(/\.m$/)) { fileType = 'source'; - }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + } +else if (filename.match(/\.h$/) || filename.match(/\.pch$/)) { fileType = 'header'; } - if(fileType){ + if (fileType) { ret.push('<' + fileType + '-file src="' + path + filename + '" />'); } } @@ -78,12 +81,12 @@ function emitFiles(path){ return ret; } -//------------------------------------------------------------------------------ -//copy resources and compile es6 from corresponding directories -babelTasks = []; //list of all babel tasks so we can build all of them -function babelize(taskName, dir){ +// ----------------------------------------------------------------------------- +// copy resources and compile es6 from corresponding directories +babelTasks = []; // list of all babel tasks so we can build all of them +function babelize(taskName, dir) { babelTasks.push(taskName + '-babel'); - if(!dir){ + if (!dir) { dir = taskName; } var srcDir = dir + '.es6/'; @@ -92,12 +95,12 @@ function babelize(taskName, dir){ gulp.task(taskName + '-copy', () => { return gulp.src(srcDir + '**/*.*').pipe(gulp.dest(destDir)); }); - gulp.task(taskName + '-babel', [taskName + '-copy'], () => { + gulp.task(taskName + '-babel', [ taskName + '-copy' ], () => { return gulp.src(srcPattern) .pipe(sourcemaps.init()) .pipe(babel({ - presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] //needed for generators etc + presets: [ 'es2015', 'stage-2' ], + plugins: [ 'transform-runtime' ] // needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -110,35 +113,35 @@ babelize('tests'); babelize('testbed', 'testbed/www/js'); gulp.task('babel', babelTasks); -//------------------------------------------------------------------------------ -//linting +// ----------------------------------------------------------------------------- +// linting + +gulp.task('lint', [ 'eslint', 'jscs-lint' ]); -gulp.task('lint', ['eslint', 'jscs-lint']); - var srcs = [ '**/*.js', '!node_modules/**', '!testbed/platforms/ios/cordova/node_modules/**' ]; -gulp.task('lint', () => { +gulp.task('eslint', () => { return gulp.src(srcs) .pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); }); -function jscsTask(fix){ - var ret = gulp.src(srcs) - .pipe(jscs({fix: fix})) +function jscsTask(fix) { + var ret = gulp.src('gulpfile.js') + .pipe(jscs({ fix: fix })) .pipe(jscs.reporter()) .pipe(jscs.reporter('fail')); - if(fix){ + if (fix) { ret.pipe(gulp.dest('.')); } return ret; } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file +gulp.task('jscs-lint', jscsTask.bind(null, false)); From a1f9786bb284d3c21243289d34a509b4d4f307b4 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 12:17:13 -0400 Subject: [PATCH 050/141] chore(gulpfile): whitespace --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c673f654..0b70f893 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file From a2eb241e001c0187abd1a71e3da908959cacc749 Mon Sep 17 00:00:00 2001 From: Alex Austin Date: Wed, 3 Aug 2016 10:30:24 -0700 Subject: [PATCH 051/141] chore(travis): setup travis CI --- .travis.yml | 26 ++++++++++++++++++++++++++ package.json | 13 +++++++------ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..901a7bf3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +sudo: false +language: node_js +cache: + directories: + - node_modules +notifications: + email: false +node_js: + - '4' + - iojs-v3 + - iojs-v2 + - iojs-v1 + - '0.12' + - '0.10' +before_install: + - npm i -g npm@^2.0.0 +before_script: + - npm prune +after_success: + - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' + - python travis_after_all.py + - export $(cat .to_export_back) &> /dev/null + - npm run semantic-release +branches: + except: + - /^v\d+\.\d+\.\d+$/ diff --git a/package.json b/package.json index 7ace4acc..22ab49ae 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,14 @@ { - "version": "2.1.10", "name": "branch-cordova-sdk", "description": "Branch Metrics Cordova SDK", "main": "www/branch.js", - "homepage": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK", + "homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking", "repository": { "type": "git", - "url": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git" + "url": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking.git" }, "bugs": { - "url": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues" + "url": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/issues" }, "keywords": [ "ecosystem:cordova", @@ -31,7 +30,8 @@ ], "license": "MIT", "scripts": { - "commit": "git-cz" + "commit": "git-cz", + "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "dependencies": { "mkpath": "^1.0.0", @@ -56,7 +56,8 @@ "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", - "xml2js": "^0.4.16" + "xml2js": "^0.4.16", + "semantic-release": "^4.3.5" }, "config": { "commitizen": { From b2040c434be998351709f1dba08a30e5a30817f9 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 13:41:40 -0400 Subject: [PATCH 052/141] chore(package.json): add dummy version to prevent warnings --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 721c9bc8..f80de613 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "branch-cordova-sdk", "description": "Branch Metrics Cordova SDK", "main": "www/branch.js", + "version": "0.0.0-semantic-release", "homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking", "repository": { "type": "git", From e22023a7dd214ddd2a0539a6e8ee29abb04cc72d Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 13:59:00 -0400 Subject: [PATCH 053/141] chore(package.json): merge --- package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.json b/package.json index f80de613..2b60b0db 100644 --- a/package.json +++ b/package.json @@ -57,12 +57,8 @@ "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", -<<<<<<< HEAD - "xml2js": "^0.4.16" -======= "xml2js": "^0.4.16", "semantic-release": "^4.3.5" ->>>>>>> a2eb241e001c0187abd1a71e3da908959cacc749 }, "config": { "commitizen": { From 9cc259f609032d80a72e6812c25b8762df576177 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 13:59:26 -0400 Subject: [PATCH 054/141] chore(gulpfile): rename build-npm -> prerelease --- gulpfile.js | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 0b70f893..dfbaaff0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,7 +5,7 @@ var babel = require('gulp-babel'); var eslint = require('gulp-eslint'); var jscs = require('gulp-jscs'); -gulp.task('build-npm', [ 'setupNpm', 'babel', 'lint' ]); +gulp.task('prerelease', [ 'setupNpm', 'babel', 'lint' ]); // ----------------------------------------------------------------------------- // setup for development use diff --git a/package.json b/package.json index 2b60b0db..a36489f0 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ ], "license": "MIT", "scripts": { + "prerelease": "gulp prerelease", "commit": "git-cz", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, From a7e3ffae6548925bb3c98a251c02dfe4cd30d692 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:07 -0400 Subject: [PATCH 055/141] chore(travis): run prerelease before deploy --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 901a7bf3..deb1aa46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ before_install: - npm i -g npm@^2.0.0 before_script: - npm prune +script: + - npm run prerelease after_success: - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' - python travis_after_all.py @@ -23,4 +25,4 @@ after_success: - npm run semantic-release branches: except: - - /^v\d+\.\d+\.\d+$/ + - /^v\d+\.\d+\.\d+$/ \ No newline at end of file From 49444c2a1b4ed966d6540a624e26534c17cb4d65 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:27 -0400 Subject: [PATCH 056/141] chore(travis): only integrate master --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index deb1aa46..9e28665c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,5 +24,5 @@ after_success: - export $(cat .to_export_back) &> /dev/null - npm run semantic-release branches: - except: - - /^v\d+\.\d+\.\d+$/ \ No newline at end of file + only: + - master \ No newline at end of file From 251e7a97faf562959fac2ee16cef6a77bbd73c62 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:58 -0400 Subject: [PATCH 057/141] chore(travis): only build against recent node versions --- .travis.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e28665c..be5507b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,9 @@ cache: notifications: email: false node_js: + - '6' + - '5' - '4' - - iojs-v3 - - iojs-v2 - - iojs-v1 - - '0.12' - - '0.10' before_install: - npm i -g npm@^2.0.0 before_script: From 01f2717c093ef25eef0ff720f0ac38af8d904527 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 16:51:44 -0400 Subject: [PATCH 058/141] chore: add developer docs --- development.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 development.md diff --git a/development.md b/development.md new file mode 100644 index 00000000..bdd9ece2 --- /dev/null +++ b/development.md @@ -0,0 +1,38 @@ +# Development Conventions + +This document outlines our development processes. + +## Git Flow + +We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. + +Please issue github pull requests against develop instead of merging features directly in. + +## Commit Messages + +Please format your commit messages to match [Angular's Conventions](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines). These messages are parsed using semantic release to determine version numbers so it is important that you stick to them exactly. We recommend using the `npm run commit` script installed in this project to draft conformant messages. + +## Linting + +The style of all js files in this project are strictly checked using [jscs](http://jscs.info/) and [eslint](http://eslint.org/) before any pull request/release is made. You can manually check your local clone using the `gulp lint` command (don't forget to `nom install -g gulp` if you haven't already). Many problems can be automatically fixed by `gulp jscs-fix`. Don't forget to commit before running jscs-fix in case you want to back out changes. + +## Testing + + + +## Updating IOS dependencies + +This project depends on [ios-branch-deep-linking](https://github.com/BranchMetrics/ios-branch-deep-linking). To upgrade that dependency a [release](https://github.com/BranchMetrics/ios-branch-deep-linking/releases) of it run the following script: + +```shell +# is the name of the release. e,g, '0.12.5' +$ src/ios/dependencies/update.sh +``` + +## Releasing + +This project is automatically released to NPM by TravisCI when changes are merged into master. Here's how that looks using git flow: + +```shell +$ git flow release start +``` \ No newline at end of file From f5a55e5c86a5830a375c7df64f243ec2c5f87df8 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:03:53 -0400 Subject: [PATCH 059/141] chore(travis): don't release pull requests --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index be5507b7..8efaee88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ after_success: - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' - python travis_after_all.py - export $(cat .to_export_back) &> /dev/null - - npm run semantic-release + - test $TRAVIS_PULL_REQUEST = false \ + && npm run semantic-release branches: only: - master \ No newline at end of file From 8de025e247383c484a0d38b96f97e1bfa4871d0d Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:07:03 -0400 Subject: [PATCH 060/141] chore(package.json): remove redundant dependencies --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index a36489f0..e1509470 100644 --- a/package.json +++ b/package.json @@ -54,11 +54,6 @@ "gulp-eslint": "^3.0.1", "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", - "mkpath": "^1.0.0", - "node-version-compare": "^1.0.1", - "plist": "^1.2.0", - "rimraf": "^2.5.2", - "xml2js": "^0.4.16", "semantic-release": "^4.3.5" }, "config": { From 21742d06374acb74c6a2d1c39249dffe92eee823 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:57:54 -0400 Subject: [PATCH 061/141] chore(dev docs): wip, document relasing --- development.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/development.md b/development.md index bdd9ece2..177a29ef 100644 --- a/development.md +++ b/development.md @@ -4,7 +4,7 @@ This document outlines our development processes. ## Git Flow -We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. +We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. Note that it is not necessary to manually bump versions in package.json, semantic-version automatically computes that for us just before each release. Also note that we don't bother with release branches. Please issue github pull requests against develop instead of merging features directly in. @@ -27,12 +27,4 @@ This project depends on [ios-branch-deep-linking](https://github.com/BranchMetri ```shell # is the name of the release. e,g, '0.12.5' $ src/ios/dependencies/update.sh -``` - -## Releasing - -This project is automatically released to NPM by TravisCI when changes are merged into master. Here's how that looks using git flow: - -```shell -$ git flow release start ``` \ No newline at end of file From cac6a12a50d4639a2b835108d4095cad87b99d52 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 14:56:53 -0400 Subject: [PATCH 062/141] chore(dependencies): add gulp --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c55b0068..5ce33a48 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From 67d70cf050ba10ebe30631101fa18ff2df8fe737 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 16:23:05 -0400 Subject: [PATCH 063/141] refactor(plugin.xml): generate ios references based on build target --- gulpfile.js | 49 ++++++++++++++++++++ plugin.template.xml | 108 ++++++++++++++++++++++++++++++++++++++++++++ plugin.xml | 38 ++++++++-------- 3 files changed, 176 insertions(+), 19 deletions(-) create mode 100644 gulpfile.js create mode 100644 plugin.template.xml diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..8303c81d --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,49 @@ +var gulp = require('gulp'); +var fs = require('fs'); + +//generate plugin.xml for use as a cordova plugin +//here we explode the contents of the frameworks +gulp.task('gen-npm-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + var files = []; + var root = 'src/ios/dependencies/'; + files = files.concat(emitFiles(root + 'Fabric/')); + files = files.concat(emitFiles(root + 'Branch-SDK/')); + files = files.concat(emitFiles(root + 'Branch-SDK/Requests/')); + + var newLineIndent = '\n '; + xml = xml.replace('', newLineIndent + + files.join(newLineIndent)); + + fs.writeFileSync('plugin.xml', xml); +}); + +//generate plugin.xml for local development +//here we reference the frameworks instead of all the files directly +gulp.task('gen-dev-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + xml = xml.replace('', + ''); + + fs.writeFileSync('plugin.xml', xml); +}); + +//emit array of cordova file references for all .h/.m files in path +function emitFiles(path){ + var ret = []; + for(filename of fs.readdirSync(path)){ + var fileType = null; + if(filename.match(/\.m$/)){ + fileType = 'source'; + }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + fileType = 'header'; + } + if(fileType){ + ret.push('<' + fileType + '-file src="' + path + filename + '" />'); + } + } + ret.push(''); + return ret; +} \ No newline at end of file diff --git a/plugin.template.xml b/plugin.template.xml new file mode 100644 index 00000000..5165dac0 --- /dev/null +++ b/plugin.template.xml @@ -0,0 +1,108 @@ + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + diff --git a/plugin.xml b/plugin.xml index 17420318..4ab7bb93 100644 --- a/plugin.xml +++ b/plugin.xml @@ -103,24 +103,26 @@ SOFTWARE. - - - - + + + From 74c373ef866983728368cce747455b74454c37b3 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 17:30:28 -0400 Subject: [PATCH 064/141] refactor(ios): automatically set correct header paths based on deployment --- .gitignore | 3 + gulpfile.js | 31 +++++- plugin.template.xml | 6 + plugin.xml | 192 -------------------------------- src/ios/AppDelegate+BranchSdk.m | 9 +- src/ios/BranchSDK.h | 15 ++- 6 files changed, 56 insertions(+), 200 deletions(-) delete mode 100644 plugin.xml diff --git a/.gitignore b/.gitignore index 83631f70..692b8299 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ testbed/hooks node_modules testbed/ul_web_hooks/ .installed + +/plugin.xml +src/ios/BranchNPM.h \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 8303c81d..4bf68ceb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,9 +1,21 @@ var gulp = require('gulp'); var fs = require('fs'); +//setup for development use +gulp.task('setupDev', function(){ + getDevPluginXML(); + setIosNpmOrDev('dev'); +}) + +//setup for npm deployment +gulp.task('setupNpm', function(){ + genNpmPluginXML(); + setIosNpmOrDev('npm'); +}); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks -gulp.task('gen-npm-plugin-xml', function(){ +function genNpmPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); var files = []; @@ -17,18 +29,29 @@ gulp.task('gen-npm-plugin-xml', function(){ + files.join(newLineIndent)); fs.writeFileSync('plugin.xml', xml); -}); +}; //generate plugin.xml for local development //here we reference the frameworks instead of all the files directly -gulp.task('gen-dev-plugin-xml', function(){ +function getDevPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); -}); +}; + +function setIosNpmOrDev(npmOrDev){ + if(npmOrDev === 'npm'){ + content = '#define BRANCH_NPM true'; + }else if(npmOrDev === 'dev'){ + content = '//empty'; + }else{ + throw new Error('expected deployed|local, not ' + deployedOrLocal); + } + fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); +} //emit array of cordova file references for all .h/.m files in path function emitFiles(path){ diff --git a/plugin.template.xml b/plugin.template.xml index 5165dac0..f415dbde 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,3 +1,8 @@ + + + + + - - - branch-cordova-sdk - Branch SDK Plugin - Apache 2.0 - cordova,branch - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $BRANCH_KEY - - - - - CFBundleURLName - io.branch.sdk - CFBundleURLSchemes - - $URI_SCHEME - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ios/AppDelegate+BranchSdk.m b/src/ios/AppDelegate+BranchSdk.m index bd0a480e..7e66c75a 100644 --- a/src/ios/AppDelegate+BranchSdk.m +++ b/src/ios/AppDelegate+BranchSdk.m @@ -7,7 +7,14 @@ // #import "AppDelegate.h" -#import + +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" +#else + #import +#endif @interface AppDelegate (BranchSDK) diff --git a/src/ios/BranchSDK.h b/src/ios/BranchSDK.h index c48f9ee6..020789f7 100644 --- a/src/ios/BranchSDK.h +++ b/src/ios/BranchSDK.h @@ -5,9 +5,18 @@ // Copyright © 2016 Branch Metrics. All rights reserved. // -#import -#import -#import +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" + #import "BranchLinkProperties.h" + #import "BranchUniversalObject.h" +#else + #import + #import + #import +#endif + #import @interface BranchSDK : CDVPlugin From fdc2b80613c91785981f793e193b71875610680b Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:34 -0400 Subject: [PATCH 065/141] fix(gulp): make plugin template comments valid xml --- plugin.template.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugin.template.xml b/plugin.template.xml index f415dbde..bd03c0ef 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,7 +1,4 @@ - - - + + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + + diff --git a/src/ios/BranchNPM.h b/src/ios/BranchNPM.h new file mode 100644 index 00000000..90fe1bcc --- /dev/null +++ b/src/ios/BranchNPM.h @@ -0,0 +1 @@ +//empty From 4383c58b3b091940509495a5af43bdcce8ec2184 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:32:12 -0400 Subject: [PATCH 068/141] chore(ios): add script to update ios dependencies --- src/ios/dependencies/update.sh | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 src/ios/dependencies/update.sh diff --git a/src/ios/dependencies/update.sh b/src/ios/dependencies/update.sh new file mode 100755 index 00000000..7a133115 --- /dev/null +++ b/src/ios/dependencies/update.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#update the ios dependencies in this directory to those storied under passed tag on github + +#fail fast on errors +set -e + +#cd into directory containing this script +cd "$(dirname "$0")" + +#check first parameter is set to tag to download +if [ -z ${1+x} ]; then + echo "You must pass this script the tag to download" + exit -1 +else + echo "downloading tag '$1'" +fi + +#this is the git tag that we'll be updating to, +#we expecct it to be the first parameter to this script +tag_name=$1 +tag_url="https://github.com/BranchMetrics/ios-branch-deep-linking/archive/$tag_name.zip" +#extract is where we stick the extracted archive of the tag +tag_extract=ios-branch-deep-linking-$tag_name + + +#check that tag exists +tag_url_status=`curl -L -o /dev/null --silent --head --write-out '%{http_code}\n' $tag_url` +if [ $tag_url_status = "200" ]; then + echo "found tag" +else + echo "could not find '$tag_url'" + echo "curl returned status '$tag_url_status'" + exit -1 +fi + +#this will overwripte existing versions of sdk.zip +curl -L -o sdk.zip $tag_url + +#delete old extracted content or do nothing if we don't have any +rm -rf $tag_extract + +#silently (-q) extract download +unzip -q -x sdk.zip +rm -f sdk.zip + +#copy in new dependencies +rm -rf Branch-SDK +mv $tag_extract/Branch-SDK/Branch-SDK . + +rm -rf Branch.framework +mv $tag_extract/Branch.framework . + +rm -rf Fabric +mv $tag_extract/Branch-SDK/Fabric . + +#clean up +rm -rf $tag_extract + +#replace all instances of '#import "../Fabric/' with '#import "' in .m files +find . -type f -name '*.m' \ + -exec perl -i -pe 's/\#import \"\.\.\/Fabric\//#import "/' '{}' + From 6a1f734fa0ca85b5544affe90e9e8df4b3ee3fd0 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:43:40 -0400 Subject: [PATCH 069/141] chore(deployment): remove npmDeployment.txt it is now automated --- NPMdeployment.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 NPMdeployment.txt diff --git a/NPMdeployment.txt b/NPMdeployment.txt deleted file mode 100644 index 0f7bf0ec..00000000 --- a/NPMdeployment.txt +++ /dev/null @@ -1,5 +0,0 @@ -NPM deployment - -1. comment out iOS framework in plugin.xml -2. change header file references of Cordova iOS libs from to "Branch.h" -3. remove "../Fabric" from all Fabric related imports \ No newline at end of file From 9a559fd58f1b5dcd300e552057c7e10947f04e8e Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 13:11:47 -0400 Subject: [PATCH 070/141] chore(gulp): add `npm run commit` command --- package.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.json b/package.json index 5ce33a48..c6dbe4ae 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,9 @@ "ios" ], "license": "MIT", + "scripts": { + "commit": "git-cz" + }, "dependencies": { "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", @@ -38,11 +41,16 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "commitizen": "^2.8.2", + "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", "xml2js": "^0.4.16" + }, + "czConfig": { + "path": "node_modules/cz-conventional-changelog" } } From d5d9699091a0c4c023c83878774945a96a262091 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 15:59:13 -0400 Subject: [PATCH 071/141] chore(commitizen): use modern commitizen config style --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c6dbe4ae..d70d69dd 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "rimraf": "^2.5.2", "xml2js": "^0.4.16" }, - "czConfig": { - "path": "node_modules/cz-conventional-changelog" + "config": { + "commitizen": { + "path": "node_modules/cz-conventional-changelog" + } } } From adda365fb220c8321ac50cdeddeb37299c1c91ae Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:56 -0400 Subject: [PATCH 072/141] fix(testbed/init.sh): make script executable From 87bcadfa2cd7b6e4fd15a7b11531266c4efd432b Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:08:39 -0400 Subject: [PATCH 073/141] chore(babel): add es6 transpiler to gulpfile --- gulpfile.js | 32 +++++++++++++++++++++++++++++++- package.json | 5 +++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 4bf68ceb..614df6e1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,7 @@ var gulp = require('gulp'); var fs = require('fs'); +var sourcemaps = require('gulp-sourcemaps'); +var babel = require('gulp-babel'); //setup for development use gulp.task('setupDev', function(){ @@ -69,4 +71,32 @@ function emitFiles(path){ } ret.push(''); return ret; -} \ No newline at end of file +} + +//copy resources and compile es6 from corresponding directory +function babelize(taskName, dir){ + if(!dir){ + dir = taskName; + } + var srcDir = dir + '.es6/'; + var srcPattern = dir + '.es6/**/*.js' + var destDir = dir + '/'; + gulp.task(taskName + '-copy', () => { + return gulp.src(srcDir + '**/*.*').pipe(gulp.dest(destDir)); + }); + gulp.task(taskName + '-babel', [taskName + '-copy'], () => { + return gulp.src(srcPattern) + .pipe(sourcemaps.init()) + .pipe(babel({ + presets: ['es2015', 'stage-2'], + plugins: ['transform-runtime'] + })) + .pipe(sourcemaps.write('.')) + .pipe(gulp.dest(destDir)); + }); +} + +babelize('hooks'); +babelize('www'); +babelize('tests'); +babelize('testbed', 'testbed/www/js'); \ No newline at end of file diff --git a/package.json b/package.json index d70d69dd..7790bdb2 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,14 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "babel-plugin-transform-runtime": "^6.12.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-2": "^6.11.0", "commitizen": "^2.8.2", "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", + "gulp-babel": "^6.1.2", + "gulp-sourcemaps": "^1.6.0", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From 07d5ecf42a47aa6ae488ebf7e75378d9ed350e67 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:09:15 -0400 Subject: [PATCH 074/141] chore: use arrow functions instead of 'function' --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 614df6e1..94a6c789 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,13 +4,13 @@ var sourcemaps = require('gulp-sourcemaps'); var babel = require('gulp-babel'); //setup for development use -gulp.task('setupDev', function(){ +gulp.task('setupDev', () => { getDevPluginXML(); setIosNpmOrDev('dev'); }) //setup for npm deployment -gulp.task('setupNpm', function(){ +gulp.task('setupNpm', () => { genNpmPluginXML(); setIosNpmOrDev('npm'); }); From 0eee41993af640b951d8c3397d284bc36919a14d Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:13:46 -0400 Subject: [PATCH 075/141] chore(babel): add task to run all babel subtasks in parallel --- gulpfile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 94a6c789..8712f8e0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,8 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); +gulp.task('build-npm', ['setupNpm', 'babel']); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -74,7 +76,9 @@ function emitFiles(path){ } //copy resources and compile es6 from corresponding directory +babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ + babelTasks.push(taskName + '-babel'); if(!dir){ dir = taskName; } @@ -89,7 +93,7 @@ function babelize(taskName, dir){ .pipe(sourcemaps.init()) .pipe(babel({ presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] + plugins: ['transform-runtime'] //needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -99,4 +103,5 @@ function babelize(taskName, dir){ babelize('hooks'); babelize('www'); babelize('tests'); -babelize('testbed', 'testbed/www/js'); \ No newline at end of file +babelize('testbed', 'testbed/www/js'); +gulp.task('babel', babelTasks); \ No newline at end of file From 679b4cfccbb22192591837d1a940f847e024a0c7 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:19:34 -0400 Subject: [PATCH 076/141] chore(lint): add branch's code style prefs --- .eslintrc | 19 +++++++++++++++++++ .jscs | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .eslintrc create mode 100644 .jscs diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..c22590e4 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +{ + "parser": "babel-eslint", + "env": { "browser": true }, + "rules": { + "quotes": 0, + "strict": 0, + "no-underscore-dangle": 0, + "eqeqeq": 0, + "camelcase": 0, + "consistent-return": 0, + "new-cap": 0 + }, + "globals": { + "module": true, + "require": false, + "mixpanel": false, + "File": false + } +} \ No newline at end of file diff --git a/.jscs b/.jscs new file mode 100644 index 00000000..8385caae --- /dev/null +++ b/.jscs @@ -0,0 +1,42 @@ +{ + "fileExtensions": [".js", ".jsx"], + "esnext": true, + + "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], + "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], + "requireSpaceBeforeBlockStatements": true, + "requireParenthesesAroundIIFE": true, + "requireSpacesInConditionalExpression": { "afterTest": true, "beforeConsequent": true, "afterConsequent": true, "beforeAlternate": true }, + "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunction": { "beforeOpeningRoundBrace": true }, + "disallowSpacesInsideParentheses": true, + "requireSpacesInsideObjectBrackets": "all", + "requireSpacesInsideArrayBrackets": "all", + "disallowSpaceAfterObjectKeys": true, + "requireCommaBeforeLineBreak": true, + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--", ";"], + "disallowSpaceBeforeBinaryOperators": [ "," ], + "requireSpaceBeforeBinaryOperators": [ "=", "+", "-", "/", "*", "==", "===", "!=", "!==" ], + "requireSpaceAfterBinaryOperators": [ "=", ",", "+", "-", "/", "*", "==", "===", "!=", "!==" ], + "disallowMultipleLineStrings": true, + "validateLineBreaks": "LF", + "disallowMixedSpacesAndTabs": "smart", + "disallowTrailingWhitespace": true, + "disallowTrailingComma": true, + "requireKeywordsOnNewLine": [ "else" ], + "requireLineFeedAtFileEnd": true, + "requireCapitalizedConstructors": true, + "safeContextKeyword": [ "self" ], + "disallowYodaConditions": true, + "requireSpaceAfterLineComment": true, + "disallowNewlineBeforeBlockStatements": true +} \ No newline at end of file From ab6a072fa7d6e71ae20c87535a0701b752913310 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:29:15 -0400 Subject: [PATCH 077/141] chore(lint): remove File and mixpanel from eslintrc globals --- .eslintrc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index c22590e4..763a8e94 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,8 +12,6 @@ }, "globals": { "module": true, - "require": false, - "mixpanel": false, - "File": false + "require": false } } \ No newline at end of file From 49b99beb00a9b5b071bcc1b5a936a872ce5d87b7 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:30:51 -0400 Subject: [PATCH 078/141] chore(gulp): add dividers to gulpfile --- gulpfile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8712f8e0..656fb8f4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,6 +3,9 @@ var fs = require('fs'); var sourcemaps = require('gulp-sourcemaps'); var babel = require('gulp-babel'); +gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); + +//------------------------------------------------------------------------------ //setup for development use gulp.task('setupDev', () => { getDevPluginXML(); @@ -15,8 +18,6 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); -gulp.task('build-npm', ['setupNpm', 'babel']); - //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -75,7 +76,8 @@ function emitFiles(path){ return ret; } -//copy resources and compile es6 from corresponding directory +//------------------------------------------------------------------------------ +//copy resources and compile es6 from corresponding directories babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ babelTasks.push(taskName + '-babel'); From ecd8b224129482951f4a5d565b9cc213d3b36de5 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:01:34 -0400 Subject: [PATCH 079/141] chore(lint): implement linting in gulpfile --- .jscs => .jscsrc | 2 -- gulpfile.js | 43 +++++++++++++++++++++++++++++++++++++++---- package.json | 3 +++ 3 files changed, 42 insertions(+), 6 deletions(-) rename .jscs => .jscsrc (99%) diff --git a/.jscs b/.jscsrc similarity index 99% rename from .jscs rename to .jscsrc index 8385caae..d2e9477e 100644 --- a/.jscs +++ b/.jscsrc @@ -1,7 +1,5 @@ { "fileExtensions": [".js", ".jsx"], - "esnext": true, - "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], "requireSpaceBeforeBlockStatements": true, diff --git a/gulpfile.js b/gulpfile.js index 656fb8f4..c333bf75 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,7 +1,9 @@ -var gulp = require('gulp'); -var fs = require('fs'); +var gulp = require('gulp'); +var fs = require('fs'); var sourcemaps = require('gulp-sourcemaps'); -var babel = require('gulp-babel'); +var babel = require('gulp-babel'); +var eslint = require('gulp-eslint'); +var jscs = require('gulp-jscs'); gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); @@ -106,4 +108,37 @@ babelize('hooks'); babelize('www'); babelize('tests'); babelize('testbed', 'testbed/www/js'); -gulp.task('babel', babelTasks); \ No newline at end of file +gulp.task('babel', babelTasks); + +//------------------------------------------------------------------------------ +//linting + +gulp.task('lint', ['eslint', 'jscs-lint']); + +var srcs = [ + '**/*.js', + '!node_modules/**', + '!testbed/platforms/ios/cordova/node_modules/**' +]; + +gulp.task('lint', () => { + return gulp.src(srcs) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + +function jscsTask(fix){ + var ret = gulp.src(srcs) + .pipe(jscs({fix: fix})) + .pipe(jscs.reporter()) + .pipe(jscs.reporter('fail')); + + if(fix){ + ret.pipe(gulp.dest('.')); + } + return ret; +} + +gulp.task('jscs-fix', jscsTask.bind(null, true)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file diff --git a/package.json b/package.json index 7790bdb2..7ace4acc 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "babel-eslint": "^6.1.2", "babel-plugin-transform-runtime": "^6.12.0", "babel-preset-es2015": "^6.9.0", "babel-preset-stage-2": "^6.11.0", @@ -48,6 +49,8 @@ "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", + "gulp-eslint": "^3.0.1", + "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", From fc2ccbe676968a7caf5b0e526e7e7e6685ce695a Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:19:49 -0400 Subject: [PATCH 080/141] chore(gulpfile): fix linting errors --- gulpfile.js | 87 +++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c333bf75..c673f654 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,26 +5,26 @@ var babel = require('gulp-babel'); var eslint = require('gulp-eslint'); var jscs = require('gulp-jscs'); -gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); +gulp.task('build-npm', [ 'setupNpm', 'babel', 'lint' ]); -//------------------------------------------------------------------------------ -//setup for development use +// ----------------------------------------------------------------------------- +// setup for development use gulp.task('setupDev', () => { getDevPluginXML(); setIosNpmOrDev('dev'); }) -//setup for npm deployment +// setup for npm deployment gulp.task('setupNpm', () => { genNpmPluginXML(); setIosNpmOrDev('npm'); }); -//generate plugin.xml for use as a cordova plugin -//here we explode the contents of the frameworks -function genNpmPluginXML(){ +// generate plugin.xml for use as a cordova plugin +// here we explode the contents of the frameworks +function genNpmPluginXML() { var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); - + var files = []; var root = 'src/ios/dependencies/'; files = files.concat(emitFiles(root + 'Fabric/')); @@ -34,43 +34,46 @@ function genNpmPluginXML(){ var newLineIndent = '\n '; xml = xml.replace('', newLineIndent + files.join(newLineIndent)); - + fs.writeFileSync('plugin.xml', xml); }; -//generate plugin.xml for local development -//here we reference the frameworks instead of all the files directly -function getDevPluginXML(){ +// generate plugin.xml for local development +// here we reference the frameworks instead of all the files directly +function getDevPluginXML() { var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); - - xml = xml.replace('', + + xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); }; -function setIosNpmOrDev(npmOrDev){ - if(npmOrDev === 'npm'){ +function setIosNpmOrDev(npmOrDev) { + if (npmOrDev === 'npm') { content = '#define BRANCH_NPM true'; - }else if(npmOrDev === 'dev'){ + } +else if (npmOrDev === 'dev') { content = '//empty'; - }else{ + } +else { throw new Error('expected deployed|local, not ' + deployedOrLocal); } fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); } -//emit array of cordova file references for all .h/.m files in path -function emitFiles(path){ +// emit array of cordova file references for all .h/.m files in path +function emitFiles(path) { var ret = []; - for(filename of fs.readdirSync(path)){ + for (filename of fs.readdirSync(path)) { var fileType = null; - if(filename.match(/\.m$/)){ + if (filename.match(/\.m$/)) { fileType = 'source'; - }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + } +else if (filename.match(/\.h$/) || filename.match(/\.pch$/)) { fileType = 'header'; } - if(fileType){ + if (fileType) { ret.push('<' + fileType + '-file src="' + path + filename + '" />'); } } @@ -78,12 +81,12 @@ function emitFiles(path){ return ret; } -//------------------------------------------------------------------------------ -//copy resources and compile es6 from corresponding directories -babelTasks = []; //list of all babel tasks so we can build all of them -function babelize(taskName, dir){ +// ----------------------------------------------------------------------------- +// copy resources and compile es6 from corresponding directories +babelTasks = []; // list of all babel tasks so we can build all of them +function babelize(taskName, dir) { babelTasks.push(taskName + '-babel'); - if(!dir){ + if (!dir) { dir = taskName; } var srcDir = dir + '.es6/'; @@ -92,12 +95,12 @@ function babelize(taskName, dir){ gulp.task(taskName + '-copy', () => { return gulp.src(srcDir + '**/*.*').pipe(gulp.dest(destDir)); }); - gulp.task(taskName + '-babel', [taskName + '-copy'], () => { + gulp.task(taskName + '-babel', [ taskName + '-copy' ], () => { return gulp.src(srcPattern) .pipe(sourcemaps.init()) .pipe(babel({ - presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] //needed for generators etc + presets: [ 'es2015', 'stage-2' ], + plugins: [ 'transform-runtime' ] // needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -110,35 +113,35 @@ babelize('tests'); babelize('testbed', 'testbed/www/js'); gulp.task('babel', babelTasks); -//------------------------------------------------------------------------------ -//linting +// ----------------------------------------------------------------------------- +// linting + +gulp.task('lint', [ 'eslint', 'jscs-lint' ]); -gulp.task('lint', ['eslint', 'jscs-lint']); - var srcs = [ '**/*.js', '!node_modules/**', '!testbed/platforms/ios/cordova/node_modules/**' ]; -gulp.task('lint', () => { +gulp.task('eslint', () => { return gulp.src(srcs) .pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); }); -function jscsTask(fix){ - var ret = gulp.src(srcs) - .pipe(jscs({fix: fix})) +function jscsTask(fix) { + var ret = gulp.src('gulpfile.js') + .pipe(jscs({ fix: fix })) .pipe(jscs.reporter()) .pipe(jscs.reporter('fail')); - if(fix){ + if (fix) { ret.pipe(gulp.dest('.')); } return ret; } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file +gulp.task('jscs-lint', jscsTask.bind(null, false)); From 899d3e73a433d62f7b3e33d6e4a0fcc618bd5f76 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 12:17:13 -0400 Subject: [PATCH 081/141] chore(gulpfile): whitespace --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c673f654..0b70f893 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file From f70ce5ab1bed17b96c4576e46b3a0c2cd7fcd213 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:56 -0400 Subject: [PATCH 082/141] fix(testbed/init.sh): make script executable From 734467e27501e6c324165a3af90187578011df0a Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:19:49 -0400 Subject: [PATCH 083/141] chore(gulpfile): fix linting errors --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 0b70f893..c673f654 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file +gulp.task('jscs-lint', jscsTask.bind(null, false)); From 7178bd5d1ccd0bb962ae050740be037d1e92ac59 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 12:17:13 -0400 Subject: [PATCH 084/141] chore(gulpfile): whitespace --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c673f654..0b70f893 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file From 601ca99b8268f54ce8e63f776fa3f08a36dd7af6 Mon Sep 17 00:00:00 2001 From: Alex Austin Date: Wed, 3 Aug 2016 10:30:24 -0700 Subject: [PATCH 085/141] chore(travis): setup travis CI --- .travis.yml | 26 ++++++++++++++++++++++++++ package.json | 13 +++++++------ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..901a7bf3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +sudo: false +language: node_js +cache: + directories: + - node_modules +notifications: + email: false +node_js: + - '4' + - iojs-v3 + - iojs-v2 + - iojs-v1 + - '0.12' + - '0.10' +before_install: + - npm i -g npm@^2.0.0 +before_script: + - npm prune +after_success: + - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' + - python travis_after_all.py + - export $(cat .to_export_back) &> /dev/null + - npm run semantic-release +branches: + except: + - /^v\d+\.\d+\.\d+$/ diff --git a/package.json b/package.json index 7ace4acc..22ab49ae 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,14 @@ { - "version": "2.1.10", "name": "branch-cordova-sdk", "description": "Branch Metrics Cordova SDK", "main": "www/branch.js", - "homepage": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK", + "homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking", "repository": { "type": "git", - "url": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git" + "url": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking.git" }, "bugs": { - "url": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues" + "url": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/issues" }, "keywords": [ "ecosystem:cordova", @@ -31,7 +30,8 @@ ], "license": "MIT", "scripts": { - "commit": "git-cz" + "commit": "git-cz", + "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "dependencies": { "mkpath": "^1.0.0", @@ -56,7 +56,8 @@ "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", - "xml2js": "^0.4.16" + "xml2js": "^0.4.16", + "semantic-release": "^4.3.5" }, "config": { "commitizen": { From c7ec7219ac2eb82749f5803c6c4701a199d28a03 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 13:41:40 -0400 Subject: [PATCH 086/141] chore(package.json): add dummy version to prevent warnings --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 22ab49ae..2b60b0db 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "branch-cordova-sdk", "description": "Branch Metrics Cordova SDK", "main": "www/branch.js", + "version": "0.0.0-semantic-release", "homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking", "repository": { "type": "git", From e0b2cddfebc7554335ddc29e918d6393449dcf8a Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 13:59:26 -0400 Subject: [PATCH 087/141] chore(gulpfile): rename build-npm -> prerelease --- gulpfile.js | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 0b70f893..dfbaaff0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,7 +5,7 @@ var babel = require('gulp-babel'); var eslint = require('gulp-eslint'); var jscs = require('gulp-jscs'); -gulp.task('build-npm', [ 'setupNpm', 'babel', 'lint' ]); +gulp.task('prerelease', [ 'setupNpm', 'babel', 'lint' ]); // ----------------------------------------------------------------------------- // setup for development use diff --git a/package.json b/package.json index 2b60b0db..a36489f0 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ ], "license": "MIT", "scripts": { + "prerelease": "gulp prerelease", "commit": "git-cz", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, From 2d6b8048ef47ab59e9d6c8395aa673f15a0b7f9f Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:07 -0400 Subject: [PATCH 088/141] chore(travis): run prerelease before deploy --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 901a7bf3..deb1aa46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ before_install: - npm i -g npm@^2.0.0 before_script: - npm prune +script: + - npm run prerelease after_success: - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' - python travis_after_all.py @@ -23,4 +25,4 @@ after_success: - npm run semantic-release branches: except: - - /^v\d+\.\d+\.\d+$/ + - /^v\d+\.\d+\.\d+$/ \ No newline at end of file From ab60be519ffd11a03a4ee03ab9274ee65fd97bff Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:27 -0400 Subject: [PATCH 089/141] chore(travis): only integrate master --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index deb1aa46..9e28665c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,5 +24,5 @@ after_success: - export $(cat .to_export_back) &> /dev/null - npm run semantic-release branches: - except: - - /^v\d+\.\d+\.\d+$/ \ No newline at end of file + only: + - master \ No newline at end of file From 113cc5afe87e7c733ec433d3ffb50337f9405a05 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:58 -0400 Subject: [PATCH 090/141] chore(travis): only build against recent node versions --- .travis.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e28665c..be5507b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,9 @@ cache: notifications: email: false node_js: + - '6' + - '5' - '4' - - iojs-v3 - - iojs-v2 - - iojs-v1 - - '0.12' - - '0.10' before_install: - npm i -g npm@^2.0.0 before_script: From 0da3024b3b179ce0d1e135686724b78d49239fd5 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 16:51:44 -0400 Subject: [PATCH 091/141] chore: add developer docs --- development.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 development.md diff --git a/development.md b/development.md new file mode 100644 index 00000000..bdd9ece2 --- /dev/null +++ b/development.md @@ -0,0 +1,38 @@ +# Development Conventions + +This document outlines our development processes. + +## Git Flow + +We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. + +Please issue github pull requests against develop instead of merging features directly in. + +## Commit Messages + +Please format your commit messages to match [Angular's Conventions](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines). These messages are parsed using semantic release to determine version numbers so it is important that you stick to them exactly. We recommend using the `npm run commit` script installed in this project to draft conformant messages. + +## Linting + +The style of all js files in this project are strictly checked using [jscs](http://jscs.info/) and [eslint](http://eslint.org/) before any pull request/release is made. You can manually check your local clone using the `gulp lint` command (don't forget to `nom install -g gulp` if you haven't already). Many problems can be automatically fixed by `gulp jscs-fix`. Don't forget to commit before running jscs-fix in case you want to back out changes. + +## Testing + + + +## Updating IOS dependencies + +This project depends on [ios-branch-deep-linking](https://github.com/BranchMetrics/ios-branch-deep-linking). To upgrade that dependency a [release](https://github.com/BranchMetrics/ios-branch-deep-linking/releases) of it run the following script: + +```shell +# is the name of the release. e,g, '0.12.5' +$ src/ios/dependencies/update.sh +``` + +## Releasing + +This project is automatically released to NPM by TravisCI when changes are merged into master. Here's how that looks using git flow: + +```shell +$ git flow release start +``` \ No newline at end of file From a838fef1349ddc8d65dba6a02361db52f842676c Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:03:53 -0400 Subject: [PATCH 092/141] chore(travis): don't release pull requests --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index be5507b7..8efaee88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ after_success: - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' - python travis_after_all.py - export $(cat .to_export_back) &> /dev/null - - npm run semantic-release + - test $TRAVIS_PULL_REQUEST = false \ + && npm run semantic-release branches: only: - master \ No newline at end of file From 5e74b60cda785d8a3ca73c2e3206bb74e1777ac1 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:07:03 -0400 Subject: [PATCH 093/141] chore(package.json): remove redundant dependencies --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index a36489f0..e1509470 100644 --- a/package.json +++ b/package.json @@ -54,11 +54,6 @@ "gulp-eslint": "^3.0.1", "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", - "mkpath": "^1.0.0", - "node-version-compare": "^1.0.1", - "plist": "^1.2.0", - "rimraf": "^2.5.2", - "xml2js": "^0.4.16", "semantic-release": "^4.3.5" }, "config": { From 32540dbd69d0be0662dbf3a856e2c33f75b9b99b Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:57:54 -0400 Subject: [PATCH 094/141] chore(dev docs): wip, document relasing --- development.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/development.md b/development.md index bdd9ece2..177a29ef 100644 --- a/development.md +++ b/development.md @@ -4,7 +4,7 @@ This document outlines our development processes. ## Git Flow -We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. +We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. Note that it is not necessary to manually bump versions in package.json, semantic-version automatically computes that for us just before each release. Also note that we don't bother with release branches. Please issue github pull requests against develop instead of merging features directly in. @@ -27,12 +27,4 @@ This project depends on [ios-branch-deep-linking](https://github.com/BranchMetri ```shell # is the name of the release. e,g, '0.12.5' $ src/ios/dependencies/update.sh -``` - -## Releasing - -This project is automatically released to NPM by TravisCI when changes are merged into master. Here's how that looks using git flow: - -```shell -$ git flow release start ``` \ No newline at end of file From a5aa787d225900b90b16551a829fa0c0e5d9d570 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 18:32:22 -0400 Subject: [PATCH 095/141] docs(contributing): switch policy from git flow to a simple branch off master scheme --- development.md => CONTRIBUTING.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename development.md => CONTRIBUTING.md (65%) diff --git a/development.md b/CONTRIBUTING.md similarity index 65% rename from development.md rename to CONTRIBUTING.md index 177a29ef..8e12baa7 100644 --- a/development.md +++ b/CONTRIBUTING.md @@ -2,11 +2,9 @@ This document outlines our development processes. -## Git Flow +## Pull Requests -We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. Note that it is not necessary to manually bump versions in package.json, semantic-version automatically computes that for us just before each release. Also note that we don't bother with release branches. - -Please issue github pull requests against develop instead of merging features directly in. +All changes to this project should be made in the form of pull requests against master. Use snake-case prefixed by 'feat/' or 'fix/' for features/fixes. Feel free to use any of the commit types listed [here](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#type) as well. Note that when pull requests are merged in they will be automatically released to npm by (Travis CI)[https://travis-ci.org/] and (semantic-release)[https://github.com/semantic-release/semantic-release] so make sure to fully test. ## Commit Messages @@ -14,7 +12,7 @@ Please format your commit messages to match [Angular's Conventions](https://gith ## Linting -The style of all js files in this project are strictly checked using [jscs](http://jscs.info/) and [eslint](http://eslint.org/) before any pull request/release is made. You can manually check your local clone using the `gulp lint` command (don't forget to `nom install -g gulp` if you haven't already). Many problems can be automatically fixed by `gulp jscs-fix`. Don't forget to commit before running jscs-fix in case you want to back out changes. +The style of all js files in this project are strictly checked using [jscs](http://jscs.info/) and [eslint](http://eslint.org/) before any pull request/release is made. You can manually check your local clone using the `gulp lint` command (don't forget to `nom install -g gulp` if you haven't already). Many problems can be automatically fixed by `gulp jscs-fix`. Don't forget to commit before running jscs-fix in case you end up needing to back out changes. ## Testing From 2cac2b742a40c81b9747b030e143695ed6cad2dd Mon Sep 17 00:00:00 2001 From: Alex Austin Date: Sun, 7 Aug 2016 16:05:17 -0700 Subject: [PATCH 096/141] Should clear deep link even if Branch --- src/android/io/branch/BranchSDK.java | 2 +- src/ios/BranchSDK.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 8043795e..0d2cfbac 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -693,11 +693,11 @@ public void onInitFinished(JSONObject referringParams, BranchError error) { message.put("error", "Not a Branch link!"); message.put("url", deepLinkUrl); - deepLinkUrl = null; out = String.format("NonBranchLinkHandler(%s)", message.toString()); webView.sendJavascript(out); } + deepLinkUrl = null; } catch (JSONException e) { e.printStackTrace(); } diff --git a/src/ios/BranchSDK.m b/src/ios/BranchSDK.m index 687a56bf..6dc761ce 100644 --- a/src/ios/BranchSDK.m +++ b/src/ios/BranchSDK.m @@ -134,9 +134,9 @@ - (void)initSession:(CDVInvokedUrlCommand*)command } else if (self.deepLinkUrl) { [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:@"BSDKPostUnhandledURL" object:self.deepLinkUrl]]; - self.deepLinkUrl = nil; } - + self.deepLinkUrl = nil; + if (command != nil) { [self.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId]; } From 859fea02c1ad16675c41e981cce14b1996b69ccd Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 8 Aug 2016 11:15:40 -0400 Subject: [PATCH 097/141] fix(package.json): add babel polyfill --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index e1509470..45563bf8 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "devDependencies": { "babel-eslint": "^6.1.2", "babel-plugin-transform-runtime": "^6.12.0", + "babel-polyfill": "^6.13.0", "babel-preset-es2015": "^6.9.0", "babel-preset-stage-2": "^6.11.0", "commitizen": "^2.8.2", From 45b81c8c2b0f782383ac87fbc4b7f877c484cfa7 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 8 Aug 2016 12:49:37 -0400 Subject: [PATCH 098/141] feature(tests-harness): create harness for running tests and document it --- CONTRIBUTING.md | 2 +- package.json | 3 + tests-harness/.gitignore | 4 ++ tests-harness/README.md | 38 +++++++++++ tests-harness/config.xml | 34 ++++++++++ tests-harness/hooks/README.md | 23 +++++++ tests-harness/www/css/index.css | 115 ++++++++++++++++++++++++++++++++ tests-harness/www/img/logo.png | Bin 0 -> 21814 bytes tests-harness/www/index.html | 49 ++++++++++++++ tests-harness/www/js/index.js | 51 ++++++++++++++ tests/README.md | 10 --- 11 files changed, 318 insertions(+), 11 deletions(-) create mode 100644 tests-harness/.gitignore create mode 100644 tests-harness/README.md create mode 100644 tests-harness/config.xml create mode 100644 tests-harness/hooks/README.md create mode 100644 tests-harness/www/css/index.css create mode 100644 tests-harness/www/img/logo.png create mode 100644 tests-harness/www/index.html create mode 100644 tests-harness/www/js/index.js delete mode 100644 tests/README.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e12baa7..7139c6b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ The style of all js files in this project are strictly checked using [jscs](http ## Testing - +See [tests-harness/README.md](https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/blob/master/tests-harness/README.md) for details on how to run this project's test suite. Please run the test suite before merging any branches. ## Updating IOS dependencies diff --git a/package.json b/package.json index 45563bf8..ffb4e666 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,9 @@ "gulp-eslint": "^3.0.1", "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", + "mkpath": "^1.0.0", + "node-version-compare": "^1.0.1", + "plist": "^1.2.0", "semantic-release": "^4.3.5" }, "config": { diff --git a/tests-harness/.gitignore b/tests-harness/.gitignore new file mode 100644 index 00000000..d04ff6f0 --- /dev/null +++ b/tests-harness/.gitignore @@ -0,0 +1,4 @@ + +platforms +plugins +node_modules \ No newline at end of file diff --git a/tests-harness/README.md b/tests-harness/README.md new file mode 100644 index 00000000..2e0150d6 --- /dev/null +++ b/tests-harness/README.md @@ -0,0 +1,38 @@ +# Running Plugin Tests + +These tests can currently only run on os x since xcode is not available on other plaforms. You may be able to get the android tests working on other machines by following a similar process to the one outlined here. + + 1. Install [homebrew](http://brew.sh/). If you already have it run `brew update` to get the latest version. + + 1. Run `brew doctor` and fix any problems that it reports. + + 1. Install java and the android development kit: + +```sh +brew install cask +brew cask install java # this should be java 8 +brew install ant maven gradle android-sdk android-ndk +android update sdk --no-ui +``` + + 1. Install node (`brew install node`) and cordova (`npm install -g cordova`) if you haven't already. + + 1. Run `open ~/Library/Android/sdk/tools/android` check off `android 6.0`, click `Install Packages`, and accept ALL licenses in the next screen before clicking install again to complete installation. + + 1. Run `~/Library/Android/sdk/tools/android avd` and create an image with name `nexus-intel` device `Galaxy Nexus (4.65"...` target `android 6.0 - API Level 23` CPU/ABI `Intel Atom (x86_64)` no skin size `200mb` and `Use Host GPU` checked off. + + 1. Run `npm install` in the project root. + + 1. Run the following commands in the tests-harness directory of this project: + +```sh +cordova prepare +cordova compile +``` + + 1. Finally run the tests: + +``` +cordova run ios --emulator +cordova run android --emulator +``` \ No newline at end of file diff --git a/tests-harness/config.xml b/tests-harness/config.xml new file mode 100644 index 00000000..9b1cecf2 --- /dev/null +++ b/tests-harness/config.xml @@ -0,0 +1,34 @@ + + + Branch Cordova Test Harness + + A testing harness for the Branch Cordova Deep Linking project. + + + Amit Bansil + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-harness/hooks/README.md b/tests-harness/hooks/README.md new file mode 100644 index 00000000..574ad4c9 --- /dev/null +++ b/tests-harness/hooks/README.md @@ -0,0 +1,23 @@ + +# Cordova Hooks + +Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide. diff --git a/tests-harness/www/css/index.css b/tests-harness/www/css/index.css new file mode 100644 index 00000000..51daa797 --- /dev/null +++ b/tests-harness/www/css/index.css @@ -0,0 +1,115 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +* { + -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ +} + +body { + -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ + -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ + -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ + background-color:#E4E4E4; + background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, #A7A7A7), + color-stop(0.51, #E4E4E4) + ); + background-attachment:fixed; + font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif; + font-size:12px; + height:100%; + margin:0px; + padding:0px; + text-transform:uppercase; + width:100%; +} + +/* Portrait layout (default) */ +.app { + background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ + position:absolute; /* position in the center of the screen */ + left:50%; + top:50%; + height:50px; /* text area height */ + width:225px; /* text area width */ + text-align:center; + padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ + margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */ + /* offset horizontal: half of text area width */ +} + +/* Landscape layout (with min-width) */ +@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { + .app { + background-position:left center; + padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */ + margin:-90px 0px 0px -198px; /* offset vertical: half of image height */ + /* offset horizontal: half of image width and text area width */ + } +} + +h1 { + font-size:24px; + font-weight:normal; + margin:0px; + overflow:visible; + padding:0px; + text-align:center; +} + +.event { + border-radius:4px; + -webkit-border-radius:4px; + color:#FFFFFF; + font-size:12px; + margin:0px 30px; + padding:2px 0px; +} + +.event.listening { + background-color:#333333; + display:block; +} + +.event.received { + background-color:#4B946A; + display:none; +} + +@keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.4; } + to { opacity: 1.0; } +} + +@-webkit-keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.4; } + to { opacity: 1.0; } +} + +.blink { + animation:fade 3000ms infinite; + -webkit-animation:fade 3000ms infinite; +} diff --git a/tests-harness/www/img/logo.png b/tests-harness/www/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9519e7dd78adb6e44548c08510a7bf02442a7697 GIT binary patch literal 21814 zcmV*iKuy1iP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIY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2X!x{FdN|DJ~Ak~2>3V>NBknw7EsH#ZTI@DDbBOogPm`eaWGu59~eR)xwbOMMf z0EjA>@kWXnpbRN0N>n`|KQu=rDxF>sF@Nd!6O0%u55#$-KK7E_Q%>LUeUejR{w8auU0P(YP9TY0L!s`^(c zVa65dwuD42Q~#U+PEl~f;pXM+m**_yaimqcYS0;^nobj-RFQZ`Maf#m4&+6yvH}6B zg4EA7WAbcN9fXwPa)oCtRL1xs-gn*R3+;4T5*_WAxWu3opO$og%UQPN*Fc| z+*v{_k2=d#|3zMZT7qVo1p1GqO@L5+iwvM6LprC`ds*y0&nA7ns{AS@0HHW0pJxWt zk+Nk#tz(;V+Uu`MO{o-bnO6Vl*)rQ!@=){&xBy?S~bgR?3lkQZ{zBJPW5rlLA6 zRG1v49I;u0J5AeuoC2%L;6XV<8cSq1v#6u$QSh2kFIV=p22{>?9#w5tlz_EJ(y9`0 zmq}BUdHrcXQi0t=DT%1xSec5ZjNhRQb09BvkDT+QKd&N9=`|=ht4LKsd9^^6W-O{4 zC}Isz;Aoen1ag)$Rn&)XLv(&6808o|_1Qh3smf4l|tNtB!Q#*CDXE=7g?7VR4R$!4>u|bJWV{vSS0aj)a{C&?hN9U#~!&wX>CH z-&Tz@@s!ui(-gna6riID$IrsqIX4Mr2jZdzZB-@W)Dkqk?{O13rimEM(vv^mP8Z-@ z^Ef`{q=}9(W(1U3W;4yCv&Q*0H8A;@pgxZD%sp<_J(=l9p%rJEutl zol{P)O&ga_ + + + + + + + + + + Hello World + + +
+

Apache Cordova

+ +
+ + + + diff --git a/tests-harness/www/js/index.js b/tests-harness/www/js/index.js new file mode 100644 index 00000000..c31cd831 --- /dev/null +++ b/tests-harness/www/js/index.js @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +var app = { + // Application Constructor + initialize: function() { + this.bindEvents(); + }, + // Bind Event Listeners + // + // Bind any events that are required on startup. Common events are: + // 'load', 'deviceready', 'offline', and 'online'. + bindEvents: function() { + document.addEventListener('deviceready', this.onDeviceReady, false); + }, + // deviceready Event Handler + // + // The scope of 'this' is the event. In order to call the 'receivedEvent' + // function, we must explicitly call 'app.receivedEvent(...);' + onDeviceReady: function() { + app.receivedEvent('deviceready'); + }, + // Update DOM on a Received Event + receivedEvent: function(id) { + var parentElement = document.getElementById(id); + var listeningElement = parentElement.querySelector('.listening'); + var receivedElement = parentElement.querySelector('.received'); + + listeningElement.setAttribute('style', 'display:none;'); + receivedElement.setAttribute('style', 'display:block;'); + + console.log('Received Event: ' + id); + } +}; + +app.initialize(); \ No newline at end of file diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index e6cf31de..00000000 --- a/tests/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Running Plugin Tests - -1. Use your existing cordova app, or create a new one. -2. Add these plugins: -``` -cordova plugin add http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework.git -cordova plugin add https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git#:/tests -``` -3. Change the start page in `config.xml` with `` or navigate to `cdvtests/index.html` from within your app. -4. That's it. \ No newline at end of file From 4756e4e64d6389f3c526732a36129878f55f0851 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 14:56:53 -0400 Subject: [PATCH 099/141] chore(dependencies): add gulp --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c55b0068..5ce33a48 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From 6b9136d8a81eea6eb5a2e4cda3f9f6f938a9aeb6 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 16:23:05 -0400 Subject: [PATCH 100/141] refactor(plugin.xml): generate ios references based on build target --- gulpfile.js | 49 ++++++++++++++++++++ plugin.template.xml | 108 ++++++++++++++++++++++++++++++++++++++++++++ plugin.xml | 38 ++++++++-------- 3 files changed, 176 insertions(+), 19 deletions(-) create mode 100644 gulpfile.js create mode 100644 plugin.template.xml diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..8303c81d --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,49 @@ +var gulp = require('gulp'); +var fs = require('fs'); + +//generate plugin.xml for use as a cordova plugin +//here we explode the contents of the frameworks +gulp.task('gen-npm-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + var files = []; + var root = 'src/ios/dependencies/'; + files = files.concat(emitFiles(root + 'Fabric/')); + files = files.concat(emitFiles(root + 'Branch-SDK/')); + files = files.concat(emitFiles(root + 'Branch-SDK/Requests/')); + + var newLineIndent = '\n '; + xml = xml.replace('', newLineIndent + + files.join(newLineIndent)); + + fs.writeFileSync('plugin.xml', xml); +}); + +//generate plugin.xml for local development +//here we reference the frameworks instead of all the files directly +gulp.task('gen-dev-plugin-xml', function(){ + var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); + + xml = xml.replace('', + ''); + + fs.writeFileSync('plugin.xml', xml); +}); + +//emit array of cordova file references for all .h/.m files in path +function emitFiles(path){ + var ret = []; + for(filename of fs.readdirSync(path)){ + var fileType = null; + if(filename.match(/\.m$/)){ + fileType = 'source'; + }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + fileType = 'header'; + } + if(fileType){ + ret.push('<' + fileType + '-file src="' + path + filename + '" />'); + } + } + ret.push(''); + return ret; +} \ No newline at end of file diff --git a/plugin.template.xml b/plugin.template.xml new file mode 100644 index 00000000..5165dac0 --- /dev/null +++ b/plugin.template.xml @@ -0,0 +1,108 @@ + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + diff --git a/plugin.xml b/plugin.xml index 17420318..4ab7bb93 100644 --- a/plugin.xml +++ b/plugin.xml @@ -103,24 +103,26 @@ SOFTWARE. - - - - + + + From f9dab4cec02b4d7ff115dd64a068721e758717df Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 17:30:28 -0400 Subject: [PATCH 101/141] refactor(ios): automatically set correct header paths based on deployment --- .gitignore | 3 + gulpfile.js | 31 +++++- plugin.template.xml | 6 + plugin.xml | 192 -------------------------------- src/ios/AppDelegate+BranchSdk.m | 9 +- src/ios/BranchSDK.h | 15 ++- 6 files changed, 56 insertions(+), 200 deletions(-) delete mode 100644 plugin.xml diff --git a/.gitignore b/.gitignore index 83631f70..692b8299 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ testbed/hooks node_modules testbed/ul_web_hooks/ .installed + +/plugin.xml +src/ios/BranchNPM.h \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 8303c81d..4bf68ceb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,9 +1,21 @@ var gulp = require('gulp'); var fs = require('fs'); +//setup for development use +gulp.task('setupDev', function(){ + getDevPluginXML(); + setIosNpmOrDev('dev'); +}) + +//setup for npm deployment +gulp.task('setupNpm', function(){ + genNpmPluginXML(); + setIosNpmOrDev('npm'); +}); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks -gulp.task('gen-npm-plugin-xml', function(){ +function genNpmPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); var files = []; @@ -17,18 +29,29 @@ gulp.task('gen-npm-plugin-xml', function(){ + files.join(newLineIndent)); fs.writeFileSync('plugin.xml', xml); -}); +}; //generate plugin.xml for local development //here we reference the frameworks instead of all the files directly -gulp.task('gen-dev-plugin-xml', function(){ +function getDevPluginXML(){ var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); -}); +}; + +function setIosNpmOrDev(npmOrDev){ + if(npmOrDev === 'npm'){ + content = '#define BRANCH_NPM true'; + }else if(npmOrDev === 'dev'){ + content = '//empty'; + }else{ + throw new Error('expected deployed|local, not ' + deployedOrLocal); + } + fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); +} //emit array of cordova file references for all .h/.m files in path function emitFiles(path){ diff --git a/plugin.template.xml b/plugin.template.xml index 5165dac0..f415dbde 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,3 +1,8 @@ + + + + + - - - branch-cordova-sdk - Branch SDK Plugin - Apache 2.0 - cordova,branch - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git - https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $BRANCH_KEY - - - - - CFBundleURLName - io.branch.sdk - CFBundleURLSchemes - - $URI_SCHEME - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ios/AppDelegate+BranchSdk.m b/src/ios/AppDelegate+BranchSdk.m index bd0a480e..7e66c75a 100644 --- a/src/ios/AppDelegate+BranchSdk.m +++ b/src/ios/AppDelegate+BranchSdk.m @@ -7,7 +7,14 @@ // #import "AppDelegate.h" -#import + +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" +#else + #import +#endif @interface AppDelegate (BranchSDK) diff --git a/src/ios/BranchSDK.h b/src/ios/BranchSDK.h index ba26e108..e9944313 100644 --- a/src/ios/BranchSDK.h +++ b/src/ios/BranchSDK.h @@ -5,9 +5,18 @@ // Copyright © 2016 Branch Metrics. All rights reserved. // -#import -#import -#import +#import "BranchNPM.h" + +#ifdef BRANCH_NPM + #import "Branch.h" + #import "BranchLinkProperties.h" + #import "BranchUniversalObject.h" +#else + #import + #import + #import +#endif + #import @interface BranchSDK : CDVPlugin From c43735b7f798f62de0062a01b32323326d6b891c Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:34 -0400 Subject: [PATCH 102/141] fix(gulp): make plugin template comments valid xml --- plugin.template.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugin.template.xml b/plugin.template.xml index f415dbde..bd03c0ef 100644 --- a/plugin.template.xml +++ b/plugin.template.xml @@ -1,7 +1,4 @@ - - - + + + + + + branch-cordova-sdk + Branch SDK Plugin + Apache 2.0 + cordova,branch + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git + https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $BRANCH_KEY + + + + + CFBundleURLName + io.branch.sdk + CFBundleURLSchemes + + $URI_SCHEME + + + + + + + + + + + diff --git a/src/ios/BranchNPM.h b/src/ios/BranchNPM.h new file mode 100644 index 00000000..90fe1bcc --- /dev/null +++ b/src/ios/BranchNPM.h @@ -0,0 +1 @@ +//empty From 44ba3e8de6b77d2cc049be3f1c0866498307be4e Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:32:12 -0400 Subject: [PATCH 105/141] chore(ios): add script to update ios dependencies --- src/ios/dependencies/update.sh | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 src/ios/dependencies/update.sh diff --git a/src/ios/dependencies/update.sh b/src/ios/dependencies/update.sh new file mode 100755 index 00000000..7a133115 --- /dev/null +++ b/src/ios/dependencies/update.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#update the ios dependencies in this directory to those storied under passed tag on github + +#fail fast on errors +set -e + +#cd into directory containing this script +cd "$(dirname "$0")" + +#check first parameter is set to tag to download +if [ -z ${1+x} ]; then + echo "You must pass this script the tag to download" + exit -1 +else + echo "downloading tag '$1'" +fi + +#this is the git tag that we'll be updating to, +#we expecct it to be the first parameter to this script +tag_name=$1 +tag_url="https://github.com/BranchMetrics/ios-branch-deep-linking/archive/$tag_name.zip" +#extract is where we stick the extracted archive of the tag +tag_extract=ios-branch-deep-linking-$tag_name + + +#check that tag exists +tag_url_status=`curl -L -o /dev/null --silent --head --write-out '%{http_code}\n' $tag_url` +if [ $tag_url_status = "200" ]; then + echo "found tag" +else + echo "could not find '$tag_url'" + echo "curl returned status '$tag_url_status'" + exit -1 +fi + +#this will overwripte existing versions of sdk.zip +curl -L -o sdk.zip $tag_url + +#delete old extracted content or do nothing if we don't have any +rm -rf $tag_extract + +#silently (-q) extract download +unzip -q -x sdk.zip +rm -f sdk.zip + +#copy in new dependencies +rm -rf Branch-SDK +mv $tag_extract/Branch-SDK/Branch-SDK . + +rm -rf Branch.framework +mv $tag_extract/Branch.framework . + +rm -rf Fabric +mv $tag_extract/Branch-SDK/Fabric . + +#clean up +rm -rf $tag_extract + +#replace all instances of '#import "../Fabric/' with '#import "' in .m files +find . -type f -name '*.m' \ + -exec perl -i -pe 's/\#import \"\.\.\/Fabric\//#import "/' '{}' + From df38da93692d6b4fb9f8b06f8bfbcfeb2fa87df4 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 1 Aug 2016 17:43:40 -0400 Subject: [PATCH 106/141] chore(deployment): remove npmDeployment.txt it is now automated --- NPMdeployment.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 NPMdeployment.txt diff --git a/NPMdeployment.txt b/NPMdeployment.txt deleted file mode 100644 index 0f7bf0ec..00000000 --- a/NPMdeployment.txt +++ /dev/null @@ -1,5 +0,0 @@ -NPM deployment - -1. comment out iOS framework in plugin.xml -2. change header file references of Cordova iOS libs from to "Branch.h" -3. remove "../Fabric" from all Fabric related imports \ No newline at end of file From b504caaa5afea1d6a2411f6a468750d855cff861 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 13:11:47 -0400 Subject: [PATCH 107/141] chore(gulp): add `npm run commit` command --- package.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.json b/package.json index 5ce33a48..c6dbe4ae 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,9 @@ "ios" ], "license": "MIT", + "scripts": { + "commit": "git-cz" + }, "dependencies": { "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", @@ -38,11 +41,16 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "commitizen": "^2.8.2", + "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", "xml2js": "^0.4.16" + }, + "czConfig": { + "path": "node_modules/cz-conventional-changelog" } } From bfd2678934990aba4db4429eb83baa3d42c7dae0 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 15:59:13 -0400 Subject: [PATCH 108/141] chore(commitizen): use modern commitizen config style --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c6dbe4ae..d70d69dd 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "rimraf": "^2.5.2", "xml2js": "^0.4.16" }, - "czConfig": { - "path": "node_modules/cz-conventional-changelog" + "config": { + "commitizen": { + "path": "node_modules/cz-conventional-changelog" + } } } From 59103ad35f159faa1e6713c4d2e52ecf522189b0 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:56 -0400 Subject: [PATCH 109/141] fix(testbed/init.sh): make script executable From 2eee5195d4c8ac3f35a15153fb236102fedfbcc2 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:08:39 -0400 Subject: [PATCH 110/141] chore(babel): add es6 transpiler to gulpfile --- gulpfile.js | 32 +++++++++++++++++++++++++++++++- package.json | 5 +++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 4bf68ceb..614df6e1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,7 @@ var gulp = require('gulp'); var fs = require('fs'); +var sourcemaps = require('gulp-sourcemaps'); +var babel = require('gulp-babel'); //setup for development use gulp.task('setupDev', function(){ @@ -69,4 +71,32 @@ function emitFiles(path){ } ret.push(''); return ret; -} \ No newline at end of file +} + +//copy resources and compile es6 from corresponding directory +function babelize(taskName, dir){ + if(!dir){ + dir = taskName; + } + var srcDir = dir + '.es6/'; + var srcPattern = dir + '.es6/**/*.js' + var destDir = dir + '/'; + gulp.task(taskName + '-copy', () => { + return gulp.src(srcDir + '**/*.*').pipe(gulp.dest(destDir)); + }); + gulp.task(taskName + '-babel', [taskName + '-copy'], () => { + return gulp.src(srcPattern) + .pipe(sourcemaps.init()) + .pipe(babel({ + presets: ['es2015', 'stage-2'], + plugins: ['transform-runtime'] + })) + .pipe(sourcemaps.write('.')) + .pipe(gulp.dest(destDir)); + }); +} + +babelize('hooks'); +babelize('www'); +babelize('tests'); +babelize('testbed', 'testbed/www/js'); \ No newline at end of file diff --git a/package.json b/package.json index d70d69dd..7790bdb2 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,14 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "babel-plugin-transform-runtime": "^6.12.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-2": "^6.11.0", "commitizen": "^2.8.2", "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", + "gulp-babel": "^6.1.2", + "gulp-sourcemaps": "^1.6.0", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", From cec9d08fcca8775c7b2005436dd6d46e2a538bfd Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:09:15 -0400 Subject: [PATCH 111/141] chore: use arrow functions instead of 'function' --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 614df6e1..94a6c789 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,13 +4,13 @@ var sourcemaps = require('gulp-sourcemaps'); var babel = require('gulp-babel'); //setup for development use -gulp.task('setupDev', function(){ +gulp.task('setupDev', () => { getDevPluginXML(); setIosNpmOrDev('dev'); }) //setup for npm deployment -gulp.task('setupNpm', function(){ +gulp.task('setupNpm', () => { genNpmPluginXML(); setIosNpmOrDev('npm'); }); From aac1ae1a921a4a534d9389a0e66545ab2492d039 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:13:46 -0400 Subject: [PATCH 112/141] chore(babel): add task to run all babel subtasks in parallel --- gulpfile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 94a6c789..8712f8e0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,8 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); +gulp.task('build-npm', ['setupNpm', 'babel']); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -74,7 +76,9 @@ function emitFiles(path){ } //copy resources and compile es6 from corresponding directory +babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ + babelTasks.push(taskName + '-babel'); if(!dir){ dir = taskName; } @@ -89,7 +93,7 @@ function babelize(taskName, dir){ .pipe(sourcemaps.init()) .pipe(babel({ presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] + plugins: ['transform-runtime'] //needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -99,4 +103,5 @@ function babelize(taskName, dir){ babelize('hooks'); babelize('www'); babelize('tests'); -babelize('testbed', 'testbed/www/js'); \ No newline at end of file +babelize('testbed', 'testbed/www/js'); +gulp.task('babel', babelTasks); \ No newline at end of file From 9fd78e90e0174b61fb4d137f9023044ca94c78a1 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:19:34 -0400 Subject: [PATCH 113/141] chore(lint): add branch's code style prefs --- .eslintrc | 19 +++++++++++++++++++ .jscs | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .eslintrc create mode 100644 .jscs diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..c22590e4 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +{ + "parser": "babel-eslint", + "env": { "browser": true }, + "rules": { + "quotes": 0, + "strict": 0, + "no-underscore-dangle": 0, + "eqeqeq": 0, + "camelcase": 0, + "consistent-return": 0, + "new-cap": 0 + }, + "globals": { + "module": true, + "require": false, + "mixpanel": false, + "File": false + } +} \ No newline at end of file diff --git a/.jscs b/.jscs new file mode 100644 index 00000000..8385caae --- /dev/null +++ b/.jscs @@ -0,0 +1,42 @@ +{ + "fileExtensions": [".js", ".jsx"], + "esnext": true, + + "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], + "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], + "requireSpaceBeforeBlockStatements": true, + "requireParenthesesAroundIIFE": true, + "requireSpacesInConditionalExpression": { "afterTest": true, "beforeConsequent": true, "afterConsequent": true, "beforeAlternate": true }, + "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunction": { "beforeOpeningRoundBrace": true }, + "disallowSpacesInsideParentheses": true, + "requireSpacesInsideObjectBrackets": "all", + "requireSpacesInsideArrayBrackets": "all", + "disallowSpaceAfterObjectKeys": true, + "requireCommaBeforeLineBreak": true, + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--", ";"], + "disallowSpaceBeforeBinaryOperators": [ "," ], + "requireSpaceBeforeBinaryOperators": [ "=", "+", "-", "/", "*", "==", "===", "!=", "!==" ], + "requireSpaceAfterBinaryOperators": [ "=", ",", "+", "-", "/", "*", "==", "===", "!=", "!==" ], + "disallowMultipleLineStrings": true, + "validateLineBreaks": "LF", + "disallowMixedSpacesAndTabs": "smart", + "disallowTrailingWhitespace": true, + "disallowTrailingComma": true, + "requireKeywordsOnNewLine": [ "else" ], + "requireLineFeedAtFileEnd": true, + "requireCapitalizedConstructors": true, + "safeContextKeyword": [ "self" ], + "disallowYodaConditions": true, + "requireSpaceAfterLineComment": true, + "disallowNewlineBeforeBlockStatements": true +} \ No newline at end of file From 8687b86d2d9c63fa2d515eb4758b7d695fbf9708 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:29:15 -0400 Subject: [PATCH 114/141] chore(lint): remove File and mixpanel from eslintrc globals --- .eslintrc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index c22590e4..763a8e94 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,8 +12,6 @@ }, "globals": { "module": true, - "require": false, - "mixpanel": false, - "File": false + "require": false } } \ No newline at end of file From 8ccc56392cf947b7b36f66850360ede3187b16ae Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:30:51 -0400 Subject: [PATCH 115/141] chore(gulp): add dividers to gulpfile --- gulpfile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8712f8e0..656fb8f4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,6 +3,9 @@ var fs = require('fs'); var sourcemaps = require('gulp-sourcemaps'); var babel = require('gulp-babel'); +gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); + +//------------------------------------------------------------------------------ //setup for development use gulp.task('setupDev', () => { getDevPluginXML(); @@ -15,8 +18,6 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); -gulp.task('build-npm', ['setupNpm', 'babel']); - //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -75,7 +76,8 @@ function emitFiles(path){ return ret; } -//copy resources and compile es6 from corresponding directory +//------------------------------------------------------------------------------ +//copy resources and compile es6 from corresponding directories babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ babelTasks.push(taskName + '-babel'); From 0cbe741a4d668a0d7ca7cd99b4132d9d97f5fb5d Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:01:34 -0400 Subject: [PATCH 116/141] chore(lint): implement linting in gulpfile --- .jscs => .jscsrc | 2 -- gulpfile.js | 43 +++++++++++++++++++++++++++++++++++++++---- package.json | 3 +++ 3 files changed, 42 insertions(+), 6 deletions(-) rename .jscs => .jscsrc (99%) diff --git a/.jscs b/.jscsrc similarity index 99% rename from .jscs rename to .jscsrc index 8385caae..d2e9477e 100644 --- a/.jscs +++ b/.jscsrc @@ -1,7 +1,5 @@ { "fileExtensions": [".js", ".jsx"], - "esnext": true, - "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], "requireSpaceBeforeBlockStatements": true, diff --git a/gulpfile.js b/gulpfile.js index 656fb8f4..c333bf75 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,7 +1,9 @@ -var gulp = require('gulp'); -var fs = require('fs'); +var gulp = require('gulp'); +var fs = require('fs'); var sourcemaps = require('gulp-sourcemaps'); -var babel = require('gulp-babel'); +var babel = require('gulp-babel'); +var eslint = require('gulp-eslint'); +var jscs = require('gulp-jscs'); gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); @@ -106,4 +108,37 @@ babelize('hooks'); babelize('www'); babelize('tests'); babelize('testbed', 'testbed/www/js'); -gulp.task('babel', babelTasks); \ No newline at end of file +gulp.task('babel', babelTasks); + +//------------------------------------------------------------------------------ +//linting + +gulp.task('lint', ['eslint', 'jscs-lint']); + +var srcs = [ + '**/*.js', + '!node_modules/**', + '!testbed/platforms/ios/cordova/node_modules/**' +]; + +gulp.task('lint', () => { + return gulp.src(srcs) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + +function jscsTask(fix){ + var ret = gulp.src(srcs) + .pipe(jscs({fix: fix})) + .pipe(jscs.reporter()) + .pipe(jscs.reporter('fail')); + + if(fix){ + ret.pipe(gulp.dest('.')); + } + return ret; +} + +gulp.task('jscs-fix', jscsTask.bind(null, true)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file diff --git a/package.json b/package.json index 7790bdb2..7ace4acc 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "xml2js": "^0.4.16" }, "devDependencies": { + "babel-eslint": "^6.1.2", "babel-plugin-transform-runtime": "^6.12.0", "babel-preset-es2015": "^6.9.0", "babel-preset-stage-2": "^6.11.0", @@ -48,6 +49,8 @@ "cz-conventional-changelog": "^1.1.6", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", + "gulp-eslint": "^3.0.1", + "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", From 73aba7954d89576b69fb55e8334624857eb67a16 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:19:49 -0400 Subject: [PATCH 117/141] chore(gulpfile): fix linting errors --- gulpfile.js | 87 +++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c333bf75..c673f654 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,26 +5,26 @@ var babel = require('gulp-babel'); var eslint = require('gulp-eslint'); var jscs = require('gulp-jscs'); -gulp.task('build-npm', ['setupNpm', 'babel', 'lint']); +gulp.task('build-npm', [ 'setupNpm', 'babel', 'lint' ]); -//------------------------------------------------------------------------------ -//setup for development use +// ----------------------------------------------------------------------------- +// setup for development use gulp.task('setupDev', () => { getDevPluginXML(); setIosNpmOrDev('dev'); }) -//setup for npm deployment +// setup for npm deployment gulp.task('setupNpm', () => { genNpmPluginXML(); setIosNpmOrDev('npm'); }); -//generate plugin.xml for use as a cordova plugin -//here we explode the contents of the frameworks -function genNpmPluginXML(){ +// generate plugin.xml for use as a cordova plugin +// here we explode the contents of the frameworks +function genNpmPluginXML() { var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); - + var files = []; var root = 'src/ios/dependencies/'; files = files.concat(emitFiles(root + 'Fabric/')); @@ -34,43 +34,46 @@ function genNpmPluginXML(){ var newLineIndent = '\n '; xml = xml.replace('', newLineIndent + files.join(newLineIndent)); - + fs.writeFileSync('plugin.xml', xml); }; -//generate plugin.xml for local development -//here we reference the frameworks instead of all the files directly -function getDevPluginXML(){ +// generate plugin.xml for local development +// here we reference the frameworks instead of all the files directly +function getDevPluginXML() { var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); - - xml = xml.replace('', + + xml = xml.replace('', ''); fs.writeFileSync('plugin.xml', xml); }; -function setIosNpmOrDev(npmOrDev){ - if(npmOrDev === 'npm'){ +function setIosNpmOrDev(npmOrDev) { + if (npmOrDev === 'npm') { content = '#define BRANCH_NPM true'; - }else if(npmOrDev === 'dev'){ + } +else if (npmOrDev === 'dev') { content = '//empty'; - }else{ + } +else { throw new Error('expected deployed|local, not ' + deployedOrLocal); } fs.writeFileSync('src/ios/BranchNPM.h', content + '\n'); } -//emit array of cordova file references for all .h/.m files in path -function emitFiles(path){ +// emit array of cordova file references for all .h/.m files in path +function emitFiles(path) { var ret = []; - for(filename of fs.readdirSync(path)){ + for (filename of fs.readdirSync(path)) { var fileType = null; - if(filename.match(/\.m$/)){ + if (filename.match(/\.m$/)) { fileType = 'source'; - }else if(filename.match(/\.h$/) || filename.match(/\.pch$/)){ + } +else if (filename.match(/\.h$/) || filename.match(/\.pch$/)) { fileType = 'header'; } - if(fileType){ + if (fileType) { ret.push('<' + fileType + '-file src="' + path + filename + '" />'); } } @@ -78,12 +81,12 @@ function emitFiles(path){ return ret; } -//------------------------------------------------------------------------------ -//copy resources and compile es6 from corresponding directories -babelTasks = []; //list of all babel tasks so we can build all of them -function babelize(taskName, dir){ +// ----------------------------------------------------------------------------- +// copy resources and compile es6 from corresponding directories +babelTasks = []; // list of all babel tasks so we can build all of them +function babelize(taskName, dir) { babelTasks.push(taskName + '-babel'); - if(!dir){ + if (!dir) { dir = taskName; } var srcDir = dir + '.es6/'; @@ -92,12 +95,12 @@ function babelize(taskName, dir){ gulp.task(taskName + '-copy', () => { return gulp.src(srcDir + '**/*.*').pipe(gulp.dest(destDir)); }); - gulp.task(taskName + '-babel', [taskName + '-copy'], () => { + gulp.task(taskName + '-babel', [ taskName + '-copy' ], () => { return gulp.src(srcPattern) .pipe(sourcemaps.init()) .pipe(babel({ - presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] //needed for generators etc + presets: [ 'es2015', 'stage-2' ], + plugins: [ 'transform-runtime' ] // needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -110,35 +113,35 @@ babelize('tests'); babelize('testbed', 'testbed/www/js'); gulp.task('babel', babelTasks); -//------------------------------------------------------------------------------ -//linting +// ----------------------------------------------------------------------------- +// linting + +gulp.task('lint', [ 'eslint', 'jscs-lint' ]); -gulp.task('lint', ['eslint', 'jscs-lint']); - var srcs = [ '**/*.js', '!node_modules/**', '!testbed/platforms/ios/cordova/node_modules/**' ]; -gulp.task('lint', () => { +gulp.task('eslint', () => { return gulp.src(srcs) .pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); }); -function jscsTask(fix){ - var ret = gulp.src(srcs) - .pipe(jscs({fix: fix})) +function jscsTask(fix) { + var ret = gulp.src('gulpfile.js') + .pipe(jscs({ fix: fix })) .pipe(jscs.reporter()) .pipe(jscs.reporter('fail')); - if(fix){ + if (fix) { ret.pipe(gulp.dest('.')); } return ret; } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file +gulp.task('jscs-lint', jscsTask.bind(null, false)); From 72edc717daa0f3fe25d0a0d20d262067a0034509 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 12:17:13 -0400 Subject: [PATCH 118/141] chore(gulpfile): whitespace --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c673f654..0b70f893 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file From 0419a23e6e65353ecba9f760629460edf5119225 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:56 -0400 Subject: [PATCH 119/141] fix(testbed/init.sh): make script executable From 96902d5e251df7b97bf546777cbf3ccf6df5d9a3 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:19:49 -0400 Subject: [PATCH 120/141] chore(gulpfile): fix linting errors --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 0b70f893..c673f654 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file +gulp.task('jscs-lint', jscsTask.bind(null, false)); From 3762faffd5c7559d26f80bec73592cbb8a01949f Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 12:17:13 -0400 Subject: [PATCH 121/141] chore(gulpfile): whitespace --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c673f654..0b70f893 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file From 5fc57ef9d9f68c72199221c31987d2486a420c61 Mon Sep 17 00:00:00 2001 From: Alex Austin Date: Wed, 3 Aug 2016 10:30:24 -0700 Subject: [PATCH 122/141] chore(travis): setup travis CI --- .travis.yml | 26 ++++++++++++++++++++++++++ package.json | 13 +++++++------ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..901a7bf3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +sudo: false +language: node_js +cache: + directories: + - node_modules +notifications: + email: false +node_js: + - '4' + - iojs-v3 + - iojs-v2 + - iojs-v1 + - '0.12' + - '0.10' +before_install: + - npm i -g npm@^2.0.0 +before_script: + - npm prune +after_success: + - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' + - python travis_after_all.py + - export $(cat .to_export_back) &> /dev/null + - npm run semantic-release +branches: + except: + - /^v\d+\.\d+\.\d+$/ diff --git a/package.json b/package.json index 7ace4acc..22ab49ae 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,14 @@ { - "version": "2.1.10", "name": "branch-cordova-sdk", "description": "Branch Metrics Cordova SDK", "main": "www/branch.js", - "homepage": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK", + "homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking", "repository": { "type": "git", - "url": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git" + "url": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking.git" }, "bugs": { - "url": "https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues" + "url": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/issues" }, "keywords": [ "ecosystem:cordova", @@ -31,7 +30,8 @@ ], "license": "MIT", "scripts": { - "commit": "git-cz" + "commit": "git-cz", + "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "dependencies": { "mkpath": "^1.0.0", @@ -56,7 +56,8 @@ "node-version-compare": "^1.0.1", "plist": "^1.2.0", "rimraf": "^2.5.2", - "xml2js": "^0.4.16" + "xml2js": "^0.4.16", + "semantic-release": "^4.3.5" }, "config": { "commitizen": { From 0c685c22194771219f741b155bf44a2abe4b168e Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 13:41:40 -0400 Subject: [PATCH 123/141] chore(package.json): add dummy version to prevent warnings --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 22ab49ae..2b60b0db 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "branch-cordova-sdk", "description": "Branch Metrics Cordova SDK", "main": "www/branch.js", + "version": "0.0.0-semantic-release", "homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking", "repository": { "type": "git", From b689bceb51d42ef6fa683b9bd3db22c5c6f114c1 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 13:59:26 -0400 Subject: [PATCH 124/141] chore(gulpfile): rename build-npm -> prerelease --- gulpfile.js | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 0b70f893..dfbaaff0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,7 +5,7 @@ var babel = require('gulp-babel'); var eslint = require('gulp-eslint'); var jscs = require('gulp-jscs'); -gulp.task('build-npm', [ 'setupNpm', 'babel', 'lint' ]); +gulp.task('prerelease', [ 'setupNpm', 'babel', 'lint' ]); // ----------------------------------------------------------------------------- // setup for development use diff --git a/package.json b/package.json index 2b60b0db..a36489f0 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ ], "license": "MIT", "scripts": { + "prerelease": "gulp prerelease", "commit": "git-cz", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, From 7952c98a6192e7983e4eaf1c10e5b726616352fd Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:07 -0400 Subject: [PATCH 125/141] chore(travis): run prerelease before deploy --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 901a7bf3..deb1aa46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ before_install: - npm i -g npm@^2.0.0 before_script: - npm prune +script: + - npm run prerelease after_success: - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' - python travis_after_all.py @@ -23,4 +25,4 @@ after_success: - npm run semantic-release branches: except: - - /^v\d+\.\d+\.\d+$/ + - /^v\d+\.\d+\.\d+$/ \ No newline at end of file From 38fc9b289b9873141f33a3d95e5be7fe485e20fc Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:27 -0400 Subject: [PATCH 126/141] chore(travis): only integrate master --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index deb1aa46..9e28665c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,5 +24,5 @@ after_success: - export $(cat .to_export_back) &> /dev/null - npm run semantic-release branches: - except: - - /^v\d+\.\d+\.\d+$/ \ No newline at end of file + only: + - master \ No newline at end of file From 006c0a9ac51714ca955ed79b2aebfc96de321fff Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 14:00:58 -0400 Subject: [PATCH 127/141] chore(travis): only build against recent node versions --- .travis.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e28665c..be5507b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,9 @@ cache: notifications: email: false node_js: + - '6' + - '5' - '4' - - iojs-v3 - - iojs-v2 - - iojs-v1 - - '0.12' - - '0.10' before_install: - npm i -g npm@^2.0.0 before_script: From eba94bc0f362e7e3ac58ef0a1e47fda1cd4840b5 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 16:51:44 -0400 Subject: [PATCH 128/141] chore: add developer docs --- development.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 development.md diff --git a/development.md b/development.md new file mode 100644 index 00000000..bdd9ece2 --- /dev/null +++ b/development.md @@ -0,0 +1,38 @@ +# Development Conventions + +This document outlines our development processes. + +## Git Flow + +We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. + +Please issue github pull requests against develop instead of merging features directly in. + +## Commit Messages + +Please format your commit messages to match [Angular's Conventions](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines). These messages are parsed using semantic release to determine version numbers so it is important that you stick to them exactly. We recommend using the `npm run commit` script installed in this project to draft conformant messages. + +## Linting + +The style of all js files in this project are strictly checked using [jscs](http://jscs.info/) and [eslint](http://eslint.org/) before any pull request/release is made. You can manually check your local clone using the `gulp lint` command (don't forget to `nom install -g gulp` if you haven't already). Many problems can be automatically fixed by `gulp jscs-fix`. Don't forget to commit before running jscs-fix in case you want to back out changes. + +## Testing + + + +## Updating IOS dependencies + +This project depends on [ios-branch-deep-linking](https://github.com/BranchMetrics/ios-branch-deep-linking). To upgrade that dependency a [release](https://github.com/BranchMetrics/ios-branch-deep-linking/releases) of it run the following script: + +```shell +# is the name of the release. e,g, '0.12.5' +$ src/ios/dependencies/update.sh +``` + +## Releasing + +This project is automatically released to NPM by TravisCI when changes are merged into master. Here's how that looks using git flow: + +```shell +$ git flow release start +``` \ No newline at end of file From 97db7b0db8026ec262f427c1bdd3d4b9e712d05d Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:03:53 -0400 Subject: [PATCH 129/141] chore(travis): don't release pull requests --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index be5507b7..8efaee88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ after_success: - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' - python travis_after_all.py - export $(cat .to_export_back) &> /dev/null - - npm run semantic-release + - test $TRAVIS_PULL_REQUEST = false \ + && npm run semantic-release branches: only: - master \ No newline at end of file From 9ff67701fa5e905cdd694a3f834a841476c60a24 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:07:03 -0400 Subject: [PATCH 130/141] chore(package.json): remove redundant dependencies --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index a36489f0..e1509470 100644 --- a/package.json +++ b/package.json @@ -54,11 +54,6 @@ "gulp-eslint": "^3.0.1", "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", - "mkpath": "^1.0.0", - "node-version-compare": "^1.0.1", - "plist": "^1.2.0", - "rimraf": "^2.5.2", - "xml2js": "^0.4.16", "semantic-release": "^4.3.5" }, "config": { From b1891f6cb0fc5c16ce6564b98c580402a5c1fa16 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 17:57:54 -0400 Subject: [PATCH 131/141] chore(dev docs): wip, document relasing --- development.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/development.md b/development.md index bdd9ece2..177a29ef 100644 --- a/development.md +++ b/development.md @@ -4,7 +4,7 @@ This document outlines our development processes. ## Git Flow -We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. +We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. Note that it is not necessary to manually bump versions in package.json, semantic-version automatically computes that for us just before each release. Also note that we don't bother with release branches. Please issue github pull requests against develop instead of merging features directly in. @@ -27,12 +27,4 @@ This project depends on [ios-branch-deep-linking](https://github.com/BranchMetri ```shell # is the name of the release. e,g, '0.12.5' $ src/ios/dependencies/update.sh -``` - -## Releasing - -This project is automatically released to NPM by TravisCI when changes are merged into master. Here's how that looks using git flow: - -```shell -$ git flow release start ``` \ No newline at end of file From 246bcd609bfecd6e06155661ae9c632fc479d947 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 26 Jul 2016 18:23:56 -0400 Subject: [PATCH 132/141] fix(testbed/init.sh): make script executable From 194dc1ea43c0a6350eb73f0fe2d1460cb6182e7b Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 19:19:49 -0400 Subject: [PATCH 133/141] chore(gulpfile): fix linting errors --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index dfbaaff0..6b561c66 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file +gulp.task('jscs-lint', jscsTask.bind(null, false)); From d0cdf96f61488ceec9ff6ee6ff6feb8d99cee1ad Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 12:17:13 -0400 Subject: [PATCH 134/141] chore(gulpfile): whitespace --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 6b561c66..dfbaaff0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); +gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file From 39df9141587b48959d1cb44197f3526c07103059 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Wed, 3 Aug 2016 18:32:22 -0400 Subject: [PATCH 135/141] docs(contributing): switch policy from git flow to a simple branch off master scheme --- development.md => CONTRIBUTING.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename development.md => CONTRIBUTING.md (65%) diff --git a/development.md b/CONTRIBUTING.md similarity index 65% rename from development.md rename to CONTRIBUTING.md index 177a29ef..8e12baa7 100644 --- a/development.md +++ b/CONTRIBUTING.md @@ -2,11 +2,9 @@ This document outlines our development processes. -## Git Flow +## Pull Requests -We use the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model for this project. We recommend installing the [git flow tool](https://github.com/nvie/gitflow/wiki/Installation) and github's [commandline](https://hub.github.com/) and [desktop](https://desktop.github.com/) suites. Note that it is not necessary to manually bump versions in package.json, semantic-version automatically computes that for us just before each release. Also note that we don't bother with release branches. - -Please issue github pull requests against develop instead of merging features directly in. +All changes to this project should be made in the form of pull requests against master. Use snake-case prefixed by 'feat/' or 'fix/' for features/fixes. Feel free to use any of the commit types listed [here](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#type) as well. Note that when pull requests are merged in they will be automatically released to npm by (Travis CI)[https://travis-ci.org/] and (semantic-release)[https://github.com/semantic-release/semantic-release] so make sure to fully test. ## Commit Messages @@ -14,7 +12,7 @@ Please format your commit messages to match [Angular's Conventions](https://gith ## Linting -The style of all js files in this project are strictly checked using [jscs](http://jscs.info/) and [eslint](http://eslint.org/) before any pull request/release is made. You can manually check your local clone using the `gulp lint` command (don't forget to `nom install -g gulp` if you haven't already). Many problems can be automatically fixed by `gulp jscs-fix`. Don't forget to commit before running jscs-fix in case you want to back out changes. +The style of all js files in this project are strictly checked using [jscs](http://jscs.info/) and [eslint](http://eslint.org/) before any pull request/release is made. You can manually check your local clone using the `gulp lint` command (don't forget to `nom install -g gulp` if you haven't already). Many problems can be automatically fixed by `gulp jscs-fix`. Don't forget to commit before running jscs-fix in case you end up needing to back out changes. ## Testing From b4dfdaae1aa095fc5c396bf52ca66b57f40554c4 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 8 Aug 2016 11:15:40 -0400 Subject: [PATCH 136/141] fix(package.json): add babel polyfill --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index e1509470..45563bf8 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "devDependencies": { "babel-eslint": "^6.1.2", "babel-plugin-transform-runtime": "^6.12.0", + "babel-polyfill": "^6.13.0", "babel-preset-es2015": "^6.9.0", "babel-preset-stage-2": "^6.11.0", "commitizen": "^2.8.2", From 9919fb01b575cfb22483d9e27c2599d0ac6fbffd Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 8 Aug 2016 12:49:37 -0400 Subject: [PATCH 137/141] feature(tests-harness): create harness for running tests and document it --- CONTRIBUTING.md | 2 +- package.json | 3 + tests-harness/.gitignore | 4 ++ tests-harness/README.md | 38 +++++++++++ tests-harness/config.xml | 34 ++++++++++ tests-harness/hooks/README.md | 23 +++++++ tests-harness/www/css/index.css | 115 ++++++++++++++++++++++++++++++++ tests-harness/www/img/logo.png | Bin 0 -> 21814 bytes tests-harness/www/index.html | 49 ++++++++++++++ tests-harness/www/js/index.js | 51 ++++++++++++++ tests/README.md | 10 --- 11 files changed, 318 insertions(+), 11 deletions(-) create mode 100644 tests-harness/.gitignore create mode 100644 tests-harness/README.md create mode 100644 tests-harness/config.xml create mode 100644 tests-harness/hooks/README.md create mode 100644 tests-harness/www/css/index.css create mode 100644 tests-harness/www/img/logo.png create mode 100644 tests-harness/www/index.html create mode 100644 tests-harness/www/js/index.js delete mode 100644 tests/README.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e12baa7..7139c6b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ The style of all js files in this project are strictly checked using [jscs](http ## Testing - +See [tests-harness/README.md](https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/blob/master/tests-harness/README.md) for details on how to run this project's test suite. Please run the test suite before merging any branches. ## Updating IOS dependencies diff --git a/package.json b/package.json index 45563bf8..ffb4e666 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,9 @@ "gulp-eslint": "^3.0.1", "gulp-jscs": "^4.0.0", "gulp-sourcemaps": "^1.6.0", + "mkpath": "^1.0.0", + "node-version-compare": "^1.0.1", + "plist": "^1.2.0", "semantic-release": "^4.3.5" }, "config": { diff --git a/tests-harness/.gitignore b/tests-harness/.gitignore new file mode 100644 index 00000000..d04ff6f0 --- /dev/null +++ b/tests-harness/.gitignore @@ -0,0 +1,4 @@ + +platforms +plugins +node_modules \ No newline at end of file diff --git a/tests-harness/README.md b/tests-harness/README.md new file mode 100644 index 00000000..2e0150d6 --- /dev/null +++ b/tests-harness/README.md @@ -0,0 +1,38 @@ +# Running Plugin Tests + +These tests can currently only run on os x since xcode is not available on other plaforms. You may be able to get the android tests working on other machines by following a similar process to the one outlined here. + + 1. Install [homebrew](http://brew.sh/). If you already have it run `brew update` to get the latest version. + + 1. Run `brew doctor` and fix any problems that it reports. + + 1. Install java and the android development kit: + +```sh +brew install cask +brew cask install java # this should be java 8 +brew install ant maven gradle android-sdk android-ndk +android update sdk --no-ui +``` + + 1. Install node (`brew install node`) and cordova (`npm install -g cordova`) if you haven't already. + + 1. Run `open ~/Library/Android/sdk/tools/android` check off `android 6.0`, click `Install Packages`, and accept ALL licenses in the next screen before clicking install again to complete installation. + + 1. Run `~/Library/Android/sdk/tools/android avd` and create an image with name `nexus-intel` device `Galaxy Nexus (4.65"...` target `android 6.0 - API Level 23` CPU/ABI `Intel Atom (x86_64)` no skin size `200mb` and `Use Host GPU` checked off. + + 1. Run `npm install` in the project root. + + 1. Run the following commands in the tests-harness directory of this project: + +```sh +cordova prepare +cordova compile +``` + + 1. Finally run the tests: + +``` +cordova run ios --emulator +cordova run android --emulator +``` \ No newline at end of file diff --git a/tests-harness/config.xml b/tests-harness/config.xml new file mode 100644 index 00000000..9b1cecf2 --- /dev/null +++ b/tests-harness/config.xml @@ -0,0 +1,34 @@ + + + Branch Cordova Test Harness + + A testing harness for the Branch Cordova Deep Linking project. + + + Amit Bansil + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-harness/hooks/README.md b/tests-harness/hooks/README.md new file mode 100644 index 00000000..574ad4c9 --- /dev/null +++ b/tests-harness/hooks/README.md @@ -0,0 +1,23 @@ + +# Cordova Hooks + +Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide. diff --git a/tests-harness/www/css/index.css b/tests-harness/www/css/index.css new file mode 100644 index 00000000..51daa797 --- /dev/null +++ b/tests-harness/www/css/index.css @@ -0,0 +1,115 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +* { + -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ +} + +body { + -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ + -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ + -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ + background-color:#E4E4E4; + background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, #A7A7A7), + color-stop(0.51, #E4E4E4) + ); + background-attachment:fixed; + font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif; + font-size:12px; + height:100%; + margin:0px; + padding:0px; + text-transform:uppercase; + width:100%; +} + +/* Portrait layout (default) */ +.app { + background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ + position:absolute; /* position in the center of the screen */ + left:50%; + top:50%; + height:50px; /* text area height */ + width:225px; /* text area width */ + text-align:center; + padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ + margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */ + /* offset horizontal: half of text area width */ +} + +/* Landscape layout (with min-width) */ +@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { + .app { + background-position:left center; + padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */ + margin:-90px 0px 0px -198px; /* offset vertical: half of image height */ + /* offset horizontal: half of image width and text area width */ + } +} + +h1 { + font-size:24px; + font-weight:normal; + margin:0px; + overflow:visible; + padding:0px; + text-align:center; +} + +.event { + border-radius:4px; + -webkit-border-radius:4px; + color:#FFFFFF; + font-size:12px; + margin:0px 30px; + padding:2px 0px; +} + +.event.listening { + background-color:#333333; + display:block; +} + +.event.received { + background-color:#4B946A; + display:none; +} + +@keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.4; } + to { opacity: 1.0; } +} + +@-webkit-keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.4; } + to { opacity: 1.0; } +} + +.blink { + animation:fade 3000ms infinite; + -webkit-animation:fade 3000ms infinite; +} diff --git a/tests-harness/www/img/logo.png b/tests-harness/www/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9519e7dd78adb6e44548c08510a7bf02442a7697 GIT binary patch literal 21814 zcmV*iKuy1iP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;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8auU0P(YP9TY0L!s`^(c zVa65dwuD42Q~#U+PEl~f;pXM+m**_yaimqcYS0;^nobj-RFQZ`Maf#m4&+6yvH}6B zg4EA7WAbcN9fXwPa)oCtRL1xs-gn*R3+;4T5*_WAxWu3opO$og%UQPN*Fc| z+*v{_k2=d#|3zMZT7qVo1p1GqO@L5+iwvM6LprC`ds*y0&nA7ns{AS@0HHW0pJxWt zk+Nk#tz(;V+Uu`MO{o-bnO6Vl*)rQ!@=){&xBy?S~bgR?3lkQZ{zBJPW5rlLA6 zRG1v49I;u0J5AeuoC2%L;6XV<8cSq1v#6u$QSh2kFIV=p22{>?9#w5tlz_EJ(y9`0 zmq}BUdHrcXQi0t=DT%1xSec5ZjNhRQb09BvkDT+QKd&N9=`|=ht4LKsd9^^6W-O{4 zC}Isz;Aoen1ag)$Rn&)XLv(&6808o|_1Qh3smf4l|tNtB!Q#*CDXE=7g?7VR4R$!4>u|bJWV{vSS0aj)a{C&?hN9U#~!&wX>CH z-&Tz@@s!ui(-gna6riID$IrsqIX4Mr2jZdzZB-@W)Dkqk?{O13rimEM(vv^mP8Z-@ z^Ef`{q=}9(W(1U3W;4yCv&Q*0H8A;@pgxZD%sp<_J(=l9p%rJEutl zol{P)O&ga_ + + + + + + + + + + Hello World + + +
+

Apache Cordova

+ +
+ + + + diff --git a/tests-harness/www/js/index.js b/tests-harness/www/js/index.js new file mode 100644 index 00000000..c31cd831 --- /dev/null +++ b/tests-harness/www/js/index.js @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +var app = { + // Application Constructor + initialize: function() { + this.bindEvents(); + }, + // Bind Event Listeners + // + // Bind any events that are required on startup. Common events are: + // 'load', 'deviceready', 'offline', and 'online'. + bindEvents: function() { + document.addEventListener('deviceready', this.onDeviceReady, false); + }, + // deviceready Event Handler + // + // The scope of 'this' is the event. In order to call the 'receivedEvent' + // function, we must explicitly call 'app.receivedEvent(...);' + onDeviceReady: function() { + app.receivedEvent('deviceready'); + }, + // Update DOM on a Received Event + receivedEvent: function(id) { + var parentElement = document.getElementById(id); + var listeningElement = parentElement.querySelector('.listening'); + var receivedElement = parentElement.querySelector('.received'); + + listeningElement.setAttribute('style', 'display:none;'); + receivedElement.setAttribute('style', 'display:block;'); + + console.log('Received Event: ' + id); + } +}; + +app.initialize(); \ No newline at end of file diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index e6cf31de..00000000 --- a/tests/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Running Plugin Tests - -1. Use your existing cordova app, or create a new one. -2. Add these plugins: -``` -cordova plugin add http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework.git -cordova plugin add https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git#:/tests -``` -3. Change the start page in `config.xml` with `` or navigate to `cdvtests/index.html` from within your app. -4. That's it. \ No newline at end of file From 30a1f7a19acd1ab79566934d4e446446df96089b Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 8 Aug 2016 13:39:37 -0400 Subject: [PATCH 138/141] fix(gulpfile): add trailing new line to make jscs happy --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index dfbaaff0..6b561c66 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,4 +144,4 @@ function jscsTask(fix) { } gulp.task('jscs-fix', jscsTask.bind(null, true)); -gulp.task('jscs-lint', jscsTask.bind(null, false)); \ No newline at end of file +gulp.task('jscs-lint', jscsTask.bind(null, false)); From 638eb273f9e60f4db75e362a1bdec506689f66df Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 8 Aug 2016 13:46:13 -0400 Subject: [PATCH 139/141] chore(jscs): lint entire project, not just gulpefile --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 6b561c66..5a44a1aa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -132,7 +132,7 @@ gulp.task('eslint', () => { }); function jscsTask(fix) { - var ret = gulp.src('gulpfile.js') + var ret = gulp.src(srcs) .pipe(jscs({ fix: fix })) .pipe(jscs.reporter()) .pipe(jscs.reporter('fail')); From cfd1950c4758572c163f76bf07cf4f2d78badef4 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Mon, 8 Aug 2016 14:42:54 -0400 Subject: [PATCH 140/141] fix(tests): harness now setup to take updates to tests and sdk --- package.json | 3 ++- tests-harness/README.md | 6 ++++-- tests-harness/android-test.sh | 5 +++++ tests-harness/config.xml | 5 ----- tests-harness/ios-test.sh | 5 +++++ 5 files changed, 16 insertions(+), 8 deletions(-) create mode 100755 tests-harness/android-test.sh create mode 100755 tests-harness/ios-test.sh diff --git a/package.json b/package.json index ffb4e666..69d63e5c 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,8 @@ "mkpath": "^1.0.0", "node-version-compare": "^1.0.1", "plist": "^1.2.0", - "semantic-release": "^4.3.5" + "semantic-release": "^4.3.5", + "wd": "^0.4.0" }, "config": { "commitizen": { diff --git a/tests-harness/README.md b/tests-harness/README.md index 2e0150d6..b34e6dd1 100644 --- a/tests-harness/README.md +++ b/tests-harness/README.md @@ -27,12 +27,14 @@ android update sdk --no-ui ```sh cordova prepare +cordova plugin add ../ --link --variable BRANCH_KEY=key_live_fnmRM1FXtu11t6e4LU8WsldpvDcA0bzv --variable URI_SCHEME=testbed +cordova plugin add ../tests --link cordova compile ``` 1. Finally run the tests: ``` -cordova run ios --emulator -cordova run android --emulator +./android-test.sh +./ios-test.sh ``` \ No newline at end of file diff --git a/tests-harness/android-test.sh b/tests-harness/android-test.sh new file mode 100755 index 00000000..ecd3bbe8 --- /dev/null +++ b/tests-harness/android-test.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +rm -rf platforms android +cordova prepare android +cordova run android --emulator \ No newline at end of file diff --git a/tests-harness/config.xml b/tests-harness/config.xml index 9b1cecf2..35d3cf6e 100644 --- a/tests-harness/config.xml +++ b/tests-harness/config.xml @@ -23,12 +23,7 @@ - - - - - \ No newline at end of file diff --git a/tests-harness/ios-test.sh b/tests-harness/ios-test.sh new file mode 100755 index 00000000..c2c8fbd2 --- /dev/null +++ b/tests-harness/ios-test.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +rm -rf platforms ios +cordova prepare ios +cordova run ios --emulator \ No newline at end of file From a78ca647d0ad5a554db1cf763aa2d336c1d48d78 Mon Sep 17 00:00:00 2001 From: Alex Austin Date: Mon, 8 Aug 2016 14:48:04 -0700 Subject: [PATCH 141/141] docs(testing): refer users to android command installed by brew --- tests-harness/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests-harness/README.md b/tests-harness/README.md index b34e6dd1..136a53f9 100644 --- a/tests-harness/README.md +++ b/tests-harness/README.md @@ -17,9 +17,9 @@ android update sdk --no-ui 1. Install node (`brew install node`) and cordova (`npm install -g cordova`) if you haven't already. - 1. Run `open ~/Library/Android/sdk/tools/android` check off `android 6.0`, click `Install Packages`, and accept ALL licenses in the next screen before clicking install again to complete installation. + 1. Run `android` check off `android 6.0`, click `Install Packages`, and accept ALL licenses in the next screen before clicking install again to complete installation. - 1. Run `~/Library/Android/sdk/tools/android avd` and create an image with name `nexus-intel` device `Galaxy Nexus (4.65"...` target `android 6.0 - API Level 23` CPU/ABI `Intel Atom (x86_64)` no skin size `200mb` and `Use Host GPU` checked off. + 1. Run `android avd` and create an image with name `nexus-intel` device `Galaxy Nexus (4.65"...` target `android 6.0 - API Level 23` CPU/ABI `Intel Atom (x86_64)` no skin size `200mb` and `Use Host GPU` checked off. 1. Run `npm install` in the project root.