diff --git a/README.md b/README.md index a7032786..6a645a93 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # cellxgene -A React + Redux web application for exploring large scale single cell RNA sequence data. +A React + Redux web application for exploring large scale single cell RNA sequence data. ##### Quickstart: diff --git a/configuration/babel/babel.dev.js b/configuration/babel/babel.dev.js index 571d4cd2..bc9dc712 100644 --- a/configuration/babel/babel.dev.js +++ b/configuration/babel/babel.dev.js @@ -1,11 +1,7 @@ module.exports = { babelrc: false, cacheDirectory: true, - presets: [ - [ "env", { loose: true, modules: false } ], - "stage-0", - "react" - ], + presets: [["env", { loose: true, modules: false }], "stage-0", "react"], plugins: [ "react-hot-loader/babel", "babel-plugin-transform-decorators-legacy" diff --git a/configuration/babel/babel.prod.js b/configuration/babel/babel.prod.js index c2399a54..d185e68b 100644 --- a/configuration/babel/babel.prod.js +++ b/configuration/babel/babel.prod.js @@ -1,12 +1,10 @@ module.exports = { babelrc: false, - presets: [ - [ "env", { loose: true, modules: false } ], - "stage-0", - "react" - ], + presets: [["env", { loose: true, modules: false }], "stage-0", "react"], plugins: [ "babel-plugin-transform-react-constant-elements", "babel-plugin-transform-decorators-legacy" - ].map(require.resolve).concat([ [ require.resolve('babel-plugin-transform-runtime') ] ]) + ] + .map(require.resolve) + .concat([[require.resolve("babel-plugin-transform-runtime")]]) }; diff --git a/configuration/babel/babel.test.js b/configuration/babel/babel.test.js index e18d5e58..63e45b6d 100644 --- a/configuration/babel/babel.test.js +++ b/configuration/babel/babel.test.js @@ -1,9 +1,9 @@ module.exports = { babelrc: false, presets: [ - 'babel-preset-es2015', - 'babel-preset-stage-0', - 'babel-preset-react' + "babel-preset-es2015", + "babel-preset-stage-0", + "babel-preset-react" ], - plugins: [ 'istanbul' ] + plugins: ["istanbul"] }; diff --git a/configuration/eslint/eslint.js b/configuration/eslint/eslint.js index e50ac01a..012c6c44 100644 --- a/configuration/eslint/eslint.js +++ b/configuration/eslint/eslint.js @@ -1,22 +1,22 @@ module.exports = { root: true, - parser: 'babel-eslint', - extends: 'airbnb', + parser: "babel-eslint", + extends: "airbnb", env: { browser: true, commonjs: true, es6: true }, globals: { expect: true }, parserOptions: { ecmaVersion: 6, - sourceType: 'module', + sourceType: "module", ecmaFeatures: { jsx: true, - generators: true, + generators: true } }, rules: { - 'no-magic-numbers': 'off', - 'func-style': 'off', - 'arrow-parens': 'off', - 'no-use-before-define': 'off', - 'react/jsx-filename-extension': 'off', + "no-magic-numbers": "off", + "func-style": "off", + "arrow-parens": "off", + "no-use-before-define": "off", + "react/jsx-filename-extension": "off" } }; diff --git a/configuration/polyfills/polyfills.js b/configuration/polyfills/polyfills.js index 1aa797e9..a63249f6 100644 --- a/configuration/polyfills/polyfills.js +++ b/configuration/polyfills/polyfills.js @@ -1,6 +1,6 @@ -if (typeof Promise === 'undefined') { - require('promise/lib/rejection-tracking').enable(); - window.Promise = require('promise/lib/es6-extensions.js'); +if (typeof Promise === "undefined") { + require("promise/lib/rejection-tracking").enable(); + window.Promise = require("promise/lib/es6-extensions.js"); } -require('whatwg-fetch'); +require("whatwg-fetch"); diff --git a/configuration/webpack/webpack.config.dev.js b/configuration/webpack/webpack.config.dev.js index 07e485e0..1beaf9aa 100644 --- a/configuration/webpack/webpack.config.dev.js +++ b/configuration/webpack/webpack.config.dev.js @@ -1,72 +1,74 @@ -const path = require('path'); -const autoprefixer = require('autoprefixer'); -const webpack = require('webpack'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); +// jshint esversion: 6 +const path = require("path"); +const autoprefixer = require("autoprefixer"); +const webpack = require("webpack"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); -const src = path.resolve('src'); -const nodeModules = path.resolve('node_modules'); +const src = path.resolve("src"); +const nodeModules = path.resolve("node_modules"); module.exports = { - devtool: 'eval', + devtool: "eval", entry: [ - 'webpack-hot-middleware/client?quiet=true&noInfo=true', - require.resolve('react-hot-loader/patch'), - require.resolve('../polyfills/polyfills'), - path.join(src, 'index') + "webpack-hot-middleware/client?quiet=true&noInfo=true", + require.resolve("react-hot-loader/patch"), + require.resolve("../polyfills/polyfills"), + path.join(src, "index") ], output: { - path: path.resolve('build'), + path: path.resolve("build"), pathinfo: true, - filename: 'static/js/bundle.js', - publicPath: '/' + filename: "static/js/bundle.js", + publicPath: "/" }, - resolve: { extensions: [ '.js', '.json' ] }, + resolve: { extensions: [".js", ".json"] }, module: { loaders: [ { test: /\.js$/, include: src, - loader: 'babel-loader', - query: require('../babel/babel.dev') + loader: "babel-loader", + query: require("../babel/babel.dev") }, { test: /\.css$/, - include: [ src, nodeModules ], - loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader' + include: [src, nodeModules], + loader: + "style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader" }, - { test: /\.json$/, include: [ src, nodeModules ], loader: 'json-loader' }, + { test: /\.json$/, include: [src, nodeModules], loader: "json-loader" }, { test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/, - include: [ src, nodeModules ], - loader: 'file-loader', - query: { name: 'static/media/[name].[ext]' } + include: [src, nodeModules], + loader: "file-loader", + query: { name: "static/media/[name].[ext]" } }, { test: /\.(mp4|webm)(\?.*)?$/, - include: [ src, nodeModules ], - loader: 'url-loader', - query: { limit: 10000, name: 'static/media/[name].[ext]' } + include: [src, nodeModules], + loader: "url-loader", + query: { limit: 10000, name: "static/media/[name].[ext]" } } ] }, plugins: [ new HtmlWebpackPlugin({ inject: true, - template: path.resolve('index.html'), - favicon: path.resolve('favicon.png') + template: path.resolve("index.html"), + favicon: path.resolve("favicon.png") }), new webpack.LoaderOptionsPlugin({ options: { eslint: { - configFile: path.resolve('./configuration/eslint/eslint.js'), + configFile: path.resolve("./configuration/eslint/eslint.js"), useEslintrc: false }, postcss() { - return [ autoprefixer ]; + return [autoprefixer]; } } }), - new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"development"' }), + new webpack.DefinePlugin({ "process.env.NODE_ENV": '"development"' }), // Note: only CSS is currently hot reloaded new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin() diff --git a/configuration/webpack/webpack.config.prod.js b/configuration/webpack/webpack.config.prod.js index bb79e005..33a9715b 100644 --- a/configuration/webpack/webpack.config.prod.js +++ b/configuration/webpack/webpack.config.prod.js @@ -1,74 +1,74 @@ -const path = require('path'); -const autoprefixer = require('autoprefixer'); -const webpack = require('webpack'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const ExtractTextPlugin = require('extract-text-webpack-plugin'); -const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const HtmlWebpackInlineSourcePlugin = require( - 'html-webpack-inline-source-plugin' -); +// jshint esversion: 6 +const path = require("path"); +const autoprefixer = require("autoprefixer"); +const webpack = require("webpack"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); +const ExtractTextPlugin = require("extract-text-webpack-plugin"); +const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin"); +const CopyWebpackPlugin = require("copy-webpack-plugin"); +const HtmlWebpackInlineSourcePlugin = require("html-webpack-inline-source-plugin"); const MinifyPlugin = require("babel-minify-webpack-plugin"); -const src = path.resolve('src'); -const nodeModules = path.resolve('node_modules'); +const src = path.resolve("src"); +const nodeModules = path.resolve("node_modules"); -const publicPath = '/'; +const publicPath = "/"; module.exports = { bail: true, - devtool: 'cheap-source-map', - entry: [ require.resolve('../polyfills/polyfills'), path.join(src, 'index') ], + devtool: "cheap-source-map", + entry: [require.resolve("../polyfills/polyfills"), path.join(src, "index")], output: { - path: path.resolve('build'), - filename: 'static/js/[name].[chunkhash:8].js', - chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js', + path: path.resolve("build"), + filename: "static/js/[name].[chunkhash:8].js", + chunkFilename: "static/js/[name].[chunkhash:8].chunk.js", publicPath }, - resolve: { extensions: [ '.js', '.json' ] }, + resolve: { extensions: [".js", ".json"] }, module: { loaders: [ { test: /\.js$/, include: src, - loader: 'babel-loader', - query: require('../babel/babel.prod') + loader: "babel-loader", + query: require("../babel/babel.prod") }, { test: /\.css$/, - include: [ src, nodeModules ], + include: [src, nodeModules], loader: ExtractTextPlugin.extract({ - fallbackLoader: 'style-loader', - loader: 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]-autoprefixer!postcss-loader' + fallbackLoader: "style-loader", + loader: + "css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]-autoprefixer!postcss-loader" }) }, { test: /\.json$/, - include: [ src, nodeModules ], - loader: 'json-loader', + include: [src, nodeModules], + loader: "json-loader", exclude: /manifest.json$/ }, { test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/, - include: [ src, nodeModules ], - loader: 'file-loader', - query: { name: 'static/media/[name].[hash:8].[ext]' } + include: [src, nodeModules], + loader: "file-loader", + query: { name: "static/media/[name].[hash:8].[ext]" } }, { test: /\.(mp4|webm)(\?.*)?$/, - include: [ src, nodeModules ], - loader: 'url-loader', - query: { limit: 10000, name: 'static/media/[name].[hash:8].[ext]' } + include: [src, nodeModules], + loader: "url-loader", + query: { limit: 10000, name: "static/media/[name].[hash:8].[ext]" } } ] }, plugins: [ new HtmlWebpackPlugin({ - inject: 'body', - filename: 'index.html', - template: path.resolve('index_template.html'), - favicon: path.resolve('favicon.png'), - inlineSource: '.(js|css)$', + inject: "body", + filename: "index.html", + template: path.resolve("index_template.html"), + favicon: path.resolve("favicon.png"), + inlineSource: ".(js|css)$", minify: { removeComments: true, collapseWhitespace: true, @@ -86,21 +86,21 @@ module.exports = { new webpack.LoaderOptionsPlugin({ options: { eslint: { - configFile: path.resolve('./configuration/eslint/eslint.js'), + configFile: path.resolve("./configuration/eslint/eslint.js"), useEslintrc: false }, postcss() { - return [ autoprefixer ]; + return [autoprefixer]; } } }), - new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }), + new webpack.DefinePlugin({ "process.env.NODE_ENV": '"production"' }), new webpack.optimize.OccurrenceOrderPlugin(), new MinifyPlugin(), - new ExtractTextPlugin('static/css/[name].[contenthash:8].css'), + new ExtractTextPlugin("static/css/[name].[contenthash:8].css"), new SWPrecacheWebpackPlugin({ - cacheId: 'cellxgene', - filename: 'service-worker.js' + cacheId: "cellxgene", + filename: "service-worker.js" }) ] }; diff --git a/index_template.html b/index_template.html index b2f683ed..e8e5327d 100644 --- a/index_template.html +++ b/index_template.html @@ -13,12 +13,12 @@
@@ -26,4 +26,4 @@ -