Skip to content

Commit a8b1812

Browse files
authored
fix: update maintaining-dependencies.md on major v8 update (#699)
1 parent e7b2fea commit a8b1812

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

lib/update-v8/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@ import updateVersionNumbers from './updateVersionNumbers.js';
66
import commitUpdate from './commitUpdate.js';
77
import majorUpdate from './majorUpdate.js';
88
import minorUpdate from './minorUpdate.js';
9+
import updateMaintainingDependencies from './updateMaintainingDependencies.js';
910
import updateV8Clone from './updateV8Clone.js';
1011

1112
export function major(options) {
1213
const tasks = new Listr(
13-
[updateV8Clone(), majorUpdate(), commitUpdate(), updateVersionNumbers()],
14+
[
15+
updateV8Clone(),
16+
majorUpdate(),
17+
updateMaintainingDependencies(),
18+
commitUpdate(),
19+
updateVersionNumbers()
20+
],
1421
getOptions(options)
1522
);
1623
return tasks.run(options);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { promises as fs } from 'node:fs';
2+
import { getNodeV8Version } from './util.js';
3+
4+
export default function updateMaintainingDependencies() {
5+
return {
6+
title: 'Update V8 version in maintaining-dependencies.md',
7+
task: async(ctx) => {
8+
const path = `${ctx.nodeDir}/doc/contributing/maintaining/maintaining-dependencies.md`;
9+
let maintainingDependenciesMd = await fs.readFile(path, 'utf8');
10+
const v8Version = (await getNodeV8Version(ctx.nodeDir)).toString();
11+
const v8VersionNoDots = v8Version.replaceAll('.', '');
12+
// V8 itemlist link
13+
maintainingDependenciesMd = maintainingDependenciesMd.replace(
14+
/\* \[V8.*/,
15+
`* [V8 ${v8Version}][]`
16+
);
17+
// V8 link to section
18+
maintainingDependenciesMd = maintainingDependenciesMd.replace(
19+
/\[v8.*\]: #v8.*/,
20+
`[v8 ${v8Version}]: #v8-${v8VersionNoDots}`
21+
);
22+
// V8 section title
23+
maintainingDependenciesMd = maintainingDependenciesMd.replace(
24+
/### V8.*/,
25+
`### V8 ${v8Version}`
26+
);
27+
await fs.writeFile(path, maintainingDependenciesMd);
28+
await ctx.execGitNode(
29+
'add',
30+
['doc/contributing/maintaining/maintaining-dependencies.md']
31+
);
32+
}
33+
};
34+
};

0 commit comments

Comments
 (0)