wu-framework 1.1.14 → 1.1.16
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/LICENSE +39 -39
- package/README.md +408 -408
- package/dist/wu-framework.cjs.js.map +1 -1
- package/dist/wu-framework.dev.js +15151 -15151
- package/dist/wu-framework.dev.js.map +1 -1
- package/dist/wu-framework.esm.js.map +1 -1
- package/dist/wu-framework.umd.js.map +1 -1
- package/integrations/astro/README.md +127 -127
- package/integrations/astro/WuApp.astro +63 -63
- package/integrations/astro/WuShell.astro +39 -39
- package/integrations/astro/index.js +68 -68
- package/integrations/astro/package.json +38 -38
- package/integrations/astro/types.d.ts +53 -53
- package/package.json +161 -161
- package/src/adapters/angular/ai.js +30 -30
- package/src/adapters/angular/index.d.ts +154 -154
- package/src/adapters/angular/index.js +932 -932
- package/src/adapters/angular.d.ts +3 -3
- package/src/adapters/angular.js +3 -3
- package/src/adapters/index.js +168 -168
- package/src/adapters/lit/ai.js +20 -20
- package/src/adapters/lit/index.d.ts +120 -120
- package/src/adapters/lit/index.js +721 -721
- package/src/adapters/lit.d.ts +3 -3
- package/src/adapters/lit.js +3 -3
- package/src/adapters/preact/ai.js +33 -33
- package/src/adapters/preact/index.d.ts +108 -108
- package/src/adapters/preact/index.js +661 -661
- package/src/adapters/preact.d.ts +3 -3
- package/src/adapters/preact.js +3 -3
- package/src/adapters/react/index.js +48 -54
- package/src/adapters/react.d.ts +3 -3
- package/src/adapters/react.js +3 -3
- package/src/adapters/shared.js +64 -64
- package/src/adapters/solid/ai.js +32 -32
- package/src/adapters/solid/index.d.ts +101 -101
- package/src/adapters/solid/index.js +586 -586
- package/src/adapters/solid.d.ts +3 -3
- package/src/adapters/solid.js +3 -3
- package/src/adapters/svelte/ai.js +31 -31
- package/src/adapters/svelte/index.d.ts +166 -166
- package/src/adapters/svelte/index.js +798 -798
- package/src/adapters/svelte.d.ts +3 -3
- package/src/adapters/svelte.js +3 -3
- package/src/adapters/vanilla/ai.js +30 -30
- package/src/adapters/vanilla/index.d.ts +179 -179
- package/src/adapters/vanilla/index.js +785 -785
- package/src/adapters/vanilla.d.ts +3 -3
- package/src/adapters/vanilla.js +3 -3
- package/src/adapters/vue/ai.js +52 -52
- package/src/adapters/vue/index.d.ts +299 -299
- package/src/adapters/vue/index.js +610 -610
- package/src/adapters/vue.d.ts +3 -3
- package/src/adapters/vue.js +3 -3
- package/src/ai/wu-ai-actions.js +261 -261
- package/src/ai/wu-ai-agent.js +546 -546
- package/src/ai/wu-ai-browser-primitives.js +354 -354
- package/src/ai/wu-ai-browser.js +380 -380
- package/src/ai/wu-ai-context.js +332 -332
- package/src/ai/wu-ai-conversation.js +613 -613
- package/src/ai/wu-ai-orchestrate.js +1021 -1021
- package/src/ai/wu-ai-permissions.js +381 -381
- package/src/ai/wu-ai-provider.js +700 -700
- package/src/ai/wu-ai-schema.js +225 -225
- package/src/ai/wu-ai-triggers.js +396 -396
- package/src/ai/wu-ai.js +804 -804
- package/src/core/wu-app.js +236 -236
- package/src/core/wu-cache.js +477 -477
- package/src/core/wu-core.js +1398 -1398
- package/src/core/wu-error-boundary.js +382 -382
- package/src/core/wu-event-bus.js +348 -348
- package/src/core/wu-hooks.js +350 -350
- package/src/core/wu-html-parser.js +190 -190
- package/src/core/wu-iframe-sandbox.js +328 -328
- package/src/core/wu-loader.js +272 -272
- package/src/core/wu-logger.js +134 -134
- package/src/core/wu-manifest.js +509 -509
- package/src/core/wu-mcp-bridge.js +432 -432
- package/src/core/wu-overrides.js +510 -510
- package/src/core/wu-performance.js +228 -228
- package/src/core/wu-plugin.js +348 -348
- package/src/core/wu-prefetch.js +414 -414
- package/src/core/wu-proxy-sandbox.js +476 -476
- package/src/core/wu-sandbox.js +779 -779
- package/src/core/wu-script-executor.js +113 -113
- package/src/core/wu-snapshot-sandbox.js +227 -227
- package/src/core/wu-strategies.js +256 -256
- package/src/core/wu-style-bridge.js +477 -477
- package/src/index.js +224 -224
- package/src/utils/dependency-resolver.js +327 -327
package/src/core/wu-logger.js
CHANGED
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 📝 WU-LOGGER: Sistema de logging inteligente para entornos
|
|
3
|
-
* Controla los logs automáticamente según el entorno
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export class WuLogger {
|
|
7
|
-
constructor() {
|
|
8
|
-
// Detectar entorno automáticamente
|
|
9
|
-
this.isDevelopment = this.detectEnvironment();
|
|
10
|
-
// En desarrollo: warn (menos ruido), en producción: error
|
|
11
|
-
this.logLevel = this.isDevelopment ? 'warn' : 'error';
|
|
12
|
-
|
|
13
|
-
this.levels = {
|
|
14
|
-
debug: 0,
|
|
15
|
-
info: 1,
|
|
16
|
-
warn: 2,
|
|
17
|
-
error: 3,
|
|
18
|
-
silent: 4
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Detectar si estamos en desarrollo
|
|
24
|
-
*/
|
|
25
|
-
detectEnvironment() {
|
|
26
|
-
// Múltiples formas de detectar desarrollo
|
|
27
|
-
return (
|
|
28
|
-
// Vite development
|
|
29
|
-
window.location.hostname === 'localhost' ||
|
|
30
|
-
window.location.hostname === '127.0.0.1' ||
|
|
31
|
-
window.location.port !== '' ||
|
|
32
|
-
// NODE_ENV si está disponible
|
|
33
|
-
(typeof process !== 'undefined' && process.env?.NODE_ENV === 'development') ||
|
|
34
|
-
// URL params para forzar debug
|
|
35
|
-
new URLSearchParams(window.location.search).has('wu-debug') ||
|
|
36
|
-
// Manual override
|
|
37
|
-
window.WU_DEBUG === true
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Configurar nivel de logging
|
|
43
|
-
*/
|
|
44
|
-
setLevel(level) {
|
|
45
|
-
this.logLevel = level;
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Habilitar/deshabilitar development mode
|
|
51
|
-
*/
|
|
52
|
-
setDevelopment(isDev) {
|
|
53
|
-
this.isDevelopment = isDev;
|
|
54
|
-
this.logLevel = isDev ? 'debug' : 'error';
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Verificar si debemos mostrar el log
|
|
60
|
-
*/
|
|
61
|
-
shouldLog(level) {
|
|
62
|
-
return this.levels[level] >= this.levels[this.logLevel];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Logging methods
|
|
67
|
-
*/
|
|
68
|
-
debug(...args) {
|
|
69
|
-
if (this.shouldLog('debug')) {
|
|
70
|
-
console.log(...args);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
info(...args) {
|
|
75
|
-
if (this.shouldLog('info')) {
|
|
76
|
-
console.info(...args);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
warn(...args) {
|
|
81
|
-
if (this.shouldLog('warn')) {
|
|
82
|
-
console.warn(...args);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
error(...args) {
|
|
87
|
-
if (this.shouldLog('error')) {
|
|
88
|
-
console.error(...args);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Logging con contexto Wu
|
|
94
|
-
*/
|
|
95
|
-
wu(level, ...args) {
|
|
96
|
-
if (this.shouldLog(level)) {
|
|
97
|
-
const method = level === 'debug' ? 'log' : level;
|
|
98
|
-
console[method]('[Wu]', ...args);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Helper methods específicos para Wu
|
|
104
|
-
*/
|
|
105
|
-
wuDebug(...args) { this.wu('debug', ...args); }
|
|
106
|
-
wuInfo(...args) { this.wu('info', ...args); }
|
|
107
|
-
wuWarn(...args) { this.wu('warn', ...args); }
|
|
108
|
-
wuError(...args) { this.wu('error', ...args); }
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Singleton instance
|
|
112
|
-
export const logger = new WuLogger();
|
|
113
|
-
|
|
114
|
-
// Helper para compatibilidad con logs existentes
|
|
115
|
-
export const wuLog = {
|
|
116
|
-
debug: (...args) => logger.wuDebug(...args),
|
|
117
|
-
info: (...args) => logger.wuInfo(...args),
|
|
118
|
-
warn: (...args) => logger.wuWarn(...args),
|
|
119
|
-
error: (...args) => logger.wuError(...args)
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* 🔇 Silenciar todos los logs de Wu Framework
|
|
124
|
-
* Útil en producción para eliminar todo el ruido
|
|
125
|
-
*/
|
|
126
|
-
export function silenceAllLogs() {
|
|
127
|
-
logger.setLevel('silent');
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* 🔊 Restaurar logs (nivel debug)
|
|
132
|
-
*/
|
|
133
|
-
export function enableAllLogs() {
|
|
134
|
-
logger.setLevel('debug');
|
|
1
|
+
/**
|
|
2
|
+
* 📝 WU-LOGGER: Sistema de logging inteligente para entornos
|
|
3
|
+
* Controla los logs automáticamente según el entorno
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export class WuLogger {
|
|
7
|
+
constructor() {
|
|
8
|
+
// Detectar entorno automáticamente
|
|
9
|
+
this.isDevelopment = this.detectEnvironment();
|
|
10
|
+
// En desarrollo: warn (menos ruido), en producción: error
|
|
11
|
+
this.logLevel = this.isDevelopment ? 'warn' : 'error';
|
|
12
|
+
|
|
13
|
+
this.levels = {
|
|
14
|
+
debug: 0,
|
|
15
|
+
info: 1,
|
|
16
|
+
warn: 2,
|
|
17
|
+
error: 3,
|
|
18
|
+
silent: 4
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Detectar si estamos en desarrollo
|
|
24
|
+
*/
|
|
25
|
+
detectEnvironment() {
|
|
26
|
+
// Múltiples formas de detectar desarrollo
|
|
27
|
+
return (
|
|
28
|
+
// Vite development
|
|
29
|
+
window.location.hostname === 'localhost' ||
|
|
30
|
+
window.location.hostname === '127.0.0.1' ||
|
|
31
|
+
window.location.port !== '' ||
|
|
32
|
+
// NODE_ENV si está disponible
|
|
33
|
+
(typeof process !== 'undefined' && process.env?.NODE_ENV === 'development') ||
|
|
34
|
+
// URL params para forzar debug
|
|
35
|
+
new URLSearchParams(window.location.search).has('wu-debug') ||
|
|
36
|
+
// Manual override
|
|
37
|
+
window.WU_DEBUG === true
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Configurar nivel de logging
|
|
43
|
+
*/
|
|
44
|
+
setLevel(level) {
|
|
45
|
+
this.logLevel = level;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Habilitar/deshabilitar development mode
|
|
51
|
+
*/
|
|
52
|
+
setDevelopment(isDev) {
|
|
53
|
+
this.isDevelopment = isDev;
|
|
54
|
+
this.logLevel = isDev ? 'debug' : 'error';
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Verificar si debemos mostrar el log
|
|
60
|
+
*/
|
|
61
|
+
shouldLog(level) {
|
|
62
|
+
return this.levels[level] >= this.levels[this.logLevel];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Logging methods
|
|
67
|
+
*/
|
|
68
|
+
debug(...args) {
|
|
69
|
+
if (this.shouldLog('debug')) {
|
|
70
|
+
console.log(...args);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
info(...args) {
|
|
75
|
+
if (this.shouldLog('info')) {
|
|
76
|
+
console.info(...args);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
warn(...args) {
|
|
81
|
+
if (this.shouldLog('warn')) {
|
|
82
|
+
console.warn(...args);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
error(...args) {
|
|
87
|
+
if (this.shouldLog('error')) {
|
|
88
|
+
console.error(...args);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Logging con contexto Wu
|
|
94
|
+
*/
|
|
95
|
+
wu(level, ...args) {
|
|
96
|
+
if (this.shouldLog(level)) {
|
|
97
|
+
const method = level === 'debug' ? 'log' : level;
|
|
98
|
+
console[method]('[Wu]', ...args);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Helper methods específicos para Wu
|
|
104
|
+
*/
|
|
105
|
+
wuDebug(...args) { this.wu('debug', ...args); }
|
|
106
|
+
wuInfo(...args) { this.wu('info', ...args); }
|
|
107
|
+
wuWarn(...args) { this.wu('warn', ...args); }
|
|
108
|
+
wuError(...args) { this.wu('error', ...args); }
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Singleton instance
|
|
112
|
+
export const logger = new WuLogger();
|
|
113
|
+
|
|
114
|
+
// Helper para compatibilidad con logs existentes
|
|
115
|
+
export const wuLog = {
|
|
116
|
+
debug: (...args) => logger.wuDebug(...args),
|
|
117
|
+
info: (...args) => logger.wuInfo(...args),
|
|
118
|
+
warn: (...args) => logger.wuWarn(...args),
|
|
119
|
+
error: (...args) => logger.wuError(...args)
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 🔇 Silenciar todos los logs de Wu Framework
|
|
124
|
+
* Útil en producción para eliminar todo el ruido
|
|
125
|
+
*/
|
|
126
|
+
export function silenceAllLogs() {
|
|
127
|
+
logger.setLevel('silent');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 🔊 Restaurar logs (nivel debug)
|
|
132
|
+
*/
|
|
133
|
+
export function enableAllLogs() {
|
|
134
|
+
logger.setLevel('debug');
|
|
135
135
|
}
|