diff --git a/package.json b/package.json index 746ed5d8c9d..8c91ca30b9e 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "fmt": "prettier --write .", "test": "jest", "typecheck": "tsc", - "regenerate-apis": "node -r esbuild-register scripts/commands/regenerateApiDocs.ts", + "regen-apis": "node -r esbuild-register scripts/commands/regenerateApiDocs.ts", "gen-api": "node -r esbuild-register scripts/commands/updateApiDocs.ts", "make-historical": "node -r esbuild-register scripts/commands/convertApiDocsToHistorical.ts" }, diff --git a/scripts/commands/regenerateApiDocs.ts b/scripts/commands/regenerateApiDocs.ts index 11da3f72a7d..89b1fb3a81d 100644 --- a/scripts/commands/regenerateApiDocs.ts +++ b/scripts/commands/regenerateApiDocs.ts @@ -10,7 +10,7 @@ // copyright notice, and modified files need to carry a notice indicating // that they have been altered from the originals. -import { readdir } from "fs/promises"; +import { readFile, readdir } from "fs/promises"; import yargs from "yargs/yargs"; import { hideBin } from "yargs/helpers"; @@ -130,14 +130,14 @@ async function getPackageVersions( for (const folder of historicalFolders) { const historicalVersion = await JSON.parse( - fs.readFileSync(`${pkgDocsPath}/${folder.name}/_package.json`, "utf-8"), + await readFile(`${pkgDocsPath}/${folder.name}/_package.json`, "utf-8"), ); historicalVersions.push(historicalVersion.version); } } const currentVersion = await JSON.parse( - fs.readFileSync(`${pkgDocsPath}/_package.json`, "utf-8"), + await readFile(`${pkgDocsPath}/_package.json`, "utf-8"), ); return [historicalVersions, currentVersion.version];