Before you lock down TypeDoc for the TSGO7 upgrade...
I have a small request for a custom deployment of TypeDoc where I have some advanced use cases that benefit from access to the runtime node utilities. I need to access discoverAllReferenceTypes. For programmatic deployments it may be useful to simply expose node-utils similar to how the browser-utils has an export of typedoc/browser. This can be accomplished simply by adding the proper sub-path export condition to package.json
{
"exports": {
"./node": {
"typedoc-ts": "./src/lib/node-utils.ts",
"types": "./dist/types/node-utils.d.ts",
"default": "./dist/node-utils.js"
}
}
}
This allows:
import { discoverAllReferenceTypes } from 'typedoc/node';
At the end of the day... I can simply modify the package.json after TypeDoc installation into my specific project to add the above, but I think this is generally useful for more advanced programmatic use cases in general.
Also just a quick thing I noticed when looking at this enhancement request.. It appears the browser export condition for typedoc-ts is not pointing to the source. IE "typedoc-ts": "./src/lib/browser-utils/index.ts" likely should be "typedoc-ts": "./src/lib/browser-utils.ts", as there is no ./src/lib/browser-utils folder in the latest repo update that I see.
Before you lock down TypeDoc for the TSGO7 upgrade...
I have a small request for a custom deployment of TypeDoc where I have some advanced use cases that benefit from access to the runtime node utilities. I need to access discoverAllReferenceTypes. For programmatic deployments it may be useful to simply expose
node-utilssimilar to how thebrowser-utilshas an export oftypedoc/browser. This can be accomplished simply by adding the proper sub-path export condition topackage.json{ "exports": { "./node": { "typedoc-ts": "./src/lib/node-utils.ts", "types": "./dist/types/node-utils.d.ts", "default": "./dist/node-utils.js" } } }This allows:
At the end of the day... I can simply modify the
package.jsonafter TypeDoc installation into my specific project to add the above, but I think this is generally useful for more advanced programmatic use cases in general.Also just a quick thing I noticed when looking at this enhancement request.. It appears the browser export condition for
typedoc-tsis not pointing to the source. IE"typedoc-ts": "./src/lib/browser-utils/index.ts"likely should be"typedoc-ts": "./src/lib/browser-utils.ts",as there is no./src/lib/browser-utilsfolder in the latest repo update that I see.