Skip to content
This repository was archived by the owner on Feb 25, 2022. It is now read-only.

Commit 7a9b26a

Browse files
committed
refactor(Connect, Discoverable, gulp): Initial es2015 refactor, babelify, add gulp
1 parent fd9df97 commit 7a9b26a

15 files changed

+526
-143
lines changed

.babelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "presets": ["es2015"] }

.eslintrc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"parser": "babel-eslint",
3+
"env": {
4+
"node": true,
5+
"es6": true,
6+
"browser": true,
7+
"mocha": true
8+
},
9+
"rules": {
10+
"eqeqeq": 2,
11+
"no-caller": 2,
12+
"no-else-return": 2,
13+
"no-eq-null": 2,
14+
"quotes": "single",
15+
"no-new-func": 2,
16+
"camelcase": [2, "always"],
17+
"brace-style": [2, "stroustrup", { "allowSingleLine": true }],
18+
"strict": [2, "global"],
19+
"comma-spacing": [2, {"before": false, "after": true}],
20+
"indent": [2, 4],
21+
"key-spacing": [2, { "beforeColon": false, "afterColon": true, "align": "value" }],
22+
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
23+
"space-before-blocks": [2, "always"],
24+
"space-before-function-paren": [2, "always"],
25+
"space-in-brackets": [2, "always", {
26+
"singleValue": false,
27+
"objectsInArrays": true,
28+
"arraysInArrays": true,
29+
"arraysInObjects": true,
30+
"objectsInObjects": true,
31+
"propertyName": false
32+
}],
33+
"space-in-parens": [2, "never"],
34+
"space-infix-ops": 2,
35+
"space-return-throw-case": 2,
36+
"dot-notation": 0
37+
}
38+
}

dist/index.js

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

dist/index.js.map

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

dist/lib/Connect.js

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

dist/lib/Connect.js.map

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

dist/lib/Discoverable.js

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

dist/lib/Discoverable.js.map

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

gulpfile.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
'use strict';
2+
3+
var gulp = require('gulp');
4+
var clean = require('gulp-clean');
5+
var babel = require('gulp-babel');
6+
var sourcemaps = require('gulp-sourcemaps');
7+
8+
var entry = 'index.js';
9+
var src = [entry, 'lib/**/*.js'];
10+
var srcOption = {
11+
base: './'
12+
};
13+
var dest = './dist';
14+
15+
16+
gulp.task('clean', function() {
17+
return gulp.src(dest, {
18+
read: false
19+
})
20+
.pipe(clean());
21+
});
22+
23+
24+
gulp.task('node', ['clean'], function() {
25+
return gulp.src(src, srcOption)
26+
.pipe(sourcemaps.init())
27+
.pipe(babel())
28+
.pipe(sourcemaps.write('.', {
29+
includeContent: false,
30+
sourceRoot: '..'
31+
}))
32+
.pipe(gulp.dest(dest));
33+
});
34+
35+
gulp.task('default', ['node']);

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
module.exports = require('./lib/connect');
1+
// Import Connect
2+
import Connect from './lib/Connect';
3+
4+
// Export Connect
5+
export default Connect;

0 commit comments

Comments
 (0)