wu-framework 1.1.11 β†’ 1.1.13

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.
@@ -3,12 +3,14 @@
3
3
  * Carga aplicaciones y componentes sin depender del framework
4
4
  */
5
5
 
6
+ import { logger } from './wu-logger.js';
7
+
6
8
  export class WuLoader {
7
9
  constructor() {
8
10
  this.cache = new Map();
9
11
  this.loadingPromises = new Map();
10
12
 
11
- console.log('[WuLoader] πŸ“¦ Dynamic loader initialized');
13
+ logger.debug('[WuLoader] πŸ“¦ Dynamic loader initialized');
12
14
  }
13
15
 
14
16
  /**
@@ -21,18 +23,18 @@ export class WuLoader {
21
23
  const entryFile = manifest?.entry || 'index.js';
22
24
  const fullUrl = `${appUrl}/${entryFile}`;
23
25
 
24
- console.log(`[WuLoader] πŸ“₯ Loading app from: ${fullUrl}`);
26
+ logger.debug(`[WuLoader] πŸ“₯ Loading app from: ${fullUrl}`);
25
27
 
26
28
  try {
27
29
  // Verificar cache
28
30
  if (this.cache.has(fullUrl)) {
29
- console.log(`[WuLoader] ⚑ Cache hit for: ${fullUrl}`);
31
+ logger.debug(`[WuLoader] ⚑ Cache hit for: ${fullUrl}`);
30
32
  return this.cache.get(fullUrl);
31
33
  }
32
34
 
33
35
  // Verificar si ya estΓ‘ cargando
34
36
  if (this.loadingPromises.has(fullUrl)) {
35
- console.log(`[WuLoader] ⏳ Loading in progress for: ${fullUrl}`);
37
+ logger.debug(`[WuLoader] ⏳ Loading in progress for: ${fullUrl}`);
36
38
  return await this.loadingPromises.get(fullUrl);
37
39
  }
38
40
 
@@ -46,7 +48,7 @@ export class WuLoader {
46
48
  this.loadingPromises.delete(fullUrl);
47
49
  this.cache.set(fullUrl, code);
48
50
 
49
- console.log(`[WuLoader] βœ… App loaded successfully: ${fullUrl}`);
51
+ logger.debug(`[WuLoader] βœ… App loaded successfully: ${fullUrl}`);
50
52
  return code;
51
53
 
52
54
  } catch (error) {
@@ -74,7 +76,7 @@ export class WuLoader {
74
76
 
75
77
  const fullUrl = `${appUrl}/${normalizedPath}`;
76
78
 
77
- console.log(`[WuLoader] 🧩 Loading component from: ${fullUrl}`);
79
+ logger.debug(`[WuLoader] 🧩 Loading component from: ${fullUrl}`);
78
80
 
79
81
  try {
80
82
  // Cargar cΓ³digo del componente
@@ -91,13 +93,13 @@ export class WuLoader {
91
93
  // Ejecutar y obtener el componente
92
94
  const fakeModule = { exports: {} };
93
95
  const fakeRequire = (name) => {
94
- console.warn(`[WuLoader] Component ${componentPath} requires ${name} - not supported yet`);
96
+ logger.warn(`[WuLoader] Component ${componentPath} requires ${name} - not supported yet`);
95
97
  return {};
96
98
  };
97
99
 
98
100
  const component = componentFunction(fakeRequire, fakeModule, fakeModule.exports);
99
101
 
100
- console.log(`[WuLoader] βœ… Component loaded: ${componentPath}`);
102
+ logger.debug(`[WuLoader] βœ… Component loaded: ${componentPath}`);
101
103
  return component;
102
104
 
103
105
  } catch (error) {
@@ -168,19 +170,19 @@ export class WuLoader {
168
170
  * @param {Array} appConfigs - Configuraciones de aplicaciones
169
171
  */
170
172
  async preload(appConfigs) {
171
- console.log(`[WuLoader] πŸš€ Preloading ${appConfigs.length} apps...`);
173
+ logger.debug(`[WuLoader] πŸš€ Preloading ${appConfigs.length} apps...`);
172
174
 
173
175
  const preloadPromises = appConfigs.map(async (config) => {
174
176
  try {
175
177
  await this.loadApp(config.url, config.manifest);
176
- console.log(`[WuLoader] βœ… Preloaded: ${config.name}`);
178
+ logger.debug(`[WuLoader] βœ… Preloaded: ${config.name}`);
177
179
  } catch (error) {
178
- console.warn(`[WuLoader] ⚠️ Failed to preload ${config.name}:`, error.message);
180
+ logger.warn(`[WuLoader] ⚠️ Failed to preload ${config.name}:`, error.message);
179
181
  }
180
182
  });
181
183
 
182
184
  await Promise.allSettled(preloadPromises);
183
- console.log(`[WuLoader] πŸŽ‰ Preload completed`);
185
+ logger.debug(`[WuLoader] πŸŽ‰ Preload completed`);
184
186
  }
185
187
 
186
188
  /**
@@ -209,13 +211,13 @@ export class WuLoader {
209
211
  const [appName, componentName] = importPath.split('.');
210
212
 
211
213
  if (!appName || !componentName) {
212
- console.warn(`[WuLoader] Invalid import format: ${importPath}`);
214
+ logger.warn(`[WuLoader] Invalid import format: ${importPath}`);
213
215
  continue;
214
216
  }
215
217
 
216
218
  const app = availableApps.get(appName);
217
219
  if (!app) {
218
- console.warn(`[WuLoader] Import app not found: ${appName}`);
220
+ logger.warn(`[WuLoader] Import app not found: ${appName}`);
219
221
  continue;
220
222
  }
221
223
 
@@ -223,14 +225,14 @@ export class WuLoader {
223
225
  const exportPath = manifest?.wu?.exports?.[componentName];
224
226
 
225
227
  if (!exportPath) {
226
- console.warn(`[WuLoader] Export not found: ${importPath}`);
228
+ logger.warn(`[WuLoader] Export not found: ${importPath}`);
227
229
  continue;
228
230
  }
229
231
 
230
232
  try {
231
233
  const component = await this.loadComponent(app.url, exportPath);
232
234
  resolved.set(importPath, component);
233
- console.log(`[WuLoader] βœ… Resolved dependency: ${importPath}`);
235
+ logger.debug(`[WuLoader] βœ… Resolved dependency: ${importPath}`);
234
236
  } catch (error) {
235
237
  console.error(`[WuLoader] ❌ Failed to resolve: ${importPath}`, error);
236
238
  }
@@ -249,12 +251,12 @@ export class WuLoader {
249
251
  for (const [url] of this.cache) {
250
252
  if (regex.test(url)) {
251
253
  this.cache.delete(url);
252
- console.log(`[WuLoader] πŸ—‘οΈ Cleared cache for: ${url}`);
254
+ logger.debug(`[WuLoader] πŸ—‘οΈ Cleared cache for: ${url}`);
253
255
  }
254
256
  }
255
257
  } else {
256
258
  this.cache.clear();
257
- console.log(`[WuLoader] πŸ—‘οΈ Cache cleared completely`);
259
+ logger.debug(`[WuLoader] πŸ—‘οΈ Cache cleared completely`);
258
260
  }
259
261
  }
260
262
 
@@ -3,6 +3,8 @@
3
3
  * ValidaciΓ³n estricta de wu.json para seguridad
4
4
  */
5
5
 
6
+ import { logger } from './wu-logger.js';
7
+
6
8
  export class WuManifest {
7
9
  constructor() {
8
10
  this.cache = new Map();
@@ -62,12 +64,12 @@ export class WuManifest {
62
64
  async load(appUrl) {
63
65
  const manifestUrl = `${appUrl}/wu.json`;
64
66
 
65
- console.log(`[WuManifest] πŸ“₯ Loading manifest: ${manifestUrl}`);
67
+ logger.debug(`[WuManifest] πŸ“₯ Loading manifest: ${manifestUrl}`);
66
68
 
67
69
  try {
68
70
  // Verificar cache
69
71
  if (this.cache.has(manifestUrl)) {
70
- console.log(`[WuManifest] ⚑ Cache hit: ${manifestUrl}`);
72
+ logger.debug(`[WuManifest] ⚑ Cache hit: ${manifestUrl}`);
71
73
  return this.cache.get(manifestUrl);
72
74
  }
73
75
 
@@ -82,7 +84,7 @@ export class WuManifest {
82
84
  if (!response.ok) {
83
85
  // Si no hay manifest, crear uno bΓ‘sico
84
86
  if (response.status === 404) {
85
- console.log(`[WuManifest] πŸ“„ No manifest found, creating default for: ${appUrl}`);
87
+ logger.debug(`[WuManifest] πŸ“„ No manifest found, creating default for: ${appUrl}`);
86
88
  return this.createDefaultManifest(appUrl);
87
89
  }
88
90
 
@@ -110,7 +112,7 @@ export class WuManifest {
110
112
  // Cachear resultado
111
113
  this.cache.set(manifestUrl, validatedManifest);
112
114
 
113
- console.log(`[WuManifest] βœ… Manifest loaded: ${manifest.name}`);
115
+ logger.debug(`[WuManifest] βœ… Manifest loaded: ${manifest.name}`);
114
116
  return validatedManifest;
115
117
 
116
118
  } catch (error) {
@@ -145,7 +147,7 @@ export class WuManifest {
145
147
  }
146
148
  };
147
149
 
148
- console.log(`[WuManifest] πŸ”§ Created default manifest for: ${appName}`);
150
+ logger.debug(`[WuManifest] πŸ”§ Created default manifest for: ${appName}`);
149
151
  return defaultManifest;
150
152
  }
151
153
 
@@ -344,7 +346,7 @@ export class WuManifest {
344
346
  // Validar imports
345
347
  normalized.wu.imports = normalized.wu.imports.filter(imp => {
346
348
  if (typeof imp !== 'string' || !imp.includes('.')) {
347
- console.warn(`[WuManifest] Invalid import format: ${imp}`);
349
+ logger.warn(`[WuManifest] Invalid import format: ${imp}`);
348
350
  return false;
349
351
  }
350
352
  return true;
@@ -486,12 +488,12 @@ export class WuManifest {
486
488
  for (const [url] of this.cache) {
487
489
  if (regex.test(url)) {
488
490
  this.cache.delete(url);
489
- console.log(`[WuManifest] πŸ—‘οΈ Cleared cache for: ${url}`);
491
+ logger.debug(`[WuManifest] πŸ—‘οΈ Cleared cache for: ${url}`);
490
492
  }
491
493
  }
492
494
  } else {
493
495
  this.cache.clear();
494
- console.log(`[WuManifest] πŸ—‘οΈ Manifest cache cleared completely`);
496
+ logger.debug(`[WuManifest] πŸ—‘οΈ Manifest cache cleared completely`);
495
497
  }
496
498
  }
497
499
 
@@ -30,6 +30,7 @@ import {
30
30
  getFilteredNetwork,
31
31
  getFilteredConsole,
32
32
  } from '../ai/wu-ai-browser-primitives.js';
33
+ import { logger } from './wu-logger.js';
33
34
 
34
35
  /**
35
36
  * Create the MCP bridge for a Wu instance.
@@ -280,7 +281,7 @@ export function createMcpBridge(wu) {
280
281
 
281
282
  function connect(url = 'ws://localhost:19100', options = {}) {
282
283
  if (ws && ws.readyState <= 1) {
283
- console.warn('[wu-mcp-bridge] Already connected or connecting');
284
+ logger.warn('[wu-mcp-bridge] Already connected or connecting');
284
285
  return;
285
286
  }
286
287
 
@@ -291,7 +292,7 @@ export function createMcpBridge(wu) {
291
292
  ws = new WebSocket(url);
292
293
 
293
294
  ws.onopen = () => {
294
- console.log('[wu-mcp-bridge] Connected to wu-mcp-server');
295
+ logger.debug('[wu-mcp-bridge] Connected to wu-mcp-server');
295
296
  reconnectAttempts = 0;
296
297
 
297
298
  // Send auth handshake if token provided
@@ -314,7 +315,7 @@ export function createMcpBridge(wu) {
314
315
  console.error('[wu-mcp-bridge] Authentication failed:', msg.reason || 'Invalid token');
315
316
  disconnect();
316
317
  } else {
317
- console.log('[wu-mcp-bridge] Authenticated successfully');
318
+ logger.debug('[wu-mcp-bridge] Authenticated successfully');
318
319
  }
319
320
  return;
320
321
  }
@@ -330,7 +331,7 @@ export function createMcpBridge(wu) {
330
331
  const { id, command, params } = msg;
331
332
 
332
333
  if (!id || !command) {
333
- console.warn('[wu-mcp-bridge] Invalid message:', msg);
334
+ logger.warn('[wu-mcp-bridge] Invalid message:', msg);
334
335
  return;
335
336
  }
336
337
 
@@ -352,7 +353,7 @@ export function createMcpBridge(wu) {
352
353
  };
353
354
 
354
355
  ws.onclose = () => {
355
- console.log('[wu-mcp-bridge] Disconnected');
356
+ logger.debug('[wu-mcp-bridge] Disconnected');
356
357
  ws = null;
357
358
  authenticated = false;
358
359
  _scheduleReconnect(url, options);
@@ -7,6 +7,8 @@
7
7
  * - EstadΓ­sticas por app
8
8
  */
9
9
 
10
+ import { logger } from './wu-logger.js';
11
+
10
12
  export class WuPerformance {
11
13
  constructor() {
12
14
  this.metrics = new Map(); // appName -> metrics
@@ -24,7 +26,7 @@ export class WuPerformance {
24
26
  load: 5000 // ms
25
27
  };
26
28
 
27
- console.log('[WuPerformance] ⚑ Framework performance monitoring initialized');
29
+ logger.debug('[WuPerformance] ⚑ Framework performance monitoring initialized');
28
30
  }
29
31
 
30
32
  /**
@@ -36,7 +38,7 @@ export class WuPerformance {
36
38
  const markName = `${appName}:${name}:start`;
37
39
  this.marks.set(markName, performance.now());
38
40
 
39
- console.log(`[WuPerformance] πŸ“Š Measure started: ${markName}`);
41
+ logger.debug(`[WuPerformance] πŸ“Š Measure started: ${markName}`);
40
42
  }
41
43
 
42
44
  /**
@@ -68,10 +70,10 @@ export class WuPerformance {
68
70
 
69
71
  // Verificar threshold
70
72
  if (this.checkThreshold(name, duration)) {
71
- console.warn(`[WuPerformance] ⚠️ Threshold exceeded for ${name}: ${duration.toFixed(2)}ms`);
73
+ logger.warn(`[WuPerformance] ⚠️ Threshold exceeded for ${name}: ${duration.toFixed(2)}ms`);
72
74
  }
73
75
 
74
- console.log(`[WuPerformance] ⏹️ Measure ended: ${markName} (${duration.toFixed(2)}ms)`);
76
+ logger.debug(`[WuPerformance] ⏹️ Measure ended: ${markName} (${duration.toFixed(2)}ms)`);
75
77
  return duration;
76
78
  }
77
79
 
@@ -203,7 +205,7 @@ export class WuPerformance {
203
205
  this.measurements = [];
204
206
  }
205
207
 
206
- console.log(`[WuPerformance] 🧹 Metrics cleared${appName ? ` for ${appName}` : ''}`);
208
+ logger.debug(`[WuPerformance] 🧹 Metrics cleared${appName ? ` for ${appName}` : ''}`);
207
209
  }
208
210
 
209
211
  /**
@@ -7,6 +7,8 @@
7
7
  * - Permission system
8
8
  * - Timeout protection
9
9
  */
10
+ import { logger } from './wu-logger.js';
11
+
10
12
 
11
13
  export class WuPluginSystem {
12
14
  constructor(core) {
@@ -101,7 +103,7 @@ export class WuPluginSystem {
101
103
  // 🚨 Acceso completo solo con permiso 'unsafe'
102
104
  if (permissions.includes('unsafe')) {
103
105
  api._unsafeCore = this._core;
104
- console.warn('[WuPlugin] ⚠️ Plugin has unsafe access to core!');
106
+ logger.warn('[WuPlugin] ⚠️ Plugin has unsafe access to core!');
105
107
  }
106
108
 
107
109
  // Congelar API para evitar modificaciones
@@ -166,7 +168,7 @@ export class WuPluginSystem {
166
168
 
167
169
  // Verificar si ya estΓ‘ instalado
168
170
  if (this.plugins.has(plugin.name)) {
169
- console.warn(`[WuPlugin] Plugin "${plugin.name}" already installed`);
171
+ logger.warn(`[WuPlugin] Plugin "${plugin.name}" already installed`);
170
172
  return;
171
173
  }
172
174
 
@@ -204,7 +206,7 @@ export class WuPluginSystem {
204
206
  installedAt: Date.now()
205
207
  });
206
208
 
207
- console.log(`[WuPlugin] βœ… Plugin "${plugin.name}" installed (permissions: ${permissions.join(', ')})`);
209
+ logger.debug(`[WuPlugin] βœ… Plugin "${plugin.name}" installed (permissions: ${permissions.join(', ')})`);
208
210
  }
209
211
 
210
212
  /**
@@ -237,7 +239,7 @@ export class WuPluginSystem {
237
239
  */
238
240
  registerHook(hookName, callback) {
239
241
  if (!this.hooks.has(hookName)) {
240
- console.warn(`[WuPlugin] Unknown hook: ${hookName}`);
242
+ logger.warn(`[WuPlugin] Unknown hook: ${hookName}`);
241
243
  return;
242
244
  }
243
245
  this.hooks.get(hookName).push(callback);
@@ -269,7 +271,7 @@ export class WuPluginSystem {
269
271
  uninstall(pluginName) {
270
272
  const pluginData = this.plugins.get(pluginName);
271
273
  if (!pluginData) {
272
- console.warn(`[WuPlugin] Plugin "${pluginName}" not found`);
274
+ logger.warn(`[WuPlugin] Plugin "${pluginName}" not found`);
273
275
  return;
274
276
  }
275
277
 
@@ -284,7 +286,7 @@ export class WuPluginSystem {
284
286
  }
285
287
 
286
288
  this.plugins.delete(pluginName);
287
- console.log(`[WuPlugin] βœ… Plugin "${pluginName}" uninstalled`);
289
+ logger.debug(`[WuPlugin] βœ… Plugin "${pluginName}" uninstalled`);
288
290
  }
289
291
 
290
292
  /**
@@ -8,6 +8,8 @@
8
8
  * - Idle: Carga cuando el navegador estΓ‘ idle
9
9
  */
10
10
 
11
+ import { logger } from './wu-logger.js';
12
+
11
13
  export class WuLoadingStrategy {
12
14
  constructor(core) {
13
15
  this.core = core;
@@ -18,7 +20,7 @@ export class WuLoadingStrategy {
18
20
  this.registerDefaultStrategies();
19
21
  this.setupIdleCallback();
20
22
 
21
- console.log('[WuStrategies] 🎯 Loading strategies initialized');
23
+ logger.debug('[WuStrategies] 🎯 Loading strategies initialized');
22
24
  }
23
25
 
24
26
  /**
@@ -29,7 +31,7 @@ export class WuLoadingStrategy {
29
31
  this.register('lazy', {
30
32
  shouldPreload: false,
31
33
  load: async (appName, config) => {
32
- console.log(`[Strategy:Lazy] Loading ${appName} on demand (no preload)`);
34
+ logger.debug(`[Strategy:Lazy] Loading ${appName} on demand (no preload)`);
33
35
  // No hace nada, la app se carga cuando se monta
34
36
  return;
35
37
  }
@@ -40,14 +42,14 @@ export class WuLoadingStrategy {
40
42
  shouldPreload: true,
41
43
  priority: 'high',
42
44
  load: async (appName, config) => {
43
- console.log(`[Strategy:Eager] Preloading ${appName} immediately`);
45
+ logger.debug(`[Strategy:Eager] Preloading ${appName} immediately`);
44
46
 
45
47
  // Cargar el mΓ³dulo de la app
46
48
  const app = this.core.apps.get(appName);
47
49
  if (app) {
48
50
  const moduleUrl = await this.core.resolveModulePath(app);
49
51
  await import(/* @vite-ignore */ moduleUrl);
50
- console.log(`[Strategy:Eager] βœ… ${appName} preloaded`);
52
+ logger.debug(`[Strategy:Eager] βœ… ${appName} preloaded`);
51
53
  }
52
54
  }
53
55
  });
@@ -57,7 +59,7 @@ export class WuLoadingStrategy {
57
59
  shouldPreload: true,
58
60
  priority: 'medium',
59
61
  load: async (appName, config) => {
60
- console.log(`[Strategy:Preload] Using resource hints for ${appName}`);
62
+ logger.debug(`[Strategy:Preload] Using resource hints for ${appName}`);
61
63
 
62
64
  // Crear <link rel="prefetch">
63
65
  const app = this.core.apps.get(appName);
@@ -70,7 +72,7 @@ export class WuLoadingStrategy {
70
72
  link.as = 'script';
71
73
  document.head.appendChild(link);
72
74
 
73
- console.log(`[Strategy:Preload] βœ… Resource hint added for ${appName}`);
75
+ logger.debug(`[Strategy:Preload] βœ… Resource hint added for ${appName}`);
74
76
  }
75
77
  }
76
78
  });
@@ -92,7 +94,7 @@ export class WuLoadingStrategy {
92
94
  this.register('idle', {
93
95
  shouldPreload: false,
94
96
  load: async (appName, config) => {
95
- console.log(`[Strategy:Idle] Queueing ${appName} for idle loading`);
97
+ logger.debug(`[Strategy:Idle] Queueing ${appName} for idle loading`);
96
98
 
97
99
  return new Promise((resolve) => {
98
100
  this.loadingQueue.push({
@@ -127,7 +129,7 @@ export class WuLoadingStrategy {
127
129
  load: strategy.load
128
130
  });
129
131
 
130
- console.log(`[WuStrategies] Strategy "${name}" registered`);
132
+ logger.debug(`[WuStrategies] Strategy "${name}" registered`);
131
133
  }
132
134
 
133
135
  /**
@@ -141,7 +143,7 @@ export class WuLoadingStrategy {
141
143
  const strategy = this.strategies.get(strategyName);
142
144
 
143
145
  if (!strategy) {
144
- console.warn(`[WuStrategies] Strategy "${strategyName}" not found, using lazy`);
146
+ logger.warn(`[WuStrategies] Strategy "${strategyName}" not found, using lazy`);
145
147
  return await this.strategies.get('lazy').load(appName, config);
146
148
  }
147
149
 
@@ -166,7 +168,7 @@ export class WuLoadingStrategy {
166
168
  return priorityOrder[aPriority] - priorityOrder[bPriority];
167
169
  });
168
170
 
169
- console.log(`[WuStrategies] Preloading ${toPreload.length} apps`);
171
+ logger.debug(`[WuStrategies] Preloading ${toPreload.length} apps`);
170
172
 
171
173
  // Precargar en orden
172
174
  for (const app of toPreload) {
@@ -219,7 +221,7 @@ export class WuLoadingStrategy {
219
221
  if (app) {
220
222
  const moduleUrl = await this.core.resolveModulePath(app);
221
223
  await import(/* @vite-ignore */ moduleUrl);
222
- console.log(`[Strategy:Idle] βœ… ${item.appName} loaded during idle time`);
224
+ logger.debug(`[Strategy:Idle] βœ… ${item.appName} loaded during idle time`);
223
225
  item.resolve(true);
224
226
  } else {
225
227
  item.resolve(null);
@@ -249,6 +251,6 @@ export class WuLoadingStrategy {
249
251
  */
250
252
  cleanup() {
251
253
  this.loadingQueue = [];
252
- console.log('[WuStrategies] 🧹 Strategies cleaned up');
254
+ logger.debug('[WuStrategies] 🧹 Strategies cleaned up');
253
255
  }
254
256
  }
@@ -3,12 +3,14 @@
3
3
  * Maneja imports/exports entre micro-apps
4
4
  */
5
5
 
6
+ import { logger } from '../core/wu-logger.js';
7
+
6
8
  export class WuDependencyResolver {
7
9
  constructor() {
8
10
  this.resolvedComponents = new Map();
9
11
  this.pendingResolutions = new Map();
10
12
 
11
- console.log('[WuDependencyResolver] πŸ”— Dependency resolver initialized');
13
+ logger.debug('[WuDependencyResolver] πŸ”— Dependency resolver initialized');
12
14
  }
13
15
 
14
16
  /**
@@ -18,7 +20,7 @@ export class WuDependencyResolver {
18
20
  * @returns {Map} Componentes resueltos
19
21
  */
20
22
  async resolveAll(imports, availableApps) {
21
- console.log(`[WuDependencyResolver] πŸ” Resolving ${imports.length} dependencies...`);
23
+ logger.debug(`[WuDependencyResolver] πŸ” Resolving ${imports.length} dependencies...`);
22
24
 
23
25
  const resolved = new Map();
24
26
  const errors = [];
@@ -27,18 +29,18 @@ export class WuDependencyResolver {
27
29
  try {
28
30
  const component = await this.resolve(importPath, availableApps);
29
31
  resolved.set(importPath, component);
30
- console.log(`[WuDependencyResolver] βœ… Resolved: ${importPath}`);
32
+ logger.debug(`[WuDependencyResolver] βœ… Resolved: ${importPath}`);
31
33
  } catch (error) {
32
34
  errors.push({ import: importPath, error: error.message });
33
- console.warn(`[WuDependencyResolver] ❌ Failed to resolve: ${importPath}`, error);
35
+ logger.warn(`[WuDependencyResolver] ❌ Failed to resolve: ${importPath}`, error);
34
36
  }
35
37
  }
36
38
 
37
39
  if (errors.length > 0) {
38
- console.warn(`[WuDependencyResolver] ⚠️ ${errors.length} dependencies failed to resolve:`, errors);
40
+ logger.warn(`[WuDependencyResolver] ⚠️ ${errors.length} dependencies failed to resolve:`, errors);
39
41
  }
40
42
 
41
- console.log(`[WuDependencyResolver] πŸŽ‰ Resolved ${resolved.size}/${imports.length} dependencies`);
43
+ logger.debug(`[WuDependencyResolver] πŸŽ‰ Resolved ${resolved.size}/${imports.length} dependencies`);
42
44
  return resolved;
43
45
  }
44
46
 
@@ -51,13 +53,13 @@ export class WuDependencyResolver {
51
53
  async resolve(importPath, availableApps) {
52
54
  // Verificar cache
53
55
  if (this.resolvedComponents.has(importPath)) {
54
- console.log(`[WuDependencyResolver] ⚑ Cache hit: ${importPath}`);
56
+ logger.debug(`[WuDependencyResolver] ⚑ Cache hit: ${importPath}`);
55
57
  return this.resolvedComponents.get(importPath);
56
58
  }
57
59
 
58
60
  // Verificar si ya estΓ‘ resolviendo
59
61
  if (this.pendingResolutions.has(importPath)) {
60
- console.log(`[WuDependencyResolver] ⏳ Waiting for pending resolution: ${importPath}`);
62
+ logger.debug(`[WuDependencyResolver] ⏳ Waiting for pending resolution: ${importPath}`);
61
63
  return await this.pendingResolutions.get(importPath);
62
64
  }
63
65
 
@@ -269,7 +271,7 @@ export class WuDependencyResolver {
269
271
  */
270
272
  createComponentWrapper(component, importPath) {
271
273
  return function WuSharedComponent(props) {
272
- console.log(`[WuDependencyResolver] 🧩 Rendering shared component: ${importPath}`);
274
+ logger.debug(`[WuDependencyResolver] 🧩 Rendering shared component: ${importPath}`);
273
275
 
274
276
  try {
275
277
  return component(props);
@@ -304,12 +306,12 @@ export class WuDependencyResolver {
304
306
  for (const [importPath] of this.resolvedComponents) {
305
307
  if (regex.test(importPath)) {
306
308
  this.resolvedComponents.delete(importPath);
307
- console.log(`[WuDependencyResolver] πŸ—‘οΈ Cleared cache for: ${importPath}`);
309
+ logger.debug(`[WuDependencyResolver] πŸ—‘οΈ Cleared cache for: ${importPath}`);
308
310
  }
309
311
  }
310
312
  } else {
311
313
  this.resolvedComponents.clear();
312
- console.log(`[WuDependencyResolver] πŸ—‘οΈ Dependency cache cleared completely`);
314
+ logger.debug(`[WuDependencyResolver] πŸ—‘οΈ Dependency cache cleared completely`);
313
315
  }
314
316
  }
315
317