Skip to content

Commit

Permalink
feat: add docs script to remove unwanted files (#1139)
Browse files Browse the repository at this point in the history
* feat: add script to remove unwanted docs files

* chore: changeset

---------

Co-authored-by: danielbate <--global>
  • Loading branch information
danielbate authored Jul 26, 2023
1 parent ee939fb commit 51d13e3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .changeset/perfect-elephants-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "",
"scripts": {
"dev": "nodemon --config nodemon.config.json -x 'typedoc && vitepress dev'",
"build": "typedoc && vitepress build",
"build": "typedoc && tsx ./scripts/typedoc-postbuild.ts && vitepress build",
"preview": "typedoc && vitepress preview",
"docs": "typedoc"
},
Expand Down
17 changes: 17 additions & 0 deletions apps/docs/scripts/typedoc-postbuild.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { unlink } from 'fs';
import { join } from 'path';

/**
* Post build script to trim off undesired leftovers from Typedoc.
*/
const docsDir = join(__dirname, '../src/');
const filesToRemove = ['api/modules.md'];
const { log } = console;

filesToRemove.forEach((filePath) => {
const fullFilePath = join(docsDir, filePath);
unlink(fullFilePath, (err) => {
if (err) throw err;
log(`Removed ${fullFilePath}`);
});
});

0 comments on commit 51d13e3

Please sign in to comment.