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
|
@@ -1,3 +1,15 @@
|
|
|
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
|
+
}
|
|
1
13
|
/**
|
|
2
14
|
* TypeScript Sync Validator - Validación síncrona de tipos como fallback
|
|
3
15
|
* Contiene la lógica extraída del módulo principal para cuando el worker no está disponible
|
|
@@ -10,36 +22,36 @@ import * as typescript from 'typescript';
|
|
|
10
22
|
* Genera declaraciones básicas de tipos para Vue como fallback
|
|
11
23
|
*/
|
|
12
24
|
const generateBasicVueTypes = () => {
|
|
13
|
-
return `// Declaraciones básicas de tipos Vue para validación
|
|
14
|
-
declare global {
|
|
15
|
-
function ref<T>(value: T): { value: T };
|
|
16
|
-
function reactive<T extends object>(target: T): T;
|
|
17
|
-
function computed<T>(getter: () => T): { value: T };
|
|
18
|
-
function defineComponent<T>(options: T): T;
|
|
19
|
-
function defineProps<T = {}>(): T;
|
|
20
|
-
function defineEmits<T = {}>(): T;
|
|
21
|
-
function defineExpose<T = {}>(exposed: T): void;
|
|
22
|
-
function onMounted(fn: () => void): void;
|
|
23
|
-
function onUnmounted(fn: () => void): void;
|
|
24
|
-
function onBeforeMount(fn: () => void): void;
|
|
25
|
-
function onBeforeUnmount(fn: () => void): void;
|
|
26
|
-
function onUpdated(fn: () => void): void;
|
|
27
|
-
function onBeforeUpdate(fn: () => void): void;
|
|
28
|
-
function provide<T>(key: string | symbol, value: T): void;
|
|
29
|
-
function inject<T>(key: string | symbol, defaultValue?: T): T | undefined;
|
|
30
|
-
function useSlots(): { [key: string]: (...args: any[]) => any };
|
|
31
|
-
function useAttrs(): { [key: string]: any };
|
|
32
|
-
function useModel<T>(modelName?: string): { value: T };
|
|
33
|
-
function watch<T>(source: () => T, callback: (newValue: T, oldValue: T) => void): void;
|
|
34
|
-
function watchEffect(effect: () => void): void;
|
|
35
|
-
function nextTick(callback?: () => void): Promise<void>;
|
|
36
|
-
function getCurrentInstance(): any;
|
|
37
|
-
function mergeModels<T>(models: T): T;
|
|
38
|
-
}
|
|
39
|
-
declare module '*.vue' {
|
|
40
|
-
const component: any;
|
|
41
|
-
export default component;
|
|
42
|
-
}
|
|
25
|
+
return `// Declaraciones básicas de tipos Vue para validación
|
|
26
|
+
declare global {
|
|
27
|
+
function ref<T>(value: T): { value: T };
|
|
28
|
+
function reactive<T extends object>(target: T): T;
|
|
29
|
+
function computed<T>(getter: () => T): { value: T };
|
|
30
|
+
function defineComponent<T>(options: T): T;
|
|
31
|
+
function defineProps<T = {}>(): T;
|
|
32
|
+
function defineEmits<T = {}>(): T;
|
|
33
|
+
function defineExpose<T = {}>(exposed: T): void;
|
|
34
|
+
function onMounted(fn: () => void): void;
|
|
35
|
+
function onUnmounted(fn: () => void): void;
|
|
36
|
+
function onBeforeMount(fn: () => void): void;
|
|
37
|
+
function onBeforeUnmount(fn: () => void): void;
|
|
38
|
+
function onUpdated(fn: () => void): void;
|
|
39
|
+
function onBeforeUpdate(fn: () => void): void;
|
|
40
|
+
function provide<T>(key: string | symbol, value: T): void;
|
|
41
|
+
function inject<T>(key: string | symbol, defaultValue?: T): T | undefined;
|
|
42
|
+
function useSlots(): { [key: string]: (...args: any[]) => any };
|
|
43
|
+
function useAttrs(): { [key: string]: any };
|
|
44
|
+
function useModel<T>(modelName?: string): { value: T };
|
|
45
|
+
function watch<T>(source: () => T, callback: (newValue: T, oldValue: T) => void): void;
|
|
46
|
+
function watchEffect(effect: () => void): void;
|
|
47
|
+
function nextTick(callback?: () => void): Promise<void>;
|
|
48
|
+
function getCurrentInstance(): any;
|
|
49
|
+
function mergeModels<T>(models: T): T;
|
|
50
|
+
}
|
|
51
|
+
declare module '*.vue' {
|
|
52
|
+
const component: any;
|
|
53
|
+
export default component;
|
|
54
|
+
}
|
|
43
55
|
export {};`;
|
|
44
56
|
};
|
|
45
57
|
/**
|
|
@@ -269,7 +281,9 @@ export const validateTypesWithLanguageService = (fileName, content, compilerOpti
|
|
|
269
281
|
try {
|
|
270
282
|
languageService.dispose();
|
|
271
283
|
}
|
|
272
|
-
catch {
|
|
284
|
+
catch {
|
|
285
|
+
/* ignore dispose errors */
|
|
286
|
+
}
|
|
273
287
|
}
|
|
274
288
|
}
|
|
275
289
|
catch (error) {
|
|
@@ -1,3 +1,15 @@
|
|
|
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
|
+
}
|
|
1
13
|
/**
|
|
2
14
|
* TypeScript Worker Pool - Pool de workers para compilación paralela
|
|
3
15
|
* Reemplaza el worker único con múltiples workers para aprovecha la concurrencia real
|