ff-stream-web

git clone git://archive.git.mtrnord.blog/MTRNord/ff-stream-web.git
Log | Files | Refs | README | LICENSE

commit 7b03f0b94381932002dd5642ef26644d159f7de5
parent 03153a3b6df9d0a14523fc2f751b356f01a0b363
Author: Konstantin Tarkus <hello@tarkus.me>
Date:   Tue, 17 May 2016 21:13:38 +0300

Update npm modules; fix ESLint warnings; remove JSCS

Diffstat:
Mpackage.json | 103++++++++++++++++++++++++++++++++++++-------------------------------------------
Msrc/client.js | 2+-
Msrc/components/Header/Header.js | 3++-
Msrc/core/passport.js | 1+
Msrc/routes/login/Login.js | 32+++++++++++++++++---------------
Msrc/server.js | 8++++----
Mtools/.eslintrc | 3++-
Mtools/run.js | 2+-
8 files changed, 75 insertions(+), 79 deletions(-)

diff --git a/package.json b/package.json @@ -5,94 +5,94 @@ "npm": ">=3.3 <4" }, "dependencies": { - "babel-polyfill": "6.7.4", + "babel-polyfill": "6.8.0", "babel-runtime": "6.6.1", "bluebird": "3.3.5", - "body-parser": "1.15.0", - "classnames": "2.2.3", + "body-parser": "1.15.1", + "classnames": "2.2.5", "cookie-parser": "1.4.1", - "core-js": "2.2.2", + "core-js": "2.4.0", "eventemitter3": "1.2.0", "express": "4.13.4", "express-graphql": "0.5.1", - "express-jwt": "3.3.0", + "express-jwt": "3.4.0", "fastclick": "1.0.6", - "fbjs": "0.8.1", + "fbjs": "0.8.2", "front-matter": "2.0.7", - "graphiql": "0.7.0", - "graphql": "0.5.0", - "history": "2.1.0", + "graphiql": "0.7.1", + "graphql": "0.6.0", + "history": "2.1.1", "isomorphic-style-loader": "1.0.0", "jade": "1.11.0", - "jsonwebtoken": "5.7.0", - "markdown-it": "6.0.1", - "node-fetch": "1.5.1", + "jsonwebtoken": "6.2.0", + "markdown-it": "6.0.2", + "node-fetch": "1.5.2", "normalize.css": "4.1.1", "passport": "0.3.2", "passport-facebook": "2.1.0", "pretty-error": "2.0.0", - "react": "15.0.1", - "react-dom": "15.0.1", - "sequelize": "^3.21.0", + "react": "15.0.2", + "react-dom": "15.0.2", + "sequelize": "^3.23.2", "source-map-support": "0.4.0", - "sqlite3": "^3.1.3", - "universal-router": "1.1.0-beta.3", - "whatwg-fetch": "0.11.0" + "sqlite3": "^3.1.4", + "universal-router": "1.2.1", + "whatwg-fetch": "1.0.0" }, "devDependencies": { "assets-webpack-plugin": "^3.4.0", "autoprefixer": "^6.3.6", - "babel-cli": "^6.7.7", - "babel-core": "^6.7.7", - "babel-eslint": "^6.0.3", + "babel-cli": "^6.8.0", + "babel-core": "^6.8.0", + "babel-eslint": "^6.0.4", "babel-loader": "^6.2.4", "babel-plugin-react-transform": "^2.0.2", - "babel-plugin-rewire": "^1.0.0-rc-2", - "babel-plugin-transform-react-constant-elements": "^6.5.0", - "babel-plugin-transform-react-inline-elements": "^6.6.5", - "babel-plugin-transform-react-remove-prop-types": "^0.2.5", - "babel-plugin-transform-runtime": "^6.7.5", + "babel-plugin-rewire": "^1.0.0-rc-3", + "babel-plugin-transform-react-constant-elements": "^6.8.0", + "babel-plugin-transform-react-inline-elements": "^6.8.0", + "babel-plugin-transform-react-remove-prop-types": "^0.2.6", + "babel-plugin-transform-runtime": "^6.8.0", "babel-preset-es2015": "^6.6.0", - "babel-preset-node5": "^11.0.1", + "babel-preset-node5": "^11.1.0", "babel-preset-react": "^6.5.0", "babel-preset-stage-0": "^6.5.0", - "babel-register": "^6.7.2", - "babel-template": "^6.7.0", - "babel-types": "^6.7.7", - "browser-sync": "^2.12.3", + "babel-register": "^6.8.0", + "babel-template": "^6.8.0", + "babel-types": "^6.8.1", + "browser-sync": "^2.12.8", "chai": "^3.5.0", "css-loader": "^0.23.1", "del": "^2.2.0", - "enzyme": "^2.2.0", - "eslint": "^2.8.0", - "eslint-config-airbnb": "^7.0.0", + "enzyme": "^2.3.0", + "eslint": "^2.10.2", + "eslint-config-airbnb": "^9.0.1", "eslint-loader": "^1.3.0", - "eslint-plugin-jsx-a11y": "^0.6.2", - "eslint-plugin-react": "^4.3.0", + "eslint-plugin-import": "^1.8.0", + "eslint-plugin-jsx-a11y": "^1.2.0", + "eslint-plugin-react": "^5.1.1", "extend": "^3.0.0", "file-loader": "^0.8.5", "gaze": "^1.0.0", "git-repository": "^0.1.4", "glob": "^7.0.3", "jade-loader": "^0.8.0", - "jscs": "^2.11.0", "json-loader": "^0.5.4", "mkdirp": "^0.5.1", "mocha": "^2.4.5", "ncp": "^2.0.0", - "postcss": "^5.0.19", - "postcss-import": "^8.1.0", - "postcss-loader": "^0.8.2", - "postcss-scss": "^0.1.7", + "postcss": "^5.0.21", + "postcss-import": "^8.1.2", + "postcss-loader": "^0.9.1", + "postcss-scss": "^0.1.8", "precss": "^1.4.0", "raw-loader": "^0.5.1", - "react-addons-test-utils": "^15.0.1", + "react-addons-test-utils": "^15.0.2", "react-transform-catch-errors": "^1.0.2", "react-transform-hmr": "^1.0.4", - "redbox-react": "^1.2.3", + "redbox-react": "^1.2.4", "sinon": "^2.0.0-pre", - "stylelint": "^6.0.3", - "stylelint-config-standard": "^6.0.0", + "stylelint": "^6.3.3", + "stylelint-config-standard": "^7.0.0", "url-loader": "^0.5.7", "webpack": "^1.13.0", "webpack-hot-middleware": "^2.10.0", @@ -130,14 +130,6 @@ ] } }, - "jscsConfig": { - "preset": "airbnb", - "excludeFiles": [ - "build/**", - "node_modules/**" - ], - "disallowSpacesInsideTemplateStringPlaceholders": null - }, "stylelint": { "extends": "stylelint-config-standard", "rules": { @@ -146,10 +138,9 @@ }, "scripts": { "eslint": "eslint src tools", - "jscs": "jscs src tools --verbose", "stylelint": "stylelint \"src/**/*.scss\" --syntax scss", - "lint": "npm run eslint && npm run jscs && npm run stylelint", - "test": "mocha 'src/**/*.test.js' --require test/setup.js --compilers js:babel-register", + "lint": "npm run eslint && npm run stylelint", + "test": "mocha \"src/**/*.test.js\" --require test/setup.js --compilers js:babel-register", "test:watch": "npm run test -- --reporter min --watch", "clean": "babel-node tools/run clean", "copy": "babel-node tools/run copy", diff --git a/src/client.js b/src/client.js @@ -16,7 +16,7 @@ import history from './core/history'; import { addEventListener, removeEventListener } from './core/DOMUtils'; const context = { - insertCss: styles => styles._insertCss(), + insertCss: styles => styles._insertCss(), // eslint-disable-line no-underscore-dangle setTitle: value => (document.title = value), setMeta: (name, content) => { // Remove and create a new <meta /> tag in order to make it work diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js @@ -12,6 +12,7 @@ import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './Header.scss'; import Link from '../Link'; import Navigation from '../Navigation'; +import logoUrl from './logo-small.png'; function Header() { return ( @@ -19,7 +20,7 @@ function Header() { <div className={s.container}> <Navigation className={s.nav} /> <Link className={s.brand} to="/"> - <img src={require('./logo-small.png')} width="38" height="38" alt="React" /> + <img src={logoUrl} width="38" height="38" alt="React" /> <span className={s.brandTxt}>Your Company</span> </Link> <div className={s.banner}> diff --git a/src/core/passport.js b/src/core/passport.js @@ -28,6 +28,7 @@ passport.use(new FacebookStrategy({ profileFields: ['name', 'email', 'link', 'locale', 'timezone'], passReqToCallback: true, }, (req, accessToken, refreshToken, profile, done) => { + /* eslint-disable no-underscore-dangle */ const loginName = 'facebook'; const claimType = 'urn:facebook:access_token'; const fooBar = async () => { diff --git a/src/routes/login/Login.js b/src/routes/login/Login.js @@ -45,14 +45,15 @@ function Login(props, context) { viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg" > - <path d={'M30 13h-4V9h-2v4h-4v2h4v4h2v-4h4m-15 2s-2-1.15-2-2c0 0-.5-1.828 1-3 ' + - '1.537-1.2 3-3.035 3-5 0-2.336-1.046-5-3-6h3l2.387-1H10C5.835 0 2 3.345 2 7c0 ' + - '3.735 2.85 6.56 7.086 6.56.295 0 .58-.006.86-.025-.273.526-.47 1.12-.47 1.735 ' + - '0 1.037.817 2.042 1.523 2.73H9c-5.16 0-9 2.593-9 6 0 3.355 4.87 6 10.03 6 5.882 ' + - '0 9.97-3 9.97-7 0-2.69-2.545-4.264-5-6zm-4-4c-2.395 0-5.587-2.857-6-6C4.587 ' + - '3.856 6.607.93 9 1c2.394.07 4.603 2.908 5.017 6.052C14.43 10.195 13 13 11 13zm-1 ' + - '15c-3.566 0-7-1.29-7-4 0-2.658 3.434-5.038 7-5 .832.01 2 0 2 0 1 0 2.88.88 4 2 1 ' + - '1 1 2.674 1 3 0 3-1.986 4-7 4z'} + <path + d={'M30 13h-4V9h-2v4h-4v2h4v4h2v-4h4m-15 2s-2-1.15-2-2c0 0-.5-1.828 1-3 ' + + '1.537-1.2 3-3.035 3-5 0-2.336-1.046-5-3-6h3l2.387-1H10C5.835 0 2 3.345 2 7c0 ' + + '3.735 2.85 6.56 7.086 6.56.295 0 .58-.006.86-.025-.273.526-.47 1.12-.47 1.735 ' + + '0 1.037.817 2.042 1.523 2.73H9c-5.16 0-9 2.593-9 6 0 3.355 4.87 6 10.03 6 5.882 ' + + '0 9.97-3 9.97-7 0-2.69-2.545-4.264-5-6zm-4-4c-2.395 0-5.587-2.857-6-6C4.587 ' + + '3.856 6.607.93 9 1c2.394.07 4.603 2.908 5.017 6.052C14.43 10.195 13 13 11 ' + + '13zm-1 15c-3.566 0-7-1.29-7-4 0-2.658 3.434-5.038 7-5 .832.01 2 0 2 0 1 0 ' + + '2.88.88 4 2 1 1 1 2.674 1 3 0 3-1.986 4-7 4z'} /> </svg> <span>Log in with Google</span> @@ -67,13 +68,14 @@ function Login(props, context) { viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg" > - <path d={'M30 6.708c-1.105.49-2.756 1.143-4 1.292 1.273-.762 2.54-2.56 ' + - '3-4-.97.577-2.087 1.355-3.227 1.773L25 5c-1.12-1.197-2.23-2-4-2-3.398 0-6 ' + - '2.602-6 6 0 .4.047.7.11.956L15 10C9 10 5.034 8.724 2 5c-.53.908-1 1.872-1 ' + - '3 0 2.136 1.348 3.894 3 5-1.01-.033-2.17-.542-3-1 0 2.98 4.186 6.432 7 7-1 ' + - '1-4.623.074-5 0 .784 2.447 3.31 3.95 6 4-2.105 1.648-4.647 2.51-7.53 2.51-.5 ' + - '0-.988-.03-1.47-.084C2.723 27.17 6.523 28 10 28c11.322 0 17-8.867 17-17 ' + - '0-.268.008-.736 0-1 1.2-.868 2.172-2.058 3-3.292z'} + <path + d={'M30 6.708c-1.105.49-2.756 1.143-4 1.292 1.273-.762 2.54-2.56 ' + + '3-4-.97.577-2.087 1.355-3.227 1.773L25 5c-1.12-1.197-2.23-2-4-2-3.398 0-6 ' + + '2.602-6 6 0 .4.047.7.11.956L15 10C9 10 5.034 8.724 2 5c-.53.908-1 1.872-1 ' + + '3 0 2.136 1.348 3.894 3 5-1.01-.033-2.17-.542-3-1 0 2.98 4.186 6.432 7 7-1 ' + + '1-4.623.074-5 0 .784 2.447 3.31 3.95 6 4-2.105 1.648-4.647 2.51-7.53 2.51-.5 ' + + '0-.988-.03-1.47-.084C2.723 27.17 6.523 28 10 28c11.322 0 17-8.867 17-17 ' + + '0-.268.008-.736 0-1 1.2-.868 2.172-2.058 3-3.292z'} /> </svg> <span>Log in with Twitter</span> diff --git a/src/server.js b/src/server.js @@ -22,7 +22,7 @@ import passport from './core/passport'; import models from './data/models'; import schema from './data/schema'; import routes from './routes'; -import assets from './assets'; +import assets from './assets'; // eslint-disable-line import/no-unresolved import { port, auth, analytics } from './config'; const app = express(); @@ -84,7 +84,7 @@ app.get('*', async (req, res, next) => { try { let css = []; let statusCode = 200; - const template = require('./views/index.jade'); + const template = require('./views/index.jade'); // eslint-disable-line global-require const data = { title: '', description: '', css: '', body: '', entry: assets.main.js }; if (process.env.NODE_ENV === 'production') { @@ -95,7 +95,7 @@ app.get('*', async (req, res, next) => { path: req.path, query: req.query, context: { - insertCss: styles => css.push(styles._getCss()), + insertCss: styles => css.push(styles._getCss()), // eslint-disable-line no-underscore-dangle setTitle: value => (data.title = value), setMeta: (key, value) => (data[key] = value), }, @@ -124,7 +124,7 @@ pe.skipPackage('express'); app.use((err, req, res, next) => { // eslint-disable-line no-unused-vars console.log(pe.render(err)); // eslint-disable-line no-console - const template = require('./views/error.jade'); + const template = require('./views/error.jade'); // eslint-disable-line global-require const statusCode = err.status || 500; res.status(statusCode); res.send(template({ diff --git a/tools/.eslintrc b/tools/.eslintrc @@ -1,5 +1,6 @@ { "rules": { - "no-console": 0 + "no-console": 0, + "global-require": 0 } } diff --git a/tools/run.js b/tools/run.js @@ -27,7 +27,7 @@ function run(fn, options) { } if (process.mainModule.children.length === 0 && process.argv.length > 2) { - delete require.cache[__filename]; + delete require.cache[__filename]; // eslint-disable-line no-underscore-dangle const module = require(`./${process.argv[2]}.js`).default; run(module).catch(err => console.error(err.stack)); }