Replies: 1 comment 2 replies
-
|
Dealing with links is unfortunately probably the worst part about typedoc... though it's probably a problem for any tool which can process somewhat arbitrary links that might not make any sense... The Broken local links can't be specified by the externalSymbolLinkMappings option (perhaps this is something that should change... it'd probably have to be another special key like The resolution you want for these links can be specified with a custom plugin, with the following config and the export you provided I get no warnings: // @ts-check
/** @import * as td from "typedoc"; */
/** @type {Record<string, string | undefined>} */
const brokenLocalLinkResolutions = {
createStore: "#",
Watcher: "#"
};
/** @param {td.Application} app */
function resolveLinksPlugin(app) {
app.converter.addUnknownSymbolResolver((ref, refl, part, symbol) => {
// If TS resolved this link, don't touch it here, let typedoc still report warnings
if (symbol) return undefined;
if (!ref.moduleSource && ref.symbolReference?.path?.length === 1) {
return brokenLocalLinkResolutions[ref.symbolReference.path[0].path];
}
return undefined;
})
}
/** @type {td.TypeDocOptions} */
const config = {
plugin: [resolveLinksPlugin],
externalSymbolLinkMappings: {
"@watchable/store": {
"Store.write": "#",
"Store.read": "#",
"Watchable.watch": "#",
}
},
};
export default config; |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A module we are publishing in our enterprise has a dependency on the package https://watchable.dev/api/modules/_watchable_store.html
We export types from the upstream package, since they are used in return types of our functions.
Attempting to create documentation for our module we get errors like this coming from markdown defined outside our project...
All these errors seem to come from the tsdoc markdown resolved from inside the upstream package. For example the first error seems to match to https://github.com/cefn/watchable/blob/bb7131e23af46b1ab712ace723937d42d6fafec1/packages/store/src/types/store.ts#L6
Our module looks after calling
createStoreon behalf of users so deliberately doesn't re-export that function. We tried providing a definition in the typedoc.mjs like this, doesn't suppress the error either...The other links we could also try to resolve to upstream documentation at
watchable.devif we knew a way to match the failed symbols linked.However the more immediate issue is that documentation warnings are deliberately configured to block the pipeline, to force 100% documentation coverage so this means we can't get pipelines to pass at all currently, and we can't establish how to selectively 'allowlist' these failures.
Questions
Initially what configuration can we use to selectively allowlist only these link failures?
As a followup is there a way to make these links correctly point to upstream documentation?
Beta Was this translation helpful? Give feedback.
All reactions