mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: cleanup typedoc script
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
"test:test-type": "turbo run test:test-type",
|
"test:test-type": "turbo run test:test-type",
|
||||||
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
||||||
"prepare": "husky install",
|
"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": {
|
"devDependencies": {
|
||||||
"eslint": "^8.28.0",
|
"eslint": "^8.28.0",
|
||||||
|
|||||||
@@ -17,6 +17,32 @@ async function* walk(dir) {
|
|||||||
for await (let filepath of walk(typedocOutPath)) {
|
for await (let filepath of walk(typedocOutPath)) {
|
||||||
let file = fs.readFileSync(filepath, 'utf-8')
|
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
|
// add all the words we need to replace here for invalid jsx errors
|
||||||
const words = ['internal']
|
const words = ['internal']
|
||||||
for (const word of words) {
|
for (const word of words) {
|
||||||
|
|||||||
Reference in New Issue
Block a user