Skip to content

Commit

Permalink
Switch to ES6
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwithanm committed Mar 28, 2015
1 parent 90340ae commit b06af5a
Show file tree
Hide file tree
Showing 13 changed files with 269 additions and 270 deletions.
41 changes: 41 additions & 0 deletions .eslintrc
@@ -0,0 +1,41 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},

"parser": "babel-eslint",

"ecmaFeatures": {
"modules": true,
"jsx": true
},

"rules": {
"strict": 0,

"comma-dangle": [2, "always-multiline"],
"no-floating-decimal": 2,

"indent": [2, 2, {"indentSwitchCase": true}],
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
"comma-style": [2, "last"],
"consistent-this": [2, "self"],
"consistent-return": 0,
"curly": [2, "multi-line"],
"new-cap": [2, {"newIsCap": true, "capIsNew": false}],
"quote-props": [2, "as-needed"],
"quotes": [2, "single", "avoid-escape"],
"space-after-function-name": [2, "never"],
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-in-brackets": [2, "never"],
"space-in-parens": [2, "never"],
"spaced-line-comment": [2, "always"],
"yoda": [2, "never"],

"no-var": 2,
"generator-star": [2, "start"]
}
}
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,4 +1,3 @@
/node_modules/
/Gruntfile.js
/test/tests.js
/test/tests-compiled.js
/lib/
4 changes: 2 additions & 2 deletions .npmignore
@@ -1,8 +1,8 @@
/node_modules/
/Gruntfile.coffee
/gulpfile.js
/test/
/vendor/
/bower.json
/coffeelint.json
/.eslintrc
/src/
/standalone/
114 changes: 0 additions & 114 deletions coffeelint.json

This file was deleted.

62 changes: 62 additions & 0 deletions gulpfile.babel.js
@@ -0,0 +1,62 @@
import gulp from 'gulp';
import gutil from 'gulp-util';
import babel from 'gulp-babel';
import browserify from 'gulp-browserify';
import rename from 'gulp-rename';
import connect from 'gulp-connect';
import gbump from 'gulp-bump';


gulp.task('watch', function() {
gulp.watch('./src/**/*', ['build']);
gulp.watch('./test/**/*', ['build:tests']);
});

function bump(type) {
gulp.src(['./bower.json', './package.json'])
.pipe(gbump({type}))
.pipe(gulp.dest('./'));
}

gulp.task('bump:major', () => { bump('major'); });
gulp.task('bump:minor', () => { bump('minor'); });
gulp.task('bump:patch', () => { bump('patch'); });

gulp.task('build:node', () => {
gulp.src('./src/*.js')
.pipe(babel().on('error', gutil.log))
.pipe(gulp.dest('./lib'));
});

gulp.task('build:browser', ['build:node'], () => {
gulp.src('./lib/*.js')
.pipe(browserify({
standalone: 'ControllablesMixin',
transform: ['browserify-shim'],
}))
.pipe(rename('react-controllables.js'))
.pipe(gulp.dest('./standalone/'));
});

gulp.task('build:tests', () => {
gulp.src('./test/tests.js')
.pipe(babel().on('error', gutil.log))
.pipe(browserify({
transform: ['browserify-shim'],
}))
.pipe(rename('tests-compiled.js'))
.pipe(gulp.dest('./test/'));
});

gulp.task('testserver', connect.server({
root: [__dirname],
port: 1337,
open: {
file: 'test/index.html',
browser: 'Google Chrome',
},
}));

gulp.task('test', ['build:browser', 'build:tests', 'testserver']);

gulp.task('build', ['build:node', 'build:browser']);
52 changes: 0 additions & 52 deletions gulpfile.coffee

This file was deleted.

5 changes: 2 additions & 3 deletions gulpfile.js
@@ -1,3 +1,2 @@
// A shim for loading the CoffeeScript gulpfile
require('coffee-script/register');
require('./gulpfile.coffee');
require('babel/register');
module.exports = require('./gulpfile.babel.js');
18 changes: 12 additions & 6 deletions package.json
Expand Up @@ -6,18 +6,24 @@
"directories": {
"test": "test"
},
"dependencies": {},
"dependencies": {
"invariant": "^2.0.0"
},
"devDependencies": {
"coffee-script": "~1.7.1",
"babel": "^4.7.16",
"babel-eslint": "^2.0.2",
"browserify": "~3.33.0",
"browserify-shim": "~3.3.2",
"envify": "^3.4.0",
"eslint": "^0.17.1",
"gulp": "~3.5.6",
"gulp-bump": "~0.1.6",
"gulp-coffee": "~1.4.1",
"gulp-util": "~2.2.14",
"gulp-babel": "^4.0.0",
"gulp-browserify": "~0.5.0",
"gulp-bump": "~0.1.6",
"gulp-cli": "^0.2.0",
"gulp-connect": "~1.0.9",
"gulp-rename": "~1.2.0"
"gulp-rename": "~1.2.0",
"gulp-util": "~2.2.14"
},
"peerDependencies": {
"react": "*"
Expand Down
33 changes: 0 additions & 33 deletions src/index.coffee

This file was deleted.

0 comments on commit b06af5a

Please sign in to comment.