TypeStrong / TypeStrong/typedoc
Export `node-utils` from package.json
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.5k
- Forks
- 775
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the exports section of package.json and compare it with the existing browser-utils export. Add the node subpath for the source, type declaration, and compiled runtime paths, and verify the browser typedoc-ts path against src/lib/browser-utils.ts. Done means typedoc/node exposes discoverAllReferenceTypes and the browser source condition points to an existing file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100