<!-- start pr-codex -->
## PR-Codex overview
This PR introduces a new `TypeDoc` workflow for generating documentation and updates the `parse.mjs` script to process documentation data. It also modifies the `package.json` to include the `typedoc-better-json` dependency and adjusts the `pnpm-lock.yaml` accordingly.
### Detailed summary
- Added `TypeDoc` GitHub Actions workflow in `.github/workflows/typedoc.yml`.
- Created a new `parse.mjs` script in `packages/thirdweb/scripts` for transforming documentation data.
- Updated `package.json` to include `typedoc-better-json` as a dependency.
- Adjusted `pnpm-lock.yaml` to reflect changes in dependencies and versions.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
20 lines
535 B
JavaScript
20 lines
535 B
JavaScript
import { transform } from "typedoc-better-json";
|
|
import { readFile, writeFile } from "fs/promises";
|
|
|
|
const inputPath = "typedoc/documentation.json";
|
|
const outputPath = "typedoc/parsed.json";
|
|
|
|
try {
|
|
const fileContent = await readFile(inputPath, "utf-8");
|
|
const fileData = JSON.parse(fileContent);
|
|
|
|
const transformedData = transform(fileData);
|
|
|
|
await writeFile(outputPath, JSON.stringify(transformedData, null, 2));
|
|
|
|
console.log(`File saved at ${outputPath}`);
|
|
} catch (error) {
|
|
console.error("Error:", error);
|
|
process.exit(1);
|
|
}
|