|
1 | 1 | # git-json-resolver
|
2 | 2 |
|
| 3 | +## 1.0.0 |
| 4 | + |
| 5 | +### Major Changes |
| 6 | + |
| 7 | +- 7e959e6: # 🚨 Breaking Change: Array Merge Strategy |
| 8 | + |
| 9 | + **Arrays are no longer merged element-by-element** under the default `merge` strategy. |
| 10 | + |
| 11 | + ## What Changed |
| 12 | + - Only **plain objects** are merged by default |
| 13 | + - Arrays now require explicit strategies: `concat`, `unique`, or custom resolvers |
| 14 | + |
| 15 | + ## Why This Change |
| 16 | + |
| 17 | + Previous array merging was unpredictable when arrays had: |
| 18 | + - Different lengths |
| 19 | + - Different semantic meanings |
| 20 | + - Mixed data types |
| 21 | + |
| 22 | + ## Migration Guide |
| 23 | + |
| 24 | + ```ts |
| 25 | + // Before (automatic array merging) |
| 26 | + rules: [{ pattern: "*", strategy: "merge" }]; |
| 27 | + |
| 28 | + // After (explicit array handling) |
| 29 | + rules: [ |
| 30 | + { pattern: "dependencies", strategy: "concat" }, |
| 31 | + { pattern: "scripts", strategy: "ours" }, |
| 32 | + { pattern: "*", strategy: "merge" }, // objects only |
| 33 | + ]; |
| 34 | + ``` |
| 35 | + |
| 36 | + This ensures **predictable and safe** conflict resolution. |
| 37 | + |
| 38 | +### Minor Changes |
| 39 | + |
| 40 | +- Add `concat` and `unique` array merge strategies |
| 41 | + - **`concat`**: Concatenate arrays from both sides (applies only if both are arrays) |
| 42 | + - **`unique`**: Merge arrays and remove duplicates (applies only if both are arrays) |
| 43 | + |
| 44 | + These strategies provide explicit control over array merging behavior for better conflict resolution. |
| 45 | + |
| 46 | +- 50f0ee1: # 📁 Configurable Backup Path |
| 47 | + |
| 48 | + ## New Feature |
| 49 | + |
| 50 | + **Backup file location is now fully configurable** for enhanced flexibility. |
| 51 | + |
| 52 | + ## Usage |
| 53 | + |
| 54 | + ```ts |
| 55 | + import { resolveConflicts } from "git-json-resolver"; |
| 56 | + |
| 57 | + resolveConflicts({ |
| 58 | + filePath: "package.json", |
| 59 | + backupPath: "./backups/package.json.backup", // Custom backup location |
| 60 | + rules: [ |
| 61 | + /* your rules */ |
| 62 | + ], |
| 63 | + }); |
| 64 | + ``` |
| 65 | + |
| 66 | + ## Benefits |
| 67 | + - **Custom backup directories** for better organization |
| 68 | + - **Integration with existing backup strategies** |
| 69 | + - **Compliance with project structure requirements** |
| 70 | + |
| 71 | +- e3f85e9: # 🔄 CLI Restore Command |
| 72 | + |
| 73 | + ## New CLI Feature |
| 74 | + |
| 75 | + **Restore backup files** with a dedicated command for quick recovery. |
| 76 | + |
| 77 | + ## Usage |
| 78 | + |
| 79 | + ```bash |
| 80 | + # Restore specific backup |
| 81 | + npx git-json-resolver restore package.json.backup |
| 82 | + |
| 83 | + # Restore all backups in directory |
| 84 | + npx git-json-resolver restore --all |
| 85 | + |
| 86 | + # Restore with confirmation prompt |
| 87 | + npx git-json-resolver restore --interactive |
| 88 | + ``` |
| 89 | + |
| 90 | + ## Benefits |
| 91 | + - **Quick recovery** from failed merges |
| 92 | + - **Batch restore operations** for multiple files |
| 93 | + - **Interactive mode** for safer restoration |
| 94 | + - **Seamless CI/CD integration** for rollback scenarios |
| 95 | + |
| 96 | +- 58df9b2: # ⚡ Pattern Negation Support |
| 97 | + |
| 98 | + ## New Matcher Feature |
| 99 | + |
| 100 | + **Pattern negation with `!` prefix** for the default `basicMatcher`. |
| 101 | + |
| 102 | + ## Usage |
| 103 | + |
| 104 | + ```ts |
| 105 | + import { resolveConflicts } from "git-json-resolver"; |
| 106 | + |
| 107 | + resolveConflicts({ |
| 108 | + filePath: "package.json", |
| 109 | + rules: [ |
| 110 | + { pattern: "dependencies.*", strategy: "ours" }, |
| 111 | + { pattern: "!dependencies.react", strategy: "theirs" }, // Negation |
| 112 | + { pattern: "scripts.*", strategy: "merge" }, |
| 113 | + { pattern: "!scripts.test", strategy: "manual" }, // Exception |
| 114 | + ], |
| 115 | + }); |
| 116 | + ``` |
| 117 | + |
| 118 | + ## Benefits |
| 119 | + - **Fine-grained control** over merge strategies |
| 120 | + - **Exception handling** within broader patterns |
| 121 | + - **Intuitive syntax** familiar from gitignore patterns |
| 122 | + - **Enhanced rule flexibility** for complex scenarios |
| 123 | + |
| 124 | +### Patch Changes |
| 125 | + |
| 126 | +- 973fc14: # 🔧 Code Refactoring |
| 127 | + |
| 128 | + ## Normalizer Simplification |
| 129 | + - **Streamlined normalizer logic** for better maintainability |
| 130 | + - **Moved file handling utilities** to dedicated utils module |
| 131 | + - **Improved separation of concerns** between components |
| 132 | + |
| 133 | + ## Benefits |
| 134 | + - Cleaner, more focused code structure |
| 135 | + - Enhanced testability and debugging |
| 136 | + - Better code reusability across modules |
| 137 | + |
| 138 | +- f9d3ea8: # 🚀 Quality & Performance Improvements |
| 139 | + |
| 140 | + ## Enhanced Error Handling |
| 141 | + - **More descriptive error messages** with context |
| 142 | + - **Graceful fallbacks** for edge cases |
| 143 | + - **Better error recovery** mechanisms |
| 144 | + |
| 145 | + ## Expanded Test Coverage |
| 146 | + - **Additional unit tests** for critical paths |
| 147 | + - **Edge case validation** scenarios |
| 148 | + - **Performance regression tests** |
| 149 | + |
| 150 | + ## Performance Enhancements |
| 151 | + - **Optimized pattern matching** algorithms |
| 152 | + - **Reduced memory footprint** for large files |
| 153 | + - **Faster conflict resolution** processing |
| 154 | + |
| 155 | + ## Benefits |
| 156 | + - More reliable conflict resolution |
| 157 | + - Better debugging experience |
| 158 | + - Improved performance for large repositories |
| 159 | + |
3 | 160 | ## 0.1.8
|
4 | 161 |
|
5 | 162 | ### Patch Changes
|
|
0 commit comments