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