- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 735
Ability to generate source links independent of the git repository (CI, gitlab) #2326
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
Comments
TypeDoc currently requires that git be installed so that it can check if a file actually exists in the git repo, rather than being .gitignored (common for types originating in node_modules, and generated code) to avoid rendering pages with broken links. It doesn't seem completely terrible to me to have a --assumeGitRepo (or something...) flag which disables this check. (Technically typedoc also does this so if your project is made up of multiple git repos links to each still work, but I suspect that doesn't come in to play often) |
We use yarn PnP, so mostly files are outside the project directory (but yarn needs to unplug some files). Although we do have generated code.
I see, that makes sense. This might be solved by having options such as
Yeah, sometimes having some broken links might be preferrable over having no links at all. Though having links is just a minor convenience feature. Either way, I think it would be very helpful to add a note to the documentation to the relevant options (e.g. https://typedoc.org/options/input/#gitrevision) so that other people don't have to wonder for hours why it's not working ; ) Something like this perhaps:
|
I decided to go with |
Search Terms
gitlab github ci pipeline source links missing repository
Problem
Before I state my problem, let me first of all say that the new documentation pages TypeDoc generates look awesome! I did not work on a frontend project for a couple of years, it's a real improvement.
I was trying to generate TypeDocs via gitlab pipelines. This works as expected, but I noticed that the source links are missing. They are generated correctly when I run TypeDoc locally. After some experimentation, I noticed that when gitlab is running pipelines, there is no
.git
repository, or at least not a fully initialized one. I was thinking that it should be possible to generate source links--sourceLinkTemplate
and--gitRevision
are provided as options, but that did not work.For generating source links, TypeDoc seems to require at least (a) that git is installed, (b) that there exists a git repo in the workspace folder and (c) that the files are in a commit. For (a), the
git
command might not even exist in a CI environment.Suggested Solution
Provided that
--sourceLinkTemplate
and--gitRevision
are given, should it not be possible to generate source links from the path of the files alone? Perhaps a--gitRoot
option might make sense, but when running in a CI environment, that will be the root folder.Workaround
For gitlab pipelines, my current workaround is to initialize a dummy git repository and delete it afterwards
The text was updated successfully, but these errors were encountered: