Skip to content

Commit b4dc605

Browse files
committed
Initial commit
0 parents  commit b4dc605

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+47459
-0
lines changed

.babelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"moduleId": "Github",
3+
"plugins": [
4+
[
5+
"transform-es2015-modules-umd",
6+
{
7+
"browserGlobals": {
8+
"github-api": "Github"
9+
}
10+
}
11+
]
12+
],
13+
"presets": ["es2015"],
14+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 3
6+
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = false
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
node_modules
3+
coverage

.jscsrc

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
{
2+
"disallowDanglingUnderscores": true,
3+
"disallowIdentifierNames": [],
4+
"disallowImplicitTypeConversion": [],
5+
"disallowKeywordsOnNewLine": [
6+
"catch",
7+
"else"
8+
],
9+
"disallowKeywords": [
10+
"void",
11+
"with"
12+
],
13+
"disallowMixedSpacesAndTabs": true,
14+
"disallowMultipleLineBreaks": true,
15+
"disallowMultipleLineStrings": true,
16+
"disallowMultipleSpaces": true,
17+
"disallowMultipleVarDecl": "exceptUndefined",
18+
"disallowNewlineBeforeBlockStatements": true,
19+
"disallowPaddingNewlinesBeforeKeywords": [
20+
"case",
21+
"typeof"
22+
],
23+
"disallowPaddingNewlinesInBlocks": true,
24+
"disallowQuotedKeysInObjects": true,
25+
"disallowSpaceAfterKeywords": [
26+
"catch",
27+
"for",
28+
"switch",
29+
"while"
30+
],
31+
"disallowSpaceAfterObjectKeys": true,
32+
"disallowSpaceAfterPrefixUnaryOperators": true,
33+
"disallowSpaceBeforePostfixUnaryOperators": true,
34+
"disallowSpacesInCallExpression": true,
35+
"disallowSpacesInFunction": {
36+
"beforeOpeningRoundBrace": true
37+
},
38+
"disallowSpacesInsideParentheses": true,
39+
"disallowTrailingComma": true,
40+
"disallowTrailingWhitespace": true,
41+
"disallowYodaConditions": true,
42+
"maximumLineLength": 120,
43+
"requireBlocksOnNewline": true,
44+
"requireCamelCaseOrUpperCaseIdentifiers": true,
45+
"requireCapitalizedComments": {
46+
"allExcept": [
47+
"exported",
48+
"global",
49+
"jshint"
50+
]
51+
},
52+
"requireCapitalizedConstructors": true,
53+
"requireCommaBeforeLineBreak": true,
54+
"requireCurlyBraces": [
55+
"catch",
56+
"do",
57+
"else",
58+
"for",
59+
"if",
60+
"try",
61+
"while"
62+
],
63+
"requireDollarBeforejQueryAssignment": true,
64+
"requireDotNotation": true,
65+
"requireKeywordsOnNewLine": [
66+
"break",
67+
"case",
68+
"default"
69+
],
70+
"requireLineBreakAfterVariableAssignment": true,
71+
"requireObjectKeysOnNewLine": true,
72+
"requireOperatorBeforeLineBreak": true,
73+
"requirePaddingNewLineAfterVariableDeclaration": true,
74+
"requirePaddingNewLinesAfterBlocks": {
75+
"allExcept": [
76+
"inArrayExpressions",
77+
"inCallExpressions",
78+
"inProperties"
79+
]
80+
},
81+
"requirePaddingNewLinesAfterUseStrict": true,
82+
"requirePaddingNewLinesBeforeExport": true,
83+
"requirePaddingNewlinesBeforeKeywords": [
84+
"do",
85+
"for",
86+
"function",
87+
"if",
88+
"return",
89+
"switch",
90+
"try",
91+
"void",
92+
"while",
93+
"with"
94+
],
95+
"requirePaddingNewLinesBeforeLineComments": {
96+
"allExcept": "firstAfterCurly"
97+
},
98+
"requirePaddingNewLinesInObjects": true,
99+
"requireParenthesesAroundIIFE": true,
100+
"requireSemicolons": true,
101+
"requireSpaceAfterBinaryOperators": true,
102+
"requireSpaceAfterKeywords": [
103+
"case",
104+
"do",
105+
"else",
106+
"if",
107+
"return",
108+
"try",
109+
"typeof"
110+
],
111+
"requireSpaceAfterLineComment": true,
112+
"requireSpaceBeforeBinaryOperators": true,
113+
"requireSpaceBeforeBlockStatements": true,
114+
"requireSpaceBeforeKeywords": [
115+
"catch",
116+
"else"
117+
],
118+
"requireSpaceBeforeObjectValues": true,
119+
"requireSpaceBetweenArguments": true,
120+
"requireSpacesInAnonymousFunctionExpression": {
121+
"beforeOpeningCurlyBrace": true
122+
},
123+
"requireSpacesInConditionalExpression": true,
124+
"requireSpacesInForStatement": true,
125+
"requireSpacesInFunctionDeclaration": {
126+
"beforeOpeningCurlyBrace": true
127+
},
128+
"requireSpacesInFunctionExpression": {
129+
"beforeOpeningCurlyBrace": true
130+
},
131+
"requireSpacesInFunction": {
132+
"beforeOpeningCurlyBrace": true
133+
},
134+
"requireSpacesInNamedFunctionExpression": {
135+
"beforeOpeningCurlyBrace": true
136+
},
137+
"safeContextKeyword": ["that"],
138+
"validateAlignedFunctionParameters": true,
139+
"validateIndentation": 3,
140+
"validateLineBreaks": "LF",
141+
"validateNewlineAfterArrayElements": {
142+
"maximum": 3
143+
},
144+
"validateParameterSeparator": ", ",
145+
"validateQuoteMarks": "'"
146+
}

.jshintrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"bitwise": true,
3+
"curly": true,
4+
"eqeqeq": true,
5+
"esnext": true,
6+
// "esversion": 6, To enable in the next version of JSHint
7+
"forin": false,
8+
"freeze": true,
9+
"funcscope": false,
10+
"futurehostile": true,
11+
"globals": [],
12+
"globalstrict": true,
13+
"iterator": false,
14+
"latedef": true,
15+
"maxcomplexity": 6,
16+
"maxdepth": 3,
17+
"maxerr": 50,
18+
"maxparams": 4,
19+
"maxstatements": 20,
20+
"noarg": true,
21+
"nocomma": true,
22+
"nonbsp": true,
23+
"nonew": true,
24+
"notypeof": true,
25+
"predef": [],
26+
"shadow": "inner",
27+
"singleGroups": true,
28+
"strict": true,
29+
"undef": true,
30+
"unused": true,
31+
"varstmt": false,
32+
33+
"browser": true
34+
}

MIT-LICENSE.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2015 Aurelio De Rosa
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# GitHub Extended
2+
3+
[GitHub Extended](https://github.com/AurelioDeRosa/github-extended) is a collection of methods to extend the
4+
functionality of [Github.js](https://github.com/michael/github) (known on [npm](https://www.npmjs.com) as
5+
[github-api](https://www.npmjs.com/package/github-api)).
6+
7+
## Requirements
8+
9+
Being an extension for Github.js, the only requirement is to install and include
10+
[Github.js](https://github.com/michael/github) before
11+
[GitHub Extended](https://github.com/AurelioDeRosa/github-extended).
12+
13+
## Installation
14+
15+
You can install GitHub Extended by using [npm](https://www.npmjs.com):
16+
17+
```
18+
npm install github-extended
19+
```
20+
21+
Alternatively, you can install it via [Bower](http://bower.io):
22+
23+
```
24+
bower install github-extended --save
25+
```
26+
27+
Another possibility is to manually download it.
28+
29+
## Methods
30+
31+
The sections below describe the methods provided.
32+
33+
### repository.search(string, options = {})
34+
35+
Searches files and folders
36+
37+
### repository.mergePullRequest(pullRequest, options = {})
38+
39+
Merges a pull request
40+
41+
### repository.remove(branchName = 'master', path = '')
42+
43+
Deletes a file or a folder and all of its content from a given branch
44+
45+
### repository.fork()
46+
47+
Creates a fork of the repository
48+
49+
## License
50+
51+
[GitHub Extended](https://github.com/AurelioDeRosa/github-extended) is dual licensed under
52+
[MIT](http://www.opensource.org/licenses/MIT) and [GPL-3.0](http://opensource.org/licenses/GPL-3.0).
53+
54+
## Author
55+
56+
[Aurelio De Rosa](http://www.audero.it) ([@AurelioDeRosa](https://twitter.com/AurelioDeRosa))

bower.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "github-extended",
3+
"description": "A collection of methods to extend the functionality of Github.js (known on npm as github-api)",
4+
"main": "src/github-extended.js",
5+
"authors": [
6+
"Aurelio De Rosa <a.derosa@audero.it> (http://audero.it)"
7+
],
8+
"license": "(MIT OR GPL-3.0)",
9+
"keywords": [
10+
"github",
11+
"github-api",
12+
"api",
13+
"javascript",
14+
"library",
15+
"umd"
16+
],
17+
"moduleType": [
18+
"es6"
19+
],
20+
"homepage": "https://github.com/AurelioDeRosa/github-extended",
21+
"ignore": [
22+
"**/.*",
23+
"node_modules",
24+
"bower_components",
25+
"test",
26+
"tests"
27+
]
28+
}

demo/github-extended.bundle.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/index.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>GitHub Extended - Demo</title>
6+
<style>
7+
input[type="search"]
8+
{
9+
display: block;
10+
margin: 1em 0;
11+
}
12+
</style>
13+
</head>
14+
<body>
15+
<h1>GitHub Extended Demo</h1>
16+
17+
<form id="form-search">
18+
<label>
19+
Search a file by its name in the
20+
<a href="https://github.com/AurelioDeRosa/audero">audero repository</a>:
21+
<input type="search" name="query" id="query" placeholder="git" />
22+
</label>
23+
<input type="submit" />
24+
<input type="reset" />
25+
</form>
26+
27+
<h2>Results</h2>
28+
<ul id="results-list"></ul>
29+
30+
<script src="github-extended.bundle.min.js"></script>
31+
<script>
32+
var github = new Github.default({
33+
username: 'mikedeboertest',
34+
password: 'test1324',
35+
auth: 'basic'
36+
});
37+
var resultsList = document.getElementById('results-list');
38+
var queryElement = document.getElementById('query');
39+
40+
document.getElementById('form-search').addEventListener('submit', function(event) {
41+
event.preventDefault();
42+
43+
var repository = github.getRepo('AurelioDeRosa', 'audero');
44+
45+
repository.search(queryElement.value).then(function(results) {
46+
resultsList.innerHTML = [].map.call(results, function(result) {
47+
return '<li>' + result.path + '</li>';
48+
}).join('');
49+
});
50+
})
51+
</script>
52+
</body>
53+
</html>

0 commit comments

Comments
 (0)