+
Skip to content

Axios #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 23, 2016
Merged

Axios #280

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"globals" : {
"require": false,
"define": false,
"escape": false
"escape": false,
"should": false
} // additional predefined global variables
}
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"github-api",
"main":"github.js",
"main":"src/github.js",
"homepage":"https://github.com/michael/github",
"authors":[
"Sergey Klimov <sergey.v.klimov@gmail.com> (http://darvin.github.com/)"
Expand Down
2 changes: 2 additions & 0 deletions dist/github.bundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/github.bundle.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/github.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/github.min.js.map

Large diffs are not rendered by default.

47 changes: 37 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ var gulp = require('gulp');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var rename = require('gulp-rename');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
var stylish = require('gulp-jscs-stylish');
var path = require('path');
var karma = require('karma');
Expand All @@ -15,24 +20,19 @@ function runTests(singleRun, isCI, done) {

var files = [
path.join(__dirname, 'test/vendor/*.js'), // PhantomJS 1.x polyfills
path.join(__dirname, 'github.js'),
path.join(__dirname, 'test/test.*.js')
];

if (singleRun) {
files.forEach(function(path) {
preprocessors[path] = ['coverage'];
});
preprocessors['test/test.*.js'] = ['browserify'];
reporters.push('coverage');
}

files.push(path.join(__dirname, 'test/user.json'));
files.push({
pattern: path.join(__dirname, 'test/gh.png'),
watched: false,
included: false
});
preprocessors['test/user.json'] = ['json_fixtures'];

var localConfig = {
files: files,
Expand Down Expand Up @@ -101,15 +101,42 @@ gulp.task('test:ci', function(done) {
gulp.task('test:auto', function(done) {
runTests(false, false, done);
});
gulp.task('clean', function () {
return del('dist/*');
});

gulp.task('build', function() {
return gulp.src('github.js')
var browserifyInstance = browserify({
debug: true,
entries: 'src/github.js',
standalone: 'Github'
});

browserifyInstance
.bundle()
.pipe(source('github.js'))
.pipe(buffer())
.pipe(sourcemaps.init({
loadMaps: true
}))
.pipe(uglify())
.pipe(rename({
extname: '.bundle.min.js'
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));

return gulp.src('src/github.js')
.pipe(sourcemaps.init())
.pipe(rename({
extname: '.min.js'
}))
.pipe(uglify())
.pipe(rename('github.min.js'))
.pipe(gulp.dest('dist/'));
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});

gulp.task('default', function() {
gulp.task('default', ['clean'], function() {
gulp.start('lint', 'test', 'build');
});

Expand Down
35 changes: 27 additions & 8 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module.exports = function(config) {
module.exports = function (config) {
'use strict';

var configuration = {
client: {
captureConsole: true,
mocha: {
timeout: 10000
timeout: 10000,
ui: 'bdd'
}
},

Expand All @@ -15,18 +16,36 @@ module.exports = function(config) {

autoWatch: false,

frameworks: ['mocha', 'chai'],
frameworks: [
'browserify',
'mocha',
'chai'
],

browsers: ['PhantomJS'],

browserify: {
debug: true,
transform: ['browserify-istanbul']
},

phantomjsLauncher: {
debug: true,
options: {
settings: {
webSecurityEnabled: false
}
}
},

coverageReporter: {
reporters: [
{
type: 'lcov'
},
{
type: 'text-summary'
}
type: 'lcov'
},
{
type: 'text-summary'
}
],
instrumenterOptions: {
istanbul: {
Expand Down
47 changes: 26 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,41 @@
"name": "github-api",
"version": "0.10.7",
"description": "A higher-level wrapper around the Github API.",
"main": "github.js",
"main": "src/github.js",
"dependencies": {
"js-base64": "^2.1.8",
"xmlhttprequest": "~1.7.0"
"axios": "^0.9.0",
"base-64": "^0.1.0",
"es6-promise": "^3.0.2",
"utf8": "^2.1.1"
},
"devDependencies": {
"chai": "^3.4.0",
"browserify": "^13.0.0",
"browserify-istanbul": "^0.2.1",
"chai": "^3.4.1",
"codecov": "^1.0.1",
"del": "^2.2.0",
"gulp": "^3.9.0",
"gulp-jscs": "^3.0.1",
"gulp-jscs-stylish": "^1.2.1",
"gulp-jshint": "^1.11.2",
"gulp-jscs": "^3.0.2",
"gulp-jscs-stylish": "^1.3.0",
"gulp-jshint": "^2.0.0",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^1.4.2",
"istanbul": "^0.3.13",
"jshint": "^2.5.8",
"jshint-stylish": "^2.0.1",
"karma": "^0.13.14",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.1",
"istanbul": "^0.4.2",
"jshint": "^2.9.1",
"jshint-stylish": "^2.1.0",
"karma": "^0.13.19",
"karma-browserify": "^4.4.2",
"karma-chai": "^0.1.0",
"karma-coverage": "^0.5.3",
"karma-json-fixtures-preprocessor": "0.0.5",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.1.1",
"karma-phantomjs-launcher": "^0.2.1",
"karma-json-fixtures-preprocessor": "0.0.6",
"karma-mocha": "^0.2.1",
"karma-mocha-reporter": "^1.1.5",
"karma-phantomjs-launcher": "^0.2.3",
"karma-sauce-launcher": "^0.3.0",
"mocha": "^2.3.3"
"mocha": "^2.3.4",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
},
"scripts": {
"test": "gulp test && gulp lint",
Expand All @@ -52,9 +61,5 @@
"gitHead": "aa8aa3c8cd5ce5240373d4fd1d06a7ab4af41a36",
"bugs": {
"url": "https://github.com/michael/github/issues"
},
"browser": {
"xmlhttprequest": false,
"base64": false
}
}
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载