node_modules glob
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.
If TypeDoc's glob implementation encounters a node_modules
dir anywhere within a path, it is explicitly ignored.
typedoc.json
with an entry point in node_modules
typedoc
Alternatively:
typedoc.json
with an entry point in node_modules
and another (known good entry point) not in a node_modules
typedoc
node_modules
is excluded from the buildA 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:
import {sync as glob} from 'glob';
require(path.join(
somePackageRoot,
'node_modules',
'typedoc',
'dist',
'lib',
'utils',
'fs.js'
)).glob = glob;
As it's unclear to me why it's present
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.
Owner Name | TypeStrong |
Repo Name | typedoc |
Full Name | TypeStrong/typedoc |
Language | TypeScript |
Created Date | 2014-05-24 |
Updated Date | 2023-03-19 |
Star Count | 6487 |
Watcher Count | 68 |
Fork Count | 639 |
Issue Count | 48 |
Issue Title | Created Date | Updated Date |
---|