From e2006228926acbebe2b7e42a34bf120a9fc5c13c Mon Sep 17 00:00:00 2001 From: Arnau Casau Date: Thu, 22 Feb 2024 21:46:03 +0100 Subject: [PATCH] feedback --- scripts/commands/convertApiDocsToHistorical.ts | 11 ++++++++--- scripts/commands/updateApiDocs.ts | 4 ++-- scripts/lib/api/releaseNotes.ts | 6 +++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/commands/convertApiDocsToHistorical.ts b/scripts/commands/convertApiDocsToHistorical.ts index 333d1703624..8c09c3e4dff 100644 --- a/scripts/commands/convertApiDocsToHistorical.ts +++ b/scripts/commands/convertApiDocsToHistorical.ts @@ -103,9 +103,14 @@ async function copyApiDocsAndUpdateLinks( ); } - const source = `${getRoot()}/docs/api/${pkgName}/release-notes/${versionWithoutPatch}.md`; - if (await pathExists(source)) { - updateLinksFile(pkgName, versionWithoutPatch, source, source); + const releaseNotePath = `${getRoot()}/docs/api/${pkgName}/release-notes/${versionWithoutPatch}.md`; + if (await pathExists(releaseNotePath)) { + updateLinksFile( + pkgName, + versionWithoutPatch, + releaseNotePath, + releaseNotePath, + ); } } diff --git a/scripts/commands/updateApiDocs.ts b/scripts/commands/updateApiDocs.ts index e16a3e563dd..103335d7fda 100644 --- a/scripts/commands/updateApiDocs.ts +++ b/scripts/commands/updateApiDocs.ts @@ -39,7 +39,7 @@ import { addNewReleaseNotes, generateReleaseNotesIndex, updateHistoricalTocFiles, - writeSeparateReleaseNotes, + writeReleaseNoteForVersion, } from "../lib/api/releaseNotes"; interface Arguments { @@ -243,7 +243,7 @@ async function convertHtmlToMarkdown( : `${baseUrl}/${link}`, ); - await writeSeparateReleaseNotes(pkg, result.markdown); + await writeReleaseNoteForVersion(pkg, result.markdown); continue; } diff --git a/scripts/lib/api/releaseNotes.ts b/scripts/lib/api/releaseNotes.ts index b46faa91bb9..b78ba7cbb70 100644 --- a/scripts/lib/api/releaseNotes.ts +++ b/scripts/lib/api/releaseNotes.ts @@ -145,10 +145,10 @@ function addNewReleaseNoteToc(releaseNotesNode: any, newVersion: string) { } /** - * Updates the release notes folder by adding the notes to their corresponding version - * file. + * Creates the release note file for the minor version found in `pkg`.If the file + * already exists, it will keep the initial header and overwrite the rest of the content. */ -export async function writeSeparateReleaseNotes( +export async function writeReleaseNoteForVersion( pkg: Pkg, releaseNoteMarkdown: string, ): Promise {