Compare commits

..

2 Commits

Author SHA1 Message Date
ae90b8297f 1.1.2 2020-11-27 12:02:58 +00:00
d75a65ee46 fix(core): update 2020-11-27 12:02:57 +00:00
6 changed files with 16 additions and 6 deletions

3
cli.js
View File

@ -1,3 +1,4 @@
#!/usr/bin/env node #!/usr/bin/env node
process.env.CLI_CALL = 'true'; process.env.CLI_CALL = 'true';
require('./dist/index'); const cliTool = require('./dist_ts/index');
cliTool.runCli();

View File

@ -1,4 +1,5 @@
#!/usr/bin/env node #!/usr/bin/env node
process.env.CLI_CALL = 'true'; process.env.CLI_CALL = 'true';
require('@gitzone/tsrun'); require('@gitzone/tsrun');
require('./ts/index'); const cliTool = require('./ts/index');
cliTool.runCli();

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tsdoc", "name": "@gitzone/tsdoc",
"version": "1.1.1", "version": "1.1.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tsdoc", "name": "@gitzone/tsdoc",
"version": "1.1.1", "version": "1.1.2",
"private": false, "private": false,
"description": "a tool for better documentation", "description": "a tool for better documentation",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -21,7 +21,9 @@ export class TypeDoc {
this.typedocDirectory = dirPathArg; this.typedocDirectory = dirPathArg;
} }
public async compile() { public async compile(options?: {
publicSubdir?: string;
}) {
const data = { const data = {
compilerOptions: { compilerOptions: {
target: 'es2017', target: 'es2017',
@ -33,6 +35,10 @@ export class TypeDoc {
}; };
data.include = [plugins.path.join(paths.cwd, './ts/**/*')]; data.include = [plugins.path.join(paths.cwd, './ts/**/*')];
await plugins.smartfile.memory.toFs(JSON.stringify(data), paths.tsconfigFile); 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( await this.smartshellInstance.exec(
`typedoc --tsconfig ${paths.tsconfigFile} --out ${paths.publicDir}` `typedoc --tsconfig ${paths.tsconfigFile} --out ${paths.publicDir}`
); );

View File

@ -21,7 +21,9 @@ export const run = async () => {
tsdocCli.addCommand('typedoc').subscribe(async (argvArg) => { tsdocCli.addCommand('typedoc').subscribe(async (argvArg) => {
const typeDocInstance = new TypeDoc(paths.cwd); const typeDocInstance = new TypeDoc(paths.cwd);
await typeDocInstance.compile(); await typeDocInstance.compile({
publicSubdir: argvArg.publicSubdir
});
}); });
tsdocCli.addCommand('test').subscribe((argvArg) => { tsdocCli.addCommand('test').subscribe((argvArg) => {