Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typedoc 0.20.1: entrypoint configuration error #1429

Closed
euberdeveloper opened this issue Dec 29, 2020 · 2 comments
Closed

Typedoc 0.20.1: entrypoint configuration error #1429

euberdeveloper opened this issue Dec 29, 2020 · 2 comments
Labels
bug Functionality does not match expectation

Comments

@euberdeveloper
Copy link

euberdeveloper commented Dec 29, 2020

Search terms

configuration options parsing entryPoint

Expected Behavior

The --help is not clear, because it says:

Usage:
  typedoc path/to/entry.ts

But it does not say if the --options will be before or after the entry.

However, by running:

typedoc source/index.ts --name mongoback --excludeExternals --includeVersion --out docs/documentation/html --plugin none --tsconfig source/tsconfig.json --gaID $GA_TOKEN

I have the correct behaviour, by running:

typedoc --name mongoback --excludeExternals --includeVersion --out docs/documentation/html --plugin none --tsconfig source/tsconfig.json --gaID $GA_TOKEN source/index.ts

I obtain: Error: No entry points provided, by running:

typedoc source/index.ts --name mongoback --excludeExternals --includeVersion --plugin none --tsconfig source/tsconfig.json --gaID $GA_TOKEN --out docs/documentation/html

I obtain:

Error: The output directory "/home/euber/Github/mongoback/docs" exists but does not seem to be a documentation generated by TypeDoc.
Make sure this is the right target directory, delete the folder and rerun TypeDoc.
Error: Documentation could not be generated due to the errors above.

In the last one, it seems that the value for --out, which is docs/documentation/html, gets taken as an entrypoint. Furthermore, I think that typedoc accepts entrypoint specified between two --options, which could be difficult to see.

Actual Behavior

I think that the --help command should be clearer, that putting entryPoints between --options should not be possible and that the last path (--out my/path) should be properly parsed.

It fails to parsing the command.

The help

Steps to reproduce the bug

Environment

  • Typedoc version: 0.20.1
  • TypeScript version: 4.1.3
  • Node.js version: 14
  • OS: ubuntu 20
@euberdeveloper euberdeveloper added the bug Functionality does not match expectation label Dec 29, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 29, 2020

But it does not say if the --options will be before or after the entry.

It doesn't matter.

The key issue here is that $GA_TOKEN is either not set, or is the empty string, so when typedoc gets your arguments, instead of seeing --gaID (something) --out, it sees --gaID --out, and then takes the next value as an entry point. 0.20.2 includes a debug print (--logLevel Debug) with the arguments which TypeDoc sees.

I expected that your first usage would have provided a warning due to a missing value for the --gaID option, but apparently that was missed a few updates ago when rebuilding the options... 0.20.2 will include a warning there.

I agree that putting entryPoints between flags is a bad idea from a maintainability standpoint, but it is really useful when trying out a bunch of different options, and it is consistent with most other argument parsers, so that behavior is going to stay. (I usually use the CLI only for specifying entry points + single run overrides for testing, and a typedoc.json file for all other options)

@euberdeveloper
Copy link
Author

Oh I see. Yes, the $GA_TOKEN was set only on vercel (hosting) but not in locale, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants