versacompiler 2.4.1 → 2.6.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.
- package/README.md +722 -722
- package/dist/compiler/compile-worker-pool.js +108 -0
- package/dist/compiler/compile-worker-thread.cjs +72 -0
- package/dist/compiler/compile.js +177 -18
- package/dist/compiler/error-reporter.js +12 -0
- package/dist/compiler/integrity-validator.js +13 -1
- package/dist/compiler/linter.js +12 -0
- package/dist/compiler/minify.js +12 -0
- package/dist/compiler/minifyTemplate.js +12 -0
- package/dist/compiler/module-resolution-optimizer.js +35 -20
- package/dist/compiler/parser.js +12 -0
- package/dist/compiler/performance-monitor.js +73 -61
- package/dist/compiler/pipeline/build-pipeline.js +139 -0
- package/dist/compiler/pipeline/core-plugins.js +230 -0
- package/dist/compiler/pipeline/module-graph.js +75 -0
- package/dist/compiler/pipeline/plugin-driver.js +99 -0
- package/dist/compiler/pipeline/types.js +14 -0
- package/dist/compiler/tailwindcss.js +12 -0
- package/dist/compiler/transform-optimizer.js +12 -0
- package/dist/compiler/transformTStoJS.js +38 -5
- package/dist/compiler/transforms.js +234 -16
- package/dist/compiler/typescript-compiler.js +12 -0
- package/dist/compiler/typescript-error-parser.js +12 -0
- package/dist/compiler/typescript-manager.js +15 -1
- package/dist/compiler/typescript-sync-validator.js +45 -31
- package/dist/compiler/typescript-worker-pool.js +12 -0
- package/dist/compiler/typescript-worker-thread.cjs +482 -475
- package/dist/compiler/typescript-worker.js +12 -0
- package/dist/compiler/vuejs.js +73 -47
- package/dist/config.js +14 -0
- package/dist/hrm/VueHRM.js +484 -359
- package/dist/hrm/errorScreen.js +95 -83
- package/dist/hrm/getInstanciaVue.js +325 -313
- package/dist/hrm/initHRM.js +736 -586
- package/dist/hrm/versaHMR.js +317 -0
- package/dist/main.js +23 -3
- package/dist/servicios/browserSync.js +127 -6
- package/dist/servicios/file-watcher.js +139 -8
- package/dist/servicios/logger.js +12 -0
- package/dist/servicios/readConfig.js +141 -54
- package/dist/servicios/versacompile.config.types.js +14 -0
- package/dist/utils/excluded-modules.js +12 -0
- package/dist/utils/module-resolver.js +86 -40
- package/dist/utils/promptUser.js +12 -0
- package/dist/utils/proxyValidator.js +12 -0
- package/dist/utils/resolve-bin.js +12 -0
- package/dist/utils/utils.js +12 -0
- package/dist/utils/vue-types-setup.js +260 -248
- package/dist/wrappers/eslint-node.js +15 -1
- package/dist/wrappers/oxlint-node.js +15 -1
- package/dist/wrappers/tailwind-node.js +12 -0
- package/package.json +74 -54
package/dist/hrm/errorScreen.js
CHANGED
|
@@ -1,83 +1,95 @@
|
|
|
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
|
-
errorOverlay
|
|
42
|
-
errorOverlay.
|
|
43
|
-
errorOverlay.style.
|
|
44
|
-
errorOverlay.style.
|
|
45
|
-
errorOverlay.style.
|
|
46
|
-
errorOverlay.style.
|
|
47
|
-
errorOverlay.style.
|
|
48
|
-
errorOverlay.style.
|
|
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
|
-
|
|
1
|
+
/* VersaCompiler HMR shim [dev] */
|
|
2
|
+
if (typeof window !== 'undefined' && window.__versaHMR) {
|
|
3
|
+
(() => {
|
|
4
|
+
const _id = new URL(import.meta.url).pathname;
|
|
5
|
+
import.meta.hot = {
|
|
6
|
+
accept(cb) { window.__versaHMR.accept(_id, typeof cb === 'function' ? cb : () => {}); },
|
|
7
|
+
invalidate() { window.__versaHMR._invalidate?.(_id); },
|
|
8
|
+
dispose(cb) { window.__versaHMR._onDispose?.(_id, cb); },
|
|
9
|
+
get data() { return window.__versaHMR._getHotData?.(_id) ?? {}; },
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Variable global que mantiene la referencia al overlay de error actual
|
|
15
|
+
* @type {HTMLElement|null}
|
|
16
|
+
*/
|
|
17
|
+
let errorOverlay;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Oculta y remueve el overlay de error actual del DOM
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
23
|
+
export function hideErrorOverlay() {
|
|
24
|
+
const existingOverlay = document.getElementById('versa-hmr-error-overlay');
|
|
25
|
+
if (existingOverlay) {
|
|
26
|
+
existingOverlay.remove();
|
|
27
|
+
}
|
|
28
|
+
errorOverlay = null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Muestra un overlay de error personalizado para errores de HMR (Hot Module Replacement).
|
|
33
|
+
* @param {string} errorMessage - Mensaje de error principal.
|
|
34
|
+
* @param {string} [errorDetails=''] - Detalles adicionales del error, opcional.
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
export function showErrorOverlay(errorMessage, errorDetails = '') {
|
|
38
|
+
hideErrorOverlay(); // Asegurar que no haya overlays duplicados
|
|
39
|
+
|
|
40
|
+
// Crear el contenedor principal del overlay
|
|
41
|
+
errorOverlay = document.createElement('div');
|
|
42
|
+
errorOverlay.id = 'versa-hmr-error-overlay';
|
|
43
|
+
errorOverlay.style.position = 'fixed';
|
|
44
|
+
errorOverlay.style.top = '0';
|
|
45
|
+
errorOverlay.style.left = '0';
|
|
46
|
+
errorOverlay.style.width = '100vw';
|
|
47
|
+
errorOverlay.style.height = '100vh';
|
|
48
|
+
errorOverlay.style.backgroundColor = 'rgba(0, 0, 0, 1.85)';
|
|
49
|
+
errorOverlay.style.color = '#ff8080';
|
|
50
|
+
errorOverlay.style.zIndex = '999999';
|
|
51
|
+
errorOverlay.style.display = 'flex';
|
|
52
|
+
errorOverlay.style.flexDirection = 'column';
|
|
53
|
+
errorOverlay.style.alignItems = 'center';
|
|
54
|
+
errorOverlay.style.justifyContent = 'center';
|
|
55
|
+
errorOverlay.style.fontFamily = 'monospace';
|
|
56
|
+
errorOverlay.style.fontSize = '16px';
|
|
57
|
+
errorOverlay.style.padding = '20px';
|
|
58
|
+
errorOverlay.style.boxSizing = 'border-box';
|
|
59
|
+
errorOverlay.style.textAlign = 'left';
|
|
60
|
+
errorOverlay.style.overflow = 'auto';
|
|
61
|
+
|
|
62
|
+
// Crear el título del overlay
|
|
63
|
+
const title = document.createElement('h2');
|
|
64
|
+
title.textContent = 'Versa HMR Error';
|
|
65
|
+
title.style.color = '#ff4d4d';
|
|
66
|
+
title.style.fontSize = '24px';
|
|
67
|
+
title.style.marginBottom = '20px';
|
|
68
|
+
|
|
69
|
+
// Crear el contenedor del mensaje principal
|
|
70
|
+
const messageDiv = document.createElement('div');
|
|
71
|
+
messageDiv.textContent = errorMessage;
|
|
72
|
+
messageDiv.style.marginBottom = '15px';
|
|
73
|
+
messageDiv.style.whiteSpace = 'pre-wrap';
|
|
74
|
+
|
|
75
|
+
// Crear el contenedor de detalles del error
|
|
76
|
+
const detailsPre = document.createElement('pre');
|
|
77
|
+
detailsPre.textContent = errorDetails;
|
|
78
|
+
detailsPre.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
|
|
79
|
+
detailsPre.style.padding = '10px';
|
|
80
|
+
detailsPre.style.borderRadius = '5px';
|
|
81
|
+
detailsPre.style.maxHeight = '50vh';
|
|
82
|
+
detailsPre.style.overflow = 'auto';
|
|
83
|
+
detailsPre.style.width = '100%';
|
|
84
|
+
detailsPre.style.maxWidth = '800px';
|
|
85
|
+
|
|
86
|
+
// Agregar elementos al overlay
|
|
87
|
+
errorOverlay.appendChild(title);
|
|
88
|
+
errorOverlay.appendChild(messageDiv);
|
|
89
|
+
if (errorDetails) {
|
|
90
|
+
errorOverlay.appendChild(detailsPre);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Agregar el overlay al DOM
|
|
94
|
+
document.body.appendChild(errorOverlay);
|
|
95
|
+
}
|