-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add subpath entry points + CommonJS types fix #503
Conversation
I'd personally rather not expose the internal structure of the library by exporting all the |
Oh, snap, I accidentally changed the export to index.js, and left the type as index-cjs.d.ts. That's 100% wrong, lol. |
I'd meant to update the types to point to index.d.ts, and inadvertently changed the *export* to index.js instead, whoops. Re: #503
Just to clarify why I don't want to export the internal modules, it makes things a lot less flexible when there's a need to move things into a submodule, but still re-export it. As a very recent example, I just in 9.1.0 started to add escape/unescape to Glob, and then realized it would also be valuable in Minimatch. So if I'd supported I realize there are ways to do similar things in package.json exports, but it's a place I never think to look, so I prefer to mostly just treat |
Pulled in the declarationMap (TIL, adding to my project init scripts, thanks!) and the fixed export/types for CommonJS. Going to close this, but happy to reopen if there's another reason I'm missing that would be a strong argument to allow submodule exports. |
@isaacs Brilliant, appreciate the quick types fix and glad the Don't worry, happy to help 😊 Yeah that makes total sense to prevent access. No strong argument in particular, just a few unreachable types in JSDoc where TypeScript utilities like It's nice not to break Node.js |
Ah, ok. I'm happy to export those from the main module, if there's something that would be useful. I agree, it's a pita to have to do a ton of |
Hello 👋
We're using JSDoc types in CommonJS and looked like the types
"require"
entry got left behind recently?I've added a fix and included a few other things:
CommonJS types
The types
"require"
entry doesn't export typesGlobOptions
,Result
,Results
etcThis fixes type declarations in CommonJS such as:
Subpath package exports
I've added both
"./*.js"
(extensionless) and"./*"
subpath exports to enable:ES modules
CommonJS modules
But also in JSDoc comments:
Declaration maps
The compiler option
{ "declarationMap": true }
lets "Go to definition" jump to the TypeScript source