switch to yorkie for git hook management

This commit is contained in:
Evan You
2018-01-06 01:10:20 -05:00
parent d8340eba1f
commit ba9c4ed080
5 changed files with 13 additions and 10 deletions

View File

@@ -6,8 +6,10 @@
],
"scripts": {
"test": "jest --env node",
"lint": "eslint --fix packages/**/*.js packages/**/bin/* test/**/*.js",
"precommit": "lint-staged"
"lint": "eslint --fix packages/**/*.js packages/**/bin/* test/**/*.js"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"jest": {
"testEnvironment": "node",
@@ -34,7 +36,6 @@
"eslint": "^4.14.0",
"eslint-plugin-vue-libs": "^2.1.0",
"globby": "^7.1.1",
"husky": "^0.14.3",
"jest": "^22.0.4",
"lerna": "^2.5.1",
"lint-staged": "^6.0.0",

View File

@@ -70,7 +70,7 @@ test('lint on commit', async () => {
lintOn: 'commit'
}
})
expect(pkg.scripts.precommit).toBe('lint-staged')
expect(pkg.gitHooks['pre-commit']).toBe('lint-staged')
expect(pkg.devDependencies).toHaveProperty('lint-staged')
expect(pkg['lint-staged']).toEqual({
'*.js': ['vue-cli-service lint', 'git add'],

View File

@@ -34,7 +34,9 @@ module.exports = (api, { config, lintOn }) => {
Object.assign(pkg.devDependencies, {
'lint-staged': '^6.0.0'
})
pkg.scripts.precommit = 'lint-staged'
pkg.gitHooks = {
'pre-commit': 'lint-staged'
}
pkg['lint-staged'] = {
'*.js': ['vue-cli-service lint', 'git add'],
'*.vue': ['vue-cli-service lint', 'git add']

View File

@@ -4,6 +4,6 @@ const projectDir =
process.env.VUE_CLI_CONTEXT ||
path.dirname(require('read-pkg-up').sync().path)
const huskyWorkingPath = path.resolve(projectDir, 'node_modules', '@vue')
const yorkieWorkingPath = path.resolve(projectDir, 'node_modules/@vue')
require('husky/src/install')(huskyWorkingPath)
require('yorkie/src/install')(yorkieWorkingPath)

View File

@@ -39,7 +39,6 @@
"friendly-errors-webpack-plugin": "^1.6.1",
"get-value": "^2.0.6",
"html-webpack-plugin": "^2.30.1",
"husky": "^0.14.3",
"javascript-stringify": "^1.6.0",
"minimist": "^1.2.0",
"opn": "^5.1.0",
@@ -59,8 +58,9 @@
"vue-template-compiler": "^2.5.13",
"webpack": "^3.10.0",
"webpack-chain": "^4.5.0",
"webpack-dev-server": "^2.9.7",
"webpack-merge": "^4.1.1"
"webpack-dev-server": "^2.10.0",
"webpack-merge": "^4.1.1",
"yorkie": "^1.0.0"
},
"devDependencies": {
"vue": "^2.5.13"