mlform 0.1.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 (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +132 -0
  3. package/dist/FieldStrategy-pPekBtH-.js +2318 -0
  4. package/dist/ModelTypes-B9_veCKB.js +5 -0
  5. package/dist/ReportStrategy-DY3GC_mJ.js +23 -0
  6. package/dist/boolean-field-Cd3uhIPj.js +104 -0
  7. package/dist/category-field-D_Ms1x9u.js +73 -0
  8. package/dist/classifier-prediction-C5QzorTo.js +193 -0
  9. package/dist/custom-element-ttkHUa8w.js +13 -0
  10. package/dist/date-field-Cg_ja679.js +162 -0
  11. package/dist/error-card-BwjPChwf.js +195 -0
  12. package/dist/field-wrapper-DqIQl76d.js +177 -0
  13. package/dist/ml-layout-Dx63KKf7.js +332 -0
  14. package/dist/mlform/extensions.mjs +38 -0
  15. package/dist/mlform/strategies.mjs +292 -0
  16. package/dist/mlform.mjs +709 -0
  17. package/dist/number-field-CC2DrVEb.js +165 -0
  18. package/dist/property-jKFNMQpR.js +561 -0
  19. package/dist/range-field-Cr7LEtsJ.js +98 -0
  20. package/dist/regressor-prediction-C18dHlfK.js +236 -0
  21. package/dist/src/core/app/DescriptorItem.d.ts +6 -0
  22. package/dist/src/core/app/DescriptorRegistry.d.ts +13 -0
  23. package/dist/src/core/app/DescriptorService.d.ts +22 -0
  24. package/dist/src/core/app/DescriptorStrategy.d.ts +11 -0
  25. package/dist/src/core/app/index.d.ts +4 -0
  26. package/dist/src/core/domain/index.d.ts +24 -0
  27. package/dist/src/core/index.d.ts +3 -0
  28. package/dist/src/core/ui/error-card.d.ts +38 -0
  29. package/dist/src/core/ui/field-wrapper.d.ts +23 -0
  30. package/dist/src/core/ui/index.d.ts +3 -0
  31. package/dist/src/core/ui/ml-layout.d.ts +23 -0
  32. package/dist/src/extensions/app/FieldStrategy.d.ts +10 -0
  33. package/dist/src/extensions/app/ReportStrategy.d.ts +9 -0
  34. package/dist/src/extensions/app/index.d.ts +2 -0
  35. package/dist/src/extensions/domain/BaseField.d.ts +7 -0
  36. package/dist/src/extensions/domain/BaseModel.d.ts +6 -0
  37. package/dist/src/extensions/domain/index.d.ts +2 -0
  38. package/dist/src/extensions/index.d.ts +3 -0
  39. package/dist/src/extensions/ui/field-element.d.ts +9 -0
  40. package/dist/src/extensions/ui/index.d.ts +1 -0
  41. package/dist/src/index.d.ts +1 -0
  42. package/dist/src/mlform/index.d.ts +1 -0
  43. package/dist/src/mlform/mlform.d.ts +27 -0
  44. package/dist/src/mlform/mlform.types.d.ts +11 -0
  45. package/dist/src/strategies/app/BooleanStrategy.d.ts +12 -0
  46. package/dist/src/strategies/app/CategoryStrategy.d.ts +13 -0
  47. package/dist/src/strategies/app/ClassifierStrategy.d.ts +15 -0
  48. package/dist/src/strategies/app/DateStrategy.d.ts +15 -0
  49. package/dist/src/strategies/app/NumberStrategy.d.ts +29 -0
  50. package/dist/src/strategies/app/RegressorStrategy.d.ts +15 -0
  51. package/dist/src/strategies/app/TextStrategy.d.ts +16 -0
  52. package/dist/src/strategies/app/index.d.ts +7 -0
  53. package/dist/src/strategies/domain/BooleanField.d.ts +10 -0
  54. package/dist/src/strategies/domain/CategoryField.d.ts +11 -0
  55. package/dist/src/strategies/domain/ClassifierModel.d.ts +11 -0
  56. package/dist/src/strategies/domain/DateField.d.ts +13 -0
  57. package/dist/src/strategies/domain/FieldTypes.d.ts +7 -0
  58. package/dist/src/strategies/domain/ModelTypes.d.ts +4 -0
  59. package/dist/src/strategies/domain/NumberField.d.ts +15 -0
  60. package/dist/src/strategies/domain/RegressorModel.d.ts +11 -0
  61. package/dist/src/strategies/domain/TextField.d.ts +14 -0
  62. package/dist/src/strategies/domain/index.d.ts +9 -0
  63. package/dist/src/strategies/index.d.ts +1 -0
  64. package/dist/src/strategies/ui/boolean-field.d.ts +13 -0
  65. package/dist/src/strategies/ui/category-field.d.ts +14 -0
  66. package/dist/src/strategies/ui/classifier-prediction.d.ts +39 -0
  67. package/dist/src/strategies/ui/date-field.d.ts +18 -0
  68. package/dist/src/strategies/ui/index.d.ts +8 -0
  69. package/dist/src/strategies/ui/number-field.d.ts +19 -0
  70. package/dist/src/strategies/ui/range-field.d.ts +17 -0
  71. package/dist/src/strategies/ui/regressor-prediction.d.ts +29 -0
  72. package/dist/src/strategies/ui/text-field.d.ts +17 -0
  73. package/dist/state-CLlTRyl1.js +12 -0
  74. package/dist/test/_fixtures/DummyField.d.ts +9 -0
  75. package/dist/test/setup.d.ts +1 -0
  76. package/dist/test/unit/DummyField.test.d.ts +1 -0
  77. package/dist/text-field-DwP-Fa1w.js +114 -0
  78. package/package.json +57 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Pablo Ulloa Santín
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # MLForm
2
+
3
+ [![CI Pipeline](https://github.com/UlloaSP/mlform/actions/workflows/ci.yml/badge.svg)](https://github.com/UlloaSP/mlform/actions/workflows/ci.yml)
4
+ [![Release](https://github.com/UlloaSP/mlform/actions/workflows/release.yml/badge.svg)](https://github.com/UlloaSP/mlform/actions/workflows/release.yml)
5
+
6
+ Un framework para crear formularios dinámicos con capacidades de machine learning.
7
+
8
+ ## 🚀 Características
9
+
10
+ - **Formularios dinámicos**: Genera formularios basados en esquemas JSON
11
+ - **Integración ML**: Soporte para modelos de clasificación y regresión
12
+ - **Web Components**: Componentes reutilizables basados en Lit
13
+ - **TypeScript**: Totalmente tipado para mejor DX
14
+ - **Validación**: Validación robusta con Zod
15
+
16
+ ## 📦 Instalación
17
+
18
+ ```bash
19
+ npm install mlform
20
+ ```
21
+
22
+ ## 🏗️ Desarrollo
23
+
24
+ ### Requisitos previos
25
+
26
+ - Node.js >= 18
27
+ - npm >= 9
28
+
29
+ ### Configuración del entorno
30
+
31
+ ```bash
32
+ # Clonar el repositorio
33
+ git clone https://github.com/UlloaSP/mlform.git
34
+ cd mlform
35
+
36
+ # Instalar dependencias
37
+ npm install
38
+
39
+ # Ejecutar tests
40
+ npm test
41
+
42
+ # Verificar código
43
+ npm run lint
44
+
45
+ # Formatear código
46
+ npm run format
47
+
48
+ # Verificar tipos
49
+ npm run type
50
+
51
+ # Construir proyecto
52
+ npm run build
53
+
54
+ # Generar documentación
55
+ npm run docs
56
+ ```
57
+
58
+ ### Scripts disponibles
59
+
60
+ - `npm run lint` - Ejecuta ESLint
61
+ - `npm run lint:fix` - Corrige automáticamente los errores de linting
62
+ - `npm run format` - Formatea el código con Prettier
63
+ - `npm run format:check` - Verifica el formato del código
64
+ - `npm run type` - Verifica tipos con TypeScript
65
+ - `npm run test` - Ejecuta tests con Vitest
66
+ - `npm run test:watch` - Ejecuta tests en modo watch
67
+ - `npm run coverage` - Genera reporte de cobertura
68
+ - `npm run build` - Construye el proyecto para producción
69
+ - `npm run docs` - Genera documentación con TypeDoc
70
+ - `npm run ci` - Ejecuta todo el pipeline de CI localmente
71
+
72
+ ## 🔄 CI/CD Pipeline
73
+
74
+ El proyecto incluye un pipeline completo de CI/CD con GitHub Actions:
75
+
76
+ ### Pipeline de CI (`.github/workflows/ci.yml`)
77
+
78
+ Se ejecuta en cada push y pull request e incluye:
79
+
80
+ 1. **🔍 Lint & Format** - Verificación de código con ESLint y Prettier
81
+ 2. **📝 Type Check** - Verificación de tipos TypeScript
82
+ 3. **🧪 Testing** - Tests unitarios en múltiples versiones de Node.js (18, 20, 22)
83
+ 4. **🏗️ Build** - Construcción del proyecto
84
+ 5. **📚 Documentation** - Generación de documentación (solo en main/docs)
85
+ 6. **🔒 Security** - Auditoría de seguridad de dependencias
86
+
87
+ ### Pipeline de Release (`.github/workflows/release.yml`)
88
+
89
+ Se ejecuta en tags de versión e incluye:
90
+
91
+ 1. **🚀 Release** - Creación de releases en GitHub
92
+ 2. **📦 NPM Publish** - Publicación automática en NPM
93
+
94
+ ### Configuración de Quality Gates
95
+
96
+ - **Cobertura de tests**: 80% mínimo
97
+ - **Linting**: Sin errores
98
+ - **Formato**: Código debe seguir las reglas de Prettier
99
+ - **Tipos**: Sin errores de TypeScript
100
+ - **Build**: Debe compilar sin errores
101
+
102
+ ## 📊 Reportes
103
+
104
+ - **Cobertura de tests**: Generada con Vitest y c8
105
+ - **Bundle size**: Visualización con rollup-plugin-visualizer en `stats/`
106
+ - **Documentación**: Disponible en `docs/` después de ejecutar `npm run docs`
107
+
108
+ ## 🤝 Contribución
109
+
110
+ 1. Fork el proyecto
111
+ 2. Crea una rama para tu feature (`git checkout -b feature/AmazingFeature`)
112
+ 3. Commit tus cambios (`git commit -m 'Add some AmazingFeature'`)
113
+ 4. Push a la rama (`git push origin feature/AmazingFeature`)
114
+ 5. Abre un Pull Request
115
+
116
+ ### Guidelines de contribución
117
+
118
+ - Sigue las reglas de ESLint y Prettier
119
+ - Escribe tests para nuevas funcionalidades
120
+ - Mantén la cobertura de tests >= 80%
121
+ - Documenta el código con JSDoc
122
+ - Usa Conventional Commits para mensajes de commit
123
+
124
+ ## 📝 Licencia
125
+
126
+ Este proyecto está bajo la Licencia MIT. Ver el archivo `LICENSE` para más detalles.
127
+
128
+ ## 🔗 Enlaces
129
+
130
+ - [Documentación](https://ulloasp.github.io/mlform/)
131
+ - [Issues](https://github.com/UlloaSP/mlform/issues)
132
+ - [NPM Package](https://www.npmjs.com/package/mlform)