-
Notifications
You must be signed in to change notification settings - Fork 378
Description
Problem
The published npm package for vscode-languageclient currently includes a d.ts file for every .js file under lib:
This is problematic for two reasons:
-
It bloats the package size. All the
d.tsfiles invscode-languageclienttake up 300KB or so -
We are likely publishing interfaces and types that are not meant to be exposed externally. For example, there are files like
utils/async.d.ts.
Proposed fix
To fix this, I suggest adopting a tool such as api extractor. This lets you bundle all the types for a project into a single d.ts file. You can also control which types are exposed and which ones stay internal
I adopted this for the markdown language service: https://github.com/microsoft/vscode-markdown-languageservice/blob/main/api-extractor.json
This helped me make sure I only exposed a well defined API to library consumers
