@mks2508/better-logger 5.0.0 → 5.0.2

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 (162) hide show
  1. package/dist/chunks/{Logger-Cbi1f10o.js → Logger-CKqzXDh3.js} +2 -2
  2. package/dist/chunks/{Logger-Cbi1f10o.js.map → Logger-CKqzXDh3.js.map} +1 -1
  3. package/dist/chunks/{Logger-BZ7B7OXE.js → Logger-D_vuKP4l.js} +2 -2
  4. package/dist/chunks/{Logger-BZ7B7OXE.js.map → Logger-D_vuKP4l.js.map} +1 -1
  5. package/dist/chunks/cli-module-B-njrTWb.js +2 -0
  6. package/dist/chunks/cli-module-B-njrTWb.js.map +1 -0
  7. package/dist/chunks/{cli-module-ClIJmaT8.js → cli-module-Cx7qotPY.js} +16 -9
  8. package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
  9. package/dist/cli.cjs +1 -1
  10. package/dist/cli.js +1 -1
  11. package/dist/exports.cjs +1 -1
  12. package/dist/exports.js +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +3 -3
  15. package/dist/styling.cjs +1 -1
  16. package/dist/styling.js +2 -2
  17. package/dist/terminal/formatter.d.ts.map +1 -1
  18. package/package.json +5 -1
  19. package/.claude/settings.local.json +0 -48
  20. package/.github/workflows/ci-quality.yml +0 -357
  21. package/.github/workflows/docs-demo.yml +0 -119
  22. package/.github/workflows/releases-core.yml +0 -512
  23. package/.github/workflows/releases-full.yml +0 -582
  24. package/.github/workflows-backup/ci.yml +0 -221
  25. package/.github/workflows-backup/nightly.yml +0 -196
  26. package/.github/workflows-backup/release-optimized.yml +0 -373
  27. package/.github/workflows-backup/release.yml +0 -269
  28. package/.release-notes-0.2.0.md +0 -129
  29. package/.yamllint +0 -28
  30. package/CHANGELOG.json +0 -1076
  31. package/CHANGELOG.md +0 -209
  32. package/CLAUDE.md +0 -217
  33. package/bun.lock +0 -333
  34. package/demo.html +0 -847
  35. package/dist/chunks/cli-module-CadqgZ1Z.js +0 -2
  36. package/dist/chunks/cli-module-CadqgZ1Z.js.map +0 -1
  37. package/dist/chunks/cli-module-ClIJmaT8.js.map +0 -1
  38. package/docs/API.md +0 -918
  39. package/docs/CORE.md +0 -264
  40. package/docs/DEVELOPMENT.md +0 -731
  41. package/docs/EXPORTS.md +0 -467
  42. package/docs/PACKAGES.md +0 -244
  43. package/docs/STYLING.md +0 -405
  44. package/docs/_config.yml +0 -36
  45. package/docs/index.md +0 -179
  46. package/examples/README.md +0 -208
  47. package/examples/basic-logging.js +0 -75
  48. package/examples/data-export.js +0 -234
  49. package/examples/package.json +0 -16
  50. package/examples/performance-timing.js +0 -170
  51. package/examples/simplified-api.js +0 -124
  52. package/examples/styling-themes.js +0 -207
  53. package/index.html +0 -358
  54. package/packages/core/package.json +0 -57
  55. package/packages/exports/package.json +0 -41
  56. package/packages/nodejs-opentui/README.md +0 -232
  57. package/packages/nodejs-opentui/package.json +0 -72
  58. package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
  59. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
  60. package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
  61. package/packages/nodejs-opentui/src/index.ts +0 -133
  62. package/packages/nodejs-opentui/src/types.ts +0 -158
  63. package/packages/nodejs-opentui/tsconfig.json +0 -20
  64. package/packages/styling/package.json +0 -41
  65. package/playground/demo-all.ts +0 -95
  66. package/playground/demo-box.ts +0 -85
  67. package/playground/demo-levels.ts +0 -56
  68. package/playground/demo-real-world.ts +0 -98
  69. package/playground/demo-spinner.ts +0 -77
  70. package/playground/demo-steps.ts +0 -72
  71. package/playground/demo-table.ts +0 -83
  72. package/project-utils/README.md +0 -172
  73. package/project-utils/auto-release-gemini.ts +0 -1193
  74. package/project-utils/auto-release-ui.ts +0 -1329
  75. package/project-utils/commit-generator.ts +0 -1385
  76. package/project-utils/commit-ui.ts +0 -264
  77. package/project-utils/git-utils.ts +0 -199
  78. package/project-utils/github-release-manager.ts +0 -466
  79. package/project-utils/project-config.ts +0 -260
  80. package/project-utils/prompt-templates.js +0 -345
  81. package/project-utils/prompt-templates.ts +0 -422
  82. package/project-utils/version-manager.ts +0 -1078
  83. package/public/vite.svg +0 -1
  84. package/src/Logger.ts +0 -1858
  85. package/src/ScopedLogger.ts +0 -256
  86. package/src/cli/CommandProcessor.ts +0 -248
  87. package/src/cli/commands/ConfigCommand.ts +0 -93
  88. package/src/cli/commands/ExportCommand.ts +0 -276
  89. package/src/cli/commands/HistoryCommand.ts +0 -117
  90. package/src/cli/commands/StatusCommand.ts +0 -112
  91. package/src/cli/commands/ThemeCommand.ts +0 -88
  92. package/src/cli/help.ts +0 -127
  93. package/src/cli/index.ts +0 -71
  94. package/src/cli-module.ts +0 -21
  95. package/src/cli-primitives/box.ts +0 -86
  96. package/src/cli-primitives/cli-table.ts +0 -62
  97. package/src/cli-primitives/divider.ts +0 -17
  98. package/src/cli-primitives/header.ts +0 -18
  99. package/src/cli-primitives/index.ts +0 -13
  100. package/src/cli-primitives/server-fallback.ts +0 -54
  101. package/src/cli-primitives/spinner.ts +0 -133
  102. package/src/cli-primitives/step.ts +0 -22
  103. package/src/constants.ts +0 -313
  104. package/src/core.ts +0 -397
  105. package/src/example.ts +0 -210
  106. package/src/exports-module.ts +0 -311
  107. package/src/handlers/AnalyticsLogHandler.ts +0 -22
  108. package/src/handlers/ExportLogHandler.ts +0 -610
  109. package/src/handlers/FileLogHandler.ts +0 -169
  110. package/src/handlers/RemoteLogHandler.ts +0 -42
  111. package/src/handlers/index.ts +0 -8
  112. package/src/hooks/HookManager.ts +0 -177
  113. package/src/hooks/index.ts +0 -1
  114. package/src/index.ts +0 -395
  115. package/src/main.ts +0 -196
  116. package/src/serializers/SerializerRegistry.ts +0 -173
  117. package/src/serializers/index.ts +0 -1
  118. package/src/style.css +0 -96
  119. package/src/styling/LogStyleBuilder.ts +0 -355
  120. package/src/styling/SemanticStyles.ts +0 -380
  121. package/src/styling/SmartPresets.ts +0 -288
  122. package/src/styling/StyleBuilder.ts +0 -319
  123. package/src/styling/StyleCache.ts +0 -131
  124. package/src/styling/banners.ts +0 -168
  125. package/src/styling/index.ts +0 -27
  126. package/src/styling/themes.ts +0 -235
  127. package/src/styling-module.ts +0 -244
  128. package/src/terminal/color-converter.ts +0 -315
  129. package/src/terminal/formatter.ts +0 -236
  130. package/src/terminal/terminal-renderer.ts +0 -342
  131. package/src/transports/ConsoleTransport.ts +0 -28
  132. package/src/transports/FileTransport.ts +0 -53
  133. package/src/transports/HttpTransport.ts +0 -56
  134. package/src/transports/TransportManager.ts +0 -130
  135. package/src/transports/index.ts +0 -4
  136. package/src/types/core.ts +0 -417
  137. package/src/types/handlers.ts +0 -95
  138. package/src/types/hooks.ts +0 -45
  139. package/src/types/index.ts +0 -83
  140. package/src/types/serializers.ts +0 -30
  141. package/src/types/transports.ts +0 -52
  142. package/src/typescript.svg +0 -1
  143. package/src/utils/adapter.ts +0 -291
  144. package/src/utils/ansi-colors.ts +0 -333
  145. package/src/utils/environment-detector.ts +0 -170
  146. package/src/utils/environment.ts +0 -94
  147. package/src/utils/formatting.ts +0 -332
  148. package/src/utils/index.ts +0 -33
  149. package/src/utils/opentui-detection.ts +0 -138
  150. package/src/utils/output.ts +0 -227
  151. package/src/utils/stackTrace.ts +0 -144
  152. package/src/utils/timestamps.ts +0 -80
  153. package/src/vite-env.d.ts +0 -1
  154. package/src/writers/BufferWriter.ts +0 -157
  155. package/src/writers/index.ts +0 -6
  156. package/test-core-browser.html +0 -237
  157. package/test-core-node.js +0 -63
  158. package/tests/test-conflict-resolution.ts +0 -391
  159. package/tests/validate-workflows.sh +0 -131
  160. package/tests/yaml-autofix.sh +0 -146
  161. package/tsconfig.json +0 -50
  162. package/vite.config.ts +0 -256
@@ -1,582 +0,0 @@
1
- ---
2
- name: Full Release Pipeline - Granular AI Steps
3
-
4
- on:
5
- workflow_dispatch:
6
- inputs:
7
- version_type:
8
- description: 'Tipo de versión'
9
- required: false
10
- default: 'auto'
11
- type: choice
12
- options:
13
- - auto
14
- - patch
15
- - minor
16
- - major
17
- version_prefix:
18
- description: 'Prefijo de versión'
19
- required: false
20
- default: 'stable'
21
- type: choice
22
- options:
23
- - stable
24
- - alpha
25
- - beta
26
- - rc
27
- target_registry:
28
- description: 'Registro objetivo'
29
- required: false
30
- default: 'both'
31
- type: choice
32
- options:
33
- - npm
34
- - github
35
- - both
36
- skip_tests:
37
- description: 'Saltar tests (no recomendado)'
38
- required: false
39
- default: false
40
- type: boolean
41
- dry_run:
42
- description: 'Solo mostrar qué haría (dry run)'
43
- required: false
44
- default: false
45
- type: boolean
46
- push:
47
- branches: [main]
48
- paths-ignore:
49
- - '*.md'
50
- - '.github/workflows/docs-demo.yml'
51
-
52
- # Concurrency control para evitar conflictos entre workflows de release
53
- concurrency:
54
- group: release-pipeline-${{ github.ref }}
55
- cancel-in-progress: true
56
-
57
- env:
58
- NODE_VERSION: '20'
59
-
60
- jobs:
61
- # ===== STEP 1: AI VERSION ANALYSIS & GENERATION =====
62
- ai-version-generation:
63
- runs-on: ubuntu-latest
64
- if: github.actor != 'github-actions[bot]'
65
- permissions:
66
- contents: write
67
-
68
- outputs:
69
- version: ${{ steps.version.outputs.version }}
70
- tag: ${{ steps.version.outputs.tag }}
71
- is_prerelease: ${{ steps.version.outputs.is_prerelease }}
72
- release_channel: ${{ steps.version.outputs.release_channel }}
73
- should_skip: ${{ steps.version.outputs.should_skip }}
74
-
75
- steps:
76
- - name: "📥 Checkout code"
77
- uses: actions/checkout@v4
78
- with:
79
- fetch-depth: 0
80
- token: ${{ secrets.GITHUB_TOKEN }}
81
-
82
- - name: "📦 Setup Bun"
83
- uses: oven-sh/setup-bun@v2
84
- with:
85
- bun-version: latest
86
-
87
- - name: "🔧 Install dependencies"
88
- run: bun install --frozen-lockfile
89
-
90
- - name: "🤖 Setup Gemini CLI"
91
- run: |
92
- echo "🤖 Configurando Gemini CLI..."
93
- # Install Gemini CLI
94
- npm install -g @google/generative-ai
95
- # Verificar instalación
96
- echo "✅ Gemini CLI configurado"
97
- env:
98
- GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
99
-
100
- - name: "🤖 Step 1: AI Version Analysis & Generation"
101
- id: version
102
- env:
103
- VERSION_TYPE: ${{ inputs.version_type || 'auto' }}
104
- VERSION_PREFIX: ${{ inputs.version_prefix || 'stable' }}
105
- TARGET_REGISTRY: ${{ inputs.target_registry || 'npm' }}
106
- DRY_RUN: ${{ inputs.dry_run || 'false' }}
107
- run: |
108
- echo "🤖 === PASO 1: ANÁLISIS Y GENERACIÓN DE VERSIÓN CON AI ==="
109
-
110
- # Mostrar contexto de ejecución
111
- if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
112
- echo "📝 Ejecutando en modo manual con parámetros especificados"
113
- else
114
- echo "🔄 Ejecutando automáticamente desde push - usando defaults"
115
- fi
116
-
117
- # Preparar argumentos para version-manager usando variables de entorno
118
- ARGS="--auto-approve"
119
-
120
- if [ "$VERSION_TYPE" != "auto" ]; then
121
- ARGS="$ARGS --type $VERSION_TYPE"
122
- fi
123
-
124
- if [ "$VERSION_PREFIX" != "stable" ]; then
125
- ARGS="$ARGS --prefix $VERSION_PREFIX"
126
- fi
127
-
128
- # Mostrar comando que se ejecutará
129
- echo "📋 Ejecutando: bun project-utils/version-manager.ts $ARGS"
130
-
131
- if [ "$DRY_RUN" = "true" ]; then
132
- echo "🔍 [DRY RUN] Se generaría nueva versión con: $ARGS"
133
- echo "should_skip=true" >> $GITHUB_OUTPUT
134
- echo "version=dry-run" >> $GITHUB_OUTPUT
135
- echo "tag=dry-run" >> $GITHUB_OUTPUT
136
- echo "is_prerelease=false" >> $GITHUB_OUTPUT
137
- echo "release_channel=dry-run" >> $GITHUB_OUTPUT
138
- else
139
- # Ejecutar version-manager con AI
140
- echo "🚀 Ejecutando version-manager con análisis AI..."
141
- bun project-utils/version-manager.ts $ARGS
142
-
143
- # Obtener nueva versión del package.json
144
- NEW_VERSION=$(node -p "require('./package.json').version")
145
- echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
146
- echo "tag=v$NEW_VERSION" >> $GITHUB_OUTPUT
147
-
148
- # Determinar si es prerelease y canal
149
- case "$NEW_VERSION" in
150
- *alpha*)
151
- echo "is_prerelease=true" >> $GITHUB_OUTPUT
152
- echo "release_channel=alpha" >> $GITHUB_OUTPUT
153
- ;;
154
- *beta*)
155
- echo "is_prerelease=true" >> $GITHUB_OUTPUT
156
- echo "release_channel=beta" >> $GITHUB_OUTPUT
157
- ;;
158
- *rc*)
159
- echo "is_prerelease=true" >> $GITHUB_OUTPUT
160
- echo "release_channel=rc" >> $GITHUB_OUTPUT
161
- ;;
162
- *)
163
- echo "is_prerelease=false" >> $GITHUB_OUTPUT
164
- echo "release_channel=latest" >> $GITHUB_OUTPUT
165
- ;;
166
- esac
167
-
168
- echo "should_skip=false" >> $GITHUB_OUTPUT
169
- echo "✅ Nueva versión generada: $NEW_VERSION"
170
- fi
171
-
172
- - name: "🏷️ Commit and push version changes"
173
- if: steps.version.outputs.should_skip != 'true'
174
- run: |
175
- echo "🏷️ Commiteando cambios de versión usando project-utils con resolución automática de conflictos..."
176
-
177
- # Configurar environment variables para detectar contexto de release
178
- export RELEASE_WORKFLOW=true
179
- export GITHUB_WORKFLOW="${{ github.workflow }}"
180
-
181
- # Usar commit-generator con contexto específico de release
182
- echo "🤖 Usando commit-generator con detección automática de conflictos..."
183
- bun project-utils/commit-generator.ts \
184
- --context "release ${{ steps.version.outputs.version }}" \
185
- --work-type "release" \
186
- --affected-components "core,styling,exports,changelog" \
187
- --auto-approve \
188
- --quiet \
189
- || {
190
- echo "⚠️ Commit-generator falló, usando estrategia de fallback..."
191
-
192
- # Fallback: estrategia manual con pull-rebase-push
193
- git config user.name "github-actions[bot]"
194
- git config user.email "github-actions[bot]@users.noreply.github.com"
195
-
196
- MAX_RETRIES=3
197
- RETRY_COUNT=0
198
-
199
- while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
200
- echo "🔄 Intento fallback $((RETRY_COUNT + 1))/$MAX_RETRIES"
201
-
202
- git fetch origin main
203
- if ! git merge-base --is-ancestor origin/main HEAD; then
204
- echo "🔄 Aplicando rebase..."
205
- git rebase origin/main || {
206
- echo "⚠️ Conflictos en rebase, aplicando reset hard"
207
- git rebase --abort
208
- git reset --hard origin/main
209
- }
210
- fi
211
-
212
- git add package.json CHANGELOG.json packages/*/package.json
213
- git commit -m "chore: release ${{ steps.version.outputs.version }} [skip ci]" || {
214
- echo "ℹ️ No hay cambios para commit"
215
- break
216
- }
217
-
218
- if git push origin main; then
219
- echo "✅ Push exitoso en intento fallback $((RETRY_COUNT + 1))"
220
- break
221
- else
222
- RETRY_COUNT=$((RETRY_COUNT + 1))
223
- if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
224
- sleep 5
225
- git reset --hard HEAD~1
226
- fi
227
- fi
228
- done
229
-
230
- if [ $RETRY_COUNT -ge $MAX_RETRIES ]; then
231
- echo "❌ Push falló después de $MAX_RETRIES intentos"
232
- exit 1
233
- fi
234
- }
235
-
236
- - name: "📤 Upload version artifacts"
237
- uses: actions/upload-artifact@v4
238
- if: always()
239
- with:
240
- name: version-artifacts
241
- path: |
242
- project-utils/.temp/
243
- CHANGELOG.json
244
- package.json
245
- retention-days: 7
246
-
247
- # ===== STEP 2: BUILD & PREPARE =====
248
- build-and-prepare:
249
- runs-on: ubuntu-latest
250
- needs: ai-version-generation
251
- if: needs.ai-version-generation.outputs.should_skip != 'true'
252
-
253
- steps:
254
- - name: "📥 Checkout code with version changes"
255
- uses: actions/checkout@v4
256
- with:
257
- fetch-depth: 0
258
- token: ${{ secrets.GITHUB_TOKEN }}
259
- ref: main
260
-
261
- - name: "🔄 Pull latest changes"
262
- run: git pull origin main
263
-
264
- - name: "📦 Setup Bun"
265
- uses: oven-sh/setup-bun@v2
266
- with:
267
- bun-version: latest
268
-
269
- - name: "🔧 Install dependencies"
270
- run: bun install --frozen-lockfile
271
-
272
- - name: "🧪 Step 2: Run tests (unless skipped)"
273
- if: github.event_name == 'workflow_dispatch' && github.event.inputs.skip_tests != 'true'
274
- run: |
275
- echo "🧪 === PASO 2: EJECUTANDO TESTS Y VALIDACIONES ==="
276
- bun run type-check
277
- bun run test
278
- echo "✅ Tests completados exitosamente"
279
-
280
- - name: "🏗️ Step 3: Build all modules"
281
- run: |
282
- echo "🏗️ === PASO 3: COMPILANDO TODOS LOS MÓDULOS ==="
283
- bun run build:all
284
- echo "✅ Build completado exitosamente"
285
-
286
- # Mostrar archivos generados
287
- echo "📊 Archivos generados:"
288
- ls -la dist/
289
-
290
- - name: "📤 Upload build artifacts"
291
- uses: actions/upload-artifact@v4
292
- with:
293
- name: build-artifacts-${{ needs.ai-version-generation.outputs.version }}
294
- path: dist/
295
- retention-days: 30
296
-
297
- # ===== STEP 3: PUBLISH SUB-PACKAGES =====
298
- publish-subpackages:
299
- runs-on: ubuntu-latest
300
- needs: [ai-version-generation, build-and-prepare]
301
- if: needs.ai-version-generation.outputs.should_skip != 'true'
302
-
303
- steps:
304
- - name: "📥 Checkout code"
305
- uses: actions/checkout@v4
306
- with:
307
- ref: main
308
-
309
- - name: "📦 Setup Node.js with NPM registry"
310
- uses: actions/setup-node@v4
311
- with:
312
- node-version: '20'
313
- registry-url: 'https://registry.npmjs.org'
314
-
315
- - name: "📥 Download build artifacts"
316
- uses: actions/download-artifact@v4
317
- with:
318
- name: build-artifacts-${{ needs.ai-version-generation.outputs.version }}
319
- path: dist/
320
-
321
- - name: "🚀 Step 3a: Publish Sub-Packages to NPM"
322
- run: |
323
- echo "🚀 === PASO 3a: PUBLICANDO SUB-PACKAGES EN NPM ==="
324
-
325
- # Core package
326
- echo "📦 Publishing @mks2508/better-logger-core"
327
- cd packages/core
328
- if [ "${{ needs.ai-version-generation.outputs.is_prerelease }}" = "true" ]; then
329
- npm publish --access public --tag ${{ needs.ai-version-generation.outputs.release_channel }}
330
- else
331
- npm publish --access public
332
- fi
333
- cd ../..
334
-
335
- # Styling package
336
- echo "📦 Publishing @mks2508/better-logger-styling"
337
- cd packages/styling
338
- if [ "${{ needs.ai-version-generation.outputs.is_prerelease }}" = "true" ]; then
339
- npm publish --access public --tag ${{ needs.ai-version-generation.outputs.release_channel }}
340
- else
341
- npm publish --access public
342
- fi
343
- cd ../..
344
-
345
- # Exports package
346
- echo "📦 Publishing @mks2508/better-logger-exports"
347
- cd packages/exports
348
- if [ "${{ needs.ai-version-generation.outputs.is_prerelease }}" = "true" ]; then
349
- npm publish --access public --tag ${{ needs.ai-version-generation.outputs.release_channel }}
350
- else
351
- npm publish --access public
352
- fi
353
- cd ../..
354
-
355
- echo "✅ Sub-packages published successfully"
356
- env:
357
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
358
-
359
- # ===== STEP 4: NPM MAIN PACKAGE PUBLISHING =====
360
- publish-npm:
361
- runs-on: ubuntu-latest
362
- needs: [ai-version-generation, build-and-prepare, publish-subpackages]
363
- if: needs.ai-version-generation.outputs.should_skip != 'true' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.target_registry == 'npm' || github.event.inputs.target_registry == 'both')))
364
-
365
- steps:
366
- - name: "📥 Checkout code"
367
- uses: actions/checkout@v4
368
- with:
369
- ref: main
370
-
371
- - name: "📦 Setup Node.js with NPM registry"
372
- uses: actions/setup-node@v4
373
- with:
374
- node-version: '20'
375
- registry-url: 'https://registry.npmjs.org'
376
-
377
- - name: "📥 Download build artifacts"
378
- uses: actions/download-artifact@v4
379
- with:
380
- name: build-artifacts-${{ needs.ai-version-generation.outputs.version }}
381
- path: dist/
382
-
383
- - name: "🚀 Step 4: Publish to NPM Registry"
384
- run: |
385
- echo "🚀 === PASO 4: PUBLICANDO EN NPM REGISTRY ==="
386
- if [ "${{ needs.ai-version-generation.outputs.is_prerelease }}" = "true" ]; then
387
- echo "📦 Publishing prerelease to NPM with tag: ${{ needs.ai-version-generation.outputs.release_channel }}"
388
- npm publish --access public --tag ${{ needs.ai-version-generation.outputs.release_channel }}
389
- else
390
- echo "📦 Publishing stable release to NPM"
391
- npm publish --access public
392
- fi
393
- echo "✅ Publicación en NPM completada"
394
- env:
395
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
396
-
397
- # ===== STEP 4.5: DOCS & DEMO DEPLOYMENT =====
398
- deploy-docs-demo:
399
- runs-on: ubuntu-latest
400
- needs: [ai-version-generation, build-and-prepare]
401
- if: needs.ai-version-generation.outputs.should_skip != 'true'
402
-
403
- steps:
404
- - name: "📥 Checkout code"
405
- uses: actions/checkout@v4
406
-
407
- - name: "📦 Setup Bun"
408
- uses: oven-sh/setup-bun@v2
409
- with:
410
- bun-version: latest
411
-
412
- - name: "🔧 Install dependencies"
413
- run: bun install --frozen-lockfile
414
-
415
- - name: "🏗️ Build library for demo"
416
- run: bun run build:full
417
-
418
- - name: "🏗️ Setup demo structure"
419
- run: |
420
- mkdir -p _site/docs
421
- cp demo.html _site/index.html
422
- cp index.html _site/dev.html
423
- cp -r dist/ _site/dist/
424
-
425
- - name: "📤 Build Jekyll documentation"
426
- uses: actions/jekyll-build-pages@v1
427
- with:
428
- source: ./docs
429
- destination: ./_site/docs
430
-
431
- - name: "📤 Setup Pages"
432
- uses: actions/configure-pages@v4
433
-
434
- - name: "📤 Upload to Pages"
435
- uses: actions/upload-pages-artifact@v3
436
- with:
437
- path: ./_site
438
-
439
- - name: "🚀 Deploy to GitHub Pages"
440
- id: deployment
441
- uses: actions/deploy-pages@v4
442
-
443
- permissions:
444
- contents: read
445
- pages: write
446
- id-token: write
447
-
448
- # ===== STEP 4: GITHUB PACKAGES PUBLISHING =====
449
- publish-github:
450
- runs-on: ubuntu-latest
451
- needs: [ai-version-generation, build-and-prepare, publish-subpackages]
452
- if: needs.ai-version-generation.outputs.should_skip != 'true' && github.event_name == 'workflow_dispatch' && (github.event.inputs.target_registry == 'github' || github.event.inputs.target_registry == 'both')
453
-
454
- steps:
455
- - name: "📥 Checkout code"
456
- uses: actions/checkout@v4
457
- with:
458
- ref: main
459
-
460
- - name: "📦 Setup Node.js with GitHub registry"
461
- uses: actions/setup-node@v4
462
- with:
463
- node-version: '20'
464
- registry-url: 'https://npm.pkg.github.com'
465
-
466
- - name: "📥 Download build artifacts"
467
- uses: actions/download-artifact@v4
468
- with:
469
- name: build-artifacts-${{ needs.ai-version-generation.outputs.version }}
470
- path: dist/
471
-
472
- - name: "📦 Step 5: Publish to GitHub Packages"
473
- run: |
474
- echo "📦 === PASO 5: PUBLICANDO EN GITHUB PACKAGES ==="
475
- if [ "${{ needs.ai-version-generation.outputs.is_prerelease }}" = "true" ]; then
476
- echo "📦 Publishing prerelease to GitHub Packages with tag: ${{ needs.ai-version-generation.outputs.release_channel }}"
477
- npm publish --access public --tag ${{ needs.ai-version-generation.outputs.release_channel }}
478
- else
479
- echo "📦 Publishing stable release to GitHub Packages"
480
- npm publish --access public
481
- fi
482
- echo "✅ Publicación en GitHub Packages completada"
483
- env:
484
- NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
485
-
486
- # ===== STEP 5: GITHUB RELEASE WITH AI =====
487
- create-github-release:
488
- runs-on: ubuntu-latest
489
- needs: [ai-version-generation, build-and-prepare, publish-subpackages, publish-npm, publish-github, deploy-docs-demo]
490
- if: always() && needs.ai-version-generation.outputs.should_skip != 'true' && needs.build-and-prepare.result == 'success'
491
-
492
- permissions:
493
- contents: write
494
-
495
- steps:
496
- - name: "📥 Checkout code"
497
- uses: actions/checkout@v4
498
- with:
499
- fetch-depth: 0
500
- ref: main
501
-
502
- - name: "📦 Setup Bun"
503
- uses: oven-sh/setup-bun@v2
504
- with:
505
- bun-version: latest
506
-
507
- - name: "🔧 Install dependencies"
508
- run: bun install --frozen-lockfile
509
-
510
- - name: "📥 Download build artifacts"
511
- uses: actions/download-artifact@v4
512
- with:
513
- name: build-artifacts-${{ needs.ai-version-generation.outputs.version }}
514
- path: dist/
515
-
516
- - name: "🏷️ Create git tag"
517
- run: |
518
- echo "🏷️ Creando tag de git..."
519
- git config user.name "github-actions[bot]"
520
- git config user.email "github-actions[bot]@users.noreply.github.com"
521
- git tag -a "${{ needs.ai-version-generation.outputs.tag }}" -m "Release ${{ needs.ai-version-generation.outputs.version }}"
522
- git push origin --tags
523
-
524
- - name: "🚀 Step 6: Create GitHub Release with AI"
525
- run: |
526
- echo "🚀 === PASO 6: CREANDO GITHUB RELEASE CON AI ==="
527
- bun project-utils/github-release-manager.ts --auto-approve
528
- echo "✅ GitHub Release creado exitosamente"
529
- env:
530
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
531
-
532
- # ===== RELEASE SUMMARY =====
533
- release-summary:
534
- runs-on: ubuntu-latest
535
- needs: [ai-version-generation, build-and-prepare, publish-subpackages, publish-npm, publish-github, deploy-docs-demo, create-github-release]
536
- if: always() && needs.ai-version-generation.outputs.should_skip != 'true'
537
-
538
- steps:
539
- - name: "📊 Comprehensive Release Summary"
540
- run: |
541
- VERSION="${{ needs.ai-version-generation.outputs.version }}"
542
- TAG="${{ needs.ai-version-generation.outputs.tag }}"
543
- CHANNEL="${{ needs.ai-version-generation.outputs.release_channel }}"
544
- IS_PRERELEASE="${{ needs.ai-version-generation.outputs.is_prerelease }}"
545
-
546
- echo "## 🎉 Full Release Pipeline Complete!" >> $GITHUB_STEP_SUMMARY
547
- echo "- **Version**: $VERSION" >> $GITHUB_STEP_SUMMARY
548
- echo "- **Channel**: $CHANNEL" >> $GITHUB_STEP_SUMMARY
549
- echo "- **Prerelease**: $IS_PRERELEASE" >> $GITHUB_STEP_SUMMARY
550
- echo "" >> $GITHUB_STEP_SUMMARY
551
-
552
- echo "### 📊 Pipeline Steps Results" >> $GITHUB_STEP_SUMMARY
553
- echo "1. **AI Version Generation**: ✅ $VERSION" >> $GITHUB_STEP_SUMMARY
554
- echo "2. **Build & Prepare**: ${{ needs.build-and-prepare.result }}" >> $GITHUB_STEP_SUMMARY
555
- echo "3. **Sub-Packages Publishing**: ${{ needs.publish-subpackages.result }}" >> $GITHUB_STEP_SUMMARY
556
- echo "4. **Main NPM Publishing**: ${{ needs.publish-npm.result }}" >> $GITHUB_STEP_SUMMARY
557
- echo "5. **GitHub Packages**: ${{ needs.publish-github.result }}" >> $GITHUB_STEP_SUMMARY
558
- echo "6. **Docs & Demo Deployment**: ${{ needs.deploy-docs-demo.result }}" >> $GITHUB_STEP_SUMMARY
559
- echo "7. **GitHub Release**: ${{ needs.create-github-release.result }}" >> $GITHUB_STEP_SUMMARY
560
- echo "" >> $GITHUB_STEP_SUMMARY
561
-
562
- echo "### 🔗 Links" >> $GITHUB_STEP_SUMMARY
563
- if [ "${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.target_registry == 'npm' || github.event.inputs.target_registry == 'both')) }}" = "true" ]; then
564
- echo "- **Main Package**: https://www.npmjs.com/package/@mks2508/better-logger" >> $GITHUB_STEP_SUMMARY
565
- echo "- **Core Package**: https://www.npmjs.com/package/@mks2508/better-logger-core" >> $GITHUB_STEP_SUMMARY
566
- echo "- **Styling Package**: https://www.npmjs.com/package/@mks2508/better-logger-styling" >> $GITHUB_STEP_SUMMARY
567
- echo "- **Exports Package**: https://www.npmjs.com/package/@mks2508/better-logger-exports" >> $GITHUB_STEP_SUMMARY
568
- fi
569
- if [ "${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.target_registry == 'github' || github.event.inputs.target_registry == 'both') }}" = "true" ]; then
570
- echo "- **GitHub Packages**: https://github.com/MKS2508/advanced-logger/packages/" >> $GITHUB_STEP_SUMMARY
571
- fi
572
- echo "- **GitHub Release**: https://github.com/MKS2508/advanced-logger/releases/tag/$TAG" >> $GITHUB_STEP_SUMMARY
573
- echo "" >> $GITHUB_STEP_SUMMARY
574
-
575
- echo "### 📦 Installation" >> $GITHUB_STEP_SUMMARY
576
- echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
577
- if [ "$IS_PRERELEASE" = "true" ]; then
578
- echo "npm install @mks2508/better-logger@$CHANNEL" >> $GITHUB_STEP_SUMMARY
579
- else
580
- echo "npm install @mks2508/better-logger" >> $GITHUB_STEP_SUMMARY
581
- fi
582
- echo "\`\`\`" >> $GITHUB_STEP_SUMMARY