Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
49601f3bac | |||
6c13622b33 | |||
9021e9ae39 | |||
7289b77398 | |||
ae90b8297f | |||
d75a65ee46 |
3
cli.js
3
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();
|
||||
|
@ -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();
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tsdoc",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tsdoc",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.4",
|
||||
"private": false,
|
||||
"description": "a tool for better documentation",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -3,4 +3,7 @@ early.start('tsdoc');
|
||||
import * as plugins from './tsdoc.plugins';
|
||||
import * as cli from './tsdoc.cli';
|
||||
early.stop();
|
||||
cli.run();
|
||||
|
||||
export const runCli = async () => {
|
||||
await cli.run();
|
||||
};
|
||||
|
@ -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,8 +35,12 @@ 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}`
|
||||
`typedoc --tsconfig ${paths.tsconfigFile} --out ${targetDir}`
|
||||
);
|
||||
plugins.smartfile.fs.remove(paths.tsconfigFile);
|
||||
}
|
||||
|
@ -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) => {
|
||||
|
Reference in New Issue
Block a user