create-vue3-enterprise 1.0.42 → 1.0.44

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/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vue3-enterprise",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "description": "Vue3 + TypeScript + Vite 企业级项目脚手架",
5
5
  "type": "module",
6
6
  "bin": {
@@ -4,41 +4,16 @@
4
4
  # Uses Conventional Commits format
5
5
  # ============================================
6
6
 
7
- # 确保输出到控制台
8
- exec 2>&1
9
-
10
7
  echo ""
11
8
  echo "📝 验证提交消息中..."
12
9
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
13
10
 
14
- # 检查提交消息文件参数是否存在
15
- if [ -z "${1}" ]; then
16
- echo ""
17
- echo "❌ 错误:未传入提交消息文件路径!"
18
- exit 1
19
- fi
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
-
28
- # 执行 commitlint 并捕获输出和退出码
29
- COMMITLINT_OUTPUT=$(npx commitlint --edit "${1}" 2>&1)
30
- COMMITLINT_EXIT_CODE=$?
31
-
32
- # 判断验证结果
33
- if [ ${COMMITLINT_EXIT_CODE} -ne 0 ]; then
11
+ # Run commitlint
12
+ if ! npx commitlint --edit ${1}; then
34
13
  echo ""
35
14
  echo "❌ 提交消息验证失败!"
36
15
  echo ""
37
- echo "🔍 具体错误信息:"
38
- echo "${COMMITLINT_OUTPUT}" | sed 's/^/ /' # 格式化错误信息,增加缩进
39
- echo ""
40
- echo "📖 请参考 .husky/pre-commit.md 中的提交规范指南进行修改。"
41
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
16
+ echo "请参考 .husky/代码规范.md 中的提交规范指南进行修改。"
42
17
  exit 1
43
18
  fi
44
19
 
@@ -1,49 +1,19 @@
1
1
  #!/usr/bin/env sh
2
2
  # Pre-commit checks - concise output
3
3
 
4
- # 确保输出到控制台
5
- exec 2>&1
6
-
4
+ # Run lint-staged and capture output
7
5
  echo ""
8
- echo "🔍 正在执行代码检查..."
6
+ echo "🔍 执行代码检查..."
9
7
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
10
8
 
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
-
18
- # Run lint-staged and capture output
19
- # 执行 lint-staged 并捕获输出和退出码
20
- OUTPUT=$(npx lint-staged 2>&1)
21
- EXIT_CODE=$?
22
-
23
- if [ $EXIT_CODE -eq 0 ]; then
24
- echo "✅ 代码检查通过!"
25
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
26
- exit 0
27
- else
9
+ if ! npx lint-staged; then
28
10
  echo "❌ 代码检查失败!"
29
11
  echo ""
30
-
31
- # 提取错误行(增强版:兼容更多 eslint 输出格式)
32
- echo "🔍 错误详情:"
33
- ERROR_CONTENT=$(echo "$OUTPUT" | grep -E ':\d+:\d+|error|Error|ERROR')
34
-
35
- if [ -n "$ERROR_CONTENT" ]; then
36
- # 有具体错误行时格式化展示
37
- echo "$ERROR_CONTENT" | sed 's/^/ /'
38
- else
39
- # 无匹配错误行时展示完整输出,避免信息丢失
40
- echo " 未匹配到具体行号错误,完整输出如下:"
41
- echo "$OUTPUT" | sed 's/^/ /'
42
- fi
43
-
12
+ echo "修复: npm run lint -- --fix"
44
13
  echo ""
45
- echo "💡 修复建议:npm run lint -- --fix"
46
- echo "💡 若自动修复无效,请手动修改上述错误后重新提交"
47
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
48
14
  exit 1
49
15
  fi
16
+
17
+ echo ""
18
+ echo "✅ 代码检查通过!"
19
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@@ -1,13 +1,4 @@
1
1
  module.exports = {
2
- // TypeScript and Vue files - lint with quiet mode (errors only, no warnings)
3
- '*.ts': ['eslint --quiet --fix'],
4
- '*.tsx': ['eslint --quiet --fix'],
5
- '*.vue': ['eslint --quiet --fix'],
6
- // Format only (fast)
7
- '*.{js,jsx,json,css,html,md}': ['prettier --write'],
8
- // Vue and TS files - format only (skip type check for speed)
9
- '*.{ts,tsx,vue}': ['prettier --write'],
10
- };
11
2
  // TypeScript and Vue files - lint only (skip slow type check in pre-commit)
12
3
  '*.ts': ['eslint --fix'],
13
4
  '*.tsx': ['eslint --fix'],