@mks2508/better-logger 0.8.1-alpha.1 → 0.12.0-alpha.1

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.
Files changed (50) hide show
  1. package/.github/workflows/ci-quality.yml +56 -55
  2. package/.github/workflows/docs-demo.yml +26 -30
  3. package/.github/workflows/releases-core.yml +119 -55
  4. package/.github/workflows/releases-full.yml +219 -41
  5. package/.yamllint +28 -0
  6. package/CHANGELOG.json +109 -1
  7. package/CLAUDE.md +92 -1
  8. package/README.md +46 -0
  9. package/bun.lock +323 -0
  10. package/dist/chunks/Logger-C2-cR3No.js +2 -0
  11. package/dist/chunks/Logger-C2-cR3No.js.map +1 -0
  12. package/dist/chunks/{Logger-CbCUS5pQ.js → Logger-CVwk8cgA.js} +202 -3
  13. package/dist/chunks/Logger-CVwk8cgA.js.map +1 -0
  14. package/dist/cli/CommandProcessor.d.ts +63 -0
  15. package/dist/cli/CommandProcessor.d.ts.map +1 -1
  16. package/dist/cli/CommandProcessor.js +129 -2
  17. package/dist/cli/commands/HistoryCommand.d.ts +50 -0
  18. package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
  19. package/dist/cli/commands/HistoryCommand.js +96 -0
  20. package/dist/cli/index.d.ts.map +1 -1
  21. package/dist/cli/index.js +6 -0
  22. package/dist/exports.cjs +1 -1
  23. package/dist/exports.js +1 -1
  24. package/dist/index.cjs +1 -1
  25. package/dist/styling.cjs +1 -1
  26. package/dist/styling.js +2 -2
  27. package/dist/types/cli/CommandProcessor.d.ts +63 -0
  28. package/dist/types/cli/CommandProcessor.d.ts.map +1 -1
  29. package/dist/types/cli/commands/HistoryCommand.d.ts +47 -0
  30. package/dist/types/cli/commands/HistoryCommand.d.ts.map +1 -0
  31. package/dist/types/cli/index.d.ts.map +1 -1
  32. package/docs/API.md +89 -5
  33. package/docs/PACKAGES.md +244 -0
  34. package/package.json +14 -1
  35. package/packages/core/package.json +1 -1
  36. package/packages/exports/package.json +2 -2
  37. package/packages/styling/package.json +2 -2
  38. package/project-utils/auto-release-ui.ts +1329 -0
  39. package/project-utils/commit-generator.ts +386 -1
  40. package/project-utils/commit-ui.ts +19 -1
  41. package/project-utils/project-config.ts +260 -0
  42. package/src/cli/CommandProcessor.ts +173 -2
  43. package/src/cli/commands/HistoryCommand.ts +117 -0
  44. package/src/cli/index.ts +12 -0
  45. package/tests/test-conflict-resolution.ts +391 -0
  46. package/tests/validate-workflows.sh +131 -0
  47. package/tests/yaml-autofix.sh +146 -0
  48. package/dist/chunks/Logger-CbCUS5pQ.js.map +0 -1
  49. package/dist/chunks/Logger-PCfgYKTP.js +0 -2
  50. package/dist/chunks/Logger-PCfgYKTP.js.map +0 -1
@@ -1,10 +1,11 @@
1
+ ---
1
2
  name: CI Quality & Testing
2
3
 
3
4
  on:
4
5
  push:
5
- branches: [ main, develop ]
6
+ branches: [main, develop]
6
7
  pull_request:
7
- branches: [ main, develop ]
8
+ branches: [main, develop]
8
9
  workflow_dispatch:
9
10
  inputs:
10
11
  run_performance:
@@ -25,33 +26,33 @@ jobs:
25
26
  # ===== MATRIX TESTING =====
26
27
  test-matrix:
27
28
  runs-on: ubuntu-latest
28
-
29
+
29
30
  strategy:
30
31
  fail-fast: false
31
32
  matrix:
32
33
  bun-version: ["1.0", "latest"]
33
34
  build-mode: [full, core, styling, exports]
34
-
35
+
35
36
  name: Test Bun ${{ matrix.bun-version }} - ${{ matrix.build-mode }}
36
-
37
+
37
38
  steps:
38
- - name: 📥 Checkout code
39
+ - name: "📥 Checkout code"
39
40
  uses: actions/checkout@v4
40
41
  with:
41
42
  fetch-depth: 0
42
43
 
43
- - name: 📦 Setup Bun ${{ matrix.bun-version }}
44
+ - name: "📦 Setup Bun ${{ matrix.bun-version }}"
44
45
  uses: oven-sh/setup-bun@v2
45
46
  with:
46
47
  bun-version: ${{ matrix.bun-version }}
47
48
 
48
- - name: 🔧 Install dependencies
49
+ - name: "🔧 Install dependencies"
49
50
  run: bun install --frozen-lockfile
50
51
 
51
52
  - name: 🔍 Type checking
52
53
  run: bun run type-check
53
54
 
54
- - name: 🏗️ Build ${{ matrix.build-mode }}
55
+ - name: "🏗️ Build ${{ matrix.build-mode }}"
55
56
  run: |
56
57
  if [ "${{ matrix.build-mode }}" = "full" ]; then
57
58
  bun run build:all
@@ -59,13 +60,13 @@ jobs:
59
60
  bun run build:${{ matrix.build-mode }}
60
61
  fi
61
62
 
62
- - name: 🧪 Run tests
63
+ - name: "🧪 Run tests"
63
64
  run: bun run ci:test
64
65
 
65
66
  - name: 📊 Check bundle sizes
66
67
  run: bun run size-limit
67
68
 
68
- - name: 📤 Upload build artifacts (Node 20 only)
69
+ - name: "📤 Upload build artifacts (Node 20 only)"
69
70
  uses: actions/upload-artifact@v4
70
71
  if: matrix.node-version == 20
71
72
  with:
@@ -78,21 +79,21 @@ jobs:
78
79
  runs-on: ubuntu-latest
79
80
  needs: test-matrix
80
81
  if: ${{ inputs.run_performance != false }}
81
-
82
+
82
83
  steps:
83
- - name: 📥 Checkout code
84
+ - name: "📥 Checkout code"
84
85
  uses: actions/checkout@v4
85
86
 
86
- - name: 📦 Setup Node.js
87
+ - name: "📦 Setup Node.js"
87
88
  uses: actions/setup-node@v4
88
89
  with:
89
90
  node-version: ${{ env.NODE_VERSION }}
90
91
  cache: 'npm'
91
92
 
92
- - name: 🔧 Install dependencies
93
+ - name: "🔧 Install dependencies"
93
94
  run: bun install --frozen-lockfile
94
95
 
95
- - name: 📥 Download build artifacts
96
+ - name: "📥 Download build artifacts"
96
97
  uses: actions/download-artifact@v4
97
98
  with:
98
99
  name: build-full-node20
@@ -108,7 +109,7 @@ jobs:
108
109
  echo "\`\`\`" >> performance-report.md
109
110
  ls -la dist/ >> performance-report.md
110
111
  echo "\`\`\`" >> performance-report.md
111
-
112
+
112
113
  echo "### File Sizes by Module" >> performance-report.md
113
114
  for module in core styling exports; do
114
115
  if [ -d "dist/modular/$module" ]; then
@@ -118,12 +119,12 @@ jobs:
118
119
  echo "\`\`\`" >> performance-report.md
119
120
  fi
120
121
  done
121
-
122
+
122
123
  echo "### Performance Metrics" >> performance-report.md
123
124
  echo "- **Build Time**: $(date)" >> performance-report.md
124
125
  echo "- **Node Version**: ${{ env.NODE_VERSION }}" >> performance-report.md
125
126
 
126
- - name: 📤 Upload performance report
127
+ - name: "📤 Upload performance report"
127
128
  uses: actions/upload-artifact@v4
128
129
  with:
129
130
  name: performance-report
@@ -135,21 +136,21 @@ jobs:
135
136
  runs-on: ubuntu-latest
136
137
  needs: test-matrix
137
138
  if: ${{ inputs.run_visual == true }}
138
-
139
+
139
140
  steps:
140
- - name: 📥 Checkout code
141
+ - name: "📥 Checkout code"
141
142
  uses: actions/checkout@v4
142
143
 
143
- - name: 📦 Setup Node.js
144
+ - name: "📦 Setup Node.js"
144
145
  uses: actions/setup-node@v4
145
146
  with:
146
147
  node-version: ${{ env.NODE_VERSION }}
147
148
  cache: 'npm'
148
149
 
149
- - name: 🔧 Install dependencies
150
+ - name: "🔧 Install dependencies"
150
151
  run: bun install --frozen-lockfile
151
152
 
152
- - name: 📥 Download build artifacts
153
+ - name: "📥 Download build artifacts"
153
154
  uses: actions/download-artifact@v4
154
155
  with:
155
156
  name: build-full-node20
@@ -158,10 +159,10 @@ jobs:
158
159
  - name: 🎭 Install Playwright
159
160
  run: npx playwright install --with-deps chromium
160
161
 
161
- - name: 🖼️ Run visual tests
162
+ - name: "🖼️ Run visual tests"
162
163
  run: bun run test:visual
163
164
 
164
- - name: 📤 Upload test results
165
+ - name: "📤 Upload test results"
165
166
  uses: actions/upload-artifact@v4
166
167
  if: always()
167
168
  with:
@@ -169,7 +170,7 @@ jobs:
169
170
  path: test-results/
170
171
  retention-days: 30
171
172
 
172
- - name: 📤 Upload screenshots
173
+ - name: "📤 Upload screenshots"
173
174
  uses: actions/upload-artifact@v4
174
175
  if: failure()
175
176
  with:
@@ -180,12 +181,12 @@ jobs:
180
181
  # ===== SECURITY AUDIT =====
181
182
  security-audit:
182
183
  runs-on: ubuntu-latest
183
-
184
+
184
185
  steps:
185
- - name: 📥 Checkout code
186
+ - name: "📥 Checkout code"
186
187
  uses: actions/checkout@v4
187
188
 
188
- - name: 📦 Setup Node.js
189
+ - name: "📦 Setup Node.js"
189
190
  uses: actions/setup-node@v4
190
191
  with:
191
192
  node-version: ${{ env.NODE_VERSION }}
@@ -208,13 +209,13 @@ jobs:
208
209
  echo "\`\`\`" >> security-report.md
209
210
  npm audit --audit-level=moderate >> security-report.md || echo "No critical vulnerabilities" >> security-report.md
210
211
  echo "\`\`\`" >> security-report.md
211
-
212
+
212
213
  echo "### Outdated Packages" >> security-report.md
213
214
  echo "\`\`\`" >> security-report.md
214
215
  npm outdated >> security-report.md || echo "All packages up to date" >> security-report.md
215
216
  echo "\`\`\`" >> security-report.md
216
217
 
217
- - name: 📤 Upload security report
218
+ - name: "📤 Upload security report"
218
219
  uses: actions/upload-artifact@v4
219
220
  with:
220
221
  name: security-report
@@ -225,37 +226,37 @@ jobs:
225
226
  code-quality:
226
227
  runs-on: ubuntu-latest
227
228
  needs: test-matrix
228
-
229
+
229
230
  steps:
230
- - name: 📥 Checkout code
231
+ - name: "📥 Checkout code"
231
232
  uses: actions/checkout@v4
232
233
 
233
- - name: 📦 Setup Node.js
234
+ - name: "📦 Setup Node.js"
234
235
  uses: actions/setup-node@v4
235
236
  with:
236
237
  node-version: ${{ env.NODE_VERSION }}
237
238
  cache: 'npm'
238
239
 
239
- - name: 🔧 Install dependencies
240
+ - name: "🔧 Install dependencies"
240
241
  run: bun install --frozen-lockfile
241
242
 
242
243
  - name: 🔍 Code analysis
243
244
  run: |
244
245
  echo "🔍 Analyzing code quality..."
245
-
246
+
246
247
  # Análisis básico de código
247
248
  echo "## 📊 Code Quality Report" > quality-report.md
248
249
  echo "### TypeScript Analysis" >> quality-report.md
249
250
  echo "\`\`\`" >> quality-report.md
250
251
  bun run type-check >> quality-report.md 2>&1 || echo "TypeScript issues detected" >> quality-report.md
251
252
  echo "\`\`\`" >> quality-report.md
252
-
253
+
253
254
  echo "### File Statistics" >> quality-report.md
254
255
  echo "- **Total TypeScript files**: $(find src/ -name '*.ts' | wc -l)" >> quality-report.md
255
256
  echo "- **Total lines of code**: $(find src/ -name '*.ts' -exec wc -l {} + | tail -1 | awk '{print $1}')" >> quality-report.md
256
257
  echo "- **Build date**: $(date)" >> quality-report.md
257
258
 
258
- - name: 📤 Upload quality report
259
+ - name: "📤 Upload quality report"
259
260
  uses: actions/upload-artifact@v4
260
261
  with:
261
262
  name: code-quality-report
@@ -265,27 +266,27 @@ jobs:
265
266
  # ===== PROJECT UTILS VALIDATION =====
266
267
  validate-project-utils:
267
268
  runs-on: ubuntu-latest
268
-
269
+
269
270
  steps:
270
- - name: 📥 Checkout code
271
+ - name: "📥 Checkout code"
271
272
  uses: actions/checkout@v4
272
273
 
273
- - name: 📦 Setup Node.js
274
+ - name: "📦 Setup Node.js"
274
275
  uses: actions/setup-node@v4
275
276
  with:
276
277
  node-version: ${{ env.NODE_VERSION }}
277
278
  cache: 'npm'
278
279
 
279
- - name: 🔧 Install dependencies
280
+ - name: "🔧 Install dependencies"
280
281
  run: bun install --frozen-lockfile
281
282
 
282
- - name: 🧪 Test project-utils scripts
283
+ - name: "🧪 Test project-utils scripts"
283
284
  run: |
284
285
  echo "🧪 Validating project-utils scripts..."
285
-
286
+
286
287
  # Verificar que los scripts existan y sean ejecutables
287
288
  SCRIPTS=("commit-generator.ts" "version-manager.ts" "github-release-manager.ts" "auto-release-gemini.ts")
288
-
289
+
289
290
  for script in "${SCRIPTS[@]}"; do
290
291
  if [ -f "project-utils/$script" ]; then
291
292
  echo "✅ $script exists"
@@ -299,10 +300,10 @@ jobs:
299
300
  - name: 📊 Validate package.json scripts
300
301
  run: |
301
302
  echo "📊 Validating package.json scripts..."
302
-
303
+
303
304
  # Verificar scripts críticos
304
305
  CRITICAL_SCRIPTS=("build" "build:all" "commit:auto" "version:auto" "workflow:full")
305
-
306
+
306
307
  for script in "${CRITICAL_SCRIPTS[@]}"; do
307
308
  if bun run --silent "$script" --help >/dev/null 2>&1; then
308
309
  echo "✅ Script '$script' is valid"
@@ -316,13 +317,13 @@ jobs:
316
317
  runs-on: ubuntu-latest
317
318
  needs: [test-matrix, performance-tests, visual-tests, security-audit, code-quality, validate-project-utils]
318
319
  if: always()
319
-
320
+
320
321
  steps:
321
322
  - name: 📊 CI Quality Summary
322
323
  run: |
323
324
  echo "## 📊 CI Quality & Testing Summary" >> $GITHUB_STEP_SUMMARY
324
325
  echo "" >> $GITHUB_STEP_SUMMARY
325
-
326
+
326
327
  # Status de cada job
327
328
  echo "### 🧪 Test Results" >> $GITHUB_STEP_SUMMARY
328
329
  echo "- **Matrix Testing**: ${{ needs.test-matrix.result }}" >> $GITHUB_STEP_SUMMARY
@@ -332,25 +333,25 @@ jobs:
332
333
  echo "- **Code Quality**: ${{ needs.code-quality.result }}" >> $GITHUB_STEP_SUMMARY
333
334
  echo "- **Project Utils**: ${{ needs.validate-project-utils.result }}" >> $GITHUB_STEP_SUMMARY
334
335
  echo "" >> $GITHUB_STEP_SUMMARY
335
-
336
+
336
337
  echo "### 📋 Coverage Matrix" >> $GITHUB_STEP_SUMMARY
337
338
  echo "- **Node Versions**: 18, 20, 21" >> $GITHUB_STEP_SUMMARY
338
339
  echo "- **Build Modes**: full, core, styling, exports" >> $GITHUB_STEP_SUMMARY
339
340
  echo "- **Test Types**: unit, performance, visual, security" >> $GITHUB_STEP_SUMMARY
340
341
  echo "" >> $GITHUB_STEP_SUMMARY
341
-
342
+
342
343
  # Determinar estado general
343
- if [ "${{ needs.test-matrix.result }}" = "success" ] && [ "${{ needs.security-audit.result }}" = "success" ] && [ "${{ needs.code-quality.result }}" = "success" ]; then
344
+ if [ "${{ needs.test-matrix.result }}" = "success" ] && ["${{ needs.security-audit.result }}" = "success"] && ["${{ needs.code-quality.result }}" = "success"]; then
344
345
  echo "### ✅ Overall Status: PASSED" >> $GITHUB_STEP_SUMMARY
345
346
  echo "All critical quality checks passed successfully." >> $GITHUB_STEP_SUMMARY
346
347
  else
347
348
  echo "### ⚠️ Overall Status: ATTENTION REQUIRED" >> $GITHUB_STEP_SUMMARY
348
349
  echo "Some quality checks require attention. Review individual job results." >> $GITHUB_STEP_SUMMARY
349
350
  fi
350
-
351
+
351
352
  echo "" >> $GITHUB_STEP_SUMMARY
352
353
  echo "### 📎 Artifacts Generated" >> $GITHUB_STEP_SUMMARY
353
354
  echo "- Build artifacts for all modules" >> $GITHUB_STEP_SUMMARY
354
355
  echo "- Performance analysis report" >> $GITHUB_STEP_SUMMARY
355
356
  echo "- Security audit report" >> $GITHUB_STEP_SUMMARY
356
- echo "- Code quality metrics" >> $GITHUB_STEP_SUMMARY
357
+ echo "- Code quality metrics" >> $GITHUB_STEP_SUMMARY
@@ -1,14 +1,10 @@
1
+ ---
1
2
  name: Docs & Demo Deployment
2
3
 
3
4
  on:
4
- push:
5
- branches: [ main ]
6
- paths:
7
- - 'docs/**'
8
- - 'demo.html'
9
- - 'index.html'
10
- - 'src/**'
11
5
  workflow_dispatch:
6
+ # Solo se ejecuta manualmente o cuando se llama desde otro workflow
7
+ workflow_call:
12
8
 
13
9
  env:
14
10
  NODE_VERSION: '20'
@@ -17,36 +13,36 @@ jobs:
17
13
  # ===== BUILD DEMO =====
18
14
  build-demo:
19
15
  runs-on: ubuntu-latest
20
-
16
+
21
17
  steps:
22
- - name: 📥 Checkout code
18
+ - name: "📥 Checkout code"
23
19
  uses: actions/checkout@v4
24
20
 
25
- - name: 📦 Setup Bun
21
+ - name: "📦 Setup Bun"
26
22
  uses: oven-sh/setup-bun@v2
27
23
  with:
28
- bun-version: latest
29
- - name: 🔧 Install dependencies
24
+ bun-version: latest
25
+ - name: "🔧 Install dependencies"
30
26
  run: bun install --frozen-lockfile
31
27
 
32
- - name: 🏗️ Build library for demo
28
+ - name: "🏗️ Build library for demo"
33
29
  run: bun run build:full
34
30
 
35
- - name: 🏗️ Setup demo structure
31
+ - name: "🏗️ Setup demo structure"
36
32
  run: |
37
33
  mkdir -p _site/docs
38
34
  # Copy demo as root
39
35
  cp demo.html _site/index.html
40
36
  cp index.html _site/dev.html
41
37
  cp -r dist/ _site/dist/
42
-
38
+
43
39
  # Create demo metadata
44
40
  echo "## 📦 Demo Build Info" > _site/build-info.md
45
41
  echo "- **Build Date**: $(date)" >> _site/build-info.md
46
42
  echo "- **Commit**: ${{ github.sha }}" >> _site/build-info.md
47
43
  echo "- **Version**: $(node -p 'require("./package.json").version')" >> _site/build-info.md
48
44
 
49
- - name: 📤 Upload demo artifacts
45
+ - name: "📤 Upload demo artifacts"
50
46
  uses: actions/upload-artifact@v4
51
47
  with:
52
48
  name: demo-site
@@ -56,18 +52,18 @@ jobs:
56
52
  # ===== BUILD DOCS =====
57
53
  build-docs:
58
54
  runs-on: ubuntu-latest
59
-
55
+
60
56
  steps:
61
- - name: 📥 Checkout code
57
+ - name: "📥 Checkout code"
62
58
  uses: actions/checkout@v4
63
59
 
64
- - name: 📤 Build Jekyll documentation
60
+ - name: "📤 Build Jekyll documentation"
65
61
  uses: actions/jekyll-build-pages@v1
66
62
  with:
67
63
  source: ./docs
68
64
  destination: ./_site/docs
69
65
 
70
- - name: 📤 Upload docs artifacts
66
+ - name: "📤 Upload docs artifacts"
71
67
  uses: actions/upload-artifact@v4
72
68
  with:
73
69
  name: docs-site
@@ -79,45 +75,45 @@ jobs:
79
75
  runs-on: ubuntu-latest
80
76
  needs: [build-demo, build-docs]
81
77
  if: github.ref == 'refs/heads/main'
82
-
78
+
83
79
  permissions:
84
80
  contents: read
85
81
  pages: write
86
82
  id-token: write
87
-
83
+
88
84
  environment:
89
85
  name: github-pages
90
86
  url: ${{ steps.deployment.outputs.page_url }}
91
-
87
+
92
88
  steps:
93
- - name: 📥 Download demo artifacts
89
+ - name: "📥 Download demo artifacts"
94
90
  uses: actions/download-artifact@v4
95
91
  with:
96
92
  name: demo-site
97
93
  path: _site/
98
94
 
99
- - name: 📥 Download docs artifacts
95
+ - name: "📥 Download docs artifacts"
100
96
  uses: actions/download-artifact@v4
101
97
  with:
102
98
  name: docs-site
103
99
  path: _site/docs/
104
100
 
105
- - name: 📤 Setup Pages
101
+ - name: "📤 Setup Pages"
106
102
  uses: actions/configure-pages@v4
107
103
 
108
- - name: 📤 Upload to Pages
104
+ - name: "📤 Upload to Pages"
109
105
  uses: actions/upload-pages-artifact@v3
110
106
  with:
111
107
  path: ./_site
112
108
 
113
- - name: 🚀 Deploy to GitHub Pages
109
+ - name: "🚀 Deploy to GitHub Pages"
114
110
  id: deployment
115
111
  uses: actions/deploy-pages@v4
116
112
 
117
113
  - name: 📊 Deployment summary
118
114
  run: |
119
115
  echo "## 📝 Documentation & Demo Deployed!" >> $GITHUB_STEP_SUMMARY
120
- echo "- **Demo URL**: ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY
116
+ echo "- **Demo URL**: ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY
121
117
  echo "- **Docs URL**: ${{ steps.deployment.outputs.page_url }}docs/" >> $GITHUB_STEP_SUMMARY
122
118
  echo "- **Dev Demo**: ${{ steps.deployment.outputs.page_url }}dev.html" >> $GITHUB_STEP_SUMMARY
123
- echo "- **Build Info**: ${{ steps.deployment.outputs.page_url }}build-info.md" >> $GITHUB_STEP_SUMMARY
119
+ echo "- **Build Info**: ${{ steps.deployment.outputs.page_url }}build-info.md" >> $GITHUB_STEP_SUMMARY