( changesetBase: string, dirs: string[] )
| 16 | ); |
| 17 | |
| 18 | async function getOldChangesets( |
| 19 | changesetBase: string, |
| 20 | dirs: string[] |
| 21 | ): Promise<Array<NewChangeset>> { |
| 22 | // this needs to support just not dealing with dirs that aren't set up properly |
| 23 | let changesets = await pFilter(dirs, async (dir) => |
| 24 | (await fs.lstat(path.join(changesetBase, dir))).isDirectory() |
| 25 | ); |
| 26 | |
| 27 | const changesetContents = changesets.map(async (changesetDir) => { |
| 28 | const jsonPath = path.join(changesetBase, changesetDir, "changes.json"); |
| 29 | |
| 30 | const [summary, json] = await Promise.all([ |
| 31 | fs.readFile( |
| 32 | path.join(changesetBase, changesetDir, "changes.md"), |
| 33 | "utf-8" |
| 34 | ), |
| 35 | fs.readJson(jsonPath), |
| 36 | ]); |
| 37 | |
| 38 | return { releases: json.releases, summary, id: changesetDir }; |
| 39 | }); |
| 40 | return Promise.all(changesetContents); |
| 41 | } |
| 42 | |
| 43 | // this function only exists while we wait for v1 changesets to be obsoleted |
| 44 | // and should be deleted before v3 |
no outgoing calls
no test coverage detected