Commit 59fba344 authored by Sam Galson's avatar Sam Galson

chore(xpub): remove xpub packages and lerna

parent 5afd0ec6
Pipeline #5009 failed with stages
in 17 seconds
packages/*/node_modules/**/*
packages/*/node_modules
node_modules
**/_build
**/node_modules
_build
node_modules
......@@ -53,10 +53,6 @@ push:latest:
only:
- master
# -----------------------------------------------
# xpub-collabra ---------------------------------
# -----------------------------------------------
review:xpub-collabra:
image: pubsweet/deployer:latest
stage: review
......@@ -134,80 +130,3 @@ demo:xpub-collabra:
script:
- source deploy.sh
- create_deployment
# -----------------------------------------------
# xpub-ui ---------------------------------------
# -----------------------------------------------
#review:xpub-ui:
# image: pubsweet/deployer:latest
# stage: review
# variables:
# PACKAGE_NAME: xpub-ui
# environment:
# name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
# # !! kube-lego will fail if domain > 63 chars
# url: "http://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
# on_stop: stop_review:xpub-ui
# except:
# - master
# script:
# - source deploy.sh
# - create_deployment
#
#stop_review:xpub-ui:
# image: pubsweet/deployer:latest
# stage: review
# variables:
# PACKAGE_NAME: xpub-ui
# GIT_STRATEGY: none
# when: manual
# environment:
# name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
# action: stop
# script:
# - source deploy.sh
# - delete_deployment
#
#staging:xpub-ui:
# image: pubsweet/deployer:latest
# stage: staging
# variables:
# PACKAGE_NAME: xpub-ui
# environment:
# name: $PACKAGE_NAME/staging
# url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
# only:
# - master
# script:
# - source deploy.sh
# - create_deployment
#
#production:xpub-ui:
# image: pubsweet/deployer:latest
# stage: production
# variables:
# PACKAGE_NAME: xpub-ui
# environment:
# name: $PACKAGE_NAME/production
# url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
# when: manual
# only:
# - master
# script:
# - source deploy.sh
# - create_deployment
#
#demo:xpub-ui:
# image: pubsweet/deployer:latest
# stage: demo
# variables:
# PACKAGE_NAME: xpub-ui
# environment:
# name: $PACKAGE_NAME/demo
# url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
# when: manual
# script:
# - source deploy.sh
# - create_deployment
#
FROM xpub/xpub:base
COPY package.json yarn.lock ./
COPY lerna.json .babelrc .eslintignore .eslintrc .prettierrc .stylelintignore .stylelintrc ./
COPY packages packages
# TODO package namespacing no longer necessary
RUN mkdir -p ${HOME}/packages/xpub-collabra
WORKDIR ${HOME}/packages/xpub-collabra
RUN [ "yarn", "config", "set", "workspaces-experimental", "true" ]
COPY package.json yarn.lock ./
# We do a development install because react-styleguidist is a dev dependency
RUN [ "yarn", "install", "--frozen-lockfile" ]
......@@ -13,18 +13,18 @@ RUN [ "yarn", "install", "--frozen-lockfile" ]
RUN [ "yarn", "cache", "clean"]
RUN [ "rm", "-rf", "/npm-packages-offline-cache"]
ENV NODE_ENV "production"
COPY app.js .babelrc .eslintignore .eslintrc .prettierrc .stylelintignore .stylelintrc ./
# We are temporarily going to use the same image with different commands to deploy different apps in the monorepo. This is bad :(.
COPY static static
COPY api api
COPY webpack webpack
COPY config config
COPY logs logs
COPY app app
WORKDIR ${HOME}/packages/xpub-collabra
RUN [ "npx", "pubsweet", "build"]
ENV NODE_ENV "production"
## No xpub-ui to deploy yet
# WORKDIR ${HOME}/packages/xpub-ui
# RUN [ "npm", "run", "styleguide:build" ]
## Create file for kubernetes health checks
# RUN touch ./styleguide/health
RUN [ "npx", "pubsweet", "build"]
EXPOSE 3000
......
# xpub-collabra
An MVP implementation of the first design sessions with [Collabra Psychology](https://www.collabra.org/), which allows a user to go through the process of creating a submission, assigning editors and reviewers, submitting reviews and submitting a decision.
Note: xpub is still _very_ new. This repository contains an initial set of components but is not yet ready for use.
## Roadmap
......@@ -28,7 +32,7 @@ You can follow more fine-grained lists of things that we're working on
* `xpub-collabra`: a PubSweet application that provides configuration and routing for a journal.
### xpub packages
### xpub packages (located in pubsweet/pubsweet)
* `xpub-connect`: a helper component for connecting pages to data
* `xpub-edit`: WYSIWYG editors for use in xpub forms
......@@ -45,7 +49,7 @@ In the root directory, run `yarn` to install all the dependencies.
## Configuration
To enable manuscript conversion via INK, add the following values to `packages/xpub-collabra/config/local-development.json` (ask in [the xpub channel](https://mattermost.coko.foundation/coko/channels/xpub) if you need an account):
To enable manuscript conversion via INK, add the following values to `config/local-development.json` (ask in [the xpub channel](https://mattermost.coko.foundation/coko/channels/xpub) if you need an account):
```json
{
......@@ -62,9 +66,8 @@ To enable manuscript conversion via INK, add the following values to `packages/x
## Running the app
1. `cd packages/xpub-collabra`
2. The first time you run the app, initialise the database with `yarn run setupdb` (press Enter when asked for a collection title, to skip that step).
3. `yarn start`
1. The first time you run the app, initialise the database with `yarn run setupdb` (press Enter when asked for a collection title, to skip that step).
2. `yarn start`
## CI
......
{
"lerna": "2.4.0",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
}
This diff is collapsed.
{
"name": "xpub",
"version": "0.0.0",
"private": true,
"name": "xpub-collabra",
"version": "0.0.1",
"description": "xpub configured for Collabra",
"license": "MIT",
"engines": {
"node": ">=8",
"yarn": ">=1.2"
},
"repository": {
"type": "git",
"url": "https://gitlab.coko.foundation/xpub/xpub"
},
"dependencies": {
"@pubsweet/default-theme": "0.2.0",
"@pubsweet/ui": "3.0.0",
"babel-core": "^6.26.0",
"config": "^1.26.2",
"font-awesome": "^4.7.0",
"fs-extra": "^4.0.2",
"history": "^4.7.2",
"joi": "^10.0.6",
"loadable-components": "^0.3.0",
"moment": "^2.18.1",
"prop-types": "^15.5.10",
"pubsweet": "^1.1.1",
"pubsweet-client": "^2.1.1",
"pubsweet-component-ink-backend": "^0.1.1",
"pubsweet-component-ink-frontend": "^1.0.0",
"pubsweet-component-login": "^1.0.1",
"pubsweet-component-signup": "^1.0.0",
"pubsweet-component-xpub-app": "^0.0.2",
"pubsweet-component-xpub-dashboard": "^0.0.2",
"pubsweet-component-xpub-find-reviewers": "^0.0.2",
"pubsweet-component-xpub-manuscript": "^0.0.2",
"pubsweet-component-xpub-review": "^0.0.2",
"pubsweet-component-xpub-review-backend": "^0.1.0",
"pubsweet-component-xpub-submit": "^0.0.2",
"pubsweet-server": "^1.0.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-router-dom": "^4.2.2",
"recompose": "^0.26.0",
"redux": "^3.6.0",
"redux-form": "^7.0.3",
"redux-logger": "^3.0.1",
"winston": "^2.4.0",
"xpub-journal": "^0.0.2",
"xpub-selectors": "^0.0.2",
"xpub-theme": "^0.0.2"
},
"devDependencies": {
"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-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",
"node-sass": "^4.5.3",
"react-hot-loader": "^3.1.1",
"sass-loader": "^6.0.6",
"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",
......@@ -17,25 +83,24 @@
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-standard": "^3.0.1",
"husky": "^0.14.3",
"lerna": "^2.5.1",
"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"
},
"repository": {
"type": "git",
"url": "git@gitlab.coko.foundation:xpub/xpub.git"
"stylelint-config-pubsweet": "^0.0.3",
"webpack-hot-middleware": "^2.20.0"
},
"scripts": {
"clean": "lerna clean",
"clean": "rm -rf node_modules",
"test": "echo YOU HAVE NO TESTS, FOOOL!",
"lint": "npm run lint:js && npm run lint:style",
"lint:js": "eslint packages",
"lint:style": "stylelint packages/**/*.scss packages/**/*.css",
"lint:js": "eslint ",
"lint:style": "stylelint app/**/*.scss app/**/*.css",
"setupdb": "pubsweet setupdb ./",
"precommit": "lint-staged",
"styleguide": "lerna run styleguide",
"test": "lerna run test"
"reset": "pubsweet setupdb --clobber ./",
"start": "pubsweet start",
"build": "NODE_ENV=production pubsweet build"
},
"lint-staged": {
"*.js": [
......@@ -44,12 +109,5 @@
],
"*.css": "stylelint",
"*.scss": "stylelint"
},
"engines": {
"node": ">=8",
"yarn": ">=1.2"
},
"workspaces": [
"packages/*"
]
}
}
## component-app
The aim of this package is to group things that are shared by apps.
*Note:
To be moved back into xpub-collabra.*
\ No newline at end of file
{
"name": "pubsweet-component-xpub-app",
"version": "0.0.2",
"main": "src",
"author": "Collaborative Knowledge Foundation",
"license": "MIT",
"files": [
"src",
"dist"
],
"dependencies": {
"@pubsweet/ui": "3.0.0",
"classnames": "^2.2.5",
"prop-types": "^15.5.10",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "^5.0.2",
"react-router-dom": "^4.2.2",
"recompose": "^0.26.0",
"redux": "^3.6.0",
"xpub-journal": "^0.0.2"
},
"peerDependencies": {
"prop-types": "^15.5.10",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "^5.0.2",
"react-router-dom": "^4.2.2"
}
}
import React from 'react'
import { compose } from 'recompose'
import { connect } from 'react-redux'
// import PropTypes from 'prop-types'
import { AppBar } from '@pubsweet/ui'
import { withJournal } from 'xpub-journal'
import actions from 'pubsweet-client/src/actions'
const App = ({ children, currentUser, journal, logoutUser }) => (
<div>
<AppBar
brand={journal.metadata.name}
onLogoutClick={logoutUser}
user={currentUser}
/>
<div>{children}</div>
</div>
)
export default compose(
connect(
state => ({
currentUser: state.currentUser.user,
}),
{ logoutUser: actions.logoutUser },
),
withJournal,
)(App)
import App from './App'
export default App
module.exports = {
frontend: {
components: [() => require('./components')],
},
}
## pubsweet-component-xpub-dashboard
A PubSweet component that provides the xpub dashboard, listing submissions that are available for the current user to take action on.
\ No newline at end of file
{
"name": "pubsweet-component-xpub-dashboard",
"version": "0.0.2",
"main": "src",
"author": "Collaborative Knowledge Foundation",
"license": "MIT",
"files": [
"src",
"dist"
],
"dependencies": {
"@pubsweet/ui": "3.0.0",
"classnames": "^2.2.5",
"lodash": "^4.17.4",
"prop-types": "^15.5.10",
"pubsweet-client": "^2.1.0",
"pubsweet-component-ink-frontend": "^1.0.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-dropzone": "^4.1.2",
"react-moment": "^0.6.1",
"react-redux": "^5.0.2",
"react-router-dom": "^4.2.2",
"recompose": "^0.26.0",
"redux": "^3.6.0",
"styled-components": "^2.4.0",
"xpub-connect": "^0.0.2",
"xpub-journal": "^0.0.2",
"xpub-selectors": "^0.0.2",
"xpub-upload": "^0.0.2"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"css-loader": "^0.28.4",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"faker": "^4.1.0",
"file-loader": "^1.1.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^22.1.1",
"node-sass": "^4.5.3",
"react-styleguidist": "^6.2.5",
"react-test-renderer": "^16.2.0",
"redux-mock-store": "^1.4.0",
"sass-loader": "^6.0.6",
"style-loader": "^0.19.0",
"webpack": "^3.8.1",
"webpack-node-externals": "^1.6.0",
"xpub-styleguide": "^0.0.2"
},
"jest": {
"moduleNameMapper": {
"\\.s?css$": "identity-obj-proxy"
},
"transformIgnorePatterns": [
"/node_modules/(?!@?pubsweet)"
],
"globals": {
"PUBSWEET_COMPONENTS": []
}
},
"scripts": {
"styleguide": "styleguidist server",
"styleguide:build": "styleguidist build",
"clean": "rimraf dist",
"prebuild": "npm run clean && npm run lint",
"build": "webpack --progress --profile",
"test": "jest"
}
}
import React from 'react'
import { compose, withProps } from 'recompose'
import { Menu } from '@pubsweet/ui'
import { withJournal } from 'xpub-journal'
// TODO: select multiple editors
const AssignEditor = ({
project,
team,
teamName,
teamTypeName,
options,
addUserToTeam,
}) => (
<Menu
label={teamName}
onChange={user => {
addUserToTeam({
group: 'editor',
name: teamName,
project,
team,
teamTypeName,
user,
})
}}
options={options}
placeholder="Assign an editor…"
value={team ? team.members[0] : null}
/>
)
export default compose(
withJournal,
withProps(({ journal, teamTypeName }) => ({
teamName: journal.roles[teamTypeName],
})),
)(AssignEditor)
A drop-down menu for assigning an editor to a project.
```js
const project = {
id: faker.random.uuid(),
};
const team = {
members: []
};
const options = [
{
value: faker.random.uuid(),
label: faker.internet.userName(),
},
{
value: faker.random.uuid(),
label: faker.internet.userName(),
},
{
value: faker.random.uuid(),
label: faker.internet.userName(),
}
];
<AssignEditor
project={project}
team={team}
teamName