@crimsonsunset/jsg-logger 1.1.6 โ†’ 1.1.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/CONTRIBUTING.md CHANGED
@@ -5,7 +5,7 @@
5
5
  **This is a personal utility project that has been extracted and published for reuse.**
6
6
 
7
7
  Contributions are welcome, but please note:
8
- - This project emerged from a specific use case (Chrome Audio Control Platform)
8
+ - This project emerged from a specific use case but is now a generic multi-environment logger
9
9
  - The core functionality is stable and feature-complete for most use cases
10
10
  - Major architectural changes should be discussed in an issue first
11
11
 
package/README.md CHANGED
@@ -345,12 +345,12 @@ const stats = logger.controls.getStats();
345
345
  ### **๐Ÿš€ BREAKTHROUGH: Perfect Browser Formatting**
346
346
  ```
347
347
  // Direct browser logger with 100% style control:
348
- 12:00 AM ๐ŸŽฏ [CACP-CORE] โœจ CACP Extension v0.3.2 - Logger Ready!
348
+ 12:00 AM ๐ŸŽฏ [JSG-CORE] โœจ JSG Application v1.0.0 - Logger Ready!
349
349
  12:00 AM ๐ŸŽต [SOUNDCLOUD] MediaSession track change detected
350
350
  โ”œโ”€ title: Alt-J - Breezeblocks (Gkat Remix)
351
351
  โ”œโ”€ artist: Gkat
352
352
  โ”œโ”€ hasArtwork: true
353
- 12:00 AM ๐ŸŽฏ [CACP-CORE] ๐Ÿงช Testing JSON context display
353
+ 12:00 AM ๐ŸŽฏ [JSG-CORE] ๐Ÿงช Testing JSON context display
354
354
  โ”œโ”€ testData: {nested: {...}, simple: 'test string', boolean: true}
355
355
  โ”œโ”€ location: {href: 'https://soundcloud.com/discover', hostname: 'soundcloud.com'}
356
356
  โ”œโ”€ timestamp: 2025-07-29T06:00:53.837Z
@@ -68,10 +68,10 @@
68
68
  **Solution**: Build essential patterns directly into the JSG Logger package
69
69
 
70
70
  ### **โœ… COMPLETED THIS SESSION:**
71
- - [x] **Static Singleton Pattern** - `CACPLogger.getInstance()` methods
71
+ - [x] **Static Singleton Pattern** - `JSGLogger.getInstance()` methods
72
72
  - [x] **Auto-Discovery Getters** - Both camelCase and kebab-case component access
73
73
  - [x] **Non-Destructive Error Handling** - Missing components log but don't break
74
- - [x] **Static Performance Logging** - `CACPLogger.logPerformance()` utility
74
+ - [x] **Static Performance Logging** - `JSGLogger.logPerformance()` utility
75
75
  - [x] **Enhanced Export Structure** - Components and getComponent available
76
76
 
77
77
  ### **โœ… PHASE 8 API ENHANCEMENT COMPLETE:**
package/docs/roadmap.md CHANGED
@@ -21,9 +21,9 @@
21
21
 
22
22
  ## ๐ŸŽฏ Current Status
23
23
  **Last Updated:** August 21, 2025
24
- **Current Phase:** Phase 9 - Genericize Logger (Remove CACP Hardcoding)
25
- **Status:** ๐Ÿš€ **IN PROGRESS** - Making JSG Logger truly generic by removing CACP-specific hardcoded components
26
- **Current Issue:** Logger still loads CACP defaults instead of project-specific `logger-config.json` files
24
+ **Current Phase:** Phase 9 - Genericize Logger (Remove Legacy Hardcoding)
25
+ **Status:** ๐Ÿš€ **IN PROGRESS** - Making JSG Logger truly generic by removing legacy-specific hardcoded components
26
+ **Current Issue:** Logger still loads legacy defaults instead of project-specific `logger-config.json` files
27
27
 
28
28
  ### Progress Overview
29
29
  - โœ… **COMPLETED:** Multi-environment logger with smart detection
@@ -340,14 +340,14 @@ Console filtering updates
340
340
 
341
341
  ## ๐Ÿ“ˆ Recent Progress
342
342
 
343
- ### August 21, 2025 - Phase 9 Discovery: CACP Hardcoding Issues ๐Ÿ”
344
- - ๐Ÿ› **Critical Discovery**: JSG Logger still deeply hardcoded for CACP use cases
345
- - ๐Ÿ” **Issue Identified**: `logger-config.json` files being ignored, falling back to CACP defaults
343
+ ### August 21, 2025 - Phase 9 Discovery: Legacy Hardcoding Issues ๐Ÿ”
344
+ - ๐Ÿ› **Critical Discovery**: JSG Logger still deeply hardcoded for legacy use cases
345
+ - ๐Ÿ” **Issue Identified**: `logger-config.json` files being ignored, falling back to legacy defaults
346
346
  - ๐Ÿ“‹ **Root Causes Documented**: 6 major areas requiring genericization
347
- 1. `CACPLogger` class name and all references
348
- 2. Default config with 10 hardcoded CACP components
347
+ 1. `JSGLogger` class name and all references โœ… COMPLETED
348
+ 2. Default config with 10 hardcoded legacy components
349
349
  3. Component schemes duplication
350
- 4. Hardcoded legacy aliases for CACP components
350
+ 4. Hardcoded legacy aliases for legacy components
351
351
  5. Core component dependency on 'cacp' logger
352
352
  6. Config loading path resolution issues
353
353
  - ๐ŸŽฏ **Phase 9 Planned**: Complete roadmap for making logger truly generic
@@ -355,7 +355,7 @@ Console filtering updates
355
355
 
356
356
  ### August 21, 2025 - Phase 8 API Enhancement Complete โœ…
357
357
  - โœ… **JSG Logger v1.1.0** - Major API simplification enhancements shipped
358
- - โœ… **Static Singleton Pattern** - `CACPLogger.getInstance()` with auto-initialization
358
+ - โœ… **Static Singleton Pattern** - `JSGLogger.getInstance()` with auto-initialization
359
359
  - โœ… **Auto-Discovery Components** - Both camelCase and kebab-case access patterns
360
360
  - โœ… **Non-Destructive Error Handling** - Missing components log but don't break apps
361
361
  - โœ… **Built-in Performance Logging** - `JSGLogger.logPerformance()` static utility
@@ -433,7 +433,7 @@ Projects using JSG Logger currently need to implement ~220 lines of boilerplate:
433
433
  #### **Solution - Built-in Enhancement Features**
434
434
 
435
435
  **โœ… Design Decisions Made:**
436
- 1. **getInstance location**: Static on CACPLogger class
436
+ 1. **getInstance location**: Static on JSGLogger class
437
437
  2. **Auto-discovery naming**: Both camelCase and kebab-case support
438
438
  3. **Performance logging**: Static utility `JSGLogger.logPerformance(...)`
439
439
  4. **Error handling**: Non-destructive with helpful logging (no fallbacks)
@@ -444,12 +444,12 @@ Projects using JSG Logger currently need to implement ~220 lines of boilerplate:
444
444
 
445
445
  ##### **Enhancement 1: Static Singleton Pattern**
446
446
  ```javascript
447
- // Static method on CACPLogger class
448
- const logger = CACPLogger.getInstance(config);
449
- const logger2 = CACPLogger.getInstance(); // Same instance, no config needed
447
+ // Static method on JSGLogger class
448
+ const logger = JSGLogger.getInstance(config);
449
+ const logger2 = JSGLogger.getInstance(); // Same instance, no config needed
450
450
  ```
451
451
 
452
- **Implementation Location**: `index.js` CACPLogger class
452
+ **Implementation Location**: `index.js` JSGLogger class
453
453
  - Add `static _instance = null`
454
454
  - Add `static async getInstance(options = {})`
455
455
  - Add `static getInstanceSync(options = {})` for sync environments
@@ -575,32 +575,32 @@ export { logger, JSGLogger };
575
575
 
576
576
  ---
577
577
 
578
- ### **Phase 9: Genericize Logger (Remove CACP Hardcoding)** ๐Ÿš€ IN PROGRESS
579
- **Goal**: Make JSG Logger truly generic by removing all CACP-specific hardcoded components and references
578
+ ### **Phase 9: Genericize Logger (Remove Legacy Hardcoding)** ๐Ÿš€ IN PROGRESS
579
+ **Goal**: Make JSG Logger truly generic by removing all legacy-specific hardcoded components and references
580
580
 
581
581
  #### **Background - The Problem**
582
- During Phase 8 integration testing with jsg-tech-check-site, we discovered the logger is still deeply hardcoded for CACP (Chrome Audio Control Panel) use cases:
582
+ During Phase 8 integration testing with jsg-tech-check-site, we discovered the logger is still deeply hardcoded for legacy use cases:
583
583
 
584
584
  **Observable Issues:**
585
585
  ```
586
586
  [JSG-LOGGER] Component 'astro-build' not found. Available: cacp, soundcloud, youtube, site-detector, websocket, popup, background, priority-manager, settings, test, siteDetector, priorityManager
587
587
  ```
588
588
 
589
- Despite providing a proper `logger-config.json` with Astro-specific components, the logger falls back to CACP defaults instead of loading the project's configuration.
589
+ Despite providing a proper `logger-config.json` with Astro-specific components, the logger falls back to legacy defaults instead of loading the project's configuration.
590
590
 
591
- #### **Root Causes - What Makes It CACP-Specific**
591
+ #### **Root Causes - What Makes It Legacy-Specific**
592
592
 
593
593
  ##### **1. Class Name & Core References**
594
- - `CACPLogger` class name should be `JSGLogger` or `GenericLogger`
595
- - All static method references (`CACPLogger.getInstance()`, etc.)
596
- - Error messages mentioning "CACP Logger"
597
- - `window.CACP_Logger` global should be `window.JSG_Logger`
594
+ - โœ… `JSGLogger` class name updated
595
+ - โœ… All static method references (`JSGLogger.getInstance()`, etc.)
596
+ - โœ… Error messages mentioning "JSG Logger"
597
+ - โœ… `window.JSG_Logger` global updated
598
598
 
599
599
  ##### **2. Default Configuration Hardcoding**
600
600
  **File:** `/config/default-config.json`
601
- - **Hardcoded project name**: `"CACP Logger"`
602
- - **10 CACP-specific components**:
603
- - `cacp` (๐ŸŽฏ CACP-CORE) - should be generic `core`
601
+ - **Hardcoded project name**: โœ… `"JSG Logger"`
602
+ - **10 legacy-specific components**:
603
+ - `cacp` (๐ŸŽฏ JSG-CORE) - should be generic `core`
604
604
  - `soundcloud` (๐ŸŽต SoundCloud)
605
605
  - `youtube` (๐Ÿ“น YouTube)
606
606
  - `site-detector` (๐Ÿ” SiteDetector)
@@ -613,7 +613,7 @@ Despite providing a proper `logger-config.json` with Astro-specific components,
613
613
 
614
614
  ##### **3. Component Schemes Duplication**
615
615
  **File:** `/config/component-schemes.js`
616
- - Duplicates the same 10 hardcoded CACP components
616
+ - Duplicates the same 10 hardcoded legacy components
617
617
  - Should be empty/minimal by default for generic usage
618
618
 
619
619
  ##### **4. Hardcoded Legacy Aliases**
@@ -627,13 +627,13 @@ this.loggers.priorityManager = this.loggers['priority-manager'];
627
627
  ```javascript
628
628
  // Initialization requires 'cacp' component:
629
629
  if (this.loggers.cacp) {
630
- this.loggers.cacp.info('CACP Logger initialized', {...});
630
+ this.loggers.cacp.info('JSG Logger initialized', {...});
631
631
  }
632
632
  ```
633
633
 
634
634
  ##### **6. Config Loading Path Issue**
635
635
  - **Critical**: The logger isn't loading our `logger-config.json` properly
636
- - Falls back to default CACP config instead of using project-specific configurations
636
+ - Falls back to default legacy config instead of using project-specific configurations
637
637
  - **Why our Astro config is ignored**: Path resolution or config merging logic issues
638
638
 
639
639
  #### **๐Ÿ”ง Implementation Plan**
@@ -660,7 +660,7 @@ if (this.loggers.cacp) {
660
660
  - `CACPLogger` โ†’ `JSGLogger`
661
661
  - Update all static method references
662
662
  - Update error messages
663
- - Update browser global: `window.CACP_Logger` โ†’ `window.JSG_Logger`
663
+ - โœ… Update browser global: `window.JSG_Logger`
664
664
 
665
665
  ##### **Fix 3: Fix Config Loading**
666
666
  **Target**: Config manager and initialization
@@ -668,7 +668,7 @@ if (this.loggers.cacp) {
668
668
  - Ensure project configs override defaults instead of falling back
669
669
  - Fix path resolution for various environments (Node.js vs browser)
670
670
 
671
- ##### **Fix 4: Remove CACP-Specific Logic**
671
+ ##### **Fix 4: Remove Legacy-Specific Logic**
672
672
  **Target**: `/index.js` `createAliases()` method
673
673
  - Remove hardcoded legacy aliases for `siteDetector`, `priorityManager`
674
674
  - Make aliases configurable if needed, not hardcoded
@@ -681,21 +681,21 @@ if (this.loggers.cacp) {
681
681
 
682
682
  ##### **Fix 6: Clean Component Schemes**
683
683
  **Target**: `/config/component-schemes.js`
684
- - Remove all CACP-specific hardcoded components
684
+ - Remove all legacy-specific hardcoded components
685
685
  - Keep only minimal example or make it empty
686
686
  - Let projects define their own components
687
687
 
688
688
  #### **๐ŸŽฏ Success Criteria**
689
- 1. โœ… **Generic by Default**: Fresh installations work without CACP references
689
+ 1. โœ… **Generic by Default**: Fresh installations work without legacy references
690
690
  2. โœ… **Config Loading Works**: Project-specific `logger-config.json` files are properly loaded
691
- 3. โœ… **No CACP Dependencies**: Logger works without any CACP-specific components
692
- 4. โœ… **Clean API**: `JSGLogger.getInstance()` instead of `CACPLogger.getInstance()`
691
+ 3. โœ… **No Legacy Dependencies**: Logger works without any legacy-specific components
692
+ 4. โœ… **Clean API**: `JSGLogger.getInstance()` working correctly
693
693
  5. โœ… **Test with Real Project**: jsg-tech-check-site loads Astro components correctly
694
694
 
695
695
  #### **๐Ÿ“‹ Implementation Steps**
696
696
  1. **Debug config loading** - Fix why `logger-config.json` is ignored
697
- 2. **Rename core class** - `CACPLogger` โ†’ `JSGLogger`
698
- 3. **Replace default config** - Remove 10 CACP components, use minimal generic
697
+ 2. โœ… **Rename core class** - `JSGLogger` completed
698
+ 3. **Replace default config** - Remove 10 legacy components, use minimal generic
699
699
  4. **Remove hardcoded aliases** - Make legacy aliases configurable
700
700
  5. **Fix core component** - Use configurable core for init logging
701
701
  6. **Update browser global** - `window.JSG_Logger`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crimsonsunset/jsg-logger",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "description": "JSG Logger - Multi-environment logger with smart detection, file-level overrides, and beautiful console formatting",
6
6
  "main": "index.js",