@syntropysoft/syntropyfront 0.2.3 โ 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 +85 -0
- package/dist/index.cjs +328 -328
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +328 -328
- package/dist/index.js.map +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +19 -10
package/README.md
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
<a href="#"><img src="https://img.shields.io/badge/status-ready%20for%20production-brightgreen.svg" alt="Ready for Production"></a>
|
|
17
17
|
<a href="#"><img src="https://github.com/Syntropysoft/syntropyfront/workflows/CodeQL/badge.svg" alt="CodeQL"></a>
|
|
18
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>
|
|
19
21
|
</p>
|
|
20
22
|
|
|
21
23
|
---
|
|
@@ -401,6 +403,89 @@ window.addEventListener('load', () => {
|
|
|
401
403
|
});
|
|
402
404
|
```
|
|
403
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
|
+
|
|
404
489
|
## ๐ Debugging
|
|
405
490
|
|
|
406
491
|
SyntropyFront logs helpful information to the console:
|