@crimsonsunset/jsg-logger 1.7.4 → 1.7.6

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/CHANGELOG.md CHANGED
@@ -5,7 +5,87 @@ All notable changes to the JSG Logger project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [1.7.3] - 2025-11-06 🎛️ **DevTools Logging Cleanup**
8
+ ## [1.7.6] - 2025-11-06 🎛️ **DevTools Singleton Fix & Logging Improvements**
9
+
10
+ ### Added
11
+ - **Static `getControls()` Method** - Added `JSGLogger.getControls()` static method for accessing singleton controls
12
+ - Returns `controls` object from existing singleton instance without triggering initialization
13
+ - Provides clean access point for DevTools panel to get logger controls
14
+ - Returns `null` if singleton not yet initialized
15
+ - Prevents DevTools from creating new logger instance when accessing controls
16
+
17
+ ### Fixed
18
+ - **DevTools Singleton Re-initialization** - Fixed DevTools panel creating new logger instance on open
19
+ - DevTools panel now uses `JSGLogger.getControls()` and `JSGLogger.getInstanceSync()` instead of top-level imports
20
+ - Prevents loss of component loggers when DevTools opens
21
+ - Component loggers now persist correctly across DevTools open/close cycles
22
+ - Fixed issue where opening DevTools would reset logger to default config with only "core" component
23
+ - **Component List Duplicates** - Fixed duplicate component entries in DevTools UI
24
+ - `listComponents()` now returns only kebab-case names from config (e.g., `devtools-ui`)
25
+ - Removed camelCase aliases from component list display
26
+ - CamelCase access still available via `logger.components.camelCase()` getters for backward compatibility
27
+ - UI now shows clean, non-duplicated component list
28
+ - **Circular Reference Errors** - Fixed circular reference errors when logging objects
29
+ - Added circular reference detection in browser formatter `displayContextData()` function
30
+ - Removed problematic object logging (theme objects, logger instances, panel instances)
31
+ - Error logging now extracts only safe properties (`message`, `stack`) to avoid serialization issues
32
+ - DevTools panel initialization no longer throws circular reference errors
33
+ - **DevTools Logging Format** - Fixed DevTools logs to use proper JSG logger formatting
34
+ - Replaced all `console.log()` calls in DevTools components with JSG logger calls
35
+ - DevTools logs now show timestamps, emojis, colors, and structured output
36
+ - All DevTools component logs (DevToolsPanel, GlobalControls, DisplayControls) use `devtools-ui` component logger
37
+ - Logs now match standard JSG logger format instead of plain `[JSG-DEVTOOLS]` console messages
38
+
39
+ ### Changed
40
+ - **DevTools Panel Logger Access** - Updated DevTools panel to use singleton access pattern
41
+ - `panel-entry.jsx` now imports `{ JSGLogger }` class instead of default export
42
+ - Uses `JSGLogger.getInstanceSync()` for full logger instance access
43
+ - Uses `JSGLogger.getControls()` for controls API access
44
+ - Prevents module-level initialization from creating new singleton instance
45
+ - **Component Alias Creation** - Disabled camelCase aliases in `this.loggers` object
46
+ - Commented out `createAliases()` calls in `init()` and `initSync()` methods
47
+ - CamelCase aliases no longer added to `this.loggers` (prevents duplicates in `listComponents()`)
48
+ - CamelCase access still works via `components` getters (e.g., `logger.components.devtoolsUi()`)
49
+
50
+ ### Technical Details
51
+ - **Files Modified**:
52
+ - `index.js` - Added `getControls()` static method, disabled `createAliases()` calls, updated `listComponents()` to use `configManager.getAvailableComponents()`
53
+ - `devtools/src/panel-entry.jsx` - Changed to use singleton access pattern, removed top-level logger import
54
+ - `devtools/src/components/DevToolsPanel.jsx` - Replaced `console.log` with JSG logger calls
55
+ - `devtools/src/components/GlobalControls.jsx` - Replaced `console.log` with JSG logger calls
56
+ - `devtools/src/components/DisplayControls.jsx` - Replaced all `console.log/warn` with JSG logger calls
57
+ - `devtools/src/App.jsx` - Fixed circular reference errors in error logging
58
+ - `formatters/browser-formatter.js` - Added circular reference detection in `displayContextData()`
59
+ - **Result**: DevTools panel now correctly uses singleton instance, component loggers persist, no duplicate entries, proper logging format throughout
60
+
61
+ ## [1.7.5] - 2025-11-06 🎛️ **DevTools Panel UX Improvements**
62
+
63
+ ### Added
64
+ - **Close Button on DevTools Panel** - Added X button in panel header to unload DevTools
65
+ - Located next to drag handle for easy access
66
+ - Hover effect (gray → red) for clear visual feedback
67
+ - Calls `disableDevPanel()` to completely unload the panel
68
+ - Logs panel closure using `devtools-ui` component
69
+
70
+ ### Changed
71
+ - **DevTools Toggle Button Text** - Improved button labels to be action-oriented
72
+ - Unloaded state: "Click to load DevTools" (was "✕ DevTools Unloaded")
73
+ - Loaded state: "Click to unload DevTools" (was "✓ DevTools Loaded")
74
+ - Clearer indication of what action will occur on click
75
+
76
+ ### Fixed
77
+ - **Button State Synchronization** - Fixed DevTools toggle button getting out of sync
78
+ - Added `jsg-devtools-destroyed` custom event dispatched when panel is destroyed
79
+ - App component listens for event to update button state automatically
80
+ - Button state now stays in sync whether panel is closed via X button or toggle button
81
+ - Uses event-driven architecture matching existing `devtoolschange` pattern
82
+
83
+ ### Technical Details
84
+ - **Files Modified**: `devtools/src/components/FloatingButton.jsx`, `devtools/src/components/DevToolsPanel.jsx`, `devtools/src/panel-entry.jsx`, `devtools/src/App.jsx`
85
+ - **Event System**: Custom event `jsg-devtools-destroyed` dispatched on panel destruction (both animation and immediate paths)
86
+ - **Result**: Improved UX with clear close action and reliable state synchronization
87
+
88
+ ## [1.7.4] - 2025-11-06 🎛️ **DevTools Logging Cleanup**
9
89
 
10
90
  ### Fixed
11
91
  - **Meta-Logger Scope** - Clarified meta-logger is for bootstrap logs only
@@ -0,0 +1,5 @@
1
+ const __viteBrowserExternal = {};
2
+ export {
3
+ __viteBrowserExternal as default
4
+ };
5
+ //# sourceMappingURL=__vite-browser-external-2Ng8QIWW-2Ng8QIWW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__vite-browser-external-2Ng8QIWW-2Ng8QIWW.js","sources":["__vite-browser-external-2Ng8QIWW.js"],"sourcesContent":["const __viteBrowserExternal = {};\nexport {\n __viteBrowserExternal as default\n};\n//# sourceMappingURL=__vite-browser-external-2Ng8QIWW.js.map\n"],"names":[],"mappings":"AAAK,MAAC,wBAAwB,CAAA;"}