MCPcopy Index your code
hub / github.com/changesets/changesets / getOldChangesets

Function getOldChangesets

packages/read/src/legacy.ts:18–41  ·  view source on GitHub ↗
(
  changesetBase: string,
  dirs: string[]
)

Source from the content-addressed store, hash-verified

16);
17
18async 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

Callers 1

getOldChangesetsAndWarnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected