@crimsonsunset/jsg-logger 1.7.5 → 1.7.7
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 +76 -0
- package/devtools/dist/__vite-browser-external-2Ng8QIWW-2Ng8QIWW-2Ng8QIWW.js +5 -0
- package/devtools/dist/__vite-browser-external-2Ng8QIWW-2Ng8QIWW-2Ng8QIWW.js.map +1 -0
- package/devtools/dist/{panel-entry-BZ56bT66.js → panel-entry-BZ56bT66-BMyD75mc.js} +4 -4
- package/devtools/dist/panel-entry-BZ56bT66-BMyD75mc.js.map +1 -0
- package/devtools/dist/panel-entry-Da9n85v7.js +13631 -0
- package/devtools/dist/panel-entry-Da9n85v7.js.map +1 -0
- package/devtools/dist/{panel-entry-DzGsV7s--DzGsV7s-.js → panel-entry-DzGsV7s--DzGsV7s--DzGsV7s-.js} +1 -1
- package/devtools/dist/panel-entry-DzGsV7s--DzGsV7s--DzGsV7s-.js.map +1 -0
- package/devtools/dist/panel-entry.js +3003 -2906
- package/devtools/dist/panel-entry.js.map +1 -1
- package/formatters/browser-formatter.js +1 -1
- package/index.js +18 -5
- package/package.json +1 -1
- package/devtools/dist/panel-entry-BZ56bT66.js.map +0 -1
- package/devtools/dist/panel-entry-DzGsV7s--DzGsV7s-.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,82 @@ 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.7] - 2025-11-07 🔧 **DevTools Import Path Fix**
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **DevTools Panel Import Resolution** - Fixed DevTools panel failing to load in Vite-based projects
|
|
12
|
+
- Changed from relative path imports (`./devtools/dist/panel-entry.js`) to package export path (`@crimsonsunset/jsg-logger/devtools`)
|
|
13
|
+
- Resolves Vite module resolution and caching issues with relative paths from `node_modules`
|
|
14
|
+
- Works consistently across Vite dev server, production builds, and other bundlers
|
|
15
|
+
- No longer requires excluding logger from Vite's dependency optimization
|
|
16
|
+
- Fixes 404 errors and "Could not resolve import" errors when calling `enableDevPanel()`
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **DevTools Import Strategy** - Updated to use package export paths for better bundler compatibility
|
|
20
|
+
- Pre-load import (line 30): Now uses `@crimsonsunset/jsg-logger/devtools` instead of relative path
|
|
21
|
+
- Dynamic import (line 534): Now uses `@crimsonsunset/jsg-logger/devtools` instead of relative path
|
|
22
|
+
- Package export path resolves through `package.json` exports field for explicit, unambiguous resolution
|
|
23
|
+
- Eliminates Vite caching issues that occurred with relative path resolution
|
|
24
|
+
|
|
25
|
+
### Technical Details
|
|
26
|
+
- **Files Modified**: `index.js` (lines 30, 534)
|
|
27
|
+
- **Root Cause**: Relative paths from within `node_modules` can cause Vite's dependency optimizer to cache incorrect resolutions or fail to resolve paths correctly
|
|
28
|
+
- **Solution**: Package export paths are explicitly defined in `package.json` and resolved consistently by all modern bundlers
|
|
29
|
+
- **Impact**: DevTools panel now loads reliably in all Vite-based projects without special configuration
|
|
30
|
+
|
|
31
|
+
## [1.7.6] - 2025-11-06 🎛️ **DevTools Singleton Fix & Logging Improvements**
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
- **Static `getControls()` Method** - Added `JSGLogger.getControls()` static method for accessing singleton controls
|
|
35
|
+
- Returns `controls` object from existing singleton instance without triggering initialization
|
|
36
|
+
- Provides clean access point for DevTools panel to get logger controls
|
|
37
|
+
- Returns `null` if singleton not yet initialized
|
|
38
|
+
- Prevents DevTools from creating new logger instance when accessing controls
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
- **DevTools Singleton Re-initialization** - Fixed DevTools panel creating new logger instance on open
|
|
42
|
+
- DevTools panel now uses `JSGLogger.getControls()` and `JSGLogger.getInstanceSync()` instead of top-level imports
|
|
43
|
+
- Prevents loss of component loggers when DevTools opens
|
|
44
|
+
- Component loggers now persist correctly across DevTools open/close cycles
|
|
45
|
+
- Fixed issue where opening DevTools would reset logger to default config with only "core" component
|
|
46
|
+
- **Component List Duplicates** - Fixed duplicate component entries in DevTools UI
|
|
47
|
+
- `listComponents()` now returns only kebab-case names from config (e.g., `devtools-ui`)
|
|
48
|
+
- Removed camelCase aliases from component list display
|
|
49
|
+
- CamelCase access still available via `logger.components.camelCase()` getters for backward compatibility
|
|
50
|
+
- UI now shows clean, non-duplicated component list
|
|
51
|
+
- **Circular Reference Errors** - Fixed circular reference errors when logging objects
|
|
52
|
+
- Added circular reference detection in browser formatter `displayContextData()` function
|
|
53
|
+
- Removed problematic object logging (theme objects, logger instances, panel instances)
|
|
54
|
+
- Error logging now extracts only safe properties (`message`, `stack`) to avoid serialization issues
|
|
55
|
+
- DevTools panel initialization no longer throws circular reference errors
|
|
56
|
+
- **DevTools Logging Format** - Fixed DevTools logs to use proper JSG logger formatting
|
|
57
|
+
- Replaced all `console.log()` calls in DevTools components with JSG logger calls
|
|
58
|
+
- DevTools logs now show timestamps, emojis, colors, and structured output
|
|
59
|
+
- All DevTools component logs (DevToolsPanel, GlobalControls, DisplayControls) use `devtools-ui` component logger
|
|
60
|
+
- Logs now match standard JSG logger format instead of plain `[JSG-DEVTOOLS]` console messages
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
- **DevTools Panel Logger Access** - Updated DevTools panel to use singleton access pattern
|
|
64
|
+
- `panel-entry.jsx` now imports `{ JSGLogger }` class instead of default export
|
|
65
|
+
- Uses `JSGLogger.getInstanceSync()` for full logger instance access
|
|
66
|
+
- Uses `JSGLogger.getControls()` for controls API access
|
|
67
|
+
- Prevents module-level initialization from creating new singleton instance
|
|
68
|
+
- **Component Alias Creation** - Disabled camelCase aliases in `this.loggers` object
|
|
69
|
+
- Commented out `createAliases()` calls in `init()` and `initSync()` methods
|
|
70
|
+
- CamelCase aliases no longer added to `this.loggers` (prevents duplicates in `listComponents()`)
|
|
71
|
+
- CamelCase access still works via `components` getters (e.g., `logger.components.devtoolsUi()`)
|
|
72
|
+
|
|
73
|
+
### Technical Details
|
|
74
|
+
- **Files Modified**:
|
|
75
|
+
- `index.js` - Added `getControls()` static method, disabled `createAliases()` calls, updated `listComponents()` to use `configManager.getAvailableComponents()`
|
|
76
|
+
- `devtools/src/panel-entry.jsx` - Changed to use singleton access pattern, removed top-level logger import
|
|
77
|
+
- `devtools/src/components/DevToolsPanel.jsx` - Replaced `console.log` with JSG logger calls
|
|
78
|
+
- `devtools/src/components/GlobalControls.jsx` - Replaced `console.log` with JSG logger calls
|
|
79
|
+
- `devtools/src/components/DisplayControls.jsx` - Replaced all `console.log/warn` with JSG logger calls
|
|
80
|
+
- `devtools/src/App.jsx` - Fixed circular reference errors in error logging
|
|
81
|
+
- `formatters/browser-formatter.js` - Added circular reference detection in `displayContextData()`
|
|
82
|
+
- **Result**: DevTools panel now correctly uses singleton instance, component loggers persist, no duplicate entries, proper logging format throughout
|
|
83
|
+
|
|
8
84
|
## [1.7.5] - 2025-11-06 🎛️ **DevTools Panel UX Improvements**
|
|
9
85
|
|
|
10
86
|
### Added
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__vite-browser-external-2Ng8QIWW-2Ng8QIWW-2Ng8QIWW.js","sources":["__vite-browser-external-2Ng8QIWW-2Ng8QIWW.js"],"sourcesContent":["const __viteBrowserExternal = {};\nexport {\n __viteBrowserExternal as default\n};\n//# sourceMappingURL=__vite-browser-external-2Ng8QIWW-2Ng8QIWW.js.map\n"],"names":[],"mappings":"AAAK,MAAC,wBAAwB,CAAA;"}
|
|
@@ -12068,7 +12068,7 @@ class ConfigManager {
|
|
|
12068
12068
|
return module.default || module;
|
|
12069
12069
|
} catch (error) {
|
|
12070
12070
|
try {
|
|
12071
|
-
const fs = await import("./__vite-browser-external-2Ng8QIWW-2Ng8QIWW.js");
|
|
12071
|
+
const fs = await import("./__vite-browser-external-2Ng8QIWW-2Ng8QIWW-2Ng8QIWW.js");
|
|
12072
12072
|
const fileContent = await fs.readFile(path, "utf-8");
|
|
12073
12073
|
return JSON.parse(fileContent);
|
|
12074
12074
|
} catch (fsError) {
|
|
@@ -12867,7 +12867,7 @@ let devtoolsModule = null;
|
|
|
12867
12867
|
let devtoolsModulePromise = null;
|
|
12868
12868
|
if (defaultDevtoolsEnabled) {
|
|
12869
12869
|
metaLog("[JSG-LOGGER] DevTools module pre-loading started (default config enabled)");
|
|
12870
|
-
devtoolsModulePromise = import("./panel-entry-DzGsV7s--DzGsV7s-.js").then((module) => {
|
|
12870
|
+
devtoolsModulePromise = import("./panel-entry-DzGsV7s--DzGsV7s--DzGsV7s-.js").then((module) => {
|
|
12871
12871
|
devtoolsModule = module;
|
|
12872
12872
|
metaLog("[JSG-LOGGER] DevTools module pre-loaded successfully");
|
|
12873
12873
|
return module;
|
|
@@ -13240,7 +13240,7 @@ const _JSGLogger = class _JSGLogger2 {
|
|
|
13240
13240
|
devtoolsModule = await devtoolsModulePromise;
|
|
13241
13241
|
} else {
|
|
13242
13242
|
devtoolsLogger2.info("Loading DevTools module dynamically (runtime config override)...");
|
|
13243
|
-
devtoolsModule = await import("./panel-entry-DzGsV7s--DzGsV7s-.js");
|
|
13243
|
+
devtoolsModule = await import("./panel-entry-DzGsV7s--DzGsV7s--DzGsV7s-.js");
|
|
13244
13244
|
}
|
|
13245
13245
|
} else {
|
|
13246
13246
|
devtoolsLogger2.info("Using pre-loaded DevTools module");
|
|
@@ -13599,4 +13599,4 @@ export {
|
|
|
13599
13599
|
initializePanel,
|
|
13600
13600
|
togglePanel
|
|
13601
13601
|
};
|
|
13602
|
-
//# sourceMappingURL=panel-entry-BZ56bT66.js.map
|
|
13602
|
+
//# sourceMappingURL=panel-entry-BZ56bT66-BMyD75mc.js.map
|