mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-21 02:40:08 +00:00
fix: cleanup typedoc script
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
"test:test-type": "turbo run test:test-type",
|
||||
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
||||
"prepare": "husky install",
|
||||
"build:doc": "typedoc --out ./website/docs/generated/ && node scripts/stripInternalInTypedocs.js"
|
||||
"build:doc": "typedoc --out ./website/docs/generated/ && node scripts/finalizeTypedocs.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.28.0",
|
||||
|
||||
@@ -17,6 +17,32 @@ async function* walk(dir) {
|
||||
for await (let filepath of walk(typedocOutPath)) {
|
||||
let file = fs.readFileSync(filepath, 'utf-8')
|
||||
|
||||
// Removes the old file in case it had ugly name, will be recreated below
|
||||
fs.rmSync(filepath);
|
||||
|
||||
if (filepath.endsWith('generated/README.md')) {
|
||||
file = [
|
||||
"discordeno-monorepo / [Modules](modules.md)",
|
||||
"",
|
||||
"# Discordeno",
|
||||
"",
|
||||
"Thank you for using Discordeno. These docs are generated automatically. If you see any issues please contact us on [Discord](https://discord.gg/ddeno)"
|
||||
].join('\n');
|
||||
filepath = filepath.replace("README", "Docs")
|
||||
}
|
||||
// These files should be simply deleted.
|
||||
const filesToDelete = [
|
||||
// "README",
|
||||
// "modules"
|
||||
];
|
||||
let deleted = false;
|
||||
|
||||
for (const filename of filesToDelete) {
|
||||
if (filepath.endsWith(`generated/${filename}.md`)) deleted = true;
|
||||
}
|
||||
// Skip the rest if this file should be deleted
|
||||
if (deleted) continue;
|
||||
|
||||
// add all the words we need to replace here for invalid jsx errors
|
||||
const words = ['internal']
|
||||
for (const word of words) {
|
||||
|
||||
Reference in New Issue
Block a user