From d75a65ee46b2c14d42d8973459078f202a76e25e Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 27 Nov 2020 12:02:57 +0000 Subject: [PATCH] fix(core): update --- cli.js | 3 ++- cli.ts.js | 3 ++- ts/tsdoc.classes.typedoc.ts | 8 +++++++- ts/tsdoc.cli.ts | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cli.js b/cli.js index 9ebd5d2..a89c9c5 100644 --- a/cli.js +++ b/cli.js @@ -1,3 +1,4 @@ #!/usr/bin/env node process.env.CLI_CALL = 'true'; -require('./dist/index'); +const cliTool = require('./dist_ts/index'); +cliTool.runCli(); diff --git a/cli.ts.js b/cli.ts.js index eafbbe1..f700436 100644 --- a/cli.ts.js +++ b/cli.ts.js @@ -1,4 +1,5 @@ #!/usr/bin/env node process.env.CLI_CALL = 'true'; require('@gitzone/tsrun'); -require('./ts/index'); +const cliTool = require('./ts/index'); +cliTool.runCli(); diff --git a/ts/tsdoc.classes.typedoc.ts b/ts/tsdoc.classes.typedoc.ts index 6c87f55..db36fd9 100644 --- a/ts/tsdoc.classes.typedoc.ts +++ b/ts/tsdoc.classes.typedoc.ts @@ -21,7 +21,9 @@ export class TypeDoc { this.typedocDirectory = dirPathArg; } - public async compile() { + public async compile(options?: { + publicSubdir?: string; + }) { const data = { compilerOptions: { target: 'es2017', @@ -33,6 +35,10 @@ export class TypeDoc { }; data.include = [plugins.path.join(paths.cwd, './ts/**/*')]; await plugins.smartfile.memory.toFs(JSON.stringify(data), paths.tsconfigFile); + let targetDir = paths.publicDir; + if (options?.publicSubdir) { + targetDir = plugins.path.join(targetDir, options.publicSubdir); + } await this.smartshellInstance.exec( `typedoc --tsconfig ${paths.tsconfigFile} --out ${paths.publicDir}` ); diff --git a/ts/tsdoc.cli.ts b/ts/tsdoc.cli.ts index 1c97d9c..20873c3 100644 --- a/ts/tsdoc.cli.ts +++ b/ts/tsdoc.cli.ts @@ -21,7 +21,9 @@ export const run = async () => { tsdocCli.addCommand('typedoc').subscribe(async (argvArg) => { const typeDocInstance = new TypeDoc(paths.cwd); - await typeDocInstance.compile(); + await typeDocInstance.compile({ + publicSubdir: argvArg.publicSubdir + }); }); tsdocCli.addCommand('test').subscribe((argvArg) => {