mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
feat: implement atomic file writing and recovery utilities
- Introduced atomic write functionality for JSON files to ensure data integrity during writes. - Added recovery mechanisms to read JSON files with fallback options for corrupted or missing files. - Enhanced existing services to utilize atomic write and recovery features for improved reliability. - Updated tests to cover new atomic writing and recovery scenarios, ensuring robust error handling and data consistency.
This commit is contained in:
@@ -53,6 +53,20 @@ export {
|
||||
// File system utilities
|
||||
export { mkdirSafe, existsSafe } from './fs-utils.js';
|
||||
|
||||
// Atomic file operations
|
||||
export {
|
||||
atomicWriteJson,
|
||||
readJsonFile,
|
||||
updateJsonAtomically,
|
||||
readJsonWithRecovery,
|
||||
rotateBackups,
|
||||
logRecoveryWarning,
|
||||
DEFAULT_BACKUP_COUNT,
|
||||
type AtomicWriteOptions,
|
||||
type ReadJsonRecoveryResult,
|
||||
type ReadJsonRecoveryOptions,
|
||||
} from './atomic-writer.js';
|
||||
|
||||
// Path utilities
|
||||
export { normalizePath, pathsEqual } from './path-utils.js';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user