Skip to content

Commit

Permalink
fix: update maintaining-dependencies.md on major v8 update (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
fasenderos authored Jun 7, 2023
1 parent e7b2fea commit a8b1812
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/update-v8/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ import updateVersionNumbers from './updateVersionNumbers.js';
import commitUpdate from './commitUpdate.js';
import majorUpdate from './majorUpdate.js';
import minorUpdate from './minorUpdate.js';
import updateMaintainingDependencies from './updateMaintainingDependencies.js';
import updateV8Clone from './updateV8Clone.js';

export function major(options) {
const tasks = new Listr(
[updateV8Clone(), majorUpdate(), commitUpdate(), updateVersionNumbers()],
[
updateV8Clone(),
majorUpdate(),
updateMaintainingDependencies(),
commitUpdate(),
updateVersionNumbers()
],
getOptions(options)
);
return tasks.run(options);
Expand Down
34 changes: 34 additions & 0 deletions lib/update-v8/updateMaintainingDependencies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { promises as fs } from 'node:fs';
import { getNodeV8Version } from './util.js';

export default function updateMaintainingDependencies() {
return {
title: 'Update V8 version in maintaining-dependencies.md',
task: async(ctx) => {
const path = `${ctx.nodeDir}/doc/contributing/maintaining/maintaining-dependencies.md`;
let maintainingDependenciesMd = await fs.readFile(path, 'utf8');
const v8Version = (await getNodeV8Version(ctx.nodeDir)).toString();
const v8VersionNoDots = v8Version.replaceAll('.', '');
// V8 itemlist link
maintainingDependenciesMd = maintainingDependenciesMd.replace(
/\* \[V8.*/,
`* [V8 ${v8Version}][]`
);
// V8 link to section
maintainingDependenciesMd = maintainingDependenciesMd.replace(
/\[v8.*\]: #v8.*/,
`[v8 ${v8Version}]: #v8-${v8VersionNoDots}`
);
// V8 section title
maintainingDependenciesMd = maintainingDependenciesMd.replace(
/### V8.*/,
`### V8 ${v8Version}`
);
await fs.writeFile(path, maintainingDependenciesMd);
await ctx.execGitNode(
'add',
['doc/contributing/maintaining/maintaining-dependencies.md']
);
}
};
};

0 comments on commit a8b1812

Please sign in to comment.