You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected to be able to use an entry point located within a node_modules folder using the packages strategy, as suggested in this comment by @Gerrit0.
Actual Behavior
If TypeDoc's glob implementation encounters a node_modules dir anywhere within a path, it is explicitly ignored.
Steps to reproduce the bug
Create a typedoc.json with an entry point in node_modules
Run typedoc
Failure: no entry points found
Alternatively:
Create a typedoc.json with an entry point in node_modules and another (known good entry point) not in a node_modules
Run typedoc
Notice that the entry point in node_modules is excluded from the build
Environment
Typedoc version: v0.23.24
TypeScript version: v4.7.4 / v4.9.4
Node.js version: v18.x
OS: macOS
A potential fix is to remove the explicit check for node_modules from the glob implementation. As it's unclear to me why it's present, this may have unintended consequences. Removing it does not fail the test suite. Another route would be to support an ignoreNodeModules option for glob -- defaulting to true -- and be set to false when computing entry points.
My workaround right now is a monkeypatch which bypasses Node's subpath exports restrictions:
If I recall correctly, because people were specifying inputs like **/*.ts, which required traversing >100k files in node_modules, and they didn't actually mean to include that. On a slow disk, this was making the build take far longer than it should. I'd have to go back in history quite a while to find it, was at least a couple years ago.
If there's a smart way to ignore node_modules unless explicitly listed in the path, I think that'd be ideal... but it's probably okay to get rid of that exclude.
Search terms
node_modules glob
Expected Behavior
I expected to be able to use an entry point located within a
node_modules
folder using thepackages
strategy, as suggested in this comment by @Gerrit0.Actual Behavior
If TypeDoc's glob implementation encounters a
node_modules
dir anywhere within a path, it is explicitly ignored.Steps to reproduce the bug
typedoc.json
with an entry point innode_modules
typedoc
Alternatively:
typedoc.json
with an entry point innode_modules
and another (known good entry point) not in anode_modules
typedoc
node_modules
is excluded from the buildEnvironment
A potential fix is to remove the explicit check for
node_modules
from theglob
implementation. As it's unclear to me why it's present, this may have unintended consequences. Removing it does not fail the test suite. Another route would be to support anignoreNodeModules
option forglob
-- defaulting totrue
-- and be set tofalse
when computing entry points.My workaround right now is a monkeypatch which bypasses Node's subpath exports restrictions:
The text was updated successfully, but these errors were encountered: