Commit b98b9586 authored by Alexandros Georgantas's avatar Alexandros Georgantas

feat: conventional commits added

parent 5c0860cc
{
"linters": {
"*.{js,jsx}": ["prettier --write", "eslint --fix", "stylelint", "git add"]
},
ignore: ["**/CHANGELOG.md"]
}
**/_build
**/node_modules
**/coverage
{
"extends": [
"stylelint-config-recommended",
"stylelint-config-styled-components"
],
"plugins": ["stylelint-order"],
"processors": ["stylelint-processor-styled-components"],
"rules": {
"order/order": ["declarations", "rules", "at-rules"],
"order/properties-alphabetical-order": true
}
}
...@@ -5,10 +5,11 @@ import ReactDOM from 'react-dom' ...@@ -5,10 +5,11 @@ import ReactDOM from 'react-dom'
import { configureStore, Root } from 'pubsweet-client' import { configureStore, Root } from 'pubsweet-client'
import theme from './theme'
import { AppContainer } from 'react-hot-loader' import { AppContainer } from 'react-hot-loader'
import createHistory from 'history/createBrowserHistory' import createHistory from 'history/createBrowserHistory'
import theme from './theme'
import routes from './routes' import routes from './routes'
const history = createHistory() const history = createHistory()
......
...@@ -38,8 +38,8 @@ class Navigation extends React.Component { ...@@ -38,8 +38,8 @@ class Navigation extends React.Component {
this.inEditor = pathname.match(/fragments/g) this.inEditor = pathname.match(/fragments/g)
this.inPaged = pathname.match(/pagedPreviewer\/paged/g) this.inPaged = pathname.match(/pagedPreviewer\/paged/g)
if (this.inEditor || this.inPaged) { if (this.inEditor || this.inPaged) {
const pathnameSplited = pathname.split('/') const pathnameSplitted = pathname.split('/')
this.collectionId = pathnameSplited[2] this.collectionId = pathnameSplitted[2] // eslint-disable-line
} }
} }
...@@ -52,8 +52,8 @@ class Navigation extends React.Component { ...@@ -52,8 +52,8 @@ class Navigation extends React.Component {
if (currentUser.isAuthenticated) { if (currentUser.isAuthenticated) {
logoutButtonIfAuthenticated = ( logoutButtonIfAuthenticated = (
<NavbarUser <NavbarUser
user={currentUser.user}
onLogoutClick={() => logoutUser('/login')} onLogoutClick={() => logoutUser('/login')}
user={currentUser.user}
/> />
) )
} }
...@@ -100,8 +100,8 @@ class Navigation extends React.Component { ...@@ -100,8 +100,8 @@ class Navigation extends React.Component {
} }
Navigation.propTypes = { Navigation.propTypes = {
currentUser: PropTypes.any, currentUser: PropTypes.any, // eslint-disable-line
history: PropTypes.any.isRequired, history: PropTypes.any.isRequired, // eslint-disable-line
logoutUser: PropTypes.func.isRequired, logoutUser: PropTypes.func.isRequired,
} }
......
...@@ -72,7 +72,7 @@ PrivateRoute.propTypes = { ...@@ -72,7 +72,7 @@ PrivateRoute.propTypes = {
isFetching: PropTypes.bool.isRequired, isFetching: PropTypes.bool.isRequired,
}).isRequired, }).isRequired,
getCurrentUser: PropTypes.func.isRequired, getCurrentUser: PropTypes.func.isRequired,
location: PropTypes.object.isRequired, location: PropTypes.object.isRequired, // eslint-disable-line
} }
export default withRouter( export default withRouter(
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import 'typeface-fira-sans' import 'typeface-fira-sans'
export default { export default {
/* Text variables */ /* Text variables */
// fonts // fonts
......
module.exports = { extends: ['@commitlint/config-conventional'] }
...@@ -33,7 +33,7 @@ class EditoriaMode { ...@@ -33,7 +33,7 @@ class EditoriaMode {
return operationMap[operation] ? operationMap[operation] : operation return operationMap[operation] ? operationMap[operation] : operation
} }
/* eslint-disable */
static difference(object, base) { static difference(object, base) {
const changes = (object, base) => const changes = (object, base) =>
transform(object, (result, value, key) => { transform(object, (result, value, key) => {
...@@ -46,7 +46,7 @@ class EditoriaMode { ...@@ -46,7 +46,7 @@ class EditoriaMode {
}) })
return changes(object, base) return changes(object, base)
} }
/* eslint-enable */
async isTeamMember(teamType, object) { async isTeamMember(teamType, object) {
let membershipCondition let membershipCondition
if (object) { if (object) {
...@@ -74,7 +74,7 @@ class EditoriaMode { ...@@ -74,7 +74,7 @@ class EditoriaMode {
async hasMembership(object) { async hasMembership(object) {
let collection let collection
if (object.collection) { if (object.collection) {
collection = object.collection collection = object.collection //eslint-disable-line
} else { } else {
collection = object collection = object
} }
...@@ -82,7 +82,7 @@ class EditoriaMode { ...@@ -82,7 +82,7 @@ class EditoriaMode {
const membershipCondition = team => const membershipCondition = team =>
!team.global && team.object.id === collection.id !team.global && team.object.id === collection.id
const memberships = await Promise.all( const memberships = await Promise.all(
this.user.teams.map(async teamId => { this.user.teams.map(async teamId => {
const teamFound = await this.context.models.Team.find(teamId) const teamFound = await this.context.models.Team.find(teamId)
if (teamFound) { if (teamFound) {
...@@ -113,7 +113,7 @@ class EditoriaMode { ...@@ -113,7 +113,7 @@ class EditoriaMode {
async findCollectionByObject(object) { async findCollectionByObject(object) {
let id let id
if (object.collection) { if (object.collection) {
id = object.collection.id id = object.collection.id //eslint-disable-line
} else if (object.bookId && object.type) { } else if (object.bookId && object.type) {
id = object.bookId id = object.bookId
} else { } else {
...@@ -122,10 +122,10 @@ class EditoriaMode { ...@@ -122,10 +122,10 @@ class EditoriaMode {
id = object.book id = object.book
break break
case 'team': case 'team':
id = object.object.id id = object.object.id //eslint-disable-line
break break
default: default:
id = object.id id = object.id //eslint-disable-line
break break
} }
} }
...@@ -218,7 +218,7 @@ class EditoriaMode { ...@@ -218,7 +218,7 @@ class EditoriaMode {
this.user = await this.context.models.User.find(this.userId) this.user = await this.context.models.User.find(this.userId)
let current let current
if (this.object.current) { if (this.object.current) {
current = this.object.current current = this.object.current //eslint-disable-line
} else { } else {
current = this.object current = this.object
} }
...@@ -236,7 +236,7 @@ class EditoriaMode { ...@@ -236,7 +236,7 @@ class EditoriaMode {
this.user = await this.context.models.User.find(this.userId) this.user = await this.context.models.User.find(this.userId)
let current let current
if (this.object.current) { if (this.object.current) {
current = this.object.current current = this.object.current //eslint-disable-line
} else { } else {
current = this.object current = this.object
} }
...@@ -621,6 +621,7 @@ class EditoriaMode { ...@@ -621,6 +621,7 @@ class EditoriaMode {
} }
return 'selection' return 'selection'
} }
/* eslint-disable */
async canRemoveTeamMember() { async canRemoveTeamMember() {
// this.user = await this.context.models.User.find(this.userId) // this.user = await this.context.models.User.find(this.userId)
// const collection = await this.findCollectionByObject(this.object) // const collection = await this.findCollectionByObject(this.object)
...@@ -632,6 +633,8 @@ class EditoriaMode { ...@@ -632,6 +633,8 @@ class EditoriaMode {
// } // }
return true return true
} }
/* eslint-enable */
async canGo() { async canGo() {
this.user = await this.context.models.User.find(this.userId) this.user = await this.context.models.User.find(this.userId)
const collection = await this.findCollectionByObject(this.object) const collection = await this.findCollectionByObject(this.object)
...@@ -870,7 +873,7 @@ module.exports = { ...@@ -870,7 +873,7 @@ module.exports = {
'team:create': (userId, operation, object, context) => true, 'team:create': (userId, operation, object, context) => true,
'team:delete': (userId, operation, object, context) => true, 'team:delete': (userId, operation, object, context) => true,
'team:patch': (userId, operation, object, context) => true, 'team:patch': (userId, operation, object, context) => true,
'can view add team memeber': (userId, operation, object, context) => 'can view add team member': (userId, operation, object, context) =>
// if (object === 'Production Editor') { // if (object === 'Production Editor') {
// return false // return false
// } // }
......
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"pubsweet": "^2.2.8", "pubsweet": "^2.2.8",
"pubsweet-client": "^2.5.5", "pubsweet-client": "^2.5.5",
"pubsweet-component-bookbuilder": "^1.1.4", "pubsweet-component-bookbuilder": "^1.1.5",
"pubsweet-component-editoria-dashboard": "^0.1.2", "pubsweet-component-editoria-dashboard": "^0.1.3",
"pubsweet-component-editoria-global-teams": "^0.1.1", "pubsweet-component-editoria-global-teams": "^0.1.2",
"pubsweet-component-epub": "^0.5.2", "pubsweet-component-epub": "^0.5.2",
"pubsweet-component-epub-frontend": "^0.1.3", "pubsweet-component-epub-frontend": "^0.1.3",
"pubsweet-component-ink-backend": "^0.1.1", "pubsweet-component-ink-backend": "^0.1.1",
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
"pubsweet-component-signup": "^0.4.1", "pubsweet-component-signup": "^0.4.1",
"pubsweet-component-theme-editoria": "^0.0.5", "pubsweet-component-theme-editoria": "^0.0.5",
"pubsweet-component-users-manager": "1.0.0", "pubsweet-component-users-manager": "1.0.0",
"pubsweet-component-vivliostyle-viewer": "^1.0.0", "pubsweet-component-vivliostyle-viewer": "^1.0.1",
"pubsweet-component-wax": "^0.6.15", "pubsweet-component-wax": "^0.6.16",
"pubsweet-server": "^7.2.0", "pubsweet-server": "^7.2.0",
"pubsweet-theme-plugin": "^0.0.3", "pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0", "react": "^16.2.0",
...@@ -136,7 +136,15 @@ ...@@ -136,7 +136,15 @@
"webpack": "^3.8.1", "webpack": "^3.8.1",
"webpack-dev-middleware": "^1.12.0", "webpack-dev-middleware": "^1.12.0",
"webpack-hot-middleware": "^2.20.0", "webpack-hot-middleware": "^2.20.0",
"winston-daily-rotate-file": "^3.2.1" "winston-daily-rotate-file": "^3.2.1",
"@commitlint/cli": "^6.0.5",
"@commitlint/config-conventional": "^6.0.4",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.1.0",
"stylelint-config-recommended": "^2.1.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.3.1",
"standard-version": "^4.4.0"
}, },
"jest": { "jest": {
"moduleNameMapper": { "moduleNameMapper": {
...@@ -164,6 +172,18 @@ ...@@ -164,6 +172,18 @@
"test": "NODE_ENV=test jest", "test": "NODE_ENV=test jest",
"test:watch": "NODE_ENV=test jest --watch", "test:watch": "NODE_ENV=test jest --watch",
"test:cover": "NODE_ENV=test jest --coverage", "test:cover": "NODE_ENV=test jest --coverage",
"build": "NODE_ENV=production pubsweet build" "build": "NODE_ENV=production pubsweet build",
"lint": "npm run lint:js && npm run lint:style",
"lint:js": "eslint 'app/**/*.{js,jsx}'",
"lint:style": "stylelint 'app/**/*.{js,jsx}'",
"precommit": "lint-staged",
"cz": "git-cz",
"commitmsg": "commitlint -e $GIT_PARAMS",
"release": "standard-version"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
} }
} }
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