diff --git a/.eslintrc b/.eslintrc index 6620eb90f2e54e6dd1eaf5bcc6f92396d0f5d31a..f2cd57c6593787ae1426f70ff63ff5fa4deeaf8f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,10 @@ // Use this file as a starting point for your project's .eslintrc. // Copy this file, and add rule overrides as needed. { - "extends": ["standard", "standard-react"] + "extends": ["standard", "standard-react"], + "parser": "babel-eslint", + "env": { + "es6": true, + "browser": true + } } diff --git a/.gitignore b/.gitignore index 10a8b909518f233620d978087555e52b48124e4b..105a7dc05cf15bcb74041e2d680fe9a8d3d6b788 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .env.* .DS_Store _build/* +__snapshots__/ api/db/* api/db/* coverage @@ -10,5 +11,3 @@ npm-debug.log public/assets/* public/uploads/* pubsweet.log -uploads/* -__snapshots__/ \ No newline at end of file diff --git a/app/.eslintrc b/app/.eslintrc deleted file mode 100644 index bb57155c6b64077529267cf5e0430a45dfae3e8b..0000000000000000000000000000000000000000 --- a/app/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -// Use this file as a starting point for your project's .eslintrc. -// Copy this file, and add rule overrides as needed. - -{ - "extends": ["standard", "standard-react"] -} diff --git a/config/dev.js b/config/dev.js index c0c3d9d4d32768ab344a30e8529709417a198f85..1f19acc0205273a13a1bbf3a0f4340b6cea9b10e 100644 --- a/config/dev.js +++ b/config/dev.js @@ -10,16 +10,16 @@ module.exports = { pubsweet: { components: universal.components }, - 'pubsweet-backend': { - dbPath: path.join(__dirname, '..', 'api', 'db'), - secret: process.env.PUBSWEET_SECRET, - API_ENDPOINT: '/api' - }, - 'pubsweet-component-ink-backend': universal.inkBackend, - 'pubsweet-frontend': { + 'pubsweet-client': { theme: universal.theme, routes: 'app/routes.jsx', navigation: 'app/components/Navigation/Navigation.jsx' }, + 'pubsweet-component-ink-backend': universal.inkBackend, + 'pubsweet-server': { + dbPath: path.join(__dirname, '..', 'api', 'db'), + secret: process.env.PUBSWEET_SECRET, + API_ENDPOINT: '/api' + }, 'validations': universal.validations } diff --git a/config/production.js b/config/production.js index 95c62c0681b3a7707093fadfb0f0b6444a8d9ddf..b70b54bd9794f7a3390402d557ae638d59bac5de 100644 --- a/config/production.js +++ b/config/production.js @@ -10,16 +10,16 @@ module.exports = { pubsweet: { components: universal.components }, - 'pubsweet-backend': { - dbPath: path.join(__dirname, '..', 'api', 'db'), - secret: '71dcce42-2245-4944-925b-0a62b83425ce', - API_ENDPOINT: '/api' - }, - 'pubsweet-component-ink-backend': universal.inkBackend, - 'pubsweet-frontend': { + 'pubsweet-client': { theme: universal.theme, routes: 'app/routes.jsx', navigation: 'app/components/Navigation/Navigation.jsx' }, + 'pubsweet-component-ink-backend': universal.inkBackend, + 'pubsweet-server': { + dbPath: path.join(__dirname, '..', 'api', 'db'), + secret: '71dcce42-2245-4944-925b-0a62b83425ce', + API_ENDPOINT: '/api' + }, 'validations': universal.validations } diff --git a/package.json b/package.json index df465061ba1d0fd8f42d3bf5eea61caf98be7270..b97999e0fa8f8503c077e4bea8a90d3dee748057 100644 --- a/package.json +++ b/package.json @@ -14,31 +14,25 @@ "bootstrap-sass": "^3.3.7", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.25.0", - "eslint": "^3.6.0", - "eslint-config-standard": "^6.2.0", - "eslint-config-standard-react": "^4.2.0", - "eslint-loader": "^1.6.0", - "eslint-plugin-promise": "^2.0.1", - "eslint-plugin-react": "^6.4.1", - "eslint-plugin-standard": "^2.0.0", "extract-text-webpack-plugin": "^2.0.0-beta.4", "file-loader": "^0.9.0", "font-awesome": "^4.7.0", "html-webpack-plugin": "^2.24.0", "json-loader": "^0.5.4", - "pubsweet-server": "git+https://gitlab.coko.foundation/pubsweet/pubsweet-server.git", - "pubsweet-component-blog": "^0.1.0", - "pubsweet-component-ink-backend": "0.0.4-alpha.3", - "pubsweet-component-ink-frontend": "0.0.1", - "pubsweet-component-login": "0.2.1", - "pubsweet-component-manage": "0.1.0", - "pubsweet-component-navigation": "0.1.0", - "pubsweet-component-signup": "0.1.0", - "pubsweet-component-teams-manager": "0.1.1", + "lodash": "^4.17.4", + "pubsweet-client": "0.8.4", + "pubsweet-component-blog": "0.1.2", + "pubsweet-component-ink-backend": "0.0.4", + "pubsweet-component-ink-frontend": "0.0.2", + "pubsweet-component-login": "0.2.2", + "pubsweet-component-manage": "0.1.2", + "pubsweet-component-navigation": "0.1.1", + "pubsweet-component-signup": "0.1.1", + "pubsweet-component-teams-manager": "0.1.2", "pubsweet-component-theme-editoria": "git+https://gitlab.coko.foundation/yannisbarlas/pubsweet-component-theme-editoria.git", - "pubsweet-component-users-manager": "0.1.0", - "pubsweet-frontend": "0.7.0", - "pubsweet-theme-plugin": "^0.0.1", + "pubsweet-component-users-manager": "0.1.1", + "pubsweet-server": "0.7.2", + "pubsweet-theme-plugin": "0.0.1", "react-dnd": "^2.1.4", "react-dnd-html5-backend": "^2.1.2", "react-hot-loader": "^3.0.0-beta.5", @@ -53,11 +47,19 @@ "webpack-hot-middleware": "^2.13.0" }, "devDependencies": { + "babel-eslint": "^7.2.1", "enzyme": "^2.7.1", "enzyme-to-json": "^1.4.5", - "react-addons-test-utils": "^15.4.2", + "eslint": "^3.6.0", + "eslint-config-standard": "^6.2.0", + "eslint-config-standard-react": "^4.2.0", + "eslint-loader": "^1.6.0", + "eslint-plugin-promise": "^2.0.1", + "eslint-plugin-react": "^6.4.1", + "eslint-plugin-standard": "^2.0.0", "identity-obj-proxy": "^3.0.0", "jest": "^18.1.0", + "react-addons-test-utils": "^15.4.2", "react-test-renderer": "^15.4.2", "sinon": "^1.17.7", "sinon-as-promised": "^4.0.2" diff --git a/test/jest.config.js b/test/jest.config.js index fde58284fe6a2bd43cd38c5741f9b4b17711145d..7c2bd1c3df6d833a2c2839af6b9f41b18d9c0ec0 100644 --- a/test/jest.config.js +++ b/test/jest.config.js @@ -1,4 +1,4 @@ -global.CONFIG = { 'pubsweet-backend': '' } +global.CONFIG = { 'pubsweet-server': '' } global.PUBSWEET_COMPONENTS = [] global.mock = { diff --git a/uploads/2b574894114e8e67a6e09a11eef7e995.jpg b/uploads/2b574894114e8e67a6e09a11eef7e995.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0dbd7bc86f208ccd4d9f43a8aa737ee74eb70ebf Binary files /dev/null and b/uploads/2b574894114e8e67a6e09a11eef7e995.jpg differ diff --git a/uploads/38cc3b94334dff9fb2ee25fc0c4c83a2.png b/uploads/38cc3b94334dff9fb2ee25fc0c4c83a2.png new file mode 100644 index 0000000000000000000000000000000000000000..b62a7a14d53d71d0581be8f83f3e11582d5e0cab Binary files /dev/null and b/uploads/38cc3b94334dff9fb2ee25fc0c4c83a2.png differ diff --git a/uploads/49128d98780c983c731bbc0d1e51cdaa.jpg b/uploads/49128d98780c983c731bbc0d1e51cdaa.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0dbd7bc86f208ccd4d9f43a8aa737ee74eb70ebf Binary files /dev/null and b/uploads/49128d98780c983c731bbc0d1e51cdaa.jpg differ diff --git a/uploads/b5e622aa7034c713dbbf7190f0fadeaf.jpg b/uploads/b5e622aa7034c713dbbf7190f0fadeaf.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0dbd7bc86f208ccd4d9f43a8aa737ee74eb70ebf Binary files /dev/null and b/uploads/b5e622aa7034c713dbbf7190f0fadeaf.jpg differ diff --git a/webpack/babel-includes.js b/webpack/babel-includes.js index c459384215f365e6891ae6b51c3ef630ac12cedc..0cf6d13a37715dccfa7c42491932ba879c41f768 100644 --- a/webpack/babel-includes.js +++ b/webpack/babel-includes.js @@ -1,7 +1,7 @@ const path = require('path') var babelIncludes = [ - new RegExp(path.join(__dirname, '../node_modules/pubsweet-frontend/src')), + new RegExp(path.join(__dirname, '../node_modules/pubsweet-client/src')), new RegExp(path.join(__dirname, '../app')), new RegExp(path.join(__dirname, '../node_modules/pubsweet-.*')) ] diff --git a/webpack/webpack.dev.config.js b/webpack/webpack.dev.config.js index e66e35f5b9c099de90daf23430fa6eeaf54245cd..6074123277175931f232f8fd7af5206d315fbc43 100644 --- a/webpack/webpack.dev.config.js +++ b/webpack/webpack.dev.config.js @@ -18,11 +18,11 @@ module.exports = [ ] }, output: { - path: path.join(__dirname, '..', 'public', 'assets'), + path: path.join(__dirname, '..', '_build', 'assets'), filename: '[name].js', publicPath: '/assets/' }, - devtool: 'inline-source-map', + devtool: 'cheap-module-source-map', module: { rules: require('./common-rules') }, @@ -33,7 +33,7 @@ module.exports = [ path.resolve(__dirname, '..', 'node_modules'), 'node_modules' ], - plugins: [new ThemePlugin(config['pubsweet-frontend'].theme)], + plugins: [new ThemePlugin(config['pubsweet-client'].theme)], extensions: ['.js', '.jsx', '.json', '.scss'], enforceExtension: false }, diff --git a/webpack/webpack.production.config.js b/webpack/webpack.production.config.js index 9699d4df2be5f77763d7f2edbad28deb1d2deaa3..9b5b3b3dfbfee7757f9f5afab1024e13afe62d1f 100644 --- a/webpack/webpack.production.config.js +++ b/webpack/webpack.production.config.js @@ -17,7 +17,7 @@ module.exports = [ ] }, output: { - path: path.join(__dirname, '..', 'public', 'assets'), + path: path.join(__dirname, '..', '_build', 'assets'), filename: '[name]-[hash].js', publicPath: '/assets/' }, @@ -32,7 +32,7 @@ module.exports = [ 'node_modules' ], extensions: ['.js', '.jsx', '.json', '.scss'], - plugins: [new ThemePlugin(config['pubsweet-frontend'].theme)] + plugins: [new ThemePlugin(config['pubsweet-client'].theme)] }, plugins: [ new HtmlWebpackPlugin({