create-vue3-enterprise 1.0.41 → 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.41",
3
+ "version": "1.0.42",
4
4
  "description": "Vue3 + TypeScript + Vite 企业级项目脚手架",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,6 +18,13 @@ if [ -z "${1}" ]; then
18
18
  exit 1
19
19
  fi
20
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
+
21
28
  # 执行 commitlint 并捕获输出和退出码
22
29
  COMMITLINT_OUTPUT=$(npx commitlint --edit "${1}" 2>&1)
23
30
  COMMITLINT_EXIT_CODE=$?
@@ -31,6 +38,7 @@ if [ ${COMMITLINT_EXIT_CODE} -ne 0 ]; then
31
38
  echo "${COMMITLINT_OUTPUT}" | sed 's/^/ /' # 格式化错误信息,增加缩进
32
39
  echo ""
33
40
  echo "📖 请参考 .husky/pre-commit.md 中的提交规范指南进行修改。"
41
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
34
42
  exit 1
35
43
  fi
36
44
 
@@ -4,6 +4,17 @@
4
4
  # 确保输出到控制台
5
5
  exec 2>&1
6
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
+
7
18
  # Run lint-staged and capture output
8
19
  # 执行 lint-staged 并捕获输出和退出码
9
20
  OUTPUT=$(npx lint-staged 2>&1)
@@ -11,6 +22,7 @@ EXIT_CODE=$?
11
22
 
12
23
  if [ $EXIT_CODE -eq 0 ]; then
13
24
  echo "✅ 代码检查通过!"
25
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
14
26
  exit 0
15
27
  else
16
28
  echo "❌ 代码检查失败!"
@@ -32,5 +44,6 @@ else
32
44
  echo ""
33
45
  echo "💡 修复建议:npm run lint -- --fix"
34
46
  echo "💡 若自动修复无效,请手动修改上述错误后重新提交"
47
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
35
48
  exit 1
36
49
  fi