also looking at this
fix: synchronize drifted native versions in recursive releases
#2015
2 files
+26
-2
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -436,13 +436,13 @@ export function updateVersionInFile(filePath: string, oldVersion: string, newVer | ||
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | const packageJson = JSON.parse(jsonContent) |
| 439 | const declaredVersion = forceUpdate ? String(packageJson.version) : oldVersion | |
| 439 | 440 | if (packageJson.version === oldVersion || forceUpdate) { |
| 440 | 441 | packageJson.version = newVersion |
| 441 | 442 | |
| 442 | 443 | // For JSONC files, preserve the original formatting with comments |
| 443 | 444 | if (isJsonc) { |
| 444 | 445 | // Replace the version value while preserving comments and formatting |
| 445 | const declaredVersion = forceUpdate ? String(packageJson.version) : oldVersion | |
| 446 | 446 | const versionRegex = new RegExp( |
| 447 | 447 | `(["']version["']\\s*:\\s*)["']${declaredVersion.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}["']`, |
| 448 | 448 | 'g', |