-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
28 changed files
with
808 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ testbed/plugins | |
testbed/hooks | ||
node_modules | ||
testbed/ul_web_hooks/ | ||
.installed | ||
.installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"fileExtensions": [".js", ".jsx"], | ||
"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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
sudo: false | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
node_js: | ||
- '6' | ||
- '5' | ||
- '4' | ||
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 | ||
- export $(cat .to_export_back) &> /dev/null | ||
- test $TRAVIS_PULL_REQUEST = false \ | ||
&& npm run semantic-release | ||
branches: | ||
only: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Development Conventions | ||
|
||
This document outlines our development processes. | ||
|
||
## Pull Requests | ||
|
||
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 | ||
|
||
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 end up needing to back out changes. | ||
|
||
## 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 | ||
|
||
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 | ||
# <tag> is the name of the release. e,g, '0.12.5' | ||
$ src/ios/dependencies/update.sh <tag> | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
var gulp = require('gulp'); | ||
var fs = require('fs'); | ||
var sourcemaps = require('gulp-sourcemaps'); | ||
var babel = require('gulp-babel'); | ||
var eslint = require('gulp-eslint'); | ||
var jscs = require('gulp-jscs'); | ||
|
||
gulp.task('prerelease', [ 'setupNpm', 'babel', 'lint' ]); | ||
|
||
// ----------------------------------------------------------------------------- | ||
// setup for development use | ||
gulp.task('setupDev', () => { | ||
getDevPluginXML(); | ||
setIosNpmOrDev('dev'); | ||
}) | ||
|
||
// 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() { | ||
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('<!--[Branch Framework Reference]-->', 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() { | ||
var xml = fs.readFileSync('plugin.template.xml', 'utf-8'); | ||
|
||
xml = xml.replace('<!--[Branch Framework Reference]-->', | ||
'<framework custom="true" src="src/ios/dependencies/Branch.framework" />'); | ||
|
||
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) { | ||
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; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
// 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) { | ||
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' ] // needed for generators etc | ||
})) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest(destDir)); | ||
}); | ||
} | ||
|
||
babelize('hooks'); | ||
babelize('www'); | ||
babelize('tests'); | ||
babelize('testbed', 'testbed/www/js'); | ||
gulp.task('babel', babelTasks); | ||
|
||
// ----------------------------------------------------------------------------- | ||
// linting | ||
|
||
gulp.task('lint', [ 'eslint', 'jscs-lint' ]); | ||
|
||
var srcs = [ | ||
'**/*.js', | ||
'!node_modules/**', | ||
'!testbed/platforms/ios/cordova/node_modules/**' | ||
]; | ||
|
||
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 })) | ||
.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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.