mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-04-10 14:08:47 +08:00
Merge branch 'next' into perf/vupress-them-hope
# Conflicts: # pnpm-lock.yaml
This commit is contained in:
10
.lintstagedrc.js
Normal file
10
.lintstagedrc.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 对add的内容格式化后再commit
|
||||
* 参考: https://www.npmjs.com/package/lint-staged#configuration
|
||||
*/
|
||||
module.exports = {
|
||||
"*.{js,ts,md}":[
|
||||
"./scripts/lint --fix",
|
||||
// "git add"
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
// 参考:<https://github.com/updownpress/markdown-lint/tree/master/rules>
|
||||
/**
|
||||
* markdownlint-cli格式化markdown文档
|
||||
* 规则参考:https://github.com/updownpress/markdown-lint/tree/master/rules
|
||||
*/
|
||||
module.exports = {
|
||||
"default": true,
|
||||
"MD001": false,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// commit-and-tag-version 配置,参考:https://github.com/conventional-changelog/standard-version
|
||||
// 配置参考:https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md
|
||||
/**
|
||||
* commit-and-tag-version 模块配置提交、标签功能
|
||||
* - 使用:https://github.com/conventional-changelog/standard-version
|
||||
* - 配置:https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.2.0/README.md
|
||||
*/
|
||||
module.exports = {
|
||||
header: '# Release history\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\n<!-- #region recent-alpha -->\n',
|
||||
releaseCommitMessageFormat: 'chore(release): publish v{{currentTag}}',
|
||||
|
||||
7
commitlint.config.js
Normal file
7
commitlint.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* 校验Git Commit信息格式
|
||||
* 参考:https://commitlint.js.org
|
||||
*/
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-conventional']
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
"scripts": {
|
||||
"preinstall": "chmod +x ./scripts/*",
|
||||
"postinstall": "pnpm build:mark-map",
|
||||
"prepare": "rm -f .husky/pre-commit && husky install && npx husky add .husky/pre-commit \"./scripts/lint\" && chmod +x .husky/pre-commit",
|
||||
"prepare": "husky install",
|
||||
"dev": "vuepress dev docs",
|
||||
"build": "./scripts/bundle build",
|
||||
"build:proxy": "./scripts/bundle build_proxy",
|
||||
@@ -33,6 +33,8 @@
|
||||
"clean": "快速删除本地依赖"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^18.2.0",
|
||||
"@commitlint/config-conventional": "^18.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||
"@typescript-eslint/parser": "^5.62.0",
|
||||
"@vue/repl": "^2.6.2",
|
||||
@@ -49,6 +51,7 @@
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-vue": "^9.18.1",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^15.0.2",
|
||||
"markdownlint-cli": "^0.37.0",
|
||||
"markmap-cli": "^0.15.4",
|
||||
"mermaid": "^10.4.0",
|
||||
|
||||
2901
pnpm-lock.yaml
generated
2901
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -32,11 +32,12 @@ exports.execShell = async commands => {
|
||||
for (let index = 0; index < runCommands.length; index++) {
|
||||
const command = runCommands[index]
|
||||
const count = index + 1
|
||||
console.log(`>>>command(${count}):\n${command} \n<<<command(${count})--start === \n`)
|
||||
console.log(`step${count}:\n${command} \nstep${count}(start): === `)
|
||||
// await syncExec(command)
|
||||
const execResult = await exec(command)
|
||||
|
||||
console.log(`\n<<<command(${count})--ending === `)
|
||||
// 打印输出结果
|
||||
// console.log(execResult.stdout);
|
||||
console.log(`step${count}(ending): === \n`)
|
||||
// 指令异常,不执行后续指令,非0退出
|
||||
if (execResult.code !== 0) {
|
||||
exit(1)
|
||||
|
||||
@@ -37,7 +37,4 @@ else
|
||||
fi
|
||||
|
||||
# 安装项目依赖
|
||||
pnpm i --frozen-lockfile --registry https://registry.npmmirror.com
|
||||
|
||||
|
||||
|
||||
pnpm i --frozen-lockfile --registry https://registry.npmmirror.com
|
||||
13
scripts/lint
13
scripts/lint
@@ -5,7 +5,8 @@
|
||||
## - 代码
|
||||
## - markdown文档
|
||||
## 使用:
|
||||
# - ./scripts/lint
|
||||
# - ./scripts/lint 校验
|
||||
# - ./scripts/lint --fix 格式化
|
||||
## 参考链接:
|
||||
## - https://eslint.org/docs/latest/use/getting-started
|
||||
## - https://github.com/igorshubovych/markdownlint-cli
|
||||
@@ -14,9 +15,15 @@
|
||||
# 设置 PATH 环境变量,避免command not found问题
|
||||
export PATH="$(pnpm bin):$PATH"
|
||||
|
||||
# 是否fix
|
||||
fixed=${1}
|
||||
|
||||
# ESLint格式化代码
|
||||
eslint --fix --ext .js,.ts,.vue --ignore-path .gitignore .
|
||||
echo "step1: eslint $fixed --ext .js,.ts,.vue --ignore-path .gitignore ."
|
||||
eslint $fixed --ext .js,.ts,.vue --ignore-path .gitignore .
|
||||
|
||||
# markdown-cli格式化markdown 文档
|
||||
markdownlint '**/*.md' -c .markdownlint.js -p .markdownlintignore --fix
|
||||
echo "step2: markdownlint '**/*.md' -c .markdownlint.js -p .markdownlintignore $fixed"
|
||||
markdownlint '**/*.md' -c .markdownlint.js -p .markdownlintignore $fixed
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user