Skip to content

Commit 8eec411

Browse files
committed
chore
* update angular promise library * use .then() instead of .promise() * create non-minifed dist file * move promise library from bower deps to npm dev deps * create npm reference * update readme (close #7)
1 parent d15e8f2 commit 8eec411

10 files changed

Lines changed: 559 additions & 96 deletions

Gruntfile.js

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,48 @@
11
module.exports = function(grunt) {
22

3+
var banner = '/**\n @name: <%= pkg.name %> \n @version: <%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) \n @author: <%= pkg.author %> \n @url: <%= pkg.homepage %> \n @license: <%= pkg.license %>\n*/\n';
4+
5+
var files = [
6+
'src/aping-github-directive.js',
7+
'src/aping-github-helper.js',
8+
'node_modules/angular-github-api-factory/src/angular-github-api-factory.js'
9+
];
10+
311
grunt.initConfig({
412
pkg: grunt.file.readJSON('package.json'),
513
uglify: {
614
js: {
715
files : {
8-
'dist/aping-plugin-github.min.js' : [
9-
'src/aping-github-directive.js',
10-
'src/aping-github-helper.js',
11-
'bower_components/angular-github-api-factory/src/angular-github-api-factory.js'
12-
]
16+
'dist/aping-plugin-github.min.js' : files
1317
}
1418
},
1519
options: {
16-
banner: '\n/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) by <%= pkg.author %> */\n',
20+
banner: banner,
1721
}
1822
},
23+
concat: {
24+
options: {
25+
separator: ';',
26+
banner: banner,
27+
},
28+
dist: {
29+
files : {
30+
'dist/aping-plugin-github.js' : files
31+
}
32+
},
33+
},
1934
watch: {
2035
minifiyJs: {
21-
files: [
22-
'src/aping-github-directive.js',
23-
'src/aping-github-helper.js',
24-
'bower_components/angular-github-api-factory/src/angular-github-api-factory.js'
25-
],
26-
tasks: ['uglify'],
36+
files: files,
37+
tasks: ['uglify', 'concat'],
2738
options: {
2839
spawn: true,
2940
}
3041
}
3142
}
3243
});
3344

45+
grunt.loadNpmTasks('grunt-contrib-concat');
3446
grunt.loadNpmTasks('grunt-contrib-uglify');
3547
grunt.loadNpmTasks('grunt-contrib-watch');
3648

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,40 @@
55

66
# Information
77
* **Supported apiNG models: `repo`**
8-
* Used promise library: [angular-github-api-factory](https://github.com/JohnnyTheTank/angular-github-api-factory) _(included in minified distribution file)_
8+
* Used promise library: [angular-github-api-factory](https://github.com/JohnnyTheTank/angular-github-api-factory) _(included in distribution files)_
99

1010
# Documentation
1111
I. INSTALLATION
1212
II. API KEY
1313
III. USAGE
1414

1515
## I. INSTALLATION
16-
a) Get files
17-
b) Include files
16+
a) Get file
17+
b) Include file
1818
c) Add dependencies
1919
d) Add the plugin
2020

21-
### a) Get files
21+
### a) Get file
2222
You can choose your preferred method of installation:
2323

24-
* Via bower: `bower install apiNG-plugin-github --save`
25-
* Download from github: [apiNG-plugin-github.zip](https://github.com/JohnnyTheTank/apiNG-plugin-github/zipball/master)
24+
Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:
2625

27-
### b) Include files
26+
* `bower install apiNG-plugin-github --save`
27+
* `npm install aping-plugin-github --save`
28+
* download [apiNG-plugin-github.zip](https://github.com/JohnnyTheTank/apiNG-plugin-github/zipball/master)
29+
30+
### b) Include file
2831
Include `aping-plugin-github.min.js` in your apiNG application
32+
2933
```html
34+
<!-- when using bower -->
3035
<script src="bower_components/apiNG-plugin-github/dist/aping-plugin-github.min.js"></script>
36+
37+
<!-- when using npm -->
38+
<script src="node_modules/aping-plugin-github/dist/aping-plugin-github.min.js"></script>
39+
40+
<!-- when using downloaded files -->
41+
<script src="aping-plugin-github.min.js"></script>
3142
```
3243

3344
### c) Add dependencies

bower.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"authors": [
55
"Jonathan Hornung <jonathan.hornung@gmail.com>"
66
],
7-
"version": "0.6.0",
7+
"version": "0.7.0",
88
"description": "github plugin for apiNG",
9-
"main": "dist/apiNG-plugin-github.min.js",
9+
"main": "dist/aping-plugin-github.min.js",
1010
"moduleType": [],
1111
"keywords": [
1212
"aping",
@@ -25,7 +25,6 @@
2525
"tests"
2626
],
2727
"dependencies": {
28-
"apiNG": "*",
29-
"angular-github-api-factory": "*"
28+
"apiNG": "*"
3029
}
3130
}

demo/aping-config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
apingApp.config(['$provide', function ($provide) {
33

44
$provide.constant("apingApiKeys", {
5-
'github': [{'access_token':'<YOUR_GITHUB_ACCESS_TOKEN>'}]
5+
'github': [
6+
{'access_token':'<YOUR_GITHUB_ACCESS_TOKEN>'},
7+
]
68
});
79

810
$provide.constant("apingDefaultSettings", {

demo/index.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99
<script src="../bower_components/apiNG/dist/aping.min.js"></script>
1010
<script src="aping-config.js"></script>
1111
<script src="app.js"></script>
12-
<script src="../bower_components/angular-github-api-factory/src/angular-github-api-factory.js"></script>
13-
<script src="../src/aping-github-directive.js"></script>
14-
<script src="../src/aping-github-helper.js"></script>
12+
<script src="../dist/aping-plugin-github.js"></script>
1513
</head>
1614
<body ng-app="app">
15+
<h1>Repos by User</h1>
16+
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank'}]"></aping>
17+
<hr>
18+
<h1>Repo by User and Name</h1>
19+
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank', 'repo':'apiNG'}]"></aping>
20+
<hr>
21+
<h1>Repos by Name</h1>
22+
<aping model="repo" items="20" aping-github="[{'search':'apiNG', 'sort':'stars', 'order':'desc'}]"></aping>
23+
1724
<!--
1825
<h1>Activity by User</h1>
1926
<aping
@@ -23,13 +30,5 @@ <h1>Activity by User</h1>
2330
</aping>
2431
<hr>
2532
-->
26-
<h1>Repos by User</h1>
27-
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank'}]"></aping>
28-
<hr>
29-
<h1>Repo by User and Name</h1>
30-
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank', 'repo':'apiNG'}]"></aping>
31-
<hr>
32-
<h1>Repos by Name</h1>
33-
<aping model="repo" items="20" aping-github="[{'search':'apiNG', 'sort':'stars', 'order':'desc'}]"></aping>
3433
</body>
3534
</html>

0 commit comments

Comments
 (0)