-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR changes the release notes to have a chronological descending order. #### How to regenerate the release notes To regenerate the release notes and fix the order of each version, I used the API generation script with some changes. We need to modify the writeSeparateReleaseNotes function from `releaseNotes.ts` and the `updateApiDocs.ts` script. The first step is to comment the `extractMarkdownReleaseNotesPatches` call in line 245, given that we don't want to write the latest release notes file. Also, we need to substitute the two arrays returned by that call for the release notes we want to regenerate and an empty dictionary. I did the regeneration in batches of 6 files: ```ts //const [minorVersionsFound, markdownByPatchVersion] = // extractMarkdownReleaseNotesPatches(releaseNoteMarkdown); const markdownByPatchVersion: { [id: string]: string; } = {}; const minorVersionsFound = ['0.10', '0.15', '0.14', '0.13', '0.12', '0.11']; ``` The following step is to add some logic to read all the files and store each patch version we find in each file. With that information, we will re-write each release notes file at the end of the function with the correct order. That piece of code was extracted from the first version of the script which can be found in this commit 7aa586f. It was copied in the same place it appear in the commit. ```ts const [_, markdownByPatchOldVersion] = extractMarkdownReleaseNotesPatches(currentMarkdown); for (let [versionPatch, markdownPatch] of Object.entries( markdownByPatchOldVersion, )) { // We keep the release notes for a patch if it hasn't been modified for the current release notes. // Otherwise, we use the modified version. if (!markdownByPatchVersion.hasOwnProperty(versionPatch)) { markdownByPatchVersion[versionPatch] = markdownPatch; } } ``` Finally, to speed up the process, I commented the files we regenerate in the `updateApiDocs.ts` script. This step is optional, and if used we have to make sure we restore all the docs before creating the PR. ```ts async function convertHtmlToMarkdown( htmlPath: string, markdownPath: string, baseSourceUrl: string, pkg: Pkg, ) { const files = await globby( [ //"apidocs/**.html", //"apidoc/**.html", //"stubs/**.html", "release_notes.html", ], { cwd: htmlPath, }, ); ``` Closes #538
- Loading branch information
1 parent
e024259
commit b270d49
Showing
20 changed files
with
4,215 additions
and
4,195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.