Merge branch 'main' of github.com:answerdev/answer

This commit is contained in:
kumfo 2022-11-04 12:27:23 +08:00
commit f2ac965be3
2 changed files with 8 additions and 2 deletions

View File

@ -15,7 +15,8 @@
"prepare": "cd .. && husky install",
"cz": "cz",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\""
"prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"preinstall": "node ./scripts/preinstall.js"
},
"config": {
"commitizen": {
@ -109,4 +110,4 @@
"pnpm": ">=7"
},
"license": "MIT"
}
}

5
ui/scripts/preinstall.js Normal file
View File

@ -0,0 +1,5 @@
// There is a bug when using npm to install: the execution of preinstall is after install, so when this prompt is displayed, the dependent packages have already been installed.
if (!/pnpm/.test(process.env.npm_execpath)) {
console.warn(`\u001b[33mThis repository requires using pnpm as the package manager for scripts to work properly.\u001b[39m\n`)
process.exit(1)
}