Commit aba4934a authored by Alexandros Georgantas's avatar Alexandros Georgantas

Libraries updated

parent 785165ad
......@@ -20,7 +20,7 @@
"editoria-common": "^0.0.3",
"font-awesome": "4.7.0",
"lodash": "4.17.4",
"pubsweet-client": "1.0.0-beta.6",
"pubsweet-client": "^2.1.1",
"react": "^16.2.0",
"react-bootstrap": "0.32.1",
"react-dnd": "2.5.4",
......
......@@ -19,7 +19,7 @@
"dependencies": {
"editoria-common": "^0.0.3",
"lodash": "4.17.4",
"pubsweet-client": "1.0.0-beta.6",
"pubsweet-client": "^2.1.1",
"react": "^16.2.0",
"react-redux": "5.0.4",
"react-router-dom": "4.2.2",
......
{
"presets": [
"es2015",
"react"
"env",
"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'
import { configureStore, Root } from 'pubsweet-client'
import theme from '@pubsweet/default-theme'
import { AppContainer } from 'react-hot-loader'
import createHistory from 'history/createBrowserHistory'
import routes from './routes'
......@@ -12,19 +14,25 @@ import routes from './routes'
const history = createHistory()
const store = configureStore(history, {})
const render = () => {
ReactDOM.render(
<AppContainer>
<Root store={store} history={history} routes={routes} />
</AppContainer>,
document.getElementById('root')
)
}
const rootEl = document.getElementById('root')
render()
ReactDOM.render(
<AppContainer>
<Root history={history} routes={routes} store={store} theme={theme} />
</AppContainer>,
rootEl,
)
if (module.hot) {
module.hot.accept('./routes', () => {
render()
module.hot.accept('pubsweet-client/src/components/Root', () => {
// 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'
import Manage from 'pubsweet-component-manage/Manage'
import Navigation from './components/Navigation/Navigation'
import PrivateRoute from './components/PrivateRoute'
// import AuthenticatedManage from './components/AuthenticatedManage/AuthenticatedManage'
// Pass configuration to editor
const Editor = WithConfig(Wax, {
......@@ -73,22 +74,42 @@ const Editor = WithConfig(Wax, {
// )
export default (
<Switch>
<Redirect exact path='/' to='/books' />
<Route path='/login' component={Login} />
<Route path='/signup' component={Signup} />
<Route path='/password-reset' component={PasswordReset} />
<Redirect exact path="/" to="/books" />
<Route component={Login} path="/login" />
<Route component={Signup} path="/signup" />
<Route component={PasswordReset} path="/password-reset" />
<Manage nav={<Navigation />}>
<PrivateRoute exact path='/books' component={Dashboard} />
<PrivateRoute path='/books/:id/book-builder' component={BookBuilder} />
<PrivateRoute path='/books/:bookId/fragments/:fragmentId' component={Editor} />
<PrivateRoute path='/teams' component={TeamsManager} />
<PrivateRoute path='/users' component={UsersManager} />
<PrivateRoute component={Dashboard} exact path="/books" />
<PrivateRoute component={BookBuilder} path="/books/:id/book-builder" />
<PrivateRoute
component={Editor}
path="/books/:bookId/fragments/:fragmentId"
/>
<PrivateRoute component={TeamsManager} path="/teams" />
<PrivateRoute component={UsersManager} path="/users" />
</Manage>
</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 @@
"pubsweet-component-vivliostyle-viewer",
"pubsweet-component-wax",
"@pubsweet/component-polling-client",
"@pubsweet/component-polling-server"
"@pubsweet/component-polling-server",
"pubsweet-component-theme-editoria"
]
......@@ -3,6 +3,7 @@ const path = require('path')
const components = require('./components')
const bookBuilder = require('./modules/book-builder')
const teams = require('./modules/teams')
const logger = require('winston')
const {
NODE_ENV: nodeEnv,
......@@ -22,18 +23,15 @@ module.exports = {
epub: {
fontsPath: '/uploads/fonts',
},
'mail-transport': {
auth: {
pass: '',
user: '',
},
host: '',
port: 25,
secure: false,
},
'password-reset': {
sender: resetSender || 'dev@example.com',
url: resetUrl || '/password-reset',
url: 'http://localhost:3000/password-reset',
sender: 'noreply@pubsweet.org',
},
mailer: {
from: 'nobody@example.com',
transport: {
sendmail: true,
},
},
publicKeys: [
'authsome',
......@@ -55,6 +53,9 @@ module.exports = {
'pubsweet-server': {
dbPath: dbPath || path.join(__dirname, '..', 'api', 'db', environment),
sse: true,
logger,
port: 3000,
uploads: 'uploads',
},
validations: path.join(__dirname, 'modules', 'validations'),
}
const logger = require('winston')
const { deferConfig } = require('config/defer')
module.exports = {
'pubsweet-server': {
logger
}
baseUrl: deferConfig(
cfg => `http://localhost:${cfg['pubsweet-server'].port}`,
),
},
}
......@@ -20,17 +20,18 @@
"version": "1.2.0",
"dependencies": {
"@pubsweet/db-manager": "^0.0.8",
"@pubsweet/logger": "^0.0.1",
"@pubsweet/ui": "2.0.0",
"@pubsweet/logger": "^0.2.2",
"@pubsweet/ui": "^3.0.0",
"@pubsweet/component-polling-client": "^0.0.1",
"@pubsweet/component-polling-server": "^0.0.2",
"@pubsweet/default-theme": "^0.2.0",
"authsome": "0.0.9",
"font-awesome": "4.7.0",
"history": "^4.7.2",
"lodash": "4.17.4",
"prop-types": "^15.6.0",
"pubsweet": "^1.1.6",
"pubsweet-client": "2.0.0",
"pubsweet": "1.1.1",
"pubsweet-client": "2.1.1",
"pubsweet-component-bookbuilder": "^0.2.0",
"pubsweet-component-editoria-dashboard": "^0.0.5",
"pubsweet-component-epub": "^0.2.13",
......@@ -39,16 +40,16 @@
"pubsweet-component-ink-frontend": "^0.2.3",
"pubsweet-component-login": "^0.5.5",
"pubsweet-component-manage": "^0.2.3",
"pubsweet-component-navigation": "^0.3.0",
"pubsweet-component-password-reset-backend": "^0.2.0",
"pubsweet-component-password-reset-frontend": "^0.2.1",
"pubsweet-component-signup": "1.0.5",
"pubsweet-component-navigation": "^1.0.1",
"pubsweet-component-password-reset-backend": "1.0.0",
"pubsweet-component-password-reset-frontend": "1.0.0",
"pubsweet-component-signup": "^0.4.1",
"pubsweet-component-teams-manager": "1.0.0",
"pubsweet-component-theme-editoria": "^0.0.3",
"pubsweet-component-users-manager": "1.0.0",
"pubsweet-component-theme-editoria": "^0.0.3",
"pubsweet-component-vivliostyle-viewer": "^0.0.2",
"pubsweet-component-wax": "^0.5.11",
"pubsweet-server": "^1.0.6",
"pubsweet-server": "1.1.1",
"pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0",
"react-bootstrap": "0.32.1",
......@@ -59,58 +60,63 @@
"react-redux": "5.0.4",
"react-router-bootstrap": "0.24.4",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.8",
"redux": "3.6.0"
},
"devDependencies": {
"app-module-path": "^2.2.0",
"babel-core": "^6.14.0",
"babel-eslint": "^8.2.1",
"babel-loader": "^7.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-eslint": "^8.0.2",
"babel-preset-es2015": "^6.24.1",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-es2015-native-modules": "^6.9.4",
"babel-preset-minify": "^0.3.0",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-2": "^6.13.0",
"bootstrap-sass": "^3.3.7",
"compression-webpack-plugin": "^1.1.6",
"copy-webpack-plugin": "^4.4.1",
"css-loader": "^0.28.9",
"eslint": "^4.17.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"clean-webpack-plugin": "^0.1.17",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.4",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.5",
"html-webpack-plugin": "^2.24.0",
"joi-browser": "^10.0.6",
"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-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-node": "^6.0.0",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.6.1",
"eslint-plugin-react": "^7.4.0",
"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",
"file-loader": "^1.1.6",
"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",
"lint-staged": "^6.1.0",
"node-sass": "^4.5.2",
"prettier": "^1.10.2",
"react-hot-loader": "^3.1.1",
"regenerator-runtime": "^0.11.0",
"sass-loader": "^6.0.3",
"script-loader": "^0.7.0",
"smtp-server": "^3.3.0",
"string-replace-loader": "^1.2.0",
"style-loader": "^0.20.1",
"testcafe": "^0.18.6",
"testcafe-react-selectors": "^1.0.5",
"url-loader": "^0.6.2",
"webpack": "^3.11.0",
"webpack-hot-middleware": "^2.20.0",
"autobind-decorator": "^1.3.4",
"babel-preset-babili": "0.0.12",
"babili-webpack-plugin": "^0.0.11",
......@@ -124,9 +130,7 @@
"react-test-renderer": "^15.4.2",
"sinon": "^1.17.7",
"sinon-as-promised": "^4.0.2",
"standard": "^10.0.1",
"uglifyjs-webpack-plugin": "^1.1.2",
"webpack-dev-middleware": "^1.12.0"
"standard": "^10.0.1"
},
"jest": {
"moduleNameMapper": {
......
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ThemePlugin = require('pubsweet-theme-plugin')
const CopyWebpackPlugin = require('copy-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 config = require('config')
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
const clientConfig = pick(config, config.publicKeys)
fs.ensureDirSync(universal.output.path)
const clientConfigPath = path.join(universal.output.path, 'client-config.json')
fs.ensureDirSync(outputPath)
const clientConfigPath = path.join(outputPath, 'client-config.json')
fs.writeJsonSync(clientConfigPath, clientConfig, { spaces: 2 })
module.exports = [
{
// The configuration for the client
name: universal.name,
target: universal.target,
context: universal.context,
name: 'app',
target: 'web',
context: path.join(__dirname, '..', 'app'),
entry: {
app: [
'./app'
]
app: ['./app'],
},
output: {
path: universal.output.path,
filename: '[name]-[hash].js',
publicPath: universal.output.publicPath
path: outputPath,
filename: '[name].[hash].js',
publicPath: '/assets/',
},
module: {
rules: require('./common-rules'),
rules,
},
resolve: {
modules: [
path.resolve(__dirname, '..'),
path.resolve(__dirname, '..', 'node_modules'),
'node_modules',
],
alias: {
joi: 'joi-browser',
config: clientConfigPath,
joi: 'joi-browser'
},
enforceExtension: false,
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 HtmlWebpackPlugin({
title: 'Editoria',
title: 'PubSweet app',
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({
'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, {
[config.authsome.mode]: config.authsome.mode,
[config.validations]: config.validations
[config.validations]: config.validations,
}),
new CopyWebpackPlugin([
{ from: '../static' }
]),
new ExtractTextPlugin('styles/main.css'),
new CopyWebpackPlugin([{ from: '../static' }]),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new CompressionPlugin({
algorithm: 'gzip',
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