Skip to content
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

fix: Types in dist have incorrect imports #136

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ondrej-langr
Copy link

@ondrej-langr ondrej-langr commented Dec 28, 2024

Often when tsconfig.json compilerOptions.baseUrl property is used the autocomplete of editors imports things like "util/myfile.js" instead of relatively like this "../util/myfile.js".

This works when developing the project, however when the d.ts files are generated the types are not correctly resolved and the issue is silently hidden and surfaces just when the types are crutial - when user uses the package.

This change fixes that, but as you may anticipate this showed some incompletion even inside the packages here in this monorepo (code relied on some variable to be defined, but type said it can be undefined) and these issues needed to be fixed.
However nothing major, just few conditions that throw when something is undefined has been added.

Just to point out something that Im not entirely sure of as it depends on the author of the code - DecryptFn declaration (decrypt.ts in crdx package) was not generic and it made some, for me, unsolvable type issue in Connection.ts in the auth package here
To solve that I made the DecryptFn generic, but according to semver it would mean a breaking change (and I dont like that frankly :D). Let me know how can we solve it differently. For now i did it quite dirty - marked the change as a patch as its, imo, a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant