I have a mono-repo project configured with an isolated library package (TS only) and another web UI package (TS + React).
I am importing the compiled library package from the consumer (web UI) package. To do so, I am using yarn to link the packages and parcel to generate the library package's distribution files.
Parcel is automatically generating a d.ts file in the library package's dist folder.
I am using the VS Code as IDE and when I open the consumer packages file that imports the library and make use of it, the VS Code is not recognizing the types declared in the library package's d.ts file.
This is the packages' structure:
rootPackage
|- library
|- web-ui
In the library package, I have a types.ts file and an index.ts file. There is only a single type being exported:
export type ParamType = "a" | "b" | "c";
I'm using parcel watch on this package to automatically refresh the dist files when something is changed.
Parcel is generating the main.d.ts file just fine and this file is being referenced by the package.json's types attribute.
When I try to use this ParamType type by the web-ui package's code, I got the following IDE error highlighting in the type:
Cannot find name 'ParamType'.ts(2304)
When I run parcel in the web-ui package, it compiles just fine and the browser is loaded with no problems/warnings.
I think it's a problem related exclusively to the VS Code and I'm not sure how to fix it.
Edit 1
I've created a public repository on GitHub to demonstrate the issue. If you know how to fix it, feel free to create a pull request, it would be very helpful.