create-vue3-enterprise 1.0.40 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/.husky/commit-msg +11 -0
- package/template/.husky/pre-commit +16 -0
- package/template/{/346/226/207/346/241/243/345/222/214/346/217/220/347/244/272/350/257/215 → .husky}//344/273/243/347/240/201/350/247/204/350/214/203/346/217/220/347/244/272/350/257/215.md +4 -0
- /package/template/{/346/226/207/346/241/243/345/222/214/346/217/220/347/244/272/350/257/215 → .husky}//344/273/243/347/240/201/350/247/204/350/214/203.md" +0 -0
package/package.json
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
# Uses Conventional Commits format
|
|
5
5
|
# ============================================
|
|
6
6
|
|
|
7
|
+
# 确保输出到控制台
|
|
8
|
+
exec 2>&1
|
|
9
|
+
|
|
7
10
|
echo ""
|
|
8
11
|
echo "📝 验证提交消息中..."
|
|
9
12
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
@@ -15,6 +18,13 @@ if [ -z "${1}" ]; then
|
|
|
15
18
|
exit 1
|
|
16
19
|
fi
|
|
17
20
|
|
|
21
|
+
# 检查 commitlint 是否安装
|
|
22
|
+
if ! npx --yes commitlint --version >/dev/null 2>&1; then
|
|
23
|
+
echo "❌ 错误:commitlint 未安装"
|
|
24
|
+
echo "请运行: npm install @commitlint/cli @commitlint/config-conventional --save-dev"
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
18
28
|
# 执行 commitlint 并捕获输出和退出码
|
|
19
29
|
COMMITLINT_OUTPUT=$(npx commitlint --edit "${1}" 2>&1)
|
|
20
30
|
COMMITLINT_EXIT_CODE=$?
|
|
@@ -28,6 +38,7 @@ if [ ${COMMITLINT_EXIT_CODE} -ne 0 ]; then
|
|
|
28
38
|
echo "${COMMITLINT_OUTPUT}" | sed 's/^/ /' # 格式化错误信息,增加缩进
|
|
29
39
|
echo ""
|
|
30
40
|
echo "📖 请参考 .husky/pre-commit.md 中的提交规范指南进行修改。"
|
|
41
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
31
42
|
exit 1
|
|
32
43
|
fi
|
|
33
44
|
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env sh
|
|
2
2
|
# Pre-commit checks - concise output
|
|
3
3
|
|
|
4
|
+
# 确保输出到控制台
|
|
5
|
+
exec 2>&1
|
|
6
|
+
|
|
7
|
+
echo ""
|
|
8
|
+
echo "🔍 正在执行代码检查..."
|
|
9
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
10
|
+
|
|
11
|
+
# 检查 lint-staged 是否安装
|
|
12
|
+
if ! npx --yes lint-staged --version >/dev/null 2>&1; then
|
|
13
|
+
echo "❌ 错误:lint-staged 未安装"
|
|
14
|
+
echo "请运行: npm install lint-staged --save-dev"
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
4
18
|
# Run lint-staged and capture output
|
|
5
19
|
# 执行 lint-staged 并捕获输出和退出码
|
|
6
20
|
OUTPUT=$(npx lint-staged 2>&1)
|
|
@@ -8,6 +22,7 @@ EXIT_CODE=$?
|
|
|
8
22
|
|
|
9
23
|
if [ $EXIT_CODE -eq 0 ]; then
|
|
10
24
|
echo "✅ 代码检查通过!"
|
|
25
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
11
26
|
exit 0
|
|
12
27
|
else
|
|
13
28
|
echo "❌ 代码检查失败!"
|
|
@@ -29,5 +44,6 @@ else
|
|
|
29
44
|
echo ""
|
|
30
45
|
echo "💡 修复建议:npm run lint -- --fix"
|
|
31
46
|
echo "💡 若自动修复无效,请手动修改上述错误后重新提交"
|
|
47
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
32
48
|
exit 1
|
|
33
49
|
fi
|