Updated dependencies (webpack 3 -> 4, eslint -> standard)

This commit is contained in:
JubbeArt 2018-07-14 22:52:59 +02:00
parent faf526ab02
commit 955a9d64a5
13 changed files with 5875 additions and 11600 deletions

View file

@ -1,10 +1,4 @@
{
"presets": [
"@babel/preset-react",
"@babel/preset-es2015"
],
"plugins": [
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-proposal-object-rest-spread"
]
"presets": ["env", "react"],
"plugins": ["transform-object-rest-spread"]
}

View file

@ -1,52 +0,0 @@
{
"env": {
"browser": true
},
"extends": "airbnb",
"rules": {
"arrow-parens": "off",
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"exports": "always-multiline",
"functions": "ignore",
"imports": "always-multiline",
"objects": "always-multiline"
}
],
"import/extensions": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"jsx-a11y/anchor-has-content": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-quotes": [
"error",
"prefer-single"
],
"max-len": "off",
"no-param-reassign": "warn",
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
],
"no-prototype-builtins": "off",
"no-script-url": "off",
"no-underscore-dangle": "off",
"no-unused-vars": "warn",
"react/jsx-filename-extension": "off",
"react/no-danger": "off",
"react/prop-types": "off",
"semi": [
"error",
"never"
],
"no-use-before-define": "off",
"import/first": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off"
}
}

7
.gitignore vendored
View file

@ -4,5 +4,8 @@
# Dependency directories
node_modules/
# Generated JS files
static/js
# Generated JS/CSS files
static/main.*
# Log files
*.log

11343
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "removeddit",
"version": "1.0.0",
"version": "1.1.0",
"description": "View removed comments from reddit",
"main": "src/index.js",
"repository": {
@ -20,49 +20,33 @@
},
"homepage": "https://github.com/JubbeArt/removeddit#readme",
"scripts": {
"start": "webpack-dev-server --config webpack.dev.js",
"build": "webpack --config webpack.dev.js",
"build-prod": "webpack --config webpack.prod.js",
"clean": "rm -r node_modules && rm package-lock.json",
"gh-pages": "npm run build-prod && node publish.js"
"start": "webpack-dev-server --mode development",
"build-dev": "webpack --mode development",
"build-prod": "webpack --mode production",
"build-sass": "node-sass --style compressed src/sass/index.sass static/main.css"
},
"dependencies": {
"@babel/polyfill": "^7.0.0-beta.37",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"redux": "^3.7.2",
"babel-polyfill": "^6.26.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"redux": "^4.0.0",
"snuownd": "git+https://github.com/JordanMilne/snuownd.git",
"whatwg-fetch": "^2.0.3"
"whatwg-fetch": "^2.0.4"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.37",
"@babel/core": "^7.0.0-beta.37",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.37",
"@babel/plugin-transform-async-to-generator": "^7.0.0-beta.37",
"@babel/preset-es2015": "^7.0.0-beta.37",
"@babel/preset-react": "^7.0.0-beta.37",
"babel-eslint": "^8.2.1",
"babel-loader": "^8.0.0-beta.0",
"clean-webpack-plugin": "^0.1.17",
"copy-webpack-plugin": "^4.3.1",
"css-loader": "^0.28.8",
"eslint": "^4.15.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.5.1",
"extract-text-webpack-plugin": "^3.0.2",
"gh-pages": "^1.1.0",
"html-loader": "^0.5.4",
"html-webpack-plugin": "^2.30.1",
"node-sass": "^4.7.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"node-sass": "^4.9.2",
"redux-logger": "^3.0.6",
"sass-loader": "^6.0.6",
"uglifyjs-webpack-plugin": "^1.1.6",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.10.0",
"webpack-merge": "^4.1.1"
"standard": "^11.0.1",
"webpack": "^4.16.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4"
}
}

View file

@ -15,7 +15,7 @@ server {
location / {
try_files $uri $uri/ /index.html =404;
}
}
#location /api/ {
# include uwsgi_params;

View file

@ -1,11 +1,10 @@
import 'babel-polyfill'
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { store } from 'state'
import App from 'App'
import '../sass/index.sass'
ReactDOM.render(
<Provider store={store}>
<App />

View file

@ -1,57 +1,3 @@
<!--
_-`````-, ,- '- .
.' .- - | | - -. `.
/.' / `. \
:/ : _... ..._ `` :
:: : /._ .`:'_.._\. || :
:: `._ ./ ,` : \ . _.'' .
`:. / | -. \-. \\_ /
\:._ _/ .' .@) \@) ` `\ ,.'
_/,--' .- .\,-.`--`.
,'/'' (( \ ` )
/'/' \ `-' (
'/'' `._,-----'
''/' .,---'
''/' ;:
''/'' ''/
''/''/''
'/'/'
`;
-->
<!--
__ __
(_ |_ _ || _ _ _ | | _ _ |__). _ |_ |_
__)|_(_||||||(_|| ) |/\|(_|_) | \ |(_)| )|_
_/
-->
<!--
.88888888:.
88888888.88888.
.8888888888888888.
888888888888888888
88' _`88'_ `88888
88 88 88 88 88888
88_88_::_88_:88888
88:::,::,:::::8888
88`:::::::::'`8888
.88 `::::' 8:88.
8888 `8:888.
.8888' `888888.
.8888:.. .::. ...:'8888888:.
.8888.' :' `'::`88:88888
.8888 ' `.888:8888.
888:8 . 888:88888
.888:88 .: 888:88888:
8888888. :: 88:888888
`.::.888. :: .88888888
.::::::.888. :: :::`8888'.:.
::::::::::.888 ' .::::::::::::
::::::::::::.8 ' .:8::::::::::::.
.::::::::::::::. .:888:::::::::::::
:::::::::::::::88:.__..:88888:::::::::::'
`'.:::::::::::88888888888.88:::::::::'
`':::_:' -- '' -'-' `':_::::'`
-->
<!DOCTYPE html>
<html>
<head>
@ -61,10 +7,11 @@ __)|_(_||||||(_|| ) |/\|(_|_) | \ |(_)| )|_
<meta type="author" content="Jesper Wrang">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="./images/favicon.ico" rel="shotcut icon">
<link href="./images/favicon.ico" rel="shotcut icon" type="image/x-icon">
<link href="./main.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="app"></div>
<script src="./js/js/main.js"></script>
<script src="./main.js"></script>
</body>
</html>

View file

@ -1,74 +0,0 @@
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const extractSass = new ExtractTextPlugin({
filename: 'bundle.[contenthash].css',
});
module.exports = {
entry: [
'@babel/polyfill',
'whatwg-fetch',
'./src/js/index.js',
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.[chunkhash].js',
publicPath: '/',
},
resolve: {
modules: [
path.resolve('./src/js'),
path.resolve('./node_modules'),
],
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: true,
},
},
],
},
{
test: /\.html$/,
loader: 'html-loader',
},
{
test: /\.sass$/,
loader: extractSass.extract({
use: ['css-loader', 'sass-loader'],
}),
},
],
},
plugins: [
new CleanWebpackPlugin(['dist']),
extractSass,
new HtmlWebpackPlugin({
template: 'src/index.html',
}),
new CopyWebpackPlugin([
{
from: 'src/404.html',
to: '404.html',
},
{
from: 'src/images',
to: 'images/',
},
]),
],
stats: {
colors: true,
},
}

38
webpack.config.js Normal file
View file

@ -0,0 +1,38 @@
const path = require('path');
module.exports = {
entry: [
'babel-polyfill',
'whatwg-fetch',
'./src/js/index.js',
],
output: {
path: path.resolve(__dirname, 'static'),
publicPath: '/',
},
devServer: {
contentBase: path.resolve(__dirname, 'static'),
historyApiFallback: true,
},
devtool: 'cheap-module-eval-source-map',
resolve: {
modules: [
path.resolve('./src/js'),
path.resolve('./node_modules'),
],
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
cacheDirectory: true,
},
},
}
]
}
}

View file

@ -1,10 +0,0 @@
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
devServer: {
historyApiFallback: true,
},
devtool: 'cheap-module-eval-source-map',
});

View file

@ -1,13 +0,0 @@
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = merge(common, {
plugins: [
new UglifyJSPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
],
});

5802
yarn.lock Normal file

File diff suppressed because it is too large Load diff