Failure to correctly link sources when building on vercel
See original GitHub issueSearch terms
vercel, source links, repository, git, markdown
Expected Behavior
When building on my local machine and building on vercel, I expect that the documentation output will be consistent between both if both are built from the same source repository. As such, I expect the source links for methods and interfaces to work on vercel reliably (they do not)
Actual Behavior
Source code links are not linked on vercel (and sometimes in docker containers too)
Steps to reproduce the bug
You can see this over at: https://github.com/inrupt/solid-client-js/pull/1481/ and https://solid-client-js-git-feature-improve-docs-generation-inrupt.vercel.app/modules/acl_acl.html (note: the vercel link may break in the future after the PR is merged)
The issue comes from how Typedoc tries to infer where the “source” is, which is by trying to look at the git remotes:
- https://github.com/TypeStrong/typedoc/blob/1e0e38cf326e36645718efae15444458fb9e8486/src/lib/converter/plugins/SourceLinkPlugin.ts#L272-L276
- https://github.com/TypeStrong/typedoc/blob/1e0e38cf326e36645718efae15444458fb9e8486/src/lib/converter/plugins/SourceLinkPlugin.ts#L178-L184
On vercel, the two git operations seem to not return back a URL for the “origin” remote (and in testing, I wasn’t able to get git remote -v
to actually output anything to the build log).
Environment
- Typedoc version: 0.22.12 (with typedoc-plugin-markdown@^3.11.14)
- TypeScript version: 4.5.5
- Node.js version: 14.x
- OS: Unknown (whatever vercel uses)
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Not that I’ve been able to come up with, I’m being really picky about false positives.
https://www.npmjs.com/package/nlfurniss-typedoc-plugin-sourcefile-url might be of interest.
@Gerrit0 hmm, so there’s not really a good “generic base URL” plugin that could make it into core?