-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
typedoc.ts
30 lines (23 loc) · 849 Bytes
/
typedoc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env ts-node
const { spawn } = require("child_process");
const appRootPath = require('app-root-path')
const dotenv = require('dotenv').config({
path: appRootPath.path + '/.env.local'
})
// @note
// Should be --> import { ApiBaseURL } from './website.config'
// See: https://github.com/TypeStrong/ts-node/issues/1007
const ApiBaseURL = 'api'
const typedoc = spawn("npx", ["typedoc", process.env.ENGINE_PATH, "--options", `${process.env.ENGINE_PATH}/typedoc.json`, "--out", "./build/"+ApiBaseURL])
typedoc.stdout.on("data", data => {
console.log(`stdout: ${data}`);
});
typedoc.stderr.on("data", data => {
console.log(`stderr: ${data}`);
});
typedoc.on('error', (error) => {
console.log(`error: ${error.message}`);
});
typedoc.on("close", code => {
console.log(`child process exited with code ${code}`);
});