-
Notifications
You must be signed in to change notification settings - Fork 927
fix: add type declarations to exports field #6307
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
Conversation
🦋 Changeset detectedLatest commit: 19adc31 The changes in this PR will be included in the next version bump. This PR includes changesets to release 31 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thank you very much for putting together this PR! I read through the Typescript documentation for this change (https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing) and if I'm understanding it correctly, the So the only files that should be broken are ones with non-matching names, mostly files with The documentation also says that the Can you correct those two things, and/or let me know if I'm incorrect about either of them? |
I wanted to be on the safe side here and be very explicit. I think this might prevent issues in case of refactorings in the future. E.g. if the types are moved to a different location and not referenced in the package.json, people might forget to add the In which package could the Also, if there are multiple conditions (
Will move. I only read that How do we think we could test whether all paths are correct? I twice through all paths, but I still might have referenced a missing type declaration. For a project this big, it might even make sense going through all export conditions (not only |
Hmm, let me see if I can put together a script to check for that. I can run it locally on your branch to verify we can merge this PR, and then I will clean it up and submit it as a CI check later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran a check and all the paths in this change resolve to at least something, except one, which is only incorrect because you copied it from the original, which was incorrect to begin with. I also found a few other incorrect paths in some parts you didn't touch, which I will fix when I create the PR for the path checking script.
I think this PR is good to go if you just fix the installations-compat path. Thanks again!
Adds paths of type definitions to each package.json's
exports
I am the least confident about the changes to
@firebase/auth
due to the many different exports. I hope I got it right.Discussion
closes #6300
context: https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs
Testing
I am not quite sure how to test these paths. Ideally, all paths within the
exports
fields should be tested to avoid referencing a missing file. Maybe a new global test that checks all packages could do the job?