From c1e2700bb66b7f39e364071f15edf593fa0db2a9 Mon Sep 17 00:00:00 2001 From: yansong Date: Fri, 10 Nov 2023 16:25:26 -0600 Subject: [PATCH] address review comments --- .github/scripts/release_notes/android-release.js | 2 ++ .github/scripts/release_notes/update-release-notes.js | 6 +++--- .github/scripts/release_notes/utils.js | 1 + src/pages/home/release-notes/index.md | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/scripts/release_notes/android-release.js b/.github/scripts/release_notes/android-release.js index bf283d81ec..3cb93c8dbc 100644 --- a/.github/scripts/release_notes/android-release.js +++ b/.github/scripts/release_notes/android-release.js @@ -33,6 +33,7 @@ async function fetchMavenArtifactInfo(groupId, capacity, timestampInMilliseconds console.log(`request options: ${JSON.stringify(options)}`) + // TODO: condiser refactoring the code blow with libraries like axios. return new Promise((resolve) => { let reqGet = https.request(options, function (res) { if (res.statusCode != 200) { @@ -84,6 +85,7 @@ async function fetchAndroidReleaseInfo(token, groupId, timestampInMilliseconds, console.log("fetchMavenArtifactInfo():") console.log(array) let releaseInfoArray = [] + // TODO: refactoring the code below with Array.prototype.map() for (let i = 0; i < array.length; i++) { let artifactId = array[i].artifactId let version = array[i].version diff --git a/.github/scripts/release_notes/update-release-notes.js b/.github/scripts/release_notes/update-release-notes.js index f0681b5927..09ced19f5e 100644 --- a/.github/scripts/release_notes/update-release-notes.js +++ b/.github/scripts/release_notes/update-release-notes.js @@ -179,7 +179,7 @@ async function updateReleaseNotesPage(filePath, releaseInfoArray) { // Read the contents of the markdown file. let contentLines = fs.readFileSync(filePath, "utf8").toString().split("\n") // Find the index of the release notes header. - let releaseNotesHeader = "# Release Notes" + let releaseNotesHeader = "# Release notes" let releaseNotesHeaderIndex = contentLines.indexOf(releaseNotesHeader) if (releaseNotesHeaderIndex == -1) { console.error("Error: can't find the release notes header") @@ -228,7 +228,7 @@ function hasLineStartWith(string, lineArray) { return false } -async function fetchNonAndoirdReleaseInfo(token, timestampInMilliseconds) { +async function fetchNonAndroidReleaseInfo(token, timestampInMilliseconds) { let releaseInofArray = [] for (const repoName of repoNames) { let releaseInfoList = await fetchReleaseInfo(token, "adobe", repoName) @@ -318,7 +318,7 @@ function updateNonAndroidReleaseInfo(releaseInfo) { async function fetchAllReleaseInfo(token, timestampInMilliseconds) { let releaseInfoArray = [] - let rawInfoArray = await fetchNonAndoirdReleaseInfo(token, timestampInMilliseconds) + let rawInfoArray = await fetchNonAndroidReleaseInfo(token, timestampInMilliseconds) for (const releaseInfo of rawInfoArray) { releaseInfoArray.push(updateNonAndroidReleaseInfo(releaseInfo)) diff --git a/.github/scripts/release_notes/utils.js b/.github/scripts/release_notes/utils.js index c5c7bb9847..32115dd9ba 100644 --- a/.github/scripts/release_notes/utils.js +++ b/.github/scripts/release_notes/utils.js @@ -63,6 +63,7 @@ function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } +// TODO: consider using dayjs to handle date format function convertIOSDateToRleaseDateFormat(ios1086DateStr) { const date = new Date(ios1086DateStr) const month = date.getMonth() diff --git a/src/pages/home/release-notes/index.md b/src/pages/home/release-notes/index.md index ada7d15533..ad91532f67 100644 --- a/src/pages/home/release-notes/index.md +++ b/src/pages/home/release-notes/index.md @@ -5,7 +5,7 @@ Keywords: - Release notes --- -# Release Notes +# Release notes ## October 31, 2023