typedoc2md / typedoc-plugin-markdown

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
https://typedoc-plugin-markdown.org
MIT License
703 stars 175 forks source link

config.js in .vuepress deleted every time while run typedoc #70

Closed dabanlee closed 5 years ago

dabanlee commented 5 years ago

typedoc --module modules --theme markdown --platform vuepress --out docs src Every time I run the command, the config.js in folder .vuepress deleted.

dabanlee commented 5 years ago
{
    "typedoc": "^0.14.2",
    "typedoc-plugin-markdown": "^2.0.9"
}
tgreyuk commented 5 years ago

@ozum I am happy to look at this unless you have any ideas?

ozum commented 5 years ago

@JustClear, could you please tell me where is .vuepress directory located?

ozum commented 5 years ago

@JustClear, better yet, could you provide very minimal repo for this, because I cannot reproduce the issue.

dabanlee commented 5 years ago

@ozum https://github.com/JustClear/npmkit Thx here.

ozum commented 5 years ago

@tgreyuk , I confirm the issue in given repo.

I think problem is not related to --platform vuepress. When I tracked, I see, line 132 in src/lib/output/renderer.ts file of typedoc library deletes every file in docs directory (-- out docs) including docs/.vuepress with above command.

I put a throw new Error() as below:

line 127-132 of src/lib/output/renderer.ts of typedoc library

render(project: ProjectReflection, outputDirectory: string) {
        if (!this.prepareTheme() || !this.prepareOutputDirectory(outputDirectory)) {
            return;
        }

        const output = new RendererEvent(RendererEvent.BEGIN, outputDirectory, project);
        throw new Error("docs directory is already emptied here...");
        ...
}

I didn't use --module modules in my projects, and didn't see the issue described here. Just a guess, it could be related to --module modules.

I don't have experience on typedoc, so I could not follow further the issue. Could you have a look please?

Thanks,

tgreyuk commented 5 years ago

@ozum thanks for looking at that. typedoc clears the output directory (however this can be skipped with disableOutputCheck argument. Ideally the docs target would be in a separate location to the .vuepress dir but not too sure about vuepress config. I will need to look at the outputcheck as this should stop typedoc emptying directories that it shouldn't.

ozum commented 5 years ago

@JustClear, as @tgreyuk mentioned, it seems related to default TypeDoc behavior. Until (if possible) @tgreyuk solves the problem, I may suggest following workarounds for temporary solutions:

Hope helps,

dabanlee commented 5 years ago

Thanks a lot.