@syntropysoft/syntropyfront 0.2.2 โ†’ 0.2.4

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/README.md CHANGED
@@ -7,13 +7,17 @@
7
7
  <p align="center">
8
8
  <strong>From Chaos to Clarity</strong>
9
9
  <br />
10
- The Observability Framework for High-Performance Teams
10
+ The Observability Library for High-Performance Teams
11
11
  </p>
12
12
 
13
13
  <p align="center">
14
14
  <a href="https://www.npmjs.com/package/@syntropysoft/syntropyfront"><img src="https://img.shields.io/npm/v/@syntropysoft/syntropyfront.svg" alt="NPM Version"></a>
15
15
  <a href="https://github.com/Syntropysoft/SyntropyLog/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@syntropysoft/syntropyfront.svg" alt="License"></a>
16
16
  <a href="#"><img src="https://img.shields.io/badge/status-ready%20for%20production-brightgreen.svg" alt="Ready for Production"></a>
17
+ <a href="#"><img src="https://github.com/Syntropysoft/syntropyfront/workflows/CodeQL/badge.svg" alt="CodeQL"></a>
18
+ <a href="#"><img src="https://img.shields.io/badge/dependabot-enabled-brightgreen.svg" alt="Dependabot"></a>
19
+ <a href="#"><img src="https://img.shields.io/badge/mutation%20score-75.94%25-brightgreen.svg" alt="Mutation Score"></a>
20
+ <a href="#"><img src="https://img.shields.io/badge/test%20coverage-91%2B%25-brightgreen.svg" alt="Test Coverage"></a>
17
21
  </p>
18
22
 
19
23
  ---
@@ -37,14 +41,14 @@ SyntropyFront automatically captures user interactions, errors, HTTP calls, and
37
41
  ### Basic Usage (1 line of code!)
38
42
 
39
43
  ```javascript
40
- import syntropyFront from 'syntropyfront';
44
+ import syntropyFront from '@syntropysoft/syntropyfront';
41
45
  // That's it! Auto-initializes and captures everything automatically
42
46
  ```
43
47
 
44
48
  ### With Custom Configuration
45
49
 
46
50
  ```javascript
47
- import syntropyFront from 'syntropyfront';
51
+ import syntropyFront from '@syntropysoft/syntropyfront';
48
52
 
49
53
  // Option 1: Console only (default)
50
54
  syntropyFront.configure({
@@ -93,7 +97,9 @@ syntropyFront.configure({
93
97
  ## ๐Ÿ“ฆ Installation
94
98
 
95
99
  ```bash
96
- npm install syntropyfront
100
+ npm install @syntropysoft/syntropyfront
101
+ ```
102
+
97
103
  ## ๐ŸŽฏ How It Works
98
104
 
99
105
  SyntropyFront automatically:
@@ -240,7 +246,7 @@ SyntropyFront captures the essentials by default, but you can extend it to captu
240
246
  ### Adding Custom Event Capture
241
247
 
242
248
  ```javascript
243
- import syntropyFront from 'syntropyfront';
249
+ import syntropyFront from '@syntropysoft/syntropyfront';
244
250
 
245
251
  // Add scroll tracking
246
252
  window.addEventListener('scroll', () => {
@@ -317,7 +323,7 @@ SyntropyFront works with any JavaScript framework:
317
323
 
318
324
  ```jsx
319
325
  import React from 'react';
320
- import syntropyFront from 'syntropyfront';
326
+ import syntropyFront from '@syntropysoft/syntropyfront';
321
327
 
322
328
  function App() {
323
329
  // SyntropyFront auto-initializes on import
@@ -339,7 +345,7 @@ function App() {
339
345
  </template>
340
346
 
341
347
  <script>
342
- import syntropyFront from 'syntropyfront';
348
+ import syntropyFront from '@syntropysoft/syntropyfront';
343
349
 
344
350
  export default {
345
351
  methods: {
@@ -354,7 +360,7 @@ export default {
354
360
  ### Manual Error Reporting
355
361
 
356
362
  ```javascript
357
- import syntropyFront from 'syntropyfront';
363
+ import syntropyFront from '@syntropysoft/syntropyfront';
358
364
 
359
365
  try {
360
366
  // Your code here
@@ -370,7 +376,7 @@ syntropyFront.sendError(new Error('Something went wrong'));
370
376
  ### Extending with Custom Events
371
377
 
372
378
  ```javascript
373
- import syntropyFront from 'syntropyfront';
379
+ import syntropyFront from '@syntropysoft/syntropyfront';
374
380
 
375
381
  // Add your custom event listeners
376
382
  window.addEventListener('scroll', () => {
@@ -397,6 +403,89 @@ window.addEventListener('load', () => {
397
403
  });
398
404
  ```
399
405
 
406
+ ## ๐Ÿ—๏ธ Architecture & Code Quality
407
+
408
+ SyntropyFront follows SOLID principles and maintains high code quality through:
409
+
410
+ ### Modular Architecture
411
+
412
+ The codebase is organized into focused modules with single responsibilities:
413
+
414
+ ```
415
+ src/core/
416
+ โ”œโ”€โ”€ agent/ # Core Agent components
417
+ โ”‚ โ”œโ”€โ”€ Agent.js # Main coordinator
418
+ โ”‚ โ”œโ”€โ”€ ConfigurationManager.js # Configuration handling
419
+ โ”‚ โ”œโ”€โ”€ QueueManager.js # Batching and queuing
420
+ โ”‚ โ””โ”€โ”€ HttpTransport.js # HTTP communication
421
+ โ”œโ”€โ”€ database/ # IndexedDB management
422
+ โ”‚ โ”œโ”€โ”€ DatabaseManager.js # Database coordinator
423
+ โ”‚ โ”œโ”€โ”€ DatabaseConfigManager.js # Configuration
424
+ โ”‚ โ”œโ”€โ”€ DatabaseConnectionManager.js # Connection handling
425
+ โ”‚ โ”œโ”€โ”€ DatabaseTransactionManager.js # Transaction management
426
+ โ”‚ โ”œโ”€โ”€ StorageManager.js # CRUD operations
427
+ โ”‚ โ””โ”€โ”€ SerializationManager.js # Data serialization
428
+ โ”œโ”€โ”€ retry/ # Retry system
429
+ โ”‚ โ”œโ”€โ”€ RetryManager.js # Retry coordination
430
+ โ”‚ โ””โ”€โ”€ RetryLogicManager.js # Retry logic
431
+ โ”œโ”€โ”€ persistent/ # Persistent buffer
432
+ โ”‚ โ””โ”€โ”€ PersistentBufferManager.js # Buffer management
433
+ โ”œโ”€โ”€ breadcrumbs/ # Event tracking
434
+ โ”‚ โ”œโ”€โ”€ BreadcrumbManager.js # Breadcrumb coordination
435
+ โ”‚ โ””โ”€โ”€ BreadcrumbStore.js # Breadcrumb storage
436
+ โ”œโ”€โ”€ context/ # Context collection
437
+ โ”‚ โ””โ”€โ”€ ContextCollector.js # Context gathering
438
+ โ””โ”€โ”€ utils/ # Utilities
439
+ โ”œโ”€โ”€ Logger.js # Logging utilities
440
+ โ””โ”€โ”€ ErrorManager.js # Error handling
441
+ ```
442
+
443
+ ### Design Principles
444
+
445
+ - **Single Responsibility Principle (SRP)**: Each class has one clear purpose
446
+ - **Dependency Injection**: Components receive dependencies through constructors
447
+ - **Declarative Error Handling**: Structured error responses with fallbacks
448
+ - **Comprehensive Testing**: 484 tests with 77.60% mutation score
449
+ - **Optimized Performance**: Timeouts optimized for faster execution
450
+
451
+ ## ๐Ÿงช Testing & Quality
452
+
453
+ SyntropyFront maintains high code quality through comprehensive testing:
454
+
455
+ ### Test Coverage & Mutation Testing
456
+
457
+ - **Mutation Score**: 77.60% - Our tests effectively detect code changes
458
+ - **Test Coverage**: 92.22% - Comprehensive unit test coverage
459
+ - **Key Components Performance**:
460
+ - `Agent.js`: 87.23% mutation score
461
+ - `ConfigurationManager.js`: 100% mutation score
462
+ - `QueueManager.js`: 97.37% mutation score
463
+ - `HttpTransport.js`: 86.96% mutation score
464
+ - `BreadcrumbManager.js`: 100% mutation score
465
+ - `BreadcrumbStore.js`: 95.00% mutation score
466
+ - `SerializationManager.js`: 100% mutation score
467
+ - `DatabaseTransactionManager.js`: 100% mutation score
468
+
469
+ ### Testing Stack
470
+
471
+ - **Jest**: Unit testing framework
472
+ - **Stryker**: Mutation testing for test quality validation
473
+ - **IndexedDB Mocking**: Browser storage testing
474
+ - **Fetch Mocking**: HTTP request testing
475
+
476
+ ### Running Tests
477
+
478
+ ```bash
479
+ # Run all tests
480
+ npm test
481
+
482
+ # Run with coverage
483
+ npm run test:coverage
484
+
485
+ # Run mutation testing
486
+ npm run test:mutation
487
+ ```
488
+
400
489
  ## ๐Ÿ” Debugging
401
490
 
402
491
  SyntropyFront logs helpful information to the console:
@@ -417,4 +506,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.
417
506
 
418
507
  ---
419
508
 
420
- **Made with โค๏ธ for better web observability**
509
+ **Made with โค๏ธ for better web observability**