relacher 0.0.4-rc.3 → 0.0.4-rc.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/package.json +3 -2
- package/src/updater/toml.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relacher",
|
|
3
|
-
"version": "0.0.4-rc.
|
|
3
|
+
"version": "0.0.4-rc.4",
|
|
4
4
|
"description": "Scriptable release orchestration library for monorepos",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -57,8 +57,9 @@
|
|
|
57
57
|
"oxlint": "^1.64.0",
|
|
58
58
|
"prettier": "^3.8.3",
|
|
59
59
|
"typescript": "^6.0.3"
|
|
60
|
-
},
|
|
60
|
+
},
|
|
61
61
|
"dependencies": {
|
|
62
|
+
"@decimalturn/toml-patch": "^2.0.0",
|
|
62
63
|
"smol-toml": "^1.6.1"
|
|
63
64
|
}
|
|
64
65
|
}
|
package/src/updater/toml.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { patch } from '@decimalturn/toml-patch';
|
|
5
|
+
import { parse } from 'smol-toml';
|
|
5
6
|
|
|
6
7
|
import type { DependencyUpdateReport } from '../types';
|
|
7
8
|
|
|
@@ -44,6 +45,9 @@ export const tomlUpdate = updateBuilder<TomlUpdateParams>({
|
|
|
44
45
|
// Safely mutate the object using the user provided callback
|
|
45
46
|
params(parsed, report, reports);
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
// Patch the original document string using the mutated JS object
|
|
49
|
+
const updatedContent = patch(content, parsed);
|
|
50
|
+
|
|
51
|
+
fs.writeFileSync(filePath, updatedContent);
|
|
48
52
|
},
|
|
49
53
|
});
|