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

Onward links to https://www.npmjs.com/ package resources or similar #2835

Open
cefn opened this issue Jan 23, 2025 · 2 comments
Open

Onward links to https://www.npmjs.com/ package resources or similar #2835

cefn opened this issue Jan 23, 2025 · 2 comments
Labels
question Question about functionality

Comments

@cefn
Copy link

cefn commented Jan 23, 2025

Search terms

Sourcelink, npm module,

Question

I imagine there's some strategies available for external packages to have links resolved in some way (e.g. to the npm package URL?). I have a feeling I've missed this config or plugin or I'm thinking about the problem wrongly.

To take an example, we have a module which can consume a LoggerOptions configuration which is provided by the winston library and passed on to that library during initialisation. See https://www.npmjs.com/package/winston

Although the details of the type are suitably hoisted and rendered, the LoggerOptions type ends up with a non-linked source reference below its definition like

Defined in node_modules/.pnpm/[email protected]/node_modules/winston/index.d.ts:84

I can almost certainly configure external to be terser about files in node_modules/.pnpm so it doesn't spit out the whole path maybe.

However, better would be for our use of a type like LoggerOptions to imply some onward journey to standard resources for the winston library.

Is there any scheme available to have types referenced from npm-resolved libraries to have an onward journey to documentation of some kind.

For example in this particular case this would mean there was some link to e.g. https://www.npmjs.com/package/winston maybe? Maybe https://github.com/winstonjs/winston/blob/c69cdb0cec15a138e0b6e374501e027d1c39606c/index.d.ts#L84 would be even better if there's a way to resolve it.

@cefn cefn added the question Question about functionality label Jan 23, 2025
@phoneticallySAARTHaK
Copy link

phoneticallySAARTHaK commented Jan 23, 2025

Probably not, according to this #2335 (comment)

You'll have to manually create a link

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 23, 2025

Either a plugin (more flexibility) or an option can be used to resolve external symbols to a link: https://typedoc.org/documents/Development.Third_Party_Symbols.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about functionality
Projects
None yet
Development

No branches or pull requests

3 participants