Add types for react-meteor-data package#377
Conversation
piotrpospiech
left a comment
There was a problem hiding this comment.
I would prefer the types to be generated from the typescript files as done in react-meteor-accounts. It will be easier to maintain them.
|
Silly me 😁 I kind of assumed that if types are in types/meteor package the code is not written in TypeScript. Will update the PR |
|
The problem I have now is that typescript generates either separate type files or one with different modules: Any ideas how can I work around that? |
|
@alisnic You can generate separate type files (just use You can also use |
|
@Grubba27 what is the status of this? |
|
Hey @StorytellerCZ, I was waiting for @piotrpospiech to approve these changes, but I've checked and reviewed it. I think it is good. I will make a new Release for react-meteor-data as soon as I can. |
|
2.6.1 is out! |
|
So after testing this does not seem to work 🤔 . Steps I did:
What did I miss in the PR? |
|
Apparently, I needed to add |
|
|
|
I'll investigate a bit more, as the entry I referenced seem to be related to the process of automatically generating types on publish, which is not the use-case here. Types are already generated, we only need to expose them |
|
Hi @alisnic, the I was curious that it didn't work, so I tested it. I created a new Meteor project with a Typescript template. It installed I removed It seems like it is an issue with the |
|
OK. I did some digging into what's going on here. I wasn't able to reproduce @piotrpospiech's experience - my experience is that types for I think the easiest workaround for this is to include The reason the current configuration doesn't work is because In any case, when consuming types from Meteor packages, I'll push up a PR in a sec to add the |
Types are taken from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/meteor/react-meteor-data.d.ts and updated to match the latest release.