Commit 1ecd20bb authored by Alexandros Georgantas's avatar Alexandros Georgantas

chore(app): update deps in progress

parent d372bf20
**/_build
**/node_modules
**/coverage
**/dist
{
"linters": {
"*.{js,jsx}": ["prettier --write", "eslint --fix", "stylelint", "git add"]
},
ignore: ["**/CHANGELOG.md"]
"*.{js,jsx}": ["prettier --write", "eslint --fix", "git add"],
"*.{json,md,css,scss}": ["prettier --write", "git add"]
}
......@@ -4,11 +4,19 @@
"@babel/preset-react"
],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-class-properties"
"@babel/plugin-proposal-throw-expressions"
]
}
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<link rel="icon" href="../static/favicon-16x16.png">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div id="root"></div>
</body>
</html>
......@@ -2,6 +2,9 @@
<html>
<head>
<meta charset="utf-8">
<link rel="icon"
type="image/png"
href="/assets/favicon.png">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
......
......@@ -2,10 +2,13 @@
<html>
<head>
<meta charset="utf-8">
<link rel="icon" href="../static/favicon-16x16.png">
<link rel="icon"
type="image/png"
href="/assets/favicon.png">
<title>Editoria</title>
</head>
<body>
<div id="root"></div>
<script type="text/javascript" charset="utf-8" src="/assets/app.js"></script>
<script type="text/javascript" charset="utf-8" src="/assets/js/bundle.js"></script>
</body>
</html>
......@@ -71,15 +71,11 @@ export default (
<Redirect exact path="/" to="/books" />
<Route
path="/login"
render={props => (
<Login {...props} logo="/assets/pubsweet-rgb-small.jpg" />
)}
render={props => <Login {...props} logo="/assets/editoria.png" />}
/>
<Route
path="/signup"
render={props => (
<Signup {...props} logo="/assets/pubsweet-rgb-small.jpg" />
)}
render={props => <Signup {...props} logo="/assets/editoria.png" />}
/>
<Route component={PasswordReset} path="/password-reset" />
<PageLayout>
......
[
"@pubsweet/model-user",
"@pubsweet/model-team",
"@pubsweet/model-fragment",
"@pubsweet/job-xsweet",
"pubsweet-component-password-reset-backend",
"pubsweet-component-password-reset-frontend",
"pubsweet-component-vivliostyle-viewer",
"pubsweet-component-pagedjs-viewer",
"pubsweet-component-wax",
"pubsweet-component-theme-editoria",
"editoria-component-login",
"editoria-component-signup",
"editoria-data-model/src/applicationParameter",
......@@ -31,4 +29,4 @@
"pubsweet-component-editoria-templates",
"editoria-api",
"editoria-file-server"
]
\ No newline at end of file
]
......@@ -17,61 +17,45 @@
"license": "MIT",
"version": "2.0.10",
"dependencies": {
"@apollo/react-hooks": "^3.0.0",
"@pubsweet/coko-theme": "^5.0.7",
"@pubsweet/db-manager": "3.0.7",
"@apollo/react-hooks": "^3.1.3",
"@apollo/react-common": "^3.1.3",
"@pubsweet/coko-theme": "^5.1.20",
"@pubsweet/db-manager": "3.1.3",
"@pubsweet/job-xsweet": "1.2.9",
"@pubsweet/logger": "^0.2.21",
"@pubsweet/model-fragment": "3.0.8",
"@pubsweet/model-team": "2.0.8",
"@pubsweet/model-user": "4.0.8",
"@pubsweet/ui": "^10.3.0",
"@pubsweet/ui-toolkit": "^2.2.0",
"@pubsweet/logger": "^0.2.38",
"@pubsweet/ui": "^12.2.1",
"@pubsweet/ui-toolkit": "^2.2.17",
"authsome": "^0.1.0",
"codemirror": "^5.45.0",
"cypress": "^3.3.0",
"editoria-api": "^0.4.11",
"editoria-common": "^0.2.1",
"editoria-component-login": "^1.3.1",
"editoria-component-signup": "^1.1.3",
"editoria-data-model": "^0.3.1",
"editoria-api": "^0.5.0",
"editoria-common": "^0.2.2",
"editoria-component-login": "^1.3.2",
"editoria-component-signup": "^1.1.4",
"editoria-data-model": "^0.3.2",
"editoria-file-server": "^0.1.1",
"formik": "^1.5.1",
"highlight.js": "^9.13.1",
"history": "^4.7.2",
"lodash": "4.17.4",
"lodash": "^4.17.15",
"nodemon": "^1.19.1",
"pagedjs": "0.1.34",
"pagedjs-cli": "0.0.9",
"path-to-regexp": "^2.4.0",
"prop-types": "^15.6.0",
"pubsweet": "^4.1.2",
"pubsweet-client": "^9.2.3",
"pubsweet-component-bookbuilder": "^1.5.5",
"pubsweet-component-editoria-dashboard": "^0.3.4",
"pubsweet-component-editoria-global-teams": "^0.2.7",
"pubsweet-component-editoria-navigation": "^0.3.1",
"pubsweet-component-editoria-templates": "^0.2.1",
"pubsweet": "^5.1.6",
"pubsweet-client": "^10.1.3",
"pubsweet-component-bookbuilder": "^1.5.6",
"pubsweet-component-editoria-dashboard": "^0.3.5",
"pubsweet-component-editoria-global-teams": "^0.2.8",
"pubsweet-component-editoria-navigation": "^0.3.2",
"pubsweet-component-editoria-templates": "^0.2.2",
"pubsweet-component-editoria-user-profile": "^0.1.2",
"pubsweet-component-pagedjs-viewer": "^0.1.2",
"pubsweet-component-editoria-user-profile": "^0.1.1",
"pubsweet-component-password-reset-backend": "2.0.3",
"pubsweet-component-password-reset-frontend": "3.0.7",
"pubsweet-component-theme-editoria": "^0.0.5",
"pubsweet-component-users-manager": "^3.0.0",
"pubsweet-component-vivliostyle-viewer": "^1.0.2",
"pubsweet-component-wax": "^0.11.6",
"pubsweet-server": "^13.7.2",
"pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0",
"react-beautiful-dnd": "^10.0.4",
"react-codemirror2": "^5.1.0",
"react-dom": "^16.2.0",
"react-modal": "^3.8.1",
"react-router-dom": "^5.0.0",
"recompose": "^0.26.0",
"styled-components": "^4.1.2",
"typeface-fira-sans": "^0.0.43",
"waait": "^1.0.2"
"pubsweet-component-wax": "^0.11.7",
"pubsweet-server": "^13.9.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"styled-components": "^4.1.3"
},
"devDependencies": {
"@babel/core": "^7.0.0",
......@@ -86,77 +70,59 @@
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@commitlint/cli": "^6.0.5",
"@commitlint/config-conventional": "^6.0.4",
"app-module-path": "^2.2.0",
"autobind-decorator": "^1.3.4",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.0",
"babel-preset-es2015-native-modules": "^6.9.4",
"babel-preset-minify": "^0.3.0",
"babili-webpack-plugin": "^0.0.11",
"bootstrap-sass": "^3.3.7",
"clean-webpack-plugin": "^0.1.17",
"babel-preset-minify": "^0.5.0",
"compression-webpack-plugin": "^2.0.0",
"commitizen": "^2.9.6",
"compression-webpack-plugin": "^1.1.6",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.4",
"@commitlint/cli": "^6.0.5",
"@commitlint/config-conventional": "^6.0.4",
"copy-webpack-plugin": "^5.0.2",
"css-loader": "^2.1.1",
"cz-conventional-changelog": "^2.1.0",
"enzyme": "^2.7.1",
"enzyme-to-json": "^1.4.5",
"eslint": "^4.13.1",
"eslint": "^4.17.0",
"eslint-config-pubsweet": "^0.0.6",
"eslint-loader": "^1.6.0",
"eslint-plugin-cypress": "^2.2.1",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.4.2",
"eslint-plugin-jest": "^21.9.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-node": "^6.0.0",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-react": "^7.6.1",
"eslint-plugin-standard": "^3.0.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"faker": "^4.1.0",
"file-loader": "^2.0.0",
"fs-extra": "^5.0.0",
"html-webpack-plugin": "^4.0.0-beta.5",
"html-webpack-plugin": "^3.2.0",
"husky": "^0.14.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^18.1.0",
"joi-browser": "^10.0.6",
"joi-browser": "^13.0.1",
"json-loader": "^0.5.4",
"lint-staged": "^6.0.0",
"lint-staged": "^6.1.0",
"mini-css-extract-plugin": "^0.9.0",
"node-dev": "^4.0.0",
"node-sass": "^4.5.2",
"pouchdb-adapter-memory": "^6.1.1",
"prettier": "^1.8.2",
"react-addons-test-utils": "^15.4.2",
"react-hot-loader": "^4.6.0",
"react-test-renderer": "^15.4.2",
"prettier": "^1.10.2",
"react-hot-loader": "^4.8.3",
"regenerator-runtime": "^0.11.0",
"sass-loader": "^6.0.3",
"sass-loader": "^8.0.2",
"script-loader": "^0.7.0",
"sinon": "^1.17.7",
"sinon-as-promised": "^4.0.2",
"smtp-server": "^3.3.0",
"standard": "^10.0.1",
"standard-version": "^4.4.0",
"string-replace-loader": "^1.3.0",
"style-loader": "^0.19.0",
"style-loader": "^0.23.1",
"stylelint": "^8.2.0",
"stylelint-config-prettier": "^2.0.0",
"stylelint-config-pubsweet": "^0.0.3",
"stylelint-config-recommended": "^2.1.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.3.1",
"testcafe": "^0.18.6",
"testcafe-react-selectors": "^1.0.5",
"uglifyjs-webpack-plugin": "^1.1.2",
"url-loader": "^0.6.2",
"webpack": "^4.29.0",
"webpack-dev-middleware": "^1.12.0",
"webpack-hot-middleware": "^2.20.0",
"testcafe": "^1.4.2",
"testcafe-react-selectors": "^3.0.0",
"url-loader": "^1.1.2",
"webpack": "^4.39.3",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2",
"webpack-hot-middleware": "^2.25.0",
"winston-daily-rotate-file": "^3.2.1"
},
"jest": {
......@@ -206,12 +172,5 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"resolutions": {
"graphql": "^14.1.1",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
"@pubsweet/model-team": "2.0.8",
"@pubsweet/base-model": "3.0.8"
}
}
const path = require('path')
// paths that use ES6 scripts and CSS modules
// TODO: compile components to ES5 for distribution
module.exports = [
// include app folder
path.join(__dirname, '..', 'app'),
// include pubsweet and editoria packages which are published untranspiled
/editoria-[^/]+\/src/,
/wax-[^/]+\/src/,
/editoria-[^/]+\/(?!node_modules)/,
/wax-[^/]+\/(?!node_modules)/,
/pubsweet-[^/\\]+\/(?!node_modules)/,
/@pubsweet\/[^/\\]+\/(?!node_modules)/,
// include pubsweet packages when npm linked from monorepo
filepath =>
// is a child of packages but not node_modules
filepath.match(/\/packages\//) && !filepath.match(/\/node_modules\//),
/packages\/[^/\\]+\/(?!node_modules)/,
]
const path = require('path')
const config = require('config')
const fs = require('fs-extra')
const { pick } = require('lodash')
const ThemePlugin = require('pubsweet-theme-plugin')
// can't use node-config in webpack so save whitelisted client config into the build and alias it below
const outputPath = path.resolve(__dirname, '..', '_build', 'config')
const clientConfig = pick(config, config.publicKeys)
fs.ensureDirSync(outputPath)
const clientConfigPath = path.join(outputPath, 'client-config.json')
fs.writeJsonSync(clientConfigPath, clientConfig, { spaces: 2 })
module.exports = {
symlinks: false, // needed so that babel doesn't look for plugins in components
modules: [
path.resolve(__dirname, '..'), // needed for resolving app/routes
path.resolve(__dirname, '../node_modules'),
path.resolve(__dirname, '../../../node_modules'),
'node_modules',
],
alias: {
joi: 'joi-browser',
config: clientConfigPath,
},
plugins: [new ThemePlugin(config['pubsweet-client'].theme)],
extensions: ['.js', '.jsx', '.json', '.scss'],
}
const babelIncludes = require('./babel-includes')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const path = require('path')
module.exports = [
{ test: /\.tsx?$/, loader: 'ts-loader' },
{
test: /\.js$|\.jsx$/,
loader: 'babel-loader',
query: {
presets: [
['@babel/preset-env', { modules: false }],
'@babel/preset-react',
],
plugins: [
require.resolve('react-hot-loader/babel'),
'@babel/plugin-proposal-class-properties',
// 'transform-decorators-legacy',
],
env: {
production: {
/* bug requires mangle:false https://github.com/babel/minify/issues/556#issuecomment-339751209 */
presets: [['minify', { builtIns: false, mangle: false }]],
},
},
},
include: babelIncludes,
},
{
test: /\.png|\.jpg$/,
loader: {
loader: 'url-loader',
options: {
limit: 5000,
},
},
},
{
test: /\.woff|\.woff2|\.svg|.eot|\.ttf|\.otf/,
loader: [
{
loader: 'url-loader',
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
],
},
{ test: /\.html$/, loader: 'html-loader' },
{
test: /\.css$|\.scss$/,
exclude: /\.local\.s?css$/, // Exclude local styles from global
loader: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
{
loader: 'sass-loader',
options: {
sassOptions: {
includePaths: [path.join(__dirname, '..', 'node_modules')],
},
},
},
],
},
{
test: /\.css$|\.scss$/,
include: /\.local\.s?css/, // Local styles
loader: [
{
loader: 'style-loader',
},
{
loader: MiniCssExtractPlugin.loader,
options: {
hmr: process.env.NODE_ENV === 'development',
},
},
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]_[local]-[hash:base64:8]',
},
},
{
loader: 'sass-loader',
options: {
sassOptions: {
includePaths: [path.join(__dirname, '..', 'node_modules')],
},
},
},
],
},
]
const config = require('config')
const webpack = require('webpack')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const CompressionPlugin = require('compression-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = (opts = {}) => {
const plugins = []
if (opts.hmr) {
plugins.push(new webpack.HotModuleReplacementPlugin())
}
if (opts.html) {
plugins.push(
new HtmlWebpackPlugin({
title: 'Editoria',
template: '../app/index.ejs', // Load a custom template
}),
)
}
if (opts.extractText) {
plugins.push(
new MiniCssExtractPlugin({
filename: 'static/css/[name].[contenthash:8].css',
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
}),
)
}
if (opts.noEmitOnErrors) {
plugins.push(new webpack.NoEmitOnErrorsPlugin())
}
plugins.push(
new webpack.DefinePlugin({
'process.env.NODE_ENV': `"${opts.env}"`,
}),
)
// put dynamically required modules into the build
if (config.validations) {
plugins.push(
new webpack.ContextReplacementPlugin(/./, __dirname, {
[config.authsome.mode]: config.authsome.mode,
}),
)
} else {
plugins.push(
new webpack.ContextReplacementPlugin(/./, __dirname, {
[config.authsome.mode]: config.authsome.mode,
}),
)
}
plugins.push(
new CopyWebpackPlugin([{ from: '../public' }]),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new CompressionPlugin(),
)
return plugins
}
/* eslint-disable global-require */
const include = require('./babel-includes')
const path = require('path')
// const stringReplaceRule = require('./string-replace')
module.exports = [
// stringReplaceRule,
{
oneOf: [
// ES6 JS
{
test: /\.(js|jsx|mjs)$/,
include,
loader: 'babel-loader',
options: {
presets: [
[require('@babel/preset-env'), { modules: false }],
require('@babel/preset-react'),
],
plugins: [
require('react-hot-loader/babel'),
require('@babel/plugin-proposal-class-properties'),
],
},
},
// CSS Modules
{
test: /\.css$|\.scss$/,
include: /\.local\.s?css/, // Local styles
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]_[local]-[hash:base64:8]',
},
},
{
loader: 'sass-loader',
options: {
includePaths: [path.join(__dirname, '..', 'node_modules')],
},
},
],
},
// global CSS
{
test: /\.css$|\.scss$/,
exclude: /\.local\.s?css$/,
use: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
includePaths: [path.join(__dirname, '..', 'node_modules')],
},
},
],
},
// files
{
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
loader: 'file-loader',
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
{ test: /\.png$/, loader: 'url-loader' },
{
test: /\.woff|\.woff2|\.svg|.eot|\.ttf/,
loader: [
{
loader: 'url-loader',
options: {
prefix: 'font',
limit: 1000,
},
},
],
},
],
},
]
/* eslint-disable global-require */
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const include = require('./babel-includes')
const path = require('path')
// const stringReplaceRule = require('./string-replace')
module.exports = [
// stringReplaceRule,
{
oneOf: [
// ES6 JS
{
test: /\.(js|jsx|mjs)$/,
include,
loader: 'babel-loader',
options: {
presets: [
[require('@babel/preset-env'), { modules: false }],
require('@babel/preset-react'),
],
plugins: [require('@babel/plugin-proposal-class-properties')],
},
},
// CSS Modules
{
test: /\.css$|\.scss$/,
include: /\.local\.s?css/, // Local styles
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]_[local]-[hash:base64:8]',
},
},
{
loader: 'sass-loader',
options: {
includePaths: [path.join(__dirname, '..', 'node_modules')],
},
},
],
}),
},
// global CSS
{
test: /\.css$|\.scss$/,
exclude: /\.local\.s?css$/,
use: ExtractTextPlugin.extract({