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'
import { configureStore, Root } from 'pubsweet-client'
import theme from './theme'
import { AppContainer } from 'react-hot-loader'
import createHistory from 'history/createBrowserHistory'
import theme from './theme'
import routes from './routes'
const history = createHistory()
......
......@@ -38,8 +38,8 @@ class Navigation extends React.Component {
this.inEditor = pathname.match(/fragments/g)
this.inPaged = pathname.match(/pagedPreviewer\/paged/g)
if (this.inEditor || this.inPaged) {
const pathnameSplited = pathname.split('/')
this.collectionId = pathnameSplited[2]
const pathnameSplitted = pathname.split('/')
this.collectionId = pathnameSplitted[2] // eslint-disable-line
}
}
......@@ -52,8 +52,8 @@ class Navigation extends React.Component {
if (currentUser.isAuthenticated) {
logoutButtonIfAuthenticated = (
<NavbarUser
user={currentUser.user}
onLogoutClick={() => logoutUser('/login')}
user={currentUser.user}
/>
)
}
......@@ -100,8 +100,8 @@ class Navigation extends React.Component {
}
Navigation.propTypes = {
currentUser: PropTypes.any,
history: PropTypes.any.isRequired,
currentUser: PropTypes.any, // eslint-disable-line
history: PropTypes.any.isRequired, // eslint-disable-line
logoutUser: PropTypes.func.isRequired,
}
......
......@@ -72,7 +72,7 @@ PrivateRoute.propTypes = {
isFetching: PropTypes.bool.isRequired,
}).isRequired,
getCurrentUser: PropTypes.func.isRequired,
location: PropTypes.object.isRequired,
location: PropTypes.object.isRequired, // eslint-disable-line
}
export default withRouter(
......
......@@ -3,7 +3,6 @@
import 'typeface-fira-sans'
export default {
/* Text variables */
// fonts
......
module.exports = { extends: ['@commitlint/config-conventional'] }
......@@ -33,7 +33,7 @@ class EditoriaMode {
return operationMap[operation] ? operationMap[operation] : operation
}
/* eslint-disable */
static difference(object, base) {
const changes = (object, base) =>
transform(object, (result, value, key) => {
......@@ -46,7 +46,7 @@ class EditoriaMode {
})
return changes(object, base)
}
/* eslint-enable */
async isTeamMember(teamType, object) {
let membershipCondition
if (object) {
......@@ -74,7 +74,7 @@ class EditoriaMode {
async hasMembership(object) {
let collection
if (object.collection) {
collection = object.collection
collection = object.collection //eslint-disable-line
} else {
collection = object
}
......@@ -113,7 +113,7 @@ class EditoriaMode {
async findCollectionByObject(object) {
let id
if (object.collection) {
id = object.collection.id
id = object.collection.id //eslint-disable-line
} else if (object.bookId && object.type) {
id = object.bookId
} else {
......@@ -122,10 +122,10 @@ class EditoriaMode {
id = object.book
break
case 'team':
id = object.object.id
id = object.object.id //eslint-disable-line
break
default:
id = object.id
id = object.id //eslint-disable-line
break
}
}
......@@ -218,7 +218,7 @@ class EditoriaMode {
this.user = await this.context.models.User.find(this.userId)
let current
if (this.object.current) {
current = this.object.current
current = this.object.current //eslint-disable-line
} else {
current = this.object
}
......@@ -236,7 +236,7 @@ class EditoriaMode {
this.user = await this.context.models.User.find(this.userId)
let current
if (this.object.current) {
current = this.object.current
current = this.object.current //eslint-disable-line
} else {
current = this.object
}
......@@ -621,6 +621,7 @@ class EditoriaMode {
}
return 'selection'
}
/* eslint-disable */
async canRemoveTeamMember() {
// this.user = await this.context.models.User.find(this.userId)
// const collection = await this.findCollectionByObject(this.object)
......@@ -632,6 +633,8 @@ class EditoriaMode {
// }
return true
}
/* eslint-enable */
async canGo() {
this.user = await this.context.models.User.find(this.userId)
const collection = await this.findCollectionByObject(this.object)
......@@ -870,7 +873,7 @@ module.exports = {
'team:create': (userId, operation, object, context) => true,
'team:delete': (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') {
// return false
// }
......
......@@ -34,9 +34,9 @@
"prop-types": "^15.6.0",
"pubsweet": "^2.2.8",
"pubsweet-client": "^2.5.5",
"pubsweet-component-bookbuilder": "^1.1.4",
"pubsweet-component-editoria-dashboard": "^0.1.2",
"pubsweet-component-editoria-global-teams": "^0.1.1",
"pubsweet-component-bookbuilder": "^1.1.5",
"pubsweet-component-editoria-dashboard": "^0.1.3",
"pubsweet-component-editoria-global-teams": "^0.1.2",
"pubsweet-component-epub": "^0.5.2",
"pubsweet-component-epub-frontend": "^0.1.3",
"pubsweet-component-ink-backend": "^0.1.1",
......@@ -50,8 +50,8 @@
"pubsweet-component-signup": "^0.4.1",
"pubsweet-component-theme-editoria": "^0.0.5",
"pubsweet-component-users-manager": "1.0.0",
"pubsweet-component-vivliostyle-viewer": "^1.0.0",
"pubsweet-component-wax": "^0.6.15",
"pubsweet-component-vivliostyle-viewer": "^1.0.1",
"pubsweet-component-wax": "^0.6.16",
"pubsweet-server": "^7.2.0",
"pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0",
......@@ -136,7 +136,15 @@
"webpack": "^3.8.1",
"webpack-dev-middleware": "^1.12.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": {
"moduleNameMapper": {
......@@ -164,6 +172,18 @@
"test": "NODE_ENV=test jest",
"test:watch": "NODE_ENV=test jest --watch",
"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