mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-03-21 02:21:00 -05:00
switch to yorkie for git hook management
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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'],
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user