diff --git a/package.json b/package.json index e6be53f731420860ec2afaf8e6d85b92eae2d302..56ccad0f32c2fa6c31e179f2f624de0978450c54 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,9 @@ { "name": "xpub-elife", "version": "1.0.0", - "private": true, - "workspaces": ["client/*", "server/*"], "description": "xpub configured for eLife", "license": "MIT", + "private": true, "engines": { "node": ">=8", "yarn": ">=1.2" @@ -13,6 +12,63 @@ "type": "git", "url": "https://gitlab.coko.foundation/xpub/xpub-elife" }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + }, + "scripts": { + "build": "NODE_ENV=production pubsweet build", + "clean": "rm -rf node_modules", + "cz": "git-cz", + "lint": "npm run lint:js && npm run lint:style && npm run lint:package", + "lint:js": "eslint .", + "lint:package": "format-package -w package.json", + "lint:style": "stylelint app/**/*.scss app/**/*.css", + "precommit": "lint-staged", + "reset": "pubsweet setupdb --clobber", + "server": "pubsweet server", + "setupdb": "pubsweet setupdb", + "start": "docker-compose up", + "start:services": "docker-compose up postgres", + "start:styleguide": "docker-compose run --no-deps -p 6060:6060 app yarn run styleguide", + "styleguide": "styleguidist server", + "test": "jest", + "test:e2e": "NODE_ENV=test testcafe chrome 'test/**/*.e2e.js'", + "test:e2e:ci": "testcafe 'chrome:headless --no-sandbox' 'test/**/*.e2e.js'" + }, + "lint-staged": { + "*.css": "stylelint", + "*.js": [ + "prettier --write", + "eslint --fix", + "git add" + ], + "*.scss": "stylelint", + "*.{json,md}": [ + "prettier --write", + "git add" + ], + "package.json": [ + "format-package -w", + "git add" + ] + }, + "jest": { + "testMatch": [ + "**/*.test.js" + ], + "transformIgnorePatterns": [ + "/node_modules/(?!@?pubsweet)" + ] + }, + "resolutions": { + "grid-styled/styled-components": "3.2.5" + }, + "workspaces": [ + "client/*", + "server/*" + ], "dependencies": { "@pubsweet/elife-theme": "^0.1.1", "@pubsweet/ui": "^3.3.3", @@ -62,6 +118,7 @@ "eslint-plugin-standard": "^3.0.1", "extract-text-webpack-plugin": "^3.0.0", "file-loader": "^1.1.5", + "format-package": "^4.2.0", "fs-extra": "^4.0.2", "html-webpack-plugin": "^2.24.0", "husky": "^0.14.3", @@ -82,43 +139,5 @@ "webpack": "^3.8.1", "webpack-dev-middleware": "^1.12.0", "webpack-hot-middleware": "^2.20.0" - }, - "resolutions": { - "grid-styled/styled-components": "3.2.5" - }, - "scripts": { - "test": "jest", - "test:e2e": "NODE_ENV=test testcafe chrome 'test/**/*.e2e.js'", - "test:e2e:ci": "testcafe 'chrome:headless --no-sandbox' 'test/**/*.e2e.js'", - "clean": "rm -rf node_modules", - "lint": "npm run lint:js && npm run lint:style", - "lint:js": "eslint .", - "lint:style": "stylelint app/**/*.scss app/**/*.css", - "precommit": "lint-staged", - "setupdb": "pubsweet setupdb", - "reset": "pubsweet setupdb --clobber", - "start": "docker-compose up", - "start:services": "docker-compose up postgres", - "start:styleguide": - "docker-compose run --no-deps -p 6060:6060 app yarn run styleguide", - "server": "pubsweet server", - "styleguide": "styleguidist server", - "build": "NODE_ENV=production pubsweet build", - "cz": "git-cz" - }, - "jest": { - "testMatch": ["**/*.test.js"], - "transformIgnorePatterns": ["/node_modules/(?!@?pubsweet)"] - }, - "lint-staged": { - "*.js": ["prettier --write", "eslint --fix", "git add"], - "*.{json,md}": ["prettier --write", "git add"], - "*.css": "stylelint", - "*.scss": "stylelint" - }, - "config": { - "commitizen": { - "path": "./node_modules/cz-conventional-changelog" - } } } diff --git a/yarn.lock b/yarn.lock index b0c56b061467c1c01218ccdc0a2d2405106bbfb0..5a7a8e138eefe374092d18ff443a3085b116feaa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4098,6 +4098,15 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" +format-package@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/format-package/-/format-package-4.2.0.tgz#251a15f5c1ca84be3bea0cc0f80d599e0f3aa8e5" + dependencies: + chalk "^2.1.0" + find-up "^2.1.0" + sort-scripts "^1.0.0" + yargs "^11.0.0" + formidable@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.1.tgz#70fb7ca0290ee6ff961090415f4b3df3d2082659" @@ -9649,6 +9658,10 @@ sort-keys@^1.0.0: dependencies: is-plain-obj "^1.0.0" +sort-scripts@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sort-scripts/-/sort-scripts-1.0.0.tgz#1753f8e281758e6084092bc19c624d185be08f5a" + source-list-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" @@ -11380,6 +11393,12 @@ yargs-parser@^8.1.0: dependencies: camelcase "^4.1.0" +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + dependencies: + camelcase "^4.1.0" + yargs@6.6.0: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" @@ -11415,6 +11434,23 @@ yargs@^10.0.3: y18n "^3.2.1" yargs-parser "^8.1.0" +yargs@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.0.0.tgz#c052931006c5eee74610e5fc0354bedfd08a201b" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + yargs@^8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360"