Skip to content

Commit d9a7458

Browse files
committed
use gulp
1 parent d3cfde6 commit d9a7458

26 files changed

+389
-437
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ root = true
33
[*]
44
indent_style = space
55
indent_size = 2
6-
end_of_line = lf
76
charset = utf-8
87
trim_trailing_whitespace = true
98
insert_final_newline = true

.gitignore

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,2 @@
1-
/node_modules/
2-
npm-debug.log
3-
### Node template
4-
# Logs
5-
logs
6-
*.log
7-
8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
13-
# Directory for instrumented libs generated by jscoverage/JSCover
14-
lib-cov
15-
16-
# Coverage directory used by tools like istanbul
17-
coverage
18-
19-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
20-
.grunt
21-
22-
# node-waf configuration
23-
.lock-wscript
24-
25-
# Compiled binary addons (http://nodejs.org/api/addons.html)
26-
build/Release
27-
28-
# Dependency directory
29-
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
301
node_modules
31-
### JetBrains template
32-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
33-
34-
*.iml
35-
36-
## Directory-based project format:
37-
.idea/
38-
# if you remove the above rule, at least ignore the following:
39-
40-
# User-specific stuff:
41-
# .idea/workspace.xml
42-
# .idea/tasks.xml
43-
# .idea/dictionaries
44-
45-
# Sensitive or high-churn files:
46-
# .idea/dataSources.ids
47-
# .idea/dataSources.xml
48-
# .idea/sqlDataSources.xml
49-
# .idea/dynamic.xml
50-
# .idea/uiDesigner.xml
51-
52-
# Gradle:
53-
# .idea/gradle.xml
54-
# .idea/libraries
55-
56-
# Mongo Explorer plugin:
57-
# .idea/mongoSettings.xml
58-
59-
## File-based project format:
60-
*.ipr
61-
*.iws
62-
63-
## Plugin-specific files:
64-
65-
# IntelliJ
66-
/out/
67-
68-
# mpeltonen/sbt-idea plugin
69-
.idea_modules/
70-
71-
# JIRA plugin
72-
atlassian-ide-plugin.xml
73-
74-
# Crashlytics plugin (for Android Studio and IntelliJ)
75-
com_crashlytics_export_strings.xml
76-
crashlytics.properties
77-
crashlytics-build.properties
78-
79-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
2+
coverage

.jshintrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.travis.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
sudo: required
21
language: node_js
3-
42
node_js:
5-
- '5'
6-
- '4'
3+
- v5
4+
- v4
75
- '0.12'
86
- '0.10'
9-
10-
script: "npm run-script test-travis"
11-
after_script: "npm install coveralls && cat ./coverage/lcov.info | coveralls"

.yo-rc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

Gruntfile.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

LICENSE

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
The MIT License (MIT)
1+
Copyright 2016 calidion <calidion@gmail.com> (calidion.github.io)
22

3-
Copyright (c) 2015
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
46

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

9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coveralls Status][coveralls-image]][coveralls-url]
2-
1+
# node-weixin-message [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
32
> Weixin message handling
43
54
微信消息处理
@@ -225,7 +224,7 @@ var video = reply.video('FromUserName', 'ToUserName', 'mediaId', 'title', 'desc'
225224
res.send(video);
226225

227226
//回复音乐
228-
var music = reply.music('FromUserName', 'ToUserName', 'mediaId', 'title',
227+
var music = reply.music('FromUserName', 'ToUserName', 'mediaId', 'title',
229228
'desc', 'http://www.musicurl.com', 'http://www.hightQualitymusicurl.com');
230229
res.send(music);
231230

@@ -362,12 +361,11 @@ service.api.news(app, process.env.APP_OPENID, articles, function (error, data) {
362361
//data.errmsg
363362
});
364363

365-
366364
```
367365

368366
## License
369367

370-
MIT © [node-weixin](www.node-weixin.com)
368+
Apache-2.0 © [calidion](calidion.github.io)
371369

372370

373371
[npm-image]: https://badge.fury.io/js/node-weixin-message.svg
@@ -376,5 +374,5 @@ MIT © [node-weixin](www.node-weixin.com)
376374
[travis-url]: https://travis-ci.org/node-weixin/node-weixin-message
377375
[daviddm-image]: https://david-dm.org/node-weixin/node-weixin-message.svg?theme=shields.io
378376
[daviddm-url]: https://david-dm.org/node-weixin/node-weixin-message
379-
[coveralls-image]: https://coveralls.io/repos/node-weixin/node-weixin-message/badge.svg?branch=master&service=github
380-
[coveralls-url]: https://coveralls.io/github/node-weixin/node-weixin-message?branch=master
377+
[coveralls-image]: https://coveralls.io/repos/node-weixin/node-weixin-message/badge.svg
378+
[coveralls-url]: https://coveralls.io/r/node-weixin/node-weixin-message

cli.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

gulpfile.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
'use strict';
2+
var path = require('path');
3+
var gulp = require('gulp');
4+
var eslint = require('gulp-eslint');
5+
var excludeGitignore = require('gulp-exclude-gitignore');
6+
var mocha = require('gulp-mocha');
7+
var istanbul = require('gulp-istanbul');
8+
var nsp = require('gulp-nsp');
9+
var plumber = require('gulp-plumber');
10+
var coveralls = require('gulp-coveralls');
11+
12+
gulp.task('static', function () {
13+
return gulp.src('**/*.js')
14+
.pipe(excludeGitignore())
15+
.pipe(eslint())
16+
.pipe(eslint.format())
17+
.pipe(eslint.failAfterError());
18+
});
19+
20+
gulp.task('nsp', function (cb) {
21+
nsp({package: path.resolve('package.json')}, cb);
22+
});
23+
24+
gulp.task('pre-test', function () {
25+
return gulp.src('lib/**/*.js')
26+
.pipe(excludeGitignore())
27+
.pipe(istanbul({
28+
includeUntested: true
29+
}))
30+
.pipe(istanbul.hookRequire());
31+
});
32+
33+
gulp.task('test', ['pre-test'], function (cb) {
34+
var mochaErr;
35+
36+
gulp.src('test/**/*.js')
37+
.pipe(plumber())
38+
.pipe(mocha({reporter: 'spec', timeout: 10000}))
39+
.on('error', function (err) {
40+
mochaErr = err;
41+
throw err;
42+
})
43+
.pipe(istanbul.writeReports())
44+
.on('end', function () {
45+
cb(mochaErr);
46+
});
47+
});
48+
49+
gulp.task('watch', function () {
50+
gulp.watch(['lib/**/*.js', 'test/**'], ['test']);
51+
});
52+
53+
gulp.task('coveralls', ['test'], function () {
54+
if (!process.env.CI) {
55+
return;
56+
}
57+
58+
gulp.src(path.join(__dirname, 'coverage/lcov.info'))
59+
.pipe(coveralls());
60+
});
61+
62+
gulp.task('prepublish', ['nsp']);
63+
gulp.task('default', ['static', 'test', 'coveralls']);

0 commit comments

Comments
 (0)