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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vue3-enterprise",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "description": "Vue3 + TypeScript + Vite 企业级项目脚手架",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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
@@ -27,4 +27,8 @@ create-vue3-enterprise 脚手架在 git 代码提交时自动触发上面3个检
27
27
 
28
28
  ```
29
29
  git提交代码触发pre-commit checks,如果代码检查成功,只打印代码检查成功提示,如果代码检查失败去除多余日志,只保留错误代码文件名和错误代码行数
30
+ ```
31
+
32
+ ```
33
+ git提交代码后,.husky文件夹里的commit-msg和pre-commit脚本日志没有输出到控制台,需要输出到控制台
30
34
  ```