-
Notifications
You must be signed in to change notification settings - Fork 2
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 extension ZIP cache directories to type roots and implement standalone extensions sharing types #365
Comments
We should also think of a way to better support sharing types between extensions you're developing. Getting types from the cache would allow development off of other published extensions, but we don't have a clear way of doing that with in-development extensions right now. We might just have to teach people how to point Maybe we could add another cache directory that copies the .d.ts files for directory extensions every time the extension host starts (or reloads). Then the .d.ts files that are read could be at least almost up-to-date. I don't know if TypeScript will be ok with duplicate definitions of your types, though. I guess you could remove For an extension you're working on that already has a published version installed, Maybe we could detect when an extension is provided by a directory (instead of a zip) and delete the unzipped files in the cache. |
Turns out that Unfortunately, I discovered a few problems with the proposed solution in the issue description along the way, so I had to change things a bit:
|
As an extension developer, I want to be able to reference types from other extensions when I'm writing code that depends on those extensions.
Extension ZIP files are decompressed by the extension service so they can be loaded and executed at runtime. We would also like to use those decompressed
d.ts
files inside of VS Code when developing other extensions so we can use their types.Platform.Bible conditionally unzips extensions into
paranext-core\dev-appdata\cache\extensions
. Let's leverage this.paranext-core\dev-appdata\cache\extensions
totypeRoots
.d.ts
files are copied into the extension cache in order to gather extension types from directories. However, that will probably mean the currently in development extension will have its.d.ts
file twice, which could pose issues. Probably the solution at least for now is to make a short documentation about how to add other extensions' directories to yourtypeRoots
.d.ts
files put in the cache and note that it may be worth deleting this folder if you experience unexpected types issues.The text was updated successfully, but these errors were encountered: