Skip to content

Commit

Permalink
feat: add lefthook and release-it
Browse files Browse the repository at this point in the history
release-it will follow convential
also added pretty-quick
  • Loading branch information
Marvin Heilemann committed Feb 11, 2020
1 parent 38fd2d4 commit 6a80367
Show file tree
Hide file tree
Showing 5 changed files with 2,449 additions and 33 deletions.
29 changes: 29 additions & 0 deletions .release-it.json
@@ -0,0 +1,29 @@
{
"default": "https://github.com/release-it/release-it/blob/master/conf/release-it.json",
"hooks": {
"before:init": "npm run lint"
},
"git": {
"requireCleanWorkingDir": false,
"requireCommits": false,
"tagName": "v${version}",
"commit": true,
"push": true
},
"npm": {
"publish": false
},
"github": {
"release": true,
"releaseName": "chore: release ${version}",
"draft": true,
"tokenRef": "GITHUB_ACCESS_TOKEN"
},
"plugins": {
"./scripts/bump-version.js": {},
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"infile": "CHANGELOG.md"
}
}
}
9 changes: 9 additions & 0 deletions commitlint.config.js
@@ -0,0 +1,9 @@
/**
* Commitlint config file.
*
* @package https://github.com/conventional-changelog/commitlint
*/

module.exports = {
extends: ['@commitlint/config-conventional'],
}
12 changes: 12 additions & 0 deletions lefthook.yml
@@ -0,0 +1,12 @@
# Refer for explanation to following link:
# https://github.com/Arkweid/lefthook/blob/master/docs/full_guide.md

pre-commit:
commands:
format-staged:
run: pretty-quick --staged
lint-commit:
run: commitlint --from HEAD~1
lint-script:
glob: "*.{js,ts}x?"
run: eslint {staged_files}
13 changes: 11 additions & 2 deletions package.json
Expand Up @@ -32,7 +32,9 @@
"prod": "webpack --mode production --progress --env.analyze",
"watch": "webpack --mode development --watch",
"vscode:prepublish": "webpack --mode production",
"lint": "eslint --cache --ext js,ts src",
"lint": "run-s lint:*",
"lint:js": "eslint --cache --ext js,ts src",
"lint:commit": "commitlint --from HEAD~1",
"compile": "tsc -p ./"
},
"dependencies": {
Expand All @@ -42,6 +44,10 @@
"suncalc": "^1.8.0"
},
"devDependencies": {
"@arkweid/lefthook": "^0.7.1",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@release-it/conventional-changelog": "^1.1.0",
"@types/got": "^9.6.9",
"@types/node": "12.12.26",
"@types/suncalc": "^1.8.0",
Expand All @@ -52,7 +58,10 @@
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-prettier": "^3.1.2",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"pretty-quick": "^2.0.1",
"release-it": "^12.4.3",
"terser-webpack-plugin": "^2.3.4",
"ts-loader": "^6.2.1",
"typescript": "^3.7.5",
Expand Down Expand Up @@ -155,4 +164,4 @@
}
}
}
}
}

0 comments on commit 6a80367

Please sign in to comment.