Commit aba4934a authored by Alexandros Georgantas's avatar Alexandros Georgantas

Libraries updated

parent 785165ad
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"editoria-common": "^0.0.3", "editoria-common": "^0.0.3",
"font-awesome": "4.7.0", "font-awesome": "4.7.0",
"lodash": "4.17.4", "lodash": "4.17.4",
"pubsweet-client": "1.0.0-beta.6", "pubsweet-client": "^2.1.1",
"react": "^16.2.0", "react": "^16.2.0",
"react-bootstrap": "0.32.1", "react-bootstrap": "0.32.1",
"react-dnd": "2.5.4", "react-dnd": "2.5.4",
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"dependencies": { "dependencies": {
"editoria-common": "^0.0.3", "editoria-common": "^0.0.3",
"lodash": "4.17.4", "lodash": "4.17.4",
"pubsweet-client": "1.0.0-beta.6", "pubsweet-client": "^2.1.1",
"react": "^16.2.0", "react": "^16.2.0",
"react-redux": "5.0.4", "react-redux": "5.0.4",
"react-router-dom": "4.2.2", "react-router-dom": "4.2.2",
......
{ {
"presets": [ "presets": [
"es2015", "env",
"react" "react",
"stage-2"
] ]
} }
\ No newline at end of file
**/_build
**/node_modules
**/coverage
{
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true
},
"extends": ["pubsweet"],
"rules": {
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"sort-keys": 0
},
"overrides": [
{
"files": ["test/**/*.test.js"],
"globals": {
"fixture": true,
"text": true
}
}
]
}
...@@ -5,6 +5,8 @@ import ReactDOM from 'react-dom' ...@@ -5,6 +5,8 @@ import ReactDOM from 'react-dom'
import { configureStore, Root } from 'pubsweet-client' import { configureStore, Root } from 'pubsweet-client'
import theme from '@pubsweet/default-theme'
import { AppContainer } from 'react-hot-loader' import { AppContainer } from 'react-hot-loader'
import createHistory from 'history/createBrowserHistory' import createHistory from 'history/createBrowserHistory'
import routes from './routes' import routes from './routes'
...@@ -12,19 +14,25 @@ import routes from './routes' ...@@ -12,19 +14,25 @@ import routes from './routes'
const history = createHistory() const history = createHistory()
const store = configureStore(history, {}) const store = configureStore(history, {})
const render = () => { const rootEl = document.getElementById('root')
ReactDOM.render(
<AppContainer>
<Root store={store} history={history} routes={routes} />
</AppContainer>,
document.getElementById('root')
)
}
render() ReactDOM.render(
<AppContainer>
<Root history={history} routes={routes} store={store} theme={theme} />
</AppContainer>,
rootEl,
)
if (module.hot) { if (module.hot) {
module.hot.accept('./routes', () => { module.hot.accept('pubsweet-client/src/components/Root', () => {
render() // eslint-disable-next-line global-require
const NextRoot = require('pubsweet-client/src/components/Root').default
ReactDOM.render(
<AppContainer>
<NextRoot history={history} routes={routes} store={store} />
</AppContainer>,
rootEl,
)
}) })
} }
...@@ -23,6 +23,7 @@ import Dashboard from 'pubsweet-component-editoria-dashboard/src/Dashboard' ...@@ -23,6 +23,7 @@ import Dashboard from 'pubsweet-component-editoria-dashboard/src/Dashboard'
import Manage from 'pubsweet-component-manage/Manage' import Manage from 'pubsweet-component-manage/Manage'
import Navigation from './components/Navigation/Navigation' import Navigation from './components/Navigation/Navigation'
import PrivateRoute from './components/PrivateRoute' import PrivateRoute from './components/PrivateRoute'
// import AuthenticatedManage from './components/AuthenticatedManage/AuthenticatedManage'
// Pass configuration to editor // Pass configuration to editor
const Editor = WithConfig(Wax, { const Editor = WithConfig(Wax, {
...@@ -73,22 +74,42 @@ const Editor = WithConfig(Wax, { ...@@ -73,22 +74,42 @@ const Editor = WithConfig(Wax, {
// ) // )
export default ( export default (
<Switch> <Switch>
<Redirect exact path='/' to='/books' /> <Redirect exact path="/" to="/books" />
<Route path='/login' component={Login} /> <Route component={Login} path="/login" />
<Route path='/signup' component={Signup} /> <Route component={Signup} path="/signup" />
<Route path='/password-reset' component={PasswordReset} /> <Route component={PasswordReset} path="/password-reset" />
<Manage nav={<Navigation />}> <Manage nav={<Navigation />}>
<PrivateRoute exact path='/books' component={Dashboard} /> <PrivateRoute component={Dashboard} exact path="/books" />
<PrivateRoute path='/books/:id/book-builder' component={BookBuilder} /> <PrivateRoute component={BookBuilder} path="/books/:id/book-builder" />
<PrivateRoute path='/books/:bookId/fragments/:fragmentId' component={Editor} />
<PrivateRoute
<PrivateRoute path='/teams' component={TeamsManager} /> component={Editor}
<PrivateRoute path='/users' component={UsersManager} /> path="/books/:bookId/fragments/:fragmentId"
/>
<PrivateRoute component={TeamsManager} path="/teams" />
<PrivateRoute component={UsersManager} path="/users" />
</Manage> </Manage>
</Switch> </Switch>
) )
// const Managed = () => (
// <AuthenticatedManage>
// <Switch>
// <Route component={Dashboard} path="/manage/books" />
// <Route component={UsersManager} path="/manage/users" />
// <Route component={TeamsManager} path="/manage/teams" />
// <Route component={BookBuilder} path="/manage/books/:id/book-builder" />
// </Switch>
// </AuthenticatedManage>
// )
// export default (
// <Switch>
// <Route component={Managed} path="/manage" />
// <Route component={Login} path="/login" />
// <Route component={Signup} path="/signup" />
// </Switch>
// )
...@@ -10,5 +10,6 @@ ...@@ -10,5 +10,6 @@
"pubsweet-component-vivliostyle-viewer", "pubsweet-component-vivliostyle-viewer",
"pubsweet-component-wax", "pubsweet-component-wax",
"@pubsweet/component-polling-client", "@pubsweet/component-polling-client",
"@pubsweet/component-polling-server" "@pubsweet/component-polling-server",
"pubsweet-component-theme-editoria"
] ]
...@@ -3,6 +3,7 @@ const path = require('path') ...@@ -3,6 +3,7 @@ const path = require('path')
const components = require('./components') const components = require('./components')
const bookBuilder = require('./modules/book-builder') const bookBuilder = require('./modules/book-builder')
const teams = require('./modules/teams') const teams = require('./modules/teams')
const logger = require('winston')
const { const {
NODE_ENV: nodeEnv, NODE_ENV: nodeEnv,
...@@ -22,18 +23,15 @@ module.exports = { ...@@ -22,18 +23,15 @@ module.exports = {
epub: { epub: {
fontsPath: '/uploads/fonts', fontsPath: '/uploads/fonts',
}, },
'mail-transport': {
auth: {
pass: '',
user: '',
},
host: '',
port: 25,
secure: false,
},
'password-reset': { 'password-reset': {
sender: resetSender || 'dev@example.com', url: 'http://localhost:3000/password-reset',
url: resetUrl || '/password-reset', sender: 'noreply@pubsweet.org',
},
mailer: {
from: 'nobody@example.com',
transport: {
sendmail: true,
},
}, },
publicKeys: [ publicKeys: [
'authsome', 'authsome',
...@@ -55,6 +53,9 @@ module.exports = { ...@@ -55,6 +53,9 @@ module.exports = {
'pubsweet-server': { 'pubsweet-server': {
dbPath: dbPath || path.join(__dirname, '..', 'api', 'db', environment), dbPath: dbPath || path.join(__dirname, '..', 'api', 'db', environment),
sse: true, sse: true,
logger,
port: 3000,
uploads: 'uploads',
}, },
validations: path.join(__dirname, 'modules', 'validations'), validations: path.join(__dirname, 'modules', 'validations'),
} }
const logger = require('winston') const { deferConfig } = require('config/defer')
module.exports = { module.exports = {
'pubsweet-server': { 'pubsweet-server': {
logger baseUrl: deferConfig(
} cfg => `http://localhost:${cfg['pubsweet-server'].port}`,
),
},
} }
...@@ -20,17 +20,18 @@ ...@@ -20,17 +20,18 @@
"version": "1.2.0", "version": "1.2.0",
"dependencies": { "dependencies": {
"@pubsweet/db-manager": "^0.0.8", "@pubsweet/db-manager": "^0.0.8",
"@pubsweet/logger": "^0.0.1", "@pubsweet/logger": "^0.2.2",
"@pubsweet/ui": "2.0.0", "@pubsweet/ui": "^3.0.0",
"@pubsweet/component-polling-client": "^0.0.1", "@pubsweet/component-polling-client": "^0.0.1",
"@pubsweet/component-polling-server": "^0.0.2", "@pubsweet/component-polling-server": "^0.0.2",
"@pubsweet/default-theme": "^0.2.0",
"authsome": "0.0.9", "authsome": "0.0.9",
"font-awesome": "4.7.0", "font-awesome": "4.7.0",
"history": "^4.7.2", "history": "^4.7.2",
"lodash": "4.17.4", "lodash": "4.17.4",
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"pubsweet": "^1.1.6", "pubsweet": "1.1.1",
"pubsweet-client": "2.0.0", "pubsweet-client": "2.1.1",
"pubsweet-component-bookbuilder": "^0.2.0", "pubsweet-component-bookbuilder": "^0.2.0",
"pubsweet-component-editoria-dashboard": "^0.0.5", "pubsweet-component-editoria-dashboard": "^0.0.5",
"pubsweet-component-epub": "^0.2.13", "pubsweet-component-epub": "^0.2.13",
...@@ -39,16 +40,16 @@ ...@@ -39,16 +40,16 @@
"pubsweet-component-ink-frontend": "^0.2.3", "pubsweet-component-ink-frontend": "^0.2.3",
"pubsweet-component-login": "^0.5.5", "pubsweet-component-login": "^0.5.5",
"pubsweet-component-manage": "^0.2.3", "pubsweet-component-manage": "^0.2.3",
"pubsweet-component-navigation": "^0.3.0", "pubsweet-component-navigation": "^1.0.1",
"pubsweet-component-password-reset-backend": "^0.2.0", "pubsweet-component-password-reset-backend": "1.0.0",
"pubsweet-component-password-reset-frontend": "^0.2.1", "pubsweet-component-password-reset-frontend": "1.0.0",
"pubsweet-component-signup": "1.0.5", "pubsweet-component-signup": "^0.4.1",
"pubsweet-component-teams-manager": "1.0.0", "pubsweet-component-teams-manager": "1.0.0",
"pubsweet-component-theme-editoria": "^0.0.3",
"pubsweet-component-users-manager": "1.0.0", "pubsweet-component-users-manager": "1.0.0",
"pubsweet-component-theme-editoria": "^0.0.3",
"pubsweet-component-vivliostyle-viewer": "^0.0.2", "pubsweet-component-vivliostyle-viewer": "^0.0.2",
"pubsweet-component-wax": "^0.5.11", "pubsweet-component-wax": "^0.5.11",
"pubsweet-server": "^1.0.6", "pubsweet-server": "1.1.1",
"pubsweet-theme-plugin": "^0.0.3", "pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0", "react": "^16.2.0",
"react-bootstrap": "0.32.1", "react-bootstrap": "0.32.1",
...@@ -59,58 +60,63 @@ ...@@ -59,58 +60,63 @@
"react-redux": "5.0.4", "react-redux": "5.0.4",
"react-router-bootstrap": "0.24.4", "react-router-bootstrap": "0.24.4",
"react-router-dom": "^4.2.2", "react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.8",
"redux": "3.6.0" "redux": "3.6.0"
}, },
"devDependencies": { "devDependencies": {
"app-module-path": "^2.2.0", "babel-eslint": "^8.0.2",
"babel-core": "^6.14.0", "babel-preset-es2015": "^6.24.1",
"babel-eslint": "^8.2.1", "babel-core": "^6.26.0",
"babel-loader": "^7.0.0", "babel-loader": "^7.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-env": "^1.6.0", "babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.14.0", "babel-preset-react": "^6.24.1",
"babel-preset-es2015-native-modules": "^6.9.4", "babel-preset-stage-2": "^6.24.1",
"babel-preset-minify": "^0.3.0", "clean-webpack-plugin": "^0.1.17",
"babel-preset-react": "^6.11.1", "copy-webpack-plugin": "^4.0.1",
"babel-preset-stage-2": "^6.13.0", "css-loader": "^0.28.4",
"bootstrap-sass": "^3.3.7", "extract-text-webpack-plugin": "^3.0.0",
"compression-webpack-plugin": "^1.1.6", "file-loader": "^1.1.5",
"copy-webpack-plugin": "^4.4.1", "html-webpack-plugin": "^2.24.0",
"css-loader": "^0.28.9", "joi-browser": "^10.0.6",
"eslint": "^4.17.0", "react-hot-loader": "^3.1.1",
"string-replace-loader": "^1.3.0",
"style-loader": "^0.19.0",
"uglifyjs-webpack-plugin": "^1.1.2",
"webpack": "^3.8.1",
"webpack-dev-middleware": "^1.12.0",
"eslint": "^4.12.0",
"eslint-config-pubsweet": "^0.0.6", "eslint-config-pubsweet": "^0.0.6",
"eslint-plugin-import": "^2.8.0", "eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.9.0", "eslint-plugin-jest": "^21.4.0",
"eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-node": "^6.0.0", "eslint-plugin-node": "^5.2.1",
"eslint-plugin-prettier": "^2.6.0", "eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-promise": "^3.6.0", "eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.6.1", "eslint-plugin-react": "^7.4.0",
"eslint-plugin-standard": "^3.0.1", "eslint-plugin-standard": "^3.0.1",
"extract-text-webpack-plugin": "^3.0.2", "husky": "^0.14.3",
"lint-staged": "^4.1.3",
"prettier": "^1.8.2",
"react-router-redux": "^5.0.0-alpha.9",
"stylelint": "^8.2.0",
"stylelint-config-pubsweet": "^0.0.3",
"webpack-hot-middleware": "^2.20.0",
"app-module-path": "^2.2.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015-native-modules": "^6.9.4",
"babel-preset-minify": "^0.3.0",
"bootstrap-sass": "^3.3.7",
"compression-webpack-plugin": "^1.1.6",
"faker": "^4.1.0", "faker": "^4.1.0",
"file-loader": "^1.1.6",
"fs-extra": "^5.0.0", "fs-extra": "^5.0.0",
"html-webpack-plugin": "^2.24.0",
"husky": "^0.14.3",
"joi-browser": "^13.0.1",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"lint-staged": "^6.1.0",
"node-sass": "^4.5.2", "node-sass": "^4.5.2",
"prettier": "^1.10.2",
"react-hot-loader": "^3.1.1",
"regenerator-runtime": "^0.11.0", "regenerator-runtime": "^0.11.0",
"sass-loader": "^6.0.3", "sass-loader": "^6.0.3",
"script-loader": "^0.7.0", "script-loader": "^0.7.0",
"smtp-server": "^3.3.0", "smtp-server": "^3.3.0",
"string-replace-loader": "^1.2.0",
"style-loader": "^0.20.1",
"testcafe": "^0.18.6", "testcafe": "^0.18.6",
"testcafe-react-selectors": "^1.0.5", "testcafe-react-selectors": "^1.0.5",
"url-loader": "^0.6.2", "url-loader": "^0.6.2",
"webpack": "^3.11.0",
"webpack-hot-middleware": "^2.20.0",
"autobind-decorator": "^1.3.4", "autobind-decorator": "^1.3.4",
"babel-preset-babili": "0.0.12", "babel-preset-babili": "0.0.12",
"babili-webpack-plugin": "^0.0.11", "babili-webpack-plugin": "^0.0.11",
...@@ -124,9 +130,7 @@ ...@@ -124,9 +130,7 @@
"react-test-renderer": "^15.4.2", "react-test-renderer": "^15.4.2",
"sinon": "^1.17.7", "sinon": "^1.17.7",
"sinon-as-promised": "^4.0.2", "sinon-as-promised": "^4.0.2",
"standard": "^10.0.1", "standard": "^10.0.1"
"uglifyjs-webpack-plugin": "^1.1.2",
"webpack-dev-middleware": "^1.12.0"
}, },
"jest": { "jest": {
"moduleNameMapper": { "moduleNameMapper": {
......
const path = require('path')
const webpack = require('webpack') const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin')
const ThemePlugin = require('pubsweet-theme-plugin') const ThemePlugin = require('pubsweet-theme-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin')
const CompressionPlugin = require('compression-webpack-plugin') const CompressionPlugin = require('compression-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const universal = require('./universal')
const path = require('path')
const fs = require('fs-extra') const fs = require('fs-extra')
const config = require('config') const config = require('config')
const { pick } = require('lodash') const { pick } = require('lodash')
const rules = require('./common-rules')
const outputPath = path.resolve(__dirname, '..', '_build', 'assets')
// console.log('conf', config)
// can't use node-config in webpack so save whitelisted client config into the build and alias it below // can't use node-config in webpack so save whitelisted client config into the build and alias it below
const clientConfig = pick(config, config.publicKeys) const clientConfig = pick(config, config.publicKeys)
fs.ensureDirSync(universal.output.path) fs.ensureDirSync(outputPath)
const clientConfigPath = path.join(universal.output.path, 'client-config.json') const clientConfigPath = path.join(outputPath, 'client-config.json')
fs.writeJsonSync(clientConfigPath, clientConfig, { spaces: 2 }) fs.writeJsonSync(clientConfigPath, clientConfig, { spaces: 2 })
module.exports = [ module.exports = [
{ {
// The configuration for the client // The configuration for the client
name: universal.name, name: 'app',
target: universal.target, target: 'web',
context: universal.context, context: path.join(__dirname, '..', 'app'),
entry: { entry: {
app: [ app: ['./app'],
'./app'
]
}, },
output: { output: {
path: universal.output.path, path: outputPath,
filename: '[name]-[hash].js', filename: '[name].[hash].js',
publicPath: universal.output.publicPath publicPath: '/assets/',
}, },
module: { module: {
rules: require('./common-rules'), rules,
}, },
resolve: { resolve: {
modules: [
path.resolve(__dirname, '..'),
path.resolve(__dirname, '..', 'node_modules'),
'node_modules',
],
alias: { alias: {
joi: 'joi-browser',
config: clientConfigPath, config: clientConfigPath,
joi: 'joi-browser'
}, },
enforceExtension: false,
extensions: ['.js', '.jsx', '.json', '.scss'], extensions: ['.js', '.jsx', '.json', '.scss'],
modules: [
path.resolve(__dirname, '..'),
path.resolve(__dirname, '../node_modules'),
path.resolve(__dirname, '../../../node_modules'),
'node_modules'
],
plugins: [new ThemePlugin(config['pubsweet-client'].theme)], plugins: [new ThemePlugin(config['pubsweet-client'].theme)],
}, },
plugins: [ plugins: [
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
title: 'Editoria', title: 'PubSweet app',
template: '../app/index.ejs', // Load a custom template template: '../app/index.ejs', // Load a custom template
inject: 'body' // Inject all scripts into the body inject: 'body', // Inject all scripts into the body
}), }),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production') 'process.env.NODE_ENV': JSON.stringify('production'),
}), }),
new ExtractTextPlugin('styles/main.css'), // put dynamically required modules into the build
new webpack.ContextReplacementPlugin(/./, __dirname, { new webpack.ContextReplacementPlugin(/./, __dirname, {
[config.authsome.mode]: config.authsome.mode, [config.authsome.mode]: config.authsome.mode,
[config.validations]: config.validations [config.validations]: config.validations,
}), }),
new CopyWebpackPlugin([ new ExtractTextPlugin('styles/main.css'),
{ from: '../static' } new CopyWebpackPlugin([{ from: '../static' }]),
]),
new webpack.optimize.AggressiveMergingPlugin(), new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(), new webpack.optimize.OccurrenceOrderPlugin(),
new CompressionPlugin({ new CompressionPlugin({
algorithm: 'gzip',
asset: '[path].gz[query]', asset: '[path].gz[query]',
test: /\.js$|\.css$|\.html$/ algorithm: 'gzip',
test: /\.js$|\.css$|\.html$/,
}), }),
new UglifyJSPlugin(),
], ],
node: universal.node node: {
} fs: 'empty',
__dirname: true,
},
},
] ]
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment