Skip to content

Commit 5bb74f6

Browse files
committed
chore
* create non-minifed dist file * move "codebird" from bower deps to npm dev deps * create npm reference * update readme (close #11)
1 parent 55e7d37 commit 5bb74f6

9 files changed

Lines changed: 1906 additions & 42 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-codebird-directive.js',
7+
'src/aping-codebird-helper.js',
8+
'node_modules/codebird/codebird.js'
9+
];
10+
311
grunt.initConfig({
412
pkg: grunt.file.readJSON('package.json'),
513
uglify: {
614
js: {
715
files : {
8-
'dist/aping-plugin-codebird.min.js' : [
9-
'src/aping-codebird-directive.js',
10-
'src/aping-codebird-helper.js',
11-
'bower_components/codebird-js/codebird.js'
12-
]
16+
'dist/aping-plugin-codebird.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-codebird.js' : files
31+
}
32+
},
33+
},
1934
watch: {
2035
minifiyJs: {
21-
files: [
22-
'src/aping-codebird-directive.js',
23-
'src/aping-codebird-helper.js',
24-
'bower_components/codebird-js/codebird.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: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,39 @@
55

66
# Information
77
* **Supported apiNG models: `social`, `image`**
8-
* Used JavaScript library: [codebird-js](https://github.com/jublonet/codebird-js) _(included in minified distribution file)_
8+
* Used JavaScript library: [codebird-js](https://github.com/jublonet/codebird-js) _(included in distribution files)_
99

1010
# Documentation
1111
I. INSTALLATION
1212
II. BEARER TOKEN
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-codebird --save`
25-
* Download from github: [apiNG-plugin-codebird.zip](https://github.com/JohnnyTheTank/apiNG-plugin-codebird/zipball/master)
24+
1. Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:
25+
1. `bower install apiNG-plugin-codebird --save`
26+
2. `npm install aping-plugin-codebird --save`
27+
3. download [apiNG-plugin-codebird.zip](https://github.com/JohnnyTheTank/apiNG-plugin-codebird/zipball/master)
2628

27-
### b) Include files
29+
### b) Include file
2830
Include `aping-plugin-codebird.min.js` in your apiNG application
31+
2932
```html
33+
<!-- when using bower -->
3034
<script src="bower_components/apiNG-plugin-codebird/dist/aping-plugin-codebird.min.js"></script>
35+
36+
<!-- when using npm -->
37+
<script src="node_modules/aping-plugin-codebird/dist/aping-plugin-codebird.min.js"></script>
38+
39+
<!-- when using downloaded files -->
40+
<script src="aping-plugin-codebird.min.js"></script>
3141
```
3242

3343
### 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": "twitter plugin for apiNG",
9-
"main": "dist/apiNG-plugin-codebird.min.js",
9+
"main": "dist/aping-plugin-codebird.min.js",
1010
"moduleType": [],
1111
"keywords": [
1212
"aping",
@@ -26,7 +26,6 @@
2626
"tests"
2727
],
2828
"dependencies": {
29-
"apiNG": "*",
30-
"codebird-js": "*"
29+
"apiNG": "*"
3130
}
3231
}

demo/index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
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/codebird-js/codebird.js"></script>
13-
<script src="../src/aping-codebird-directive.js"></script>
14-
<script src="../src/aping-codebird-helper.js"></script>
12+
<script src="../dist/aping-plugin-codebird.js"></script>
1513
</head>
1614
<body ng-app="app">
1715
<h1>{'search':'münchen', 'result_type':'recent', 'language':'de'}</h1>

0 commit comments

Comments
 (0)