From dbf2bcf83a8b2c1005144af3f2313258bb68bb4f Mon Sep 17 00:00:00 2001 From: Bo Borgerson Date: Wed, 10 Feb 2016 16:19:05 -0800 Subject: [PATCH] Attempt at travis integration Also pulled eslint config up to the top-level and added some README badges. --- .eslintrc | 109 +++++++++++++++++++++++++++++ .travis.yml | 10 +++ README.md | 7 +- gulpfile.js | 15 ++++ package.json | 6 +- packages/react-server/README.md | 6 +- packages/react-server/package.json | 109 ----------------------------- 7 files changed, 150 insertions(+), 112 deletions(-) create mode 100644 .eslintrc create mode 100644 .travis.yml create mode 100644 gulpfile.js diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..4c381daa3 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,109 @@ +{ + "globals": { + "__LOGGER__": false, + "SERVER_SIDE": false + }, + "ecmaFeatures": { + "jsx": true, + "modules": true + }, + "env": { + "browser": true, + "es6": true, + "node": true, + "jasmine": true + }, + "plugins": [ + "react" + ], + "rules": { + "camelcase": 0, + "comma-dangle": [ + 2, + "always-multiline" + ], + "comma-spacing": 0, + "consistent-return": 2, + "constructor-super": 2, + "curly": [ + 2, + "multi-line" + ], + "dot-notation": 2, + "eol-last": 2, + "eqeqeq": [ + 2, + "smart" + ], + "guard-for-in": 2, + "handle-callback-err": 0, + "indent": [ + 2, + "tab" + ], + "key-spacing": 0, + "linebreak-style": [ + 2, + "unix" + ], + "new-cap": 0, + "new-parens": 0, + "no-cond-assign": [ + 2, + "except-parens" + ], + "no-constant-condition": 2, + "no-dupe-args": 2, + "no-dupe-keys": 2, + "no-empty": 2, + "no-eval": 2, + "no-ex-assign": 2, + "no-extra-bind": 2, + "no-extra-semi": 0, + "no-loop-func": 2, + "no-mixed-requires": 0, + "no-mixed-spaces-and-tabs": 2, + "no-multi-spaces": 0, + "no-new-func": 2, + "no-obj-calls": 2, + "no-path-concat": 2, + "no-process-env": 2, + "no-process-exit": 2, + "no-redeclare": 2, + "no-return-assign": 2, + "no-script-url": 2, + "no-self-compare": 2, + "no-sequences": 0, + "no-shadow": 0, + "no-spaced-func": 0, + "no-this-before-super": 2, + "no-throw-literal": 2, + "no-trailing-spaces": 2, + "no-undef": 2, + "no-underscore-dangle": 0, + "no-unexpected-multiline": 2, + "no-unreachable": 2, + "no-unused-expressions": 0, + "no-unused-vars": 2, + "no-use-before-define": 0, + "no-wrap-func": 0, + "quotes": [ + 0, + "double" + ], + "semi": [ + 0, + "always" + ], + "semi-spacing": 2, + "space-infix-ops": 0, + "space-return-throw-case": 2, + "space-unary-ops": 2, + "strict": [ + 2, + "never" + ], + "valid-typeof": 2, + "yoda": 0 + } +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..8dc8b8614 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +--- +language: node_js + +node_js: + - "4.3.2" + +before_script: + - npm install -g gulp + +script: gulp travis-ci diff --git a/README.md b/README.md index eacb4d7f9..70c46099c 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -react-server monorepo. (see: [README](packages/react-server/README.md)) +# react-server monorepo [![Build Status][build-badge-img][build-url] + +(see: [README](packages/react-server/README.md)) + +[build-badge-img]: https://travis-ci.org/redfin/react-server.png?branch=master +[build-url]: https://travis-ci.org/robatron/gulp-chug diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 000000000..7ae27327b --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,15 @@ +var gulp = require('gulp'); +var chug = require('gulp-chug'); + +gulp.task('travis-ci', ['test', 'eslint']); + +// Pass-through tasks. +[ + 'test', + 'eslint', +].map(task => { + gulp.task(task, () => gulp + .src('./packages/*/gulpfile.js', {read: false}) + .pipe(chug({ tasks: [task] })) + ) +}); diff --git a/package.json b/package.json index 05c1989f3..b33b6f07e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,10 @@ { "private": true, "devDependencies": { + "eslint": "0.24.1", + "eslint-plugin-react": "3.0.0", + "gulp": "3.9.1", + "gulp-chug": "0.5.1", "lerna": "^1.1.0" } -} \ No newline at end of file +} diff --git a/packages/react-server/README.md b/packages/react-server/README.md index c53478e53..fe18dadf3 100644 --- a/packages/react-server/README.md +++ b/packages/react-server/README.md @@ -1,4 +1,5 @@ -# react-server +# react-server [![NPM version][npm-badge-img]][npm-url] + react-server is an [Express](http://expressjs.com/) [middleware](http://expressjs.com/guide/using-middleware.html) for serving universal (isomorphic) JavaScript applications built with [React](https://facebook.github.io/react/) based on the [Flux pattern](https://facebook.github.io/flux/docs/overview.html). @@ -160,3 +161,6 @@ We welcome contributions to react-server! To contribute, follow these steps: ## What is "triton"? Why do I see that in code comments? Back when we started this project, we came up with a great name -- `triton` -- and we started using it internally. And then it took us forever to get around to making the source code public. And then [Joyent](https://www.joyent.com) released a product called `triton` and stole our thunder, so we had to go with `react-server` instead (a terrible, terrible tragedy, we know). It has always seemed like a preeeety big coincidence to us that they were first to market with a product named `triton`, and they are also one floor above our San Francisco engineering office... + +[npm-badge-img]: https://badge.fury.io/js/react-server.png +[npm-url]: https://npmjs.org/package/react-server diff --git a/packages/react-server/package.json b/packages/react-server/package.json index 740bc15a9..515e9ab2a 100644 --- a/packages/react-server/package.json +++ b/packages/react-server/package.json @@ -67,114 +67,5 @@ "path-to-regexp": "1.0.1", "webpack": "1.4.13", "zombie": "4.1.0" - }, - "eslintConfig": { - "globals": { - "__LOGGER__": false, - "SERVER_SIDE": false - }, - "ecmaFeatures": { - "jsx": true, - "modules": true - }, - "env": { - "browser": true, - "es6": true, - "node": true, - "jasmine": true - }, - "plugins": [ - "react" - ], - "rules": { - "camelcase": 0, - "comma-dangle": [ - 2, - "always-multiline" - ], - "comma-spacing": 0, - "consistent-return": 2, - "constructor-super": 2, - "curly": [ - 2, - "multi-line" - ], - "dot-notation": 2, - "eol-last": 2, - "eqeqeq": [ - 2, - "smart" - ], - "guard-for-in": 2, - "handle-callback-err": 0, - "indent": [ - 2, - "tab" - ], - "key-spacing": 0, - "linebreak-style": [ - 2, - "unix" - ], - "new-cap": 0, - "new-parens": 0, - "no-cond-assign": [ - 2, - "except-parens" - ], - "no-constant-condition": 2, - "no-dupe-args": 2, - "no-dupe-keys": 2, - "no-empty": 2, - "no-eval": 2, - "no-ex-assign": 2, - "no-extra-bind": 2, - "no-extra-semi": 0, - "no-loop-func": 2, - "no-mixed-requires": 0, - "no-mixed-spaces-and-tabs": 2, - "no-multi-spaces": 0, - "no-new-func": 2, - "no-obj-calls": 2, - "no-path-concat": 2, - "no-process-env": 2, - "no-process-exit": 2, - "no-redeclare": 2, - "no-return-assign": 2, - "no-script-url": 2, - "no-self-compare": 2, - "no-sequences": 0, - "no-shadow": 0, - "no-spaced-func": 0, - "no-this-before-super": 2, - "no-throw-literal": 2, - "no-trailing-spaces": 2, - "no-undef": 2, - "no-underscore-dangle": 0, - "no-unexpected-multiline": 2, - "no-unreachable": 2, - "no-unused-expressions": 0, - "no-unused-vars": 2, - "no-use-before-define": 0, - "no-wrap-func": 0, - "quotes": [ - 0, - "double" - ], - "semi": [ - 0, - "always" - ], - "semi-spacing": 2, - "space-infix-ops": 0, - "space-return-throw-case": 2, - "space-unary-ops": 2, - "strict": [ - 2, - "never" - ], - "valid-typeof": 2, - "yoda": 0 - } } }