@mks2508/better-logger 0.0.2-alpha.0 → 0.3.0

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 (325) hide show
  1. package/.claude/settings.local.json +24 -2
  2. package/.github/workflows/ci-quality.yml +357 -0
  3. package/.github/workflows/docs-demo.yml +119 -0
  4. package/.github/workflows/releases-core.yml +512 -0
  5. package/.github/workflows/releases-full.yml +582 -0
  6. package/.github/{workflows → workflows-backup}/ci.yml +14 -100
  7. package/.github/workflows-backup/nightly.yml +196 -0
  8. package/.github/workflows-backup/release-optimized.yml +373 -0
  9. package/.github/{workflows → workflows-backup}/release.yml +22 -1
  10. package/.release-notes-0.2.0.md +129 -0
  11. package/.yamllint +28 -0
  12. package/CHANGELOG.json +783 -0
  13. package/CLAUDE.md +92 -1
  14. package/README.md +198 -490
  15. package/bun.lock +323 -0
  16. package/demo.html +9 -2
  17. package/dist/.tsbuildinfo +1 -0
  18. package/dist/Logger.d.ts +272 -0
  19. package/dist/Logger.d.ts.map +1 -0
  20. package/dist/Logger.js +680 -0
  21. package/dist/ScopedLogger.d.ts +126 -0
  22. package/dist/ScopedLogger.d.ts.map +1 -0
  23. package/dist/ScopedLogger.js +234 -0
  24. package/dist/chunks/Logger-BpeuYIxR.js +2 -0
  25. package/dist/chunks/Logger-BpeuYIxR.js.map +1 -0
  26. package/dist/chunks/Logger-Didxtr23.js +3275 -0
  27. package/dist/chunks/Logger-Didxtr23.js.map +1 -0
  28. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
  29. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
  30. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
  31. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
  32. package/dist/chunks/environment-Bxbnw4pd.js +544 -0
  33. package/dist/chunks/environment-Bxbnw4pd.js.map +1 -0
  34. package/dist/chunks/environment-Dm66zOML.js +4 -0
  35. package/dist/chunks/environment-Dm66zOML.js.map +1 -0
  36. package/dist/chunks/formatting-C0riPC5_.js +95 -0
  37. package/dist/chunks/formatting-C0riPC5_.js.map +1 -0
  38. package/dist/chunks/formatting-DNCAV66-.js +2 -0
  39. package/dist/chunks/formatting-DNCAV66-.js.map +1 -0
  40. package/dist/cli/CommandProcessor.d.ts +103 -0
  41. package/dist/cli/CommandProcessor.d.ts.map +1 -0
  42. package/dist/cli/CommandProcessor.js +184 -0
  43. package/dist/cli/commands/ConfigCommand.d.ts +17 -0
  44. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
  45. package/dist/cli/commands/ConfigCommand.js +88 -0
  46. package/dist/cli/commands/ExportCommand.d.ts +51 -0
  47. package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
  48. package/dist/cli/commands/ExportCommand.js +243 -0
  49. package/dist/cli/commands/HistoryCommand.d.ts +50 -0
  50. package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
  51. package/dist/cli/commands/HistoryCommand.js +96 -0
  52. package/dist/cli/commands/StatusCommand.d.ts +33 -0
  53. package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
  54. package/dist/cli/commands/StatusCommand.js +93 -0
  55. package/dist/cli/commands/ThemeCommand.d.ts +33 -0
  56. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
  57. package/dist/cli/commands/ThemeCommand.js +79 -0
  58. package/dist/cli/help.d.ts +15 -0
  59. package/dist/cli/help.d.ts.map +1 -0
  60. package/dist/cli/help.js +118 -0
  61. package/dist/cli/index.d.ts +15 -0
  62. package/dist/cli/index.d.ts.map +1 -0
  63. package/dist/cli/index.js +46 -0
  64. package/dist/constants.d.ts +122 -0
  65. package/dist/constants.d.ts.map +1 -0
  66. package/dist/constants.js +159 -0
  67. package/dist/core.cjs +1 -1
  68. package/dist/core.cjs.map +1 -1
  69. package/dist/core.d.ts +134 -0
  70. package/dist/core.d.ts.map +1 -0
  71. package/dist/core.js +315 -242
  72. package/dist/core.js.map +1 -1
  73. package/dist/example.d.ts +18 -0
  74. package/dist/example.d.ts.map +1 -0
  75. package/dist/example.js +154 -0
  76. package/dist/exports-module.d.ts +203 -0
  77. package/dist/exports-module.d.ts.map +1 -0
  78. package/dist/exports-module.js +260 -0
  79. package/dist/exports.cjs +1 -1
  80. package/dist/exports.cjs.map +1 -1
  81. package/dist/exports.js +5 -4
  82. package/dist/exports.js.map +1 -1
  83. package/dist/handlers/AnalyticsLogHandler.d.ts +11 -0
  84. package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  85. package/dist/handlers/AnalyticsLogHandler.js +19 -0
  86. package/dist/handlers/ExportLogHandler.d.ts +103 -0
  87. package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
  88. package/dist/handlers/ExportLogHandler.js +516 -0
  89. package/dist/handlers/FileLogHandler.d.ts +36 -0
  90. package/dist/handlers/FileLogHandler.d.ts.map +1 -0
  91. package/dist/handlers/FileLogHandler.js +156 -0
  92. package/dist/handlers/RemoteLogHandler.d.ts +14 -0
  93. package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
  94. package/dist/handlers/RemoteLogHandler.js +37 -0
  95. package/dist/handlers/index.d.ts +8 -0
  96. package/dist/handlers/index.d.ts.map +1 -0
  97. package/dist/handlers/index.js +7 -0
  98. package/dist/index.cjs +1 -1
  99. package/dist/index.cjs.map +1 -1
  100. package/dist/index.d.ts +86 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +89 -103
  103. package/dist/index.js.map +1 -1
  104. package/dist/main.d.ts +2 -0
  105. package/dist/main.d.ts.map +1 -0
  106. package/dist/main.js +139 -0
  107. package/dist/styling/LogStyleBuilder.d.ts +149 -0
  108. package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
  109. package/dist/styling/LogStyleBuilder.js +289 -0
  110. package/dist/styling/SemanticStyles.d.ts +181 -0
  111. package/dist/styling/SemanticStyles.d.ts.map +1 -0
  112. package/dist/styling/SemanticStyles.js +339 -0
  113. package/dist/styling/SmartPresets.d.ts +25 -0
  114. package/dist/styling/SmartPresets.d.ts.map +1 -0
  115. package/dist/styling/SmartPresets.js +276 -0
  116. package/dist/styling/StyleBuilder.d.ts +140 -0
  117. package/dist/styling/StyleBuilder.d.ts.map +1 -0
  118. package/dist/styling/StyleBuilder.js +280 -0
  119. package/dist/styling/banners.d.ts +45 -0
  120. package/dist/styling/banners.d.ts.map +1 -0
  121. package/dist/styling/banners.js +155 -0
  122. package/dist/styling/index.d.ts +10 -0
  123. package/dist/styling/index.d.ts.map +1 -0
  124. package/dist/styling/index.js +9 -0
  125. package/dist/styling/themes.d.ts +10 -0
  126. package/dist/styling/themes.d.ts.map +1 -0
  127. package/dist/styling/themes.js +231 -0
  128. package/dist/styling-module.d.ts +185 -0
  129. package/dist/styling-module.d.ts.map +1 -0
  130. package/dist/styling-module.js +199 -0
  131. package/dist/styling.cjs +1 -1
  132. package/dist/styling.cjs.map +1 -1
  133. package/dist/styling.js +6 -6
  134. package/dist/styling.js.map +1 -1
  135. package/dist/types/Logger.d.ts +268 -0
  136. package/dist/types/Logger.d.ts.map +1 -0
  137. package/dist/types/ScopedLogger.d.ts +123 -0
  138. package/dist/types/ScopedLogger.d.ts.map +1 -0
  139. package/dist/types/cli/CommandProcessor.d.ts +100 -0
  140. package/dist/types/cli/CommandProcessor.d.ts.map +1 -0
  141. package/dist/types/cli/commands/ConfigCommand.d.ts +14 -0
  142. package/dist/types/cli/commands/ConfigCommand.d.ts.map +1 -0
  143. package/dist/types/cli/commands/ExportCommand.d.ts +48 -0
  144. package/dist/types/cli/commands/ExportCommand.d.ts.map +1 -0
  145. package/dist/types/cli/commands/HistoryCommand.d.ts +47 -0
  146. package/dist/types/cli/commands/HistoryCommand.d.ts.map +1 -0
  147. package/dist/types/cli/commands/StatusCommand.d.ts +30 -0
  148. package/dist/types/cli/commands/StatusCommand.d.ts.map +1 -0
  149. package/dist/types/cli/commands/ThemeCommand.d.ts +30 -0
  150. package/dist/types/cli/commands/ThemeCommand.d.ts.map +1 -0
  151. package/dist/types/cli/help.d.ts +12 -0
  152. package/dist/types/cli/help.d.ts.map +1 -0
  153. package/dist/types/cli/index.d.ts +15 -0
  154. package/dist/types/cli/index.d.ts.map +1 -0
  155. package/dist/types/constants.d.ts +119 -0
  156. package/dist/types/constants.d.ts.map +1 -0
  157. package/dist/types/core.d.ts +125 -211
  158. package/dist/types/core.d.ts.map +1 -0
  159. package/dist/types/core.js +13 -0
  160. package/dist/types/example.d.ts +18 -0
  161. package/dist/types/example.d.ts.map +1 -0
  162. package/dist/types/exports-module.d.ts +196 -0
  163. package/dist/types/exports-module.d.ts.map +1 -0
  164. package/dist/types/handlers/AnalyticsLogHandler.d.ts +8 -0
  165. package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  166. package/dist/types/handlers/ExportLogHandler.d.ts +100 -0
  167. package/dist/types/handlers/ExportLogHandler.d.ts.map +1 -0
  168. package/dist/types/handlers/FileLogHandler.d.ts +33 -0
  169. package/dist/types/handlers/FileLogHandler.d.ts.map +1 -0
  170. package/dist/types/handlers/RemoteLogHandler.d.ts +11 -0
  171. package/dist/types/handlers/RemoteLogHandler.d.ts.map +1 -0
  172. package/dist/types/handlers/index.d.ts +8 -0
  173. package/dist/types/handlers/index.d.ts.map +1 -0
  174. package/dist/types/handlers.d.ts +88 -0
  175. package/dist/types/handlers.d.ts.map +1 -0
  176. package/dist/types/handlers.js +4 -0
  177. package/dist/types/index.d.ts +7 -675
  178. package/dist/types/index.d.ts.map +1 -0
  179. package/dist/types/index.js +4 -0
  180. package/dist/types/main.d.ts +2 -0
  181. package/dist/types/main.d.ts.map +1 -0
  182. package/dist/types/styling/LogStyleBuilder.d.ts +146 -0
  183. package/dist/types/styling/LogStyleBuilder.d.ts.map +1 -0
  184. package/dist/types/styling/SemanticStyles.d.ts +178 -0
  185. package/dist/types/styling/SemanticStyles.d.ts.map +1 -0
  186. package/dist/types/styling/SmartPresets.d.ts +22 -0
  187. package/dist/types/styling/SmartPresets.d.ts.map +1 -0
  188. package/dist/types/styling/StyleBuilder.d.ts +140 -0
  189. package/dist/types/styling/StyleBuilder.d.ts.map +1 -0
  190. package/dist/types/styling/banners.d.ts +42 -0
  191. package/dist/types/styling/banners.d.ts.map +1 -0
  192. package/dist/types/styling/index.d.ts +10 -0
  193. package/dist/types/styling/index.d.ts.map +1 -0
  194. package/dist/types/styling/themes.d.ts +7 -0
  195. package/dist/types/styling/themes.d.ts.map +1 -0
  196. package/dist/types/styling-module.d.ts +178 -0
  197. package/dist/types/styling-module.d.ts.map +1 -0
  198. package/dist/types/types/core.d.ts +125 -0
  199. package/dist/types/types/core.d.ts.map +1 -0
  200. package/dist/types/types/handlers.d.ts +85 -0
  201. package/dist/types/types/handlers.d.ts.map +1 -0
  202. package/dist/types/types/index.d.ts +7 -0
  203. package/dist/types/types/index.d.ts.map +1 -0
  204. package/dist/types/utils/environment.d.ts +47 -0
  205. package/dist/types/utils/environment.d.ts.map +1 -0
  206. package/dist/types/utils/formatting.d.ts +37 -0
  207. package/dist/types/utils/formatting.d.ts.map +1 -0
  208. package/dist/types/utils/index.d.ts +7 -0
  209. package/dist/types/utils/index.d.ts.map +1 -0
  210. package/dist/types/utils/opentui-detection.d.ts +34 -0
  211. package/dist/types/utils/opentui-detection.d.ts.map +1 -0
  212. package/dist/types/utils/output.d.ts +41 -0
  213. package/dist/types/utils/output.d.ts.map +1 -0
  214. package/dist/types/utils/stackTrace.d.ts +6 -0
  215. package/dist/types/utils/stackTrace.d.ts.map +1 -0
  216. package/dist/types/utils/timestamps.d.ts +20 -0
  217. package/dist/types/utils/timestamps.d.ts.map +1 -0
  218. package/dist/utils/environment.d.ts +47 -0
  219. package/dist/utils/environment.d.ts.map +1 -0
  220. package/dist/utils/environment.js +85 -0
  221. package/dist/utils/formatting.d.ts +40 -0
  222. package/dist/utils/formatting.d.ts.map +1 -0
  223. package/dist/utils/formatting.js +117 -0
  224. package/dist/utils/index.d.ts +7 -0
  225. package/dist/utils/index.d.ts.map +1 -0
  226. package/dist/utils/index.js +6 -0
  227. package/dist/utils/opentui-detection.d.ts +34 -0
  228. package/dist/utils/opentui-detection.d.ts.map +1 -0
  229. package/dist/utils/opentui-detection.js +116 -0
  230. package/dist/utils/output.d.ts +44 -0
  231. package/dist/utils/output.d.ts.map +1 -0
  232. package/dist/utils/output.js +150 -0
  233. package/dist/utils/stackTrace.d.ts +9 -0
  234. package/dist/utils/stackTrace.d.ts.map +1 -0
  235. package/dist/utils/stackTrace.js +81 -0
  236. package/dist/utils/timestamps.d.ts +20 -0
  237. package/dist/utils/timestamps.d.ts.map +1 -0
  238. package/dist/utils/timestamps.js +71 -0
  239. package/docs/API.md +691 -0
  240. package/docs/CORE.md +10 -10
  241. package/docs/DEVELOPMENT.md +731 -0
  242. package/docs/PACKAGES.md +244 -0
  243. package/docs/_config.yml +36 -0
  244. package/docs/index.md +179 -0
  245. package/examples/README.md +208 -0
  246. package/examples/basic-logging.js +75 -0
  247. package/examples/data-export.js +234 -0
  248. package/examples/package.json +16 -0
  249. package/examples/performance-timing.js +170 -0
  250. package/examples/simplified-api.js +124 -0
  251. package/examples/styling-themes.js +207 -0
  252. package/package.json +45 -19
  253. package/packages/core/package.json +57 -0
  254. package/packages/exports/package.json +41 -0
  255. package/packages/nodejs-opentui/README.md +232 -0
  256. package/packages/nodejs-opentui/package.json +72 -0
  257. package/packages/nodejs-opentui/src/LogRenderer.ts +171 -0
  258. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +178 -0
  259. package/packages/nodejs-opentui/src/components/LogBadge.tsx +131 -0
  260. package/packages/nodejs-opentui/src/index.ts +133 -0
  261. package/packages/nodejs-opentui/src/types.ts +158 -0
  262. package/packages/nodejs-opentui/tsconfig.json +20 -0
  263. package/packages/styling/package.json +41 -0
  264. package/project-utils/README.md +172 -0
  265. package/project-utils/auto-release-gemini.ts +1193 -0
  266. package/project-utils/auto-release-ui.ts +1329 -0
  267. package/project-utils/commit-generator.ts +1385 -0
  268. package/project-utils/commit-ui.ts +264 -0
  269. package/project-utils/git-utils.ts +199 -0
  270. package/project-utils/github-release-manager.ts +466 -0
  271. package/project-utils/project-config.ts +260 -0
  272. package/project-utils/prompt-templates.js +345 -0
  273. package/project-utils/prompt-templates.ts +422 -0
  274. package/project-utils/version-manager.ts +1078 -0
  275. package/src/Logger.ts +251 -16
  276. package/src/ScopedLogger.ts +262 -0
  277. package/src/cli/CommandProcessor.ts +173 -2
  278. package/src/cli/commands/HistoryCommand.ts +117 -0
  279. package/src/cli/index.ts +12 -0
  280. package/src/constants.ts +84 -2
  281. package/src/core.ts +119 -46
  282. package/src/example.ts +4 -4
  283. package/src/exports-module.ts +1 -1
  284. package/src/handlers/ExportLogHandler.ts +141 -0
  285. package/src/handlers/FileLogHandler.ts +144 -5
  286. package/src/index.ts +1 -1
  287. package/src/main.ts +3 -3
  288. package/src/styling/LogStyleBuilder.ts +355 -0
  289. package/src/styling/SemanticStyles.ts +380 -0
  290. package/src/styling/SmartPresets.ts +288 -0
  291. package/src/styling/StyleBuilder.ts +14 -0
  292. package/src/styling/index.ts +16 -1
  293. package/src/styling-module.ts +1 -1
  294. package/src/types/core.ts +60 -0
  295. package/src/types/index.ts +6 -0
  296. package/src/utils/environment.ts +94 -0
  297. package/src/utils/formatting.ts +142 -0
  298. package/src/utils/index.ts +3 -0
  299. package/src/utils/opentui-detection.ts +138 -0
  300. package/src/utils/output.ts +66 -8
  301. package/test-core-browser.html +237 -0
  302. package/test-core-node.js +63 -0
  303. package/tests/test-conflict-resolution.ts +391 -0
  304. package/tests/validate-workflows.sh +131 -0
  305. package/tests/yaml-autofix.sh +146 -0
  306. package/vite.config.ts +189 -50
  307. package/dist/chunks/Logger-BQhMKy_T.js +0 -2
  308. package/dist/chunks/Logger-BQhMKy_T.js.map +0 -1
  309. package/dist/chunks/Logger-BrFKFZcD.js +0 -978
  310. package/dist/chunks/Logger-BrFKFZcD.js.map +0 -1
  311. package/dist/chunks/core-2opW4Pi3.js +0 -194
  312. package/dist/chunks/core-2opW4Pi3.js.map +0 -1
  313. package/dist/chunks/core-DyugwSYZ.js +0 -4
  314. package/dist/chunks/core-DyugwSYZ.js.map +0 -1
  315. package/dist/chunks/exports-BNP3R7dp.js +0 -421
  316. package/dist/chunks/exports-BNP3R7dp.js.map +0 -1
  317. package/dist/chunks/exports-U1xLBXrY.js +0 -2
  318. package/dist/chunks/exports-U1xLBXrY.js.map +0 -1
  319. package/dist/chunks/styling-DhUDzwlE.js +0 -654
  320. package/dist/chunks/styling-DhUDzwlE.js.map +0 -1
  321. package/dist/chunks/styling-tmRDI28D.js +0 -2
  322. package/dist/chunks/styling-tmRDI28D.js.map +0 -1
  323. package/dist/types/exports.d.ts +0 -600
  324. package/dist/types/styling.d.ts +0 -751
  325. package/src/Logger.ts.backup +0 -1684
@@ -8,9 +8,31 @@
8
8
  "Bash(npm publish:*)",
9
9
  "Bash(git commit:*)",
10
10
  "Bash(git push:*)",
11
- "Bash(npm install:*)"
11
+ "Bash(npm install:*)",
12
+ "Bash(gh workflow view:*)",
13
+ "Bash(gh run list:*)",
14
+ "Bash(gh run view:*)",
15
+ "Bash(gh api:*)",
16
+ "Bash(gh run rerun:*)",
17
+ "Bash(gh workflow run:*)",
18
+ "Bash(bun:*)",
19
+ "Bash(npm view:*)",
20
+ "WebFetch(domain:github.com)",
21
+ "Bash(sed:*)",
22
+ "Bash(python3:*)",
23
+ "Bash(gh workflow:*)",
24
+ "Bash(yamllint:*)",
25
+ "Bash(git stash:*)",
26
+ "Bash(git pull:*)",
27
+ "Bash(npm config set:*)",
28
+ "Bash(git rebase:*)",
29
+ "Bash(find:*)",
30
+ "Bash(npm run type-check:*)"
12
31
  ],
13
32
  "deny": [],
14
- "ask": []
33
+ "ask": [],
34
+ "additionalDirectories": [
35
+ "/Users/mks/gemini-commit-wizard"
36
+ ]
15
37
  }
16
38
  }
@@ -0,0 +1,357 @@
1
+ ---
2
+ name: CI Quality & Testing
3
+
4
+ on:
5
+ push:
6
+ branches: [main, develop]
7
+ pull_request:
8
+ branches: [main, develop]
9
+ workflow_dispatch:
10
+ inputs:
11
+ run_performance:
12
+ description: 'Ejecutar tests de performance'
13
+ required: false
14
+ default: true
15
+ type: boolean
16
+ run_visual:
17
+ description: 'Ejecutar tests visuales'
18
+ required: false
19
+ default: false
20
+ type: boolean
21
+
22
+ env:
23
+ NODE_VERSION: '20'
24
+
25
+ jobs:
26
+ # ===== MATRIX TESTING =====
27
+ test-matrix:
28
+ runs-on: ubuntu-latest
29
+
30
+ strategy:
31
+ fail-fast: false
32
+ matrix:
33
+ bun-version: ["1.0", "latest"]
34
+ build-mode: [full, core, styling, exports]
35
+
36
+ name: Test Bun ${{ matrix.bun-version }} - ${{ matrix.build-mode }}
37
+
38
+ steps:
39
+ - name: "📥 Checkout code"
40
+ uses: actions/checkout@v4
41
+ with:
42
+ fetch-depth: 0
43
+
44
+ - name: "📦 Setup Bun ${{ matrix.bun-version }}"
45
+ uses: oven-sh/setup-bun@v2
46
+ with:
47
+ bun-version: ${{ matrix.bun-version }}
48
+
49
+ - name: "🔧 Install dependencies"
50
+ run: bun install --frozen-lockfile
51
+
52
+ - name: 🔍 Type checking
53
+ run: bun run type-check
54
+
55
+ - name: "🏗️ Build ${{ matrix.build-mode }}"
56
+ run: |
57
+ if [ "${{ matrix.build-mode }}" = "full" ]; then
58
+ bun run build:all
59
+ else
60
+ bun run build:${{ matrix.build-mode }}
61
+ fi
62
+
63
+ - name: "🧪 Run tests"
64
+ run: bun run ci:test
65
+
66
+ - name: 📊 Check bundle sizes
67
+ run: bun run size-limit
68
+
69
+ - name: "📤 Upload build artifacts (Node 20 only)"
70
+ uses: actions/upload-artifact@v4
71
+ if: matrix.node-version == 20
72
+ with:
73
+ name: build-${{ matrix.build-mode }}-node${{ matrix.node-version }}
74
+ path: dist/
75
+ retention-days: 7
76
+
77
+ # ===== PERFORMANCE TESTING =====
78
+ performance-tests:
79
+ runs-on: ubuntu-latest
80
+ needs: test-matrix
81
+ if: ${{ inputs.run_performance != false }}
82
+
83
+ steps:
84
+ - name: "📥 Checkout code"
85
+ uses: actions/checkout@v4
86
+
87
+ - name: "📦 Setup Node.js"
88
+ uses: actions/setup-node@v4
89
+ with:
90
+ node-version: ${{ env.NODE_VERSION }}
91
+ cache: 'npm'
92
+
93
+ - name: "🔧 Install dependencies"
94
+ run: bun install --frozen-lockfile
95
+
96
+ - name: "📥 Download build artifacts"
97
+ uses: actions/download-artifact@v4
98
+ with:
99
+ name: build-full-node20
100
+ path: dist/
101
+
102
+ - name: ⚡ Performance benchmarks
103
+ run: bun run test:performance
104
+
105
+ - name: 📊 Bundle analysis
106
+ run: |
107
+ echo "## 📦 Bundle Analysis Report" > performance-report.md
108
+ echo "### Size Breakdown" >> performance-report.md
109
+ echo "\`\`\`" >> performance-report.md
110
+ ls -la dist/ >> performance-report.md
111
+ echo "\`\`\`" >> performance-report.md
112
+
113
+ echo "### File Sizes by Module" >> performance-report.md
114
+ for module in core styling exports; do
115
+ if [ -d "dist/modular/$module" ]; then
116
+ echo "#### $module Module" >> performance-report.md
117
+ echo "\`\`\`" >> performance-report.md
118
+ ls -la dist/modular/$module/ >> performance-report.md
119
+ echo "\`\`\`" >> performance-report.md
120
+ fi
121
+ done
122
+
123
+ echo "### Performance Metrics" >> performance-report.md
124
+ echo "- **Build Time**: $(date)" >> performance-report.md
125
+ echo "- **Node Version**: ${{ env.NODE_VERSION }}" >> performance-report.md
126
+
127
+ - name: "📤 Upload performance report"
128
+ uses: actions/upload-artifact@v4
129
+ with:
130
+ name: performance-report
131
+ path: performance-report.md
132
+ retention-days: 30
133
+
134
+ # ===== VISUAL TESTING =====
135
+ visual-tests:
136
+ runs-on: ubuntu-latest
137
+ needs: test-matrix
138
+ if: ${{ inputs.run_visual == true }}
139
+
140
+ steps:
141
+ - name: "📥 Checkout code"
142
+ uses: actions/checkout@v4
143
+
144
+ - name: "📦 Setup Node.js"
145
+ uses: actions/setup-node@v4
146
+ with:
147
+ node-version: ${{ env.NODE_VERSION }}
148
+ cache: 'npm'
149
+
150
+ - name: "🔧 Install dependencies"
151
+ run: bun install --frozen-lockfile
152
+
153
+ - name: "📥 Download build artifacts"
154
+ uses: actions/download-artifact@v4
155
+ with:
156
+ name: build-full-node20
157
+ path: dist/
158
+
159
+ - name: 🎭 Install Playwright
160
+ run: npx playwright install --with-deps chromium
161
+
162
+ - name: "🖼️ Run visual tests"
163
+ run: bun run test:visual
164
+
165
+ - name: "📤 Upload test results"
166
+ uses: actions/upload-artifact@v4
167
+ if: always()
168
+ with:
169
+ name: visual-test-results
170
+ path: test-results/
171
+ retention-days: 30
172
+
173
+ - name: "📤 Upload screenshots"
174
+ uses: actions/upload-artifact@v4
175
+ if: failure()
176
+ with:
177
+ name: visual-test-failures
178
+ path: test-results/
179
+ retention-days: 30
180
+
181
+ # ===== SECURITY AUDIT =====
182
+ security-audit:
183
+ runs-on: ubuntu-latest
184
+
185
+ steps:
186
+ - name: "📥 Checkout code"
187
+ uses: actions/checkout@v4
188
+
189
+ - name: "📦 Setup Node.js"
190
+ uses: actions/setup-node@v4
191
+ with:
192
+ node-version: ${{ env.NODE_VERSION }}
193
+ cache: 'npm'
194
+
195
+ - name: 🔒 Security audit
196
+ run: |
197
+ echo "🔒 Running security audit..."
198
+ npm audit --audit-level=high || echo "Security issues detected, review required"
199
+
200
+ - name: 📊 Check for outdated packages
201
+ run: |
202
+ echo "📊 Checking for outdated packages..."
203
+ npm outdated || true
204
+
205
+ - name: 🔍 Vulnerability report
206
+ run: |
207
+ echo "## 🔒 Security Audit Report" > security-report.md
208
+ echo "### NPM Audit Results" >> security-report.md
209
+ echo "\`\`\`" >> security-report.md
210
+ npm audit --audit-level=moderate >> security-report.md || echo "No critical vulnerabilities" >> security-report.md
211
+ echo "\`\`\`" >> security-report.md
212
+
213
+ echo "### Outdated Packages" >> security-report.md
214
+ echo "\`\`\`" >> security-report.md
215
+ npm outdated >> security-report.md || echo "All packages up to date" >> security-report.md
216
+ echo "\`\`\`" >> security-report.md
217
+
218
+ - name: "📤 Upload security report"
219
+ uses: actions/upload-artifact@v4
220
+ with:
221
+ name: security-report
222
+ path: security-report.md
223
+ retention-days: 30
224
+
225
+ # ===== CODE QUALITY ANALYSIS =====
226
+ code-quality:
227
+ runs-on: ubuntu-latest
228
+ needs: test-matrix
229
+
230
+ steps:
231
+ - name: "📥 Checkout code"
232
+ uses: actions/checkout@v4
233
+
234
+ - name: "📦 Setup Node.js"
235
+ uses: actions/setup-node@v4
236
+ with:
237
+ node-version: ${{ env.NODE_VERSION }}
238
+ cache: 'npm'
239
+
240
+ - name: "🔧 Install dependencies"
241
+ run: bun install --frozen-lockfile
242
+
243
+ - name: 🔍 Code analysis
244
+ run: |
245
+ echo "🔍 Analyzing code quality..."
246
+
247
+ # Análisis básico de código
248
+ echo "## 📊 Code Quality Report" > quality-report.md
249
+ echo "### TypeScript Analysis" >> quality-report.md
250
+ echo "\`\`\`" >> quality-report.md
251
+ bun run type-check >> quality-report.md 2>&1 || echo "TypeScript issues detected" >> quality-report.md
252
+ echo "\`\`\`" >> quality-report.md
253
+
254
+ echo "### File Statistics" >> quality-report.md
255
+ echo "- **Total TypeScript files**: $(find src/ -name '*.ts' | wc -l)" >> quality-report.md
256
+ echo "- **Total lines of code**: $(find src/ -name '*.ts' -exec wc -l {} + | tail -1 | awk '{print $1}')" >> quality-report.md
257
+ echo "- **Build date**: $(date)" >> quality-report.md
258
+
259
+ - name: "📤 Upload quality report"
260
+ uses: actions/upload-artifact@v4
261
+ with:
262
+ name: code-quality-report
263
+ path: quality-report.md
264
+ retention-days: 30
265
+
266
+ # ===== PROJECT UTILS VALIDATION =====
267
+ validate-project-utils:
268
+ runs-on: ubuntu-latest
269
+
270
+ steps:
271
+ - name: "📥 Checkout code"
272
+ uses: actions/checkout@v4
273
+
274
+ - name: "📦 Setup Node.js"
275
+ uses: actions/setup-node@v4
276
+ with:
277
+ node-version: ${{ env.NODE_VERSION }}
278
+ cache: 'npm'
279
+
280
+ - name: "🔧 Install dependencies"
281
+ run: bun install --frozen-lockfile
282
+
283
+ - name: "🧪 Test project-utils scripts"
284
+ run: |
285
+ echo "🧪 Validating project-utils scripts..."
286
+
287
+ # Verificar que los scripts existan y sean ejecutables
288
+ SCRIPTS=("commit-generator.ts" "version-manager.ts" "github-release-manager.ts" "auto-release-gemini.ts")
289
+
290
+ for script in "${SCRIPTS[@]}"; do
291
+ if [ -f "project-utils/$script" ]; then
292
+ echo "✅ $script exists"
293
+ # Verificar sintaxis básica
294
+ node --check "project-utils/$script" && echo "✅ $script syntax OK" || echo "❌ $script syntax error"
295
+ else
296
+ echo "❌ $script missing"
297
+ fi
298
+ done
299
+
300
+ - name: 📊 Validate package.json scripts
301
+ run: |
302
+ echo "📊 Validating package.json scripts..."
303
+
304
+ # Verificar scripts críticos
305
+ CRITICAL_SCRIPTS=("build" "build:all" "commit:auto" "version:auto" "workflow:full")
306
+
307
+ for script in "${CRITICAL_SCRIPTS[@]}"; do
308
+ if bun run --silent "$script" --help >/dev/null 2>&1; then
309
+ echo "✅ Script '$script' is valid"
310
+ else
311
+ echo "❌ Script '$script' has issues"
312
+ fi
313
+ done
314
+
315
+ # ===== COMPREHENSIVE SUMMARY =====
316
+ ci-summary:
317
+ runs-on: ubuntu-latest
318
+ needs: [test-matrix, performance-tests, visual-tests, security-audit, code-quality, validate-project-utils]
319
+ if: always()
320
+
321
+ steps:
322
+ - name: 📊 CI Quality Summary
323
+ run: |
324
+ echo "## 📊 CI Quality & Testing Summary" >> $GITHUB_STEP_SUMMARY
325
+ echo "" >> $GITHUB_STEP_SUMMARY
326
+
327
+ # Status de cada job
328
+ echo "### 🧪 Test Results" >> $GITHUB_STEP_SUMMARY
329
+ echo "- **Matrix Testing**: ${{ needs.test-matrix.result }}" >> $GITHUB_STEP_SUMMARY
330
+ echo "- **Performance Tests**: ${{ needs.performance-tests.result }}" >> $GITHUB_STEP_SUMMARY
331
+ echo "- **Visual Tests**: ${{ needs.visual-tests.result }}" >> $GITHUB_STEP_SUMMARY
332
+ echo "- **Security Audit**: ${{ needs.security-audit.result }}" >> $GITHUB_STEP_SUMMARY
333
+ echo "- **Code Quality**: ${{ needs.code-quality.result }}" >> $GITHUB_STEP_SUMMARY
334
+ echo "- **Project Utils**: ${{ needs.validate-project-utils.result }}" >> $GITHUB_STEP_SUMMARY
335
+ echo "" >> $GITHUB_STEP_SUMMARY
336
+
337
+ echo "### 📋 Coverage Matrix" >> $GITHUB_STEP_SUMMARY
338
+ echo "- **Node Versions**: 18, 20, 21" >> $GITHUB_STEP_SUMMARY
339
+ echo "- **Build Modes**: full, core, styling, exports" >> $GITHUB_STEP_SUMMARY
340
+ echo "- **Test Types**: unit, performance, visual, security" >> $GITHUB_STEP_SUMMARY
341
+ echo "" >> $GITHUB_STEP_SUMMARY
342
+
343
+ # Determinar estado general
344
+ if [ "${{ needs.test-matrix.result }}" = "success" ] && ["${{ needs.security-audit.result }}" = "success"] && ["${{ needs.code-quality.result }}" = "success"]; then
345
+ echo "### ✅ Overall Status: PASSED" >> $GITHUB_STEP_SUMMARY
346
+ echo "All critical quality checks passed successfully." >> $GITHUB_STEP_SUMMARY
347
+ else
348
+ echo "### ⚠️ Overall Status: ATTENTION REQUIRED" >> $GITHUB_STEP_SUMMARY
349
+ echo "Some quality checks require attention. Review individual job results." >> $GITHUB_STEP_SUMMARY
350
+ fi
351
+
352
+ echo "" >> $GITHUB_STEP_SUMMARY
353
+ echo "### 📎 Artifacts Generated" >> $GITHUB_STEP_SUMMARY
354
+ echo "- Build artifacts for all modules" >> $GITHUB_STEP_SUMMARY
355
+ echo "- Performance analysis report" >> $GITHUB_STEP_SUMMARY
356
+ echo "- Security audit report" >> $GITHUB_STEP_SUMMARY
357
+ echo "- Code quality metrics" >> $GITHUB_STEP_SUMMARY
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: Docs & Demo Deployment
3
+
4
+ on:
5
+ workflow_dispatch:
6
+ # Solo se ejecuta manualmente o cuando se llama desde otro workflow
7
+ workflow_call:
8
+
9
+ env:
10
+ NODE_VERSION: '20'
11
+
12
+ jobs:
13
+ # ===== BUILD DEMO =====
14
+ build-demo:
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: "📥 Checkout code"
19
+ uses: actions/checkout@v4
20
+
21
+ - name: "📦 Setup Bun"
22
+ uses: oven-sh/setup-bun@v2
23
+ with:
24
+ bun-version: latest
25
+ - name: "🔧 Install dependencies"
26
+ run: bun install --frozen-lockfile
27
+
28
+ - name: "🏗️ Build library for demo"
29
+ run: bun run build:full
30
+
31
+ - name: "🏗️ Setup demo structure"
32
+ run: |
33
+ mkdir -p _site/docs
34
+ # Copy demo as root
35
+ cp demo.html _site/index.html
36
+ cp index.html _site/dev.html
37
+ cp -r dist/ _site/dist/
38
+
39
+ # Create demo metadata
40
+ echo "## 📦 Demo Build Info" > _site/build-info.md
41
+ echo "- **Build Date**: $(date)" >> _site/build-info.md
42
+ echo "- **Commit**: ${{ github.sha }}" >> _site/build-info.md
43
+ echo "- **Version**: $(node -p 'require("./package.json").version')" >> _site/build-info.md
44
+
45
+ - name: "📤 Upload demo artifacts"
46
+ uses: actions/upload-artifact@v4
47
+ with:
48
+ name: demo-site
49
+ path: _site/
50
+ retention-days: 30
51
+
52
+ # ===== BUILD DOCS =====
53
+ build-docs:
54
+ runs-on: ubuntu-latest
55
+
56
+ steps:
57
+ - name: "📥 Checkout code"
58
+ uses: actions/checkout@v4
59
+
60
+ - name: "📤 Build Jekyll documentation"
61
+ uses: actions/jekyll-build-pages@v1
62
+ with:
63
+ source: ./docs
64
+ destination: ./_site/docs
65
+
66
+ - name: "📤 Upload docs artifacts"
67
+ uses: actions/upload-artifact@v4
68
+ with:
69
+ name: docs-site
70
+ path: _site/docs/
71
+ retention-days: 30
72
+
73
+ # ===== DEPLOY TO GITHUB PAGES =====
74
+ deploy-pages:
75
+ runs-on: ubuntu-latest
76
+ needs: [build-demo, build-docs]
77
+ if: github.ref == 'refs/heads/main'
78
+
79
+ permissions:
80
+ contents: read
81
+ pages: write
82
+ id-token: write
83
+
84
+ environment:
85
+ name: github-pages
86
+ url: ${{ steps.deployment.outputs.page_url }}
87
+
88
+ steps:
89
+ - name: "📥 Download demo artifacts"
90
+ uses: actions/download-artifact@v4
91
+ with:
92
+ name: demo-site
93
+ path: _site/
94
+
95
+ - name: "📥 Download docs artifacts"
96
+ uses: actions/download-artifact@v4
97
+ with:
98
+ name: docs-site
99
+ path: _site/docs/
100
+
101
+ - name: "📤 Setup Pages"
102
+ uses: actions/configure-pages@v4
103
+
104
+ - name: "📤 Upload to Pages"
105
+ uses: actions/upload-pages-artifact@v3
106
+ with:
107
+ path: ./_site
108
+
109
+ - name: "🚀 Deploy to GitHub Pages"
110
+ id: deployment
111
+ uses: actions/deploy-pages@v4
112
+
113
+ - name: 📊 Deployment summary
114
+ run: |
115
+ echo "## 📝 Documentation & Demo Deployed!" >> $GITHUB_STEP_SUMMARY
116
+ echo "- **Demo URL**: ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY
117
+ echo "- **Docs URL**: ${{ steps.deployment.outputs.page_url }}docs/" >> $GITHUB_STEP_SUMMARY
118
+ echo "- **Dev Demo**: ${{ steps.deployment.outputs.page_url }}dev.html" >> $GITHUB_STEP_SUMMARY
119
+ echo "- **Build Info**: ${{ steps.deployment.outputs.page_url }}build-info.md" >> $GITHUB_STEP_SUMMARY