Skip to content

Commit

Permalink
Build: Update builds to use gulp and babel6 (Fixes rauchg#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoon committed Dec 17, 2015
1 parent 9817875 commit 6dac818
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
23 changes: 0 additions & 23 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion bin/slackin
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var pkg = require('../package');
var program = require('commander');
var slackin = require('../node');
var slackin = require('../node').default;

program
.version(pkg.version)
Expand Down
30 changes: 30 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

import gulp from 'gulp';
import babel from 'gulp-babel';
import rimraf from 'gulp-rimraf';

const paths = {
in_js: "lib/*.js",
in_assets: "lib/assets/*",
out_js: "node",
out_assets: "node/assets",
};

gulp.task('es6to5', () => {
return gulp.src(paths.in_js)
.pipe(babel())
.pipe(gulp.dest(paths.out_js));
});

gulp.task('copyassets', () => {
return gulp.src(paths.in_assets)
.pipe(gulp.dest(paths.out_assets));
});

gulp.task('clean', () => {
return gulp.src(paths.out_js, { read: false })
.pipe(rimraf());
});

gulp.task('default', ['es6to5', 'copyassets']);
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// es6 runtime requirements
require('babel/polyfill');
require('babel-polyfill');

// their code
import express from 'express';
Expand Down
1 change: 1 addition & 0 deletions lib/slack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { EventEmitter } from 'events';
export default class SlackData extends EventEmitter {

constructor({ token, interval, org: host }){
super();
this.host = host;
this.token = token;
this.interval = interval;
Expand Down
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@
"version": "0.7.3",
"description": "",
"dependencies": {
"babel": "4.7.1",
"babel-core": "6.3.15",
"babel-preset-es2015": "6.3.13",
"babel-polyfill": "6.3.14",
"body-parser": "1.10.2",
"commander": "2.6.0",
"debug": "2.1.1",
"email-regex": "1.0.0",
"express": "4.11.0",
"gulp": "3.9.0",
"gulp-babel": "6.1.1",
"gulp-rimraf": "0.2.0",
"hostenv": "1.0.1",
"opentype.js": "0.4.4",
"socket.io": "1.3.6",
"superagent": "0.21.0",
"vd": "0.1.0"
},
"devDependencies": {
"babel-core": "^6.3.15",
"babel-preset-es2015": "^6.3.13",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.1",
"gulp-rimraf": "^0.2.0",
"mocha": "2.2.4",
"nock": "2.17.0",
"supertest": "0.15.0"
Expand All @@ -29,7 +39,7 @@
},
"scripts": {
"test": "mocha",
"postinstall": "make",
"start": "./bin/slackin $SLACK_SUBDOMAIN $SLACK_API_TOKEN"
"postinstall": "gulp",
"start": "node ./bin/slackin"
}
}

0 comments on commit 6dac818

Please sign in to comment.