Skip to content

Commit e0c0bc8

Browse files
committed
chore(ghPagesDeploy): add typedoc to be build for documentation
1 parent f8c671c commit e0c0bc8

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ coverage
4444
.nyc_output
4545
package-lock.json
4646
build
47+
typedoc

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"semantic-release": "semantic-release",
5656
"readme:toc": "doctoc ./README.md",
5757
"postinstall": "husky install",
58-
"website": "yarn --cwd website/ run start"
58+
"website": "yarn --cwd website/ run start",
59+
"typedoc": "typedoc packages/mongodb-memory-server-core/src/index.ts --out typedoc --tsconfig packages/mongodb-memory-server-core/tsconfig.build.json"
5960
}
6061
}

scripts/ghPagesDeploy.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const path = require('node:path');
77
/* Constants / Config */
88

99
/** keep ".git", ".github", "website" and "scripts" */
10-
const keepRegex = /^(?:\.git|website|scripts|versions)/;
10+
const keepRegex = /^(?:\.git|website|scripts|versions|typedoc)/;
1111
/** Regex to filter and get versions output from git ls-tree */
1212
const versionsFilter = /^versions\/(\d+\.x|beta)\/?$/;
1313
/** Which branch to deploy to */
@@ -50,6 +50,9 @@ function main() {
5050
// build the website
5151
execSync('yarn --cwd ./website build', { stdio: 'inherit' });
5252

53+
// build the typedoc website
54+
execSync('yarn run typedoc', { stdio: 'inherit' });
55+
5356
console.log('\nSwitching Branches\n');
5457

5558
// ensure there is nothing blocking from changing branches
@@ -93,6 +96,14 @@ function main() {
9396
fs.renameSync(from, to);
9497
}
9598

99+
// move typedoc to "deployAs"
100+
{
101+
const from = 'typedoc';
102+
const to = path.join(deployInfo.deployPath, 'typedoc');
103+
console.log('rename', from, '->', to); // always log what is renamed
104+
fs.renameSync(from, to);
105+
}
106+
96107
// remove website
97108
fs.rmSync('website', { recursive: true });
98109

0 commit comments

Comments
 (0)