Fix type linking for msdocs and NPM packages #96
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
With the addition of the server-bindings, there needs to be updates to the logic that links types between modules. If something has a type from @minecraft/server-bindings and it depends on @minecraft/server, then that dependency should be changed to @minecraft/server and this PR enables that all the time.
Tech Overview
At filter time, the parent module (i.e. server-bindings) may not exist because it was merged with the base (i.e. server). I needed to add support for updating types'
from_modulefrom the parent to the base, even if the parent doesn't exist. So I store all the needed data on the base module.Testing
I previously added support for this but it only worked if the base module and the parent module both existed (i.e. if
--includeBaseis set) but for regular invocations where the base module (i.e. server-bindings) is deleted, it wouldn't work. I added a test for both these cases to ensure linking types works.