versacompiler 1.0.5 → 2.0.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.
- package/README.md +633 -145
- package/dist/compiler/compile.js +1362 -0
- package/dist/compiler/error-reporter.js +467 -0
- package/dist/compiler/linter.js +72 -0
- package/dist/compiler/minify.js +229 -0
- package/dist/compiler/module-resolution-optimizer.js +844 -0
- package/dist/compiler/parser.js +203 -0
- package/dist/compiler/performance-monitor.js +192 -0
- package/dist/compiler/tailwindcss.js +39 -0
- package/dist/compiler/transform-optimizer.js +287 -0
- package/dist/compiler/transformTStoJS.js +16 -0
- package/dist/compiler/transforms.js +578 -0
- package/dist/compiler/typescript-compiler.js +379 -0
- package/dist/compiler/typescript-error-parser.js +281 -0
- package/dist/compiler/typescript-manager.js +378 -0
- package/dist/compiler/typescript-sync-validator.js +228 -0
- package/dist/compiler/typescript-worker-pool.js +479 -0
- package/dist/compiler/typescript-worker-thread.cjs +457 -0
- package/dist/compiler/typescript-worker.js +339 -0
- package/dist/compiler/vuejs.js +390 -0
- package/dist/hrm/VueHRM.js +353 -0
- package/dist/hrm/errorScreen.js +23 -1
- package/dist/hrm/getInstanciaVue.js +313 -0
- package/dist/hrm/initHRM.js +140 -0
- package/dist/main.js +286 -0
- package/dist/servicios/browserSync.js +469 -0
- package/dist/servicios/file-watcher.js +316 -0
- package/dist/servicios/logger.js +34 -0
- package/dist/servicios/readConfig.js +430 -0
- package/dist/utils/module-resolver.js +495 -0
- package/dist/utils/promptUser.js +48 -0
- package/dist/utils/resolve-bin.js +48 -0
- package/dist/utils/utils.js +8 -35
- package/dist/wrappers/eslint-node.js +145 -0
- package/dist/wrappers/oxlint-node.js +120 -0
- package/dist/wrappers/tailwind-node.js +92 -0
- package/package.json +62 -17
- package/dist/hrm/devMode.js +0 -346
- package/dist/hrm/instanciaVue.js +0 -35
- package/dist/hrm/setupHMR.js +0 -57
- package/dist/index.js +0 -1010
- package/dist/services/acorn.js +0 -29
- package/dist/services/linter.js +0 -55
- package/dist/services/minify.js +0 -31
- package/dist/services/typescript.js +0 -89
- package/dist/services/vueLoader.js +0 -326
- package/dist/services/vuejs.js +0 -259
- package/dist/utils/transformWithAcorn.js +0 -316
package/README.md
CHANGED
|
@@ -1,145 +1,633 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1
|
+
# 🚀 VersaCompiler
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.typescriptlang.org/)
|
|
5
|
+
[](https://vuejs.org/)
|
|
6
|
+
|
|
7
|
+
> **🎯 Compilador rápido y eficiente para Vue.js, TypeScript y JavaScript con Hot Module Replacement (HMR) integrado.**
|
|
8
|
+
|
|
9
|
+
**VersaCompiler** es una herramienta de compilación diseñada para proyectos Vue 3 con soporte completo para TypeScript, JavaScript y todas las funcionalidades modernas que necesitas para desarrollo web.
|
|
10
|
+
|
|
11
|
+
## 🌟 Características Principales
|
|
12
|
+
|
|
13
|
+
- ⚡ **Compilación ultra-rápida** - Workers paralelos y cache inteligente
|
|
14
|
+
- 🔥 **Hot Module Replacement (HMR)** - Actualizaciones instantáneas con preservación de estado
|
|
15
|
+
- 🧩 **Soporte completo para Vue 3** - SFC, Composition API, script setup
|
|
16
|
+
- 📝 **TypeScript avanzado** - Language Service, decorators, validación de tipos
|
|
17
|
+
- 🔍 **Sistema de linting dual** - ESLint + OxLint con auto-fix
|
|
18
|
+
- 🎨 **TailwindCSS integrado** - Compilación automática y optimizada
|
|
19
|
+
- 🗜️ **Minificación de última generación** - OxcMinify para builds ultra-optimizados
|
|
20
|
+
- 📦 **Bundling inteligente** - Agrupación configurable de módulos (EN DESARROLLO)
|
|
21
|
+
- 🛠️ **Compilación por archivo** - Granular control de compilación
|
|
22
|
+
- 🧹 **Gestión de caché avanzada** - Cache automático con invalidación inteligente
|
|
23
|
+
|
|
24
|
+
## ⚡ Instalación
|
|
25
|
+
|
|
26
|
+
### 📦 Desde código fuente
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/kriollo/versaCompiler.git
|
|
30
|
+
cd versaCompiler
|
|
31
|
+
npm install
|
|
32
|
+
npm run build
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 🔗 Instalación local en tu proyecto
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Copiar archivos compilados a tu proyecto
|
|
39
|
+
cp -r dist/* tu-proyecto/versacompiler/
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 🎯 Quick Start
|
|
43
|
+
|
|
44
|
+
### 1. Configuración inicial
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Crear archivo de configuración
|
|
48
|
+
versacompiler --init
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Estructura de proyecto
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
mi-proyecto/
|
|
55
|
+
├── src/ # 📝 Código fuente
|
|
56
|
+
│ ├── components/ # 🧩 Componentes Vue
|
|
57
|
+
│ └── main.ts # 🚀 Punto de entrada
|
|
58
|
+
├── dist/ # 📦 Archivos compilados (auto-generado)
|
|
59
|
+
├── versacompile.config.ts # ⚙️ Configuración
|
|
60
|
+
└── package.json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 3. Comandos básicos
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 🔥 Desarrollo con auto-reload y HMR
|
|
67
|
+
versacompiler --watch
|
|
68
|
+
|
|
69
|
+
# 🔥 Desarrollo con análisis detallado
|
|
70
|
+
versacompiler --watch --verbose
|
|
71
|
+
|
|
72
|
+
# 🏗️ Compilar todo el proyecto
|
|
73
|
+
versacompiler --all
|
|
74
|
+
|
|
75
|
+
# 📄 Compilar archivo específico
|
|
76
|
+
versacompiler --file src/components/MyComponent.vue
|
|
77
|
+
|
|
78
|
+
# 📝 Compilar múltiples archivos específicos
|
|
79
|
+
versacompiler src/main.ts src/components/App.vue
|
|
80
|
+
|
|
81
|
+
# 🚀 Build para producción (minificado)
|
|
82
|
+
versacompiler --all --prod
|
|
83
|
+
|
|
84
|
+
# 🧹 Limpiar y recompilar todo
|
|
85
|
+
versacompiler --all --cleanOutput --cleanCache
|
|
86
|
+
|
|
87
|
+
# 🔍 Solo verificar código (linting)
|
|
88
|
+
versacompiler --linter
|
|
89
|
+
|
|
90
|
+
# 🎨 Solo compilar TailwindCSS
|
|
91
|
+
versacompiler --tailwind
|
|
92
|
+
|
|
93
|
+
# ⚡ Compilación rápida con confirmación automática
|
|
94
|
+
versacompiler --all --prod --yes
|
|
95
|
+
|
|
96
|
+
# 🔬 Verificación de tipos específica
|
|
97
|
+
versacompiler --typeCheck --file src/types.ts
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 📖 Configuración
|
|
101
|
+
|
|
102
|
+
### 🛠️ Comandos CLI Disponibles
|
|
103
|
+
|
|
104
|
+
| Comando | Alias | Descripción |
|
|
105
|
+
| ------------------ | ----- | ---------------------------------------------- |
|
|
106
|
+
| `--init` | | Inicializar configuración del proyecto |
|
|
107
|
+
| `--watch` | `-w` | Modo observación con HMR y auto-recompilación |
|
|
108
|
+
| `--all` | | Compilar todos los archivos del proyecto |
|
|
109
|
+
| `--file <archivo>` | `-f` | Compilar un archivo específico |
|
|
110
|
+
| `[archivos...]` | | Compilar múltiples archivos específicos |
|
|
111
|
+
| `--prod` | `-p` | Modo producción con minificación |
|
|
112
|
+
| `--verbose` | `-v` | Mostrar información detallada de compilación |
|
|
113
|
+
| `--cleanOutput` | `-co` | Limpiar directorio de salida antes de compilar |
|
|
114
|
+
| `--cleanCache` | `-cc` | Limpiar caché de compilación |
|
|
115
|
+
| `--yes` | `-y` | Confirmar automáticamente todas las acciones |
|
|
116
|
+
| `--typeCheck` | `-t` | Habilitar/deshabilitar verificación de tipos |
|
|
117
|
+
| `--tailwind` | | Habilitar/deshabilitar compilación TailwindCSS |
|
|
118
|
+
| `--linter` | | Habilitar/deshabilitar análisis de código |
|
|
119
|
+
| `--help` | `-h` | Mostrar ayuda y opciones disponibles |
|
|
120
|
+
|
|
121
|
+
### 🔧 Archivo de configuración
|
|
122
|
+
|
|
123
|
+
Crea un archivo `versacompile.config.ts` en la raíz de tu proyecto:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
// Archivo de configuración de VersaCompiler
|
|
127
|
+
export default {
|
|
128
|
+
tsconfig: './tsconfig.json',
|
|
129
|
+
compilerOptions: {
|
|
130
|
+
sourceRoot: './src',
|
|
131
|
+
outDir: './dist',
|
|
132
|
+
pathsAlias: {
|
|
133
|
+
'@/*': ['src/*'],
|
|
134
|
+
'P@/*': ['public/*'],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
proxyConfig: {
|
|
138
|
+
proxyUrl: '',
|
|
139
|
+
assetsOmit: true,
|
|
140
|
+
},
|
|
141
|
+
aditionalWatch: ['./app/templates/**/*.twig'],
|
|
142
|
+
tailwindConfig: {
|
|
143
|
+
bin: './node_modules/.bin/tailwindcss',
|
|
144
|
+
input: './src/css/input.css',
|
|
145
|
+
output: './public/css/output.css',
|
|
146
|
+
},
|
|
147
|
+
linter: [
|
|
148
|
+
{
|
|
149
|
+
name: 'eslint',
|
|
150
|
+
bin: './node_modules/.bin/eslint',
|
|
151
|
+
configFile: './eslint.config.js',
|
|
152
|
+
fix: false,
|
|
153
|
+
paths: ['src/'],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'oxlint',
|
|
157
|
+
bin: './node_modules/.bin/oxlint',
|
|
158
|
+
configFile: './.oxlintrc.json',
|
|
159
|
+
fix: false,
|
|
160
|
+
paths: ['src/'],
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
bundlers: [
|
|
164
|
+
{
|
|
165
|
+
name: 'appLoader',
|
|
166
|
+
fileInput: './public/module/appLoader.js',
|
|
167
|
+
fileOutput: './public/module/appLoader.prod.js',
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### 📝 Opciones de configuración
|
|
174
|
+
|
|
175
|
+
#### `compilerOptions`
|
|
176
|
+
|
|
177
|
+
- `sourceRoot`: Directorio de archivos fuente (por defecto: `'./src'`)
|
|
178
|
+
- `outDir`: Directorio de salida (por defecto: `'./dist'`)
|
|
179
|
+
- `pathsAlias`: Aliases para imports (ej: `'@/*': ['src/*']`)
|
|
180
|
+
|
|
181
|
+
#### `proxyConfig`
|
|
182
|
+
|
|
183
|
+
- `proxyUrl`: URL del proxy para desarrollo
|
|
184
|
+
- `assetsOmit`: Omitir assets en el proxy
|
|
185
|
+
|
|
186
|
+
#### `tailwindConfig`
|
|
187
|
+
|
|
188
|
+
- `bin`: Ruta al binario de TailwindCSS
|
|
189
|
+
- `input`: Archivo CSS de entrada
|
|
190
|
+
- `output`: Archivo CSS de salida
|
|
191
|
+
|
|
192
|
+
#### `linter`
|
|
193
|
+
|
|
194
|
+
Array de configuraciones de linters avanzadas:
|
|
195
|
+
|
|
196
|
+
- `name`: Nombre del linter (`'eslint'` o `'oxlint'`)
|
|
197
|
+
- `bin`: Ruta al binario del linter
|
|
198
|
+
- `configFile`: Archivo de configuración del linter
|
|
199
|
+
- `fix`: Auto-fix de errores detectados
|
|
200
|
+
- `paths`: Rutas específicas a analizar
|
|
201
|
+
- `eslintConfig`: Configuración específica de ESLint
|
|
202
|
+
- `cache`: Habilitar cache de ESLint
|
|
203
|
+
- `maxWarnings`: Máximo número de warnings
|
|
204
|
+
- `quiet`: Mostrar solo errores
|
|
205
|
+
- `formats`: Formatos de salida (`'json'`, `'stylish'`, `'compact'`)
|
|
206
|
+
- `oxlintConfig`: Configuración específica de OxLint
|
|
207
|
+
- `rules`: Reglas personalizadas
|
|
208
|
+
- `plugins`: Plugins de OxLint
|
|
209
|
+
- `deny`: Reglas a denegar
|
|
210
|
+
- `allow`: Reglas a permitir
|
|
211
|
+
|
|
212
|
+
#### `bundlers`
|
|
213
|
+
|
|
214
|
+
Array de configuraciones de bundling:
|
|
215
|
+
|
|
216
|
+
- `name`: Nombre del bundle
|
|
217
|
+
- `fileInput`: Archivo de entrada
|
|
218
|
+
- `fileOutput`: Archivo de salida
|
|
219
|
+
|
|
220
|
+
## 🎯 Ejemplos de Uso
|
|
221
|
+
|
|
222
|
+
### Desarrollo Local
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Iniciar servidor de desarrollo con HMR
|
|
226
|
+
versacompiler --watch
|
|
227
|
+
|
|
228
|
+
# Desarrollo con información detallada
|
|
229
|
+
versacompiler --watch --verbose
|
|
230
|
+
|
|
231
|
+
# Compilación específica durante desarrollo
|
|
232
|
+
versacompiler --file src/main.ts
|
|
233
|
+
|
|
234
|
+
# Solo linting durante desarrollo
|
|
235
|
+
versacompiler --linter
|
|
236
|
+
|
|
237
|
+
# Desarrollo con limpieza de caché
|
|
238
|
+
versacompiler --watch --cleanCache
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Compilación para Producción
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Build completo para producción
|
|
245
|
+
versacompiler --all --prod
|
|
246
|
+
|
|
247
|
+
# Build con limpieza previa
|
|
248
|
+
versacompiler --all --prod --cleanOutput --cleanCache
|
|
249
|
+
|
|
250
|
+
# Build silencioso para CI/CD
|
|
251
|
+
versacompiler --all --prod --yes
|
|
252
|
+
|
|
253
|
+
# Build con análisis detallado
|
|
254
|
+
versacompiler --all --prod --verbose
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Flujos de Trabajo Específicos
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Compilar solo archivos modificados
|
|
261
|
+
versacompiler file1.vue file2.ts file3.js
|
|
262
|
+
|
|
263
|
+
# Verificación de tipos específica
|
|
264
|
+
versacompiler --typeCheck --file src/types/api.ts
|
|
265
|
+
|
|
266
|
+
# Solo TailwindCSS
|
|
267
|
+
versacompiler --tailwind
|
|
268
|
+
|
|
269
|
+
# Compilación híbrida (linting + compilación)
|
|
270
|
+
versacompiler --all --linter --typeCheck
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Integración CI/CD
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# Pipeline de CI completo
|
|
277
|
+
versacompiler --linter # 1. Verificar código
|
|
278
|
+
versacompiler --typeCheck --all # 2. Verificar tipos
|
|
279
|
+
versacompiler --all --prod --yes # 3. Build para producción
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## 🧩 Casos de Uso Avanzados
|
|
283
|
+
|
|
284
|
+
### 🎮 Desarrollo de Componentes Vue
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# Compilación específica de componente con hot reload
|
|
288
|
+
versacompiler --watch --file src/components/GameBoard.vue
|
|
289
|
+
|
|
290
|
+
# Desarrollo con validación de tipos estricta
|
|
291
|
+
versacompiler --watch --typeCheck --verbose
|
|
292
|
+
|
|
293
|
+
# Solo compilar estilos para rapid prototyping
|
|
294
|
+
versacompiler --tailwind --file src/styles/components.css
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### 🏢 Proyectos Enterprise
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
# Validación completa antes de commit
|
|
301
|
+
versacompiler --linter --typeCheck --all
|
|
302
|
+
|
|
303
|
+
# Build optimizado para múltiples entornos
|
|
304
|
+
versacompiler --all --prod --cleanOutput --verbose
|
|
305
|
+
|
|
306
|
+
# Análisis de bundle para optimización
|
|
307
|
+
versacompiler --all --prod --verbose | grep "Bundle"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### 🧪 Testing y CI/CD
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
# Pre-commit hooks
|
|
314
|
+
versacompiler --linter --typeCheck --cleanCache
|
|
315
|
+
|
|
316
|
+
# GitHub Actions / CI Pipeline
|
|
317
|
+
versacompiler --all --prod --yes --verbose
|
|
318
|
+
|
|
319
|
+
# Testing de componentes individuales
|
|
320
|
+
versacompiler --file tests/components/Button.test.ts
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### 🎨 Design System Development
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# Compilación de componentes de design system
|
|
327
|
+
versacompiler --watch src/design-system/components/
|
|
328
|
+
|
|
329
|
+
# Build de librería de componentes
|
|
330
|
+
versacompiler --all --prod src/design-system/
|
|
331
|
+
|
|
332
|
+
# Validación de tokens de diseño
|
|
333
|
+
versacompiler --tailwind --verbose
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## 🏗️ Funcionalidades
|
|
337
|
+
|
|
338
|
+
### 🔥 Hot Module Replacement (HMR)
|
|
339
|
+
|
|
340
|
+
- **Componentes Vue**: Actualizaciones instantáneas preservando estado de componentes
|
|
341
|
+
- **TypeScript/JavaScript**: Recarga inteligente de módulos sin perder contexto
|
|
342
|
+
- **CSS/TailwindCSS**: Inyección de estilos en tiempo real
|
|
343
|
+
- **Key-based updates**: Sistema de keys únicos para identificación de componentes
|
|
344
|
+
|
|
345
|
+
### 🚀 Sistema de Compilación Avanzado
|
|
346
|
+
|
|
347
|
+
- **Worker Threads**: Pool de workers TypeScript optimizado para CPU cores
|
|
348
|
+
- **Cache inteligente**: Sistema de cache por archivos con invalidación automática
|
|
349
|
+
- **Compilación incremental**: Solo recompila archivos modificados
|
|
350
|
+
- **Progress tracking**: Métricas en tiempo real con timing detallado
|
|
351
|
+
- **Lazy loading**: Carga de módulos bajo demanda para máxima eficiencia
|
|
352
|
+
|
|
353
|
+
### 🔍 Sistema de Linting Dual de Nueva Generación
|
|
354
|
+
|
|
355
|
+
- **ESLint**: Análisis profundo de código JavaScript/TypeScript/Vue
|
|
356
|
+
- Soporte para múltiples formatos de salida (json, stylish, compact)
|
|
357
|
+
- Cache inteligente para acelerar análisis repetitivos
|
|
358
|
+
- Auto-fix avanzado con preservación de formato
|
|
359
|
+
- **OxLint**: Linter ultra-rápido escrito en Rust
|
|
360
|
+
- Análisis paralelo de archivos
|
|
361
|
+
- Reglas optimizadas para Vue 3 y TypeScript moderno
|
|
362
|
+
- Integración con tsconfig.json
|
|
363
|
+
|
|
364
|
+
### 📝 TypeScript de Última Generación
|
|
365
|
+
|
|
366
|
+
- **Language Service Host**: Validación de tipos completa y optimizada
|
|
367
|
+
- **Soporte para Decorators**: Experimental decorators y emit decorator metadata
|
|
368
|
+
- **Archivos virtuales**: Soporte para archivos .vue como .vue.ts
|
|
369
|
+
- **Worker-based validation**: Validación de tipos en threads separados
|
|
370
|
+
- **Fallback inteligente**: Modo sincrónico para entornos de testing
|
|
371
|
+
- **Error filtering**: Filtrado inteligente de errores específicos de TypeScript
|
|
372
|
+
|
|
373
|
+
### 🧩 Soporte Vue 3 de Nivel Profesional
|
|
374
|
+
|
|
375
|
+
- **Vue 3.5 Support**: Soporte completo para las últimas características
|
|
376
|
+
- **Script Setup**: Compilación optimizada de composition API
|
|
377
|
+
- **CSS Modules**: Soporte completo para CSS modules con hashing
|
|
378
|
+
- **Scoped Styles**: Compilación de estilos scoped con scope IDs únicos
|
|
379
|
+
- **SCSS/Sass**: Preprocesadores CSS integrados
|
|
380
|
+
- **Custom Blocks**: Soporte para bloques personalizados en SFC
|
|
381
|
+
- **Slots avanzados**: Compilación optimizada de slots con fallbacks
|
|
382
|
+
|
|
383
|
+
### 📦 Minificación y Optimización
|
|
384
|
+
|
|
385
|
+
- **OxcMinify**: Minificador de última generación escrito en Rust
|
|
386
|
+
- **Tree shaking**: Eliminación inteligente de código no utilizado
|
|
387
|
+
- **Variable mangling**: Renombrado de variables para máxima compresión
|
|
388
|
+
- **Dead code elimination**: Eliminación de código muerto
|
|
389
|
+
- **Compresión avanzada**: Algoritmos de compresión optimizados
|
|
390
|
+
- **Source maps**: Generación de source maps en desarrollo
|
|
391
|
+
|
|
392
|
+
### 🛠️ Gestión de Archivos y Cache
|
|
393
|
+
|
|
394
|
+
- **Sistema de cache multinivel**: Cache de configuraciones, compilaciones y validaciones
|
|
395
|
+
- **Invalidación inteligente**: Cache invalidation basado en timestamps y dependencias
|
|
396
|
+
- **Compilación granular**: Compilación por archivo individual o en lotes
|
|
397
|
+
- **Gestión de dependencias**: Tracking automático de dependencias entre archivos
|
|
398
|
+
- **Limpieza automática**: Auto-limpieza de archivos obsoletos
|
|
399
|
+
|
|
400
|
+
### 🎨 TailwindCSS Integrado
|
|
401
|
+
|
|
402
|
+
- **Compilación automática**: Watch mode integrado para cambios en CSS
|
|
403
|
+
- **Optimización de producción**: Minificación y purging automático
|
|
404
|
+
- **Content scanning**: Escaneo inteligente de archivos para clases utilizadas
|
|
405
|
+
- **Config personalizada**: Soporte para configuraciones personalizadas de Tailwind
|
|
406
|
+
|
|
407
|
+
## 🚧 Troubleshooting
|
|
408
|
+
|
|
409
|
+
### ❌ Problemas Frecuentes
|
|
410
|
+
|
|
411
|
+
#### 🔍 Error: "Cannot resolve module" o problemas de imports
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
# Verificar configuración de aliases y paths
|
|
415
|
+
versacompiler --verbose --file problemFile.ts
|
|
416
|
+
|
|
417
|
+
# Limpiar cache TypeScript si persiste
|
|
418
|
+
versacompiler --cleanCache
|
|
419
|
+
|
|
420
|
+
# Verificar configuración en tsconfig.json
|
|
421
|
+
cat tsconfig.json | grep -A 10 "paths"
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
#### 🔥 HMR no funciona correctamente
|
|
425
|
+
|
|
426
|
+
```typescript
|
|
427
|
+
// Verificar configuración en versacompile.config.ts
|
|
428
|
+
export default {
|
|
429
|
+
proxyConfig: {
|
|
430
|
+
proxyUrl: '', // Vacío si no usas proxy backend
|
|
431
|
+
assetsOmit: true,
|
|
432
|
+
},
|
|
433
|
+
};
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
# Reiniciar con limpieza de cache
|
|
438
|
+
versacompiler --watch --cleanCache
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
#### 🐌 Compilación o linting muy lento
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
# Usar solo OxLint para máxima velocidad
|
|
445
|
+
versacompiler --linter --verbose
|
|
446
|
+
|
|
447
|
+
# Verificar si worker threads están activos
|
|
448
|
+
versacompiler --verbose --typeCheck
|
|
449
|
+
|
|
450
|
+
# Limpiar cache si está corrupto
|
|
451
|
+
versacompiler --cleanCache --cleanOutput
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
#### 🔴 Errores de TypeScript en archivos Vue
|
|
455
|
+
|
|
456
|
+
```bash
|
|
457
|
+
# Verificar soporte para decorators en tsconfig.json
|
|
458
|
+
{
|
|
459
|
+
"compilerOptions": {
|
|
460
|
+
"experimentalDecorators": true,
|
|
461
|
+
"emitDecoratorMetadata": true
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
# Ejecutar solo verificación de tipos
|
|
466
|
+
versacompiler --typeCheck --file Component.vue
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
#### ⚠️ Warnings de dependencias o módulos
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
# Verificar si las dependencias están instaladas
|
|
473
|
+
npm install
|
|
474
|
+
|
|
475
|
+
# Revisar configuración de paths en versacompile.config.ts
|
|
476
|
+
versacompiler --verbose --file problematicFile.ts
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
#### 🎨 TailwindCSS no se actualiza
|
|
480
|
+
|
|
481
|
+
```bash
|
|
482
|
+
# Verificar configuración de Tailwind
|
|
483
|
+
versacompiler --tailwind --verbose
|
|
484
|
+
|
|
485
|
+
# Limpiar cache de TailwindCSS
|
|
486
|
+
rm -rf ./node_modules/.cache/tailwindcss
|
|
487
|
+
versacompiler --tailwind --cleanCache
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### 🔧 Configuraciones de Debug
|
|
491
|
+
|
|
492
|
+
#### Habilitar logging detallado
|
|
493
|
+
|
|
494
|
+
```bash
|
|
495
|
+
# Máximo nivel de detalle
|
|
496
|
+
versacompiler --verbose --all
|
|
497
|
+
|
|
498
|
+
# Debug específico por archivo
|
|
499
|
+
versacompiler --verbose --file src/problematicFile.vue
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
#### Verificar configuración activa
|
|
503
|
+
|
|
504
|
+
```bash
|
|
505
|
+
# Ver configuración cargada
|
|
506
|
+
versacompiler --verbose --init # Muestra config actual
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
#### Performance profiling
|
|
510
|
+
|
|
511
|
+
```bash
|
|
512
|
+
# Analizar performance de compilación
|
|
513
|
+
versacompiler --verbose --all --prod
|
|
514
|
+
# Revisar timings en la salida
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
## 📚 Documentación
|
|
518
|
+
|
|
519
|
+
- 📖 [**Guía de Inicio Rápido**](./docs/getting-started.md)
|
|
520
|
+
- 📋 [**Configuración Avanzada**](./docs/configuration.md)
|
|
521
|
+
- 🎯 [**Ejemplos y Recetas**](./docs/examples.md)
|
|
522
|
+
- 🔧 [**API Reference**](./docs/api.md)
|
|
523
|
+
- 🔄 [**Guía de Migración**](./docs/migration.md)
|
|
524
|
+
- 🤝 [**Guía de Contribución**](./docs/contributing.md)
|
|
525
|
+
- ❓ [**FAQ - Preguntas Frecuentes**](./docs/faq.md)
|
|
526
|
+
|
|
527
|
+
## 🧪 Testing
|
|
528
|
+
|
|
529
|
+
```bash
|
|
530
|
+
# Ejecutar tests
|
|
531
|
+
npm test
|
|
532
|
+
|
|
533
|
+
# Tests con coverage
|
|
534
|
+
npm run test:coverage
|
|
535
|
+
|
|
536
|
+
# Tests en modo watch
|
|
537
|
+
npm run test:watch
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
## 🤝 Contribuir
|
|
541
|
+
|
|
542
|
+
¡Las contribuciones son bienvenidas! Ver [CONTRIBUTING.md](./docs/contributing.md) para detalles.
|
|
543
|
+
|
|
544
|
+
### 🛠️ Desarrollo Local
|
|
545
|
+
|
|
546
|
+
```bash
|
|
547
|
+
git clone https://github.com/kriollo/versaCompiler.git
|
|
548
|
+
cd versaCompiler
|
|
549
|
+
npm install
|
|
550
|
+
npm run dev
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
## 📄 Licencia
|
|
554
|
+
|
|
555
|
+
MIT © [Jorge Jara H](https://github.com/kriollo)
|
|
556
|
+
|
|
557
|
+
## 🙏 Agradecimientos
|
|
558
|
+
|
|
559
|
+
- **Vue.js Team** - Por el increíble framework
|
|
560
|
+
- **TypeScript Team** - Por el excelente sistema de tipos
|
|
561
|
+
- **Oxc Project** - Por las herramientas de desarrollo ultra-rápidas
|
|
562
|
+
- **Comunidad Open Source** - Por el feedback y contribuciones
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## 🔧 Arquitectura Técnica
|
|
567
|
+
|
|
568
|
+
### Compilación de Archivos
|
|
569
|
+
|
|
570
|
+
- **JavaScript (.js)**: Procesamiento, transformaciones y optimización con placement inteligente
|
|
571
|
+
- **TypeScript (.ts)**: Transpilación completa usando TypeScript Compiler API con Language Service
|
|
572
|
+
- **Vue SFC (.vue)**: Compilación completa de Single File Components con:
|
|
573
|
+
- Script compilation (incluyendo script setup)
|
|
574
|
+
- Template compilation con optimizaciones
|
|
575
|
+
- Style compilation (CSS, SCSS, CSS Modules, Scoped)
|
|
576
|
+
- Custom blocks processing
|
|
577
|
+
|
|
578
|
+
### Sistema de Workers Avanzado
|
|
579
|
+
|
|
580
|
+
- **TypeScript Worker Threads**: Validación de tipos en procesos separados
|
|
581
|
+
- **Fallback sincrónico**: Detección automática de entorno de testing
|
|
582
|
+
- **Pool de workers**: Optimizado según CPU cores disponibles
|
|
583
|
+
- **Cache de validación**: Resultados de validación persistentes
|
|
584
|
+
|
|
585
|
+
### Minificación de Última Generación
|
|
586
|
+
|
|
587
|
+
- **OxcMinify**: Minificador ultra-rápido en Rust para modo `--prod`
|
|
588
|
+
- **Variable mangling**: Renombrado inteligente de variables
|
|
589
|
+
- **Dead code elimination**: Eliminación de código no utilizado
|
|
590
|
+
- **Modern JavaScript**: Preservación de sintaxis ES2020+
|
|
591
|
+
|
|
592
|
+
### Sistema de Observación de Archivos
|
|
593
|
+
|
|
594
|
+
- **Chokidar**: Observación eficiente de cambios en archivos
|
|
595
|
+
- **Debounced compilation**: Evita recompilaciones excesivas
|
|
596
|
+
- **Dependency tracking**: Seguimiento de dependencias entre archivos
|
|
597
|
+
- **Hot Module Replacement**: Actualizaciones sin perder estado
|
|
598
|
+
|
|
599
|
+
### Cache Multinivel
|
|
600
|
+
|
|
601
|
+
- **Configuration cache**: Cache de tsconfig.json y configuraciones
|
|
602
|
+
- **Compilation cache**: Resultados de compilación por archivo
|
|
603
|
+
- **TypeScript cache**: Cache del Language Service Host
|
|
604
|
+
- **File system cache**: Cache de lecturas de archivos
|
|
605
|
+
|
|
606
|
+
### Dependencias Principales
|
|
607
|
+
|
|
608
|
+
- **Vue.js**: `vue/compiler-sfc` para compilación de SFC
|
|
609
|
+
- **TypeScript**: Compiler API completa con Language Service Host
|
|
610
|
+
- **OxcMinify**: Minificación ultra-optimizada
|
|
611
|
+
- **OxLint**: Linting ultra-rápido en Rust
|
|
612
|
+
- **ESLint**: Análisis profundo de código
|
|
613
|
+
- **Chokidar**: Observación de archivos
|
|
614
|
+
- **BrowserSync**: Servidor de desarrollo con HMR
|
|
615
|
+
- **TailwindCSS**: Compilación de utilidades CSS
|
|
616
|
+
|
|
617
|
+
### Optimizaciones de Performance
|
|
618
|
+
|
|
619
|
+
- **Lazy loading**: Carga de módulos bajo demanda
|
|
620
|
+
- **Module manager**: Gestión inteligente de dependencias pesadas
|
|
621
|
+
- **Compilation batching**: Agrupación de compilaciones
|
|
622
|
+
- **Progressive compilation**: Compilación incremental
|
|
623
|
+
- **Memory management**: Gestión optimizada de memoria en workers
|
|
624
|
+
|
|
625
|
+
---
|
|
626
|
+
|
|
627
|
+
<div align="center">
|
|
628
|
+
|
|
629
|
+
**¿Te gusta VersaCompiler? ¡Dale una ⭐ en GitHub!**
|
|
630
|
+
|
|
631
|
+
[🐛 Reportar Bug](https://github.com/kriollo/versaCompiler/issues) • [✨ Feature Request](https://github.com/kriollo/versaCompiler/issues) • [💬 Discusiones](https://github.com/kriollo/versaCompiler/discussions)
|
|
632
|
+
|
|
633
|
+
</div>
|