metaplex-foundation / js

A JavaScript SDK for interacting with Metaplex's programs
357 stars 182 forks source link

Types seem to be missing for NftClient methods (other types are fine) in VScode #227

Closed mikemaccana closed 2 years ago

mikemaccana commented 2 years ago

Using @metaplex-foundation/js@0.14.0 in vscode, while the NftClient object itself is typed (so I can see the type definitions are working), all the methods inside NftClient are of any type, have no parameters, and return any.

image

image

I'm not sure what's going on here, I can see types like CreateNftOutput exist in js/dist/types/plugins/nftModule/createNft.d.ts but for some reason the way the types are created doesn't seem to agree with vscode.

mikemaccana commented 2 years ago

PS I can product a standalone project reproducing this behavior if needed, just let me know!

lorisleiva commented 2 years ago

Oh no that's annoying. Thanks for raising this I'll investigate asap. This must be due to a recent refactoring that moves the client methods directly into the operation files so everything is in one place. But I didn't know VS Code was not going to be happy about this. I'll see if I can be more explicit when I link the method with the class.

lorisleiva commented 2 years ago

This should now be fixed in version 0.15. 🚀

mayoyml commented 2 years ago

@lorisleiva Thank you always! It seems like the version isn't ready on npm yet? I got this when installing it:

yarn add @metaplex-foundation/js@0.15.0
...
[1/4] 🔍  Resolving packages...
Couldn't find any versions for "@metaplex-foundation/js" that matches "0.15.0"
lorisleiva commented 2 years ago

Ah I'm an idiot, I forgot to publish. Thanks for raising this! It should be published now. 🍺

mayoyml commented 2 years ago

@lorisleiva yay!! HEAVEN!

image
mikemaccana commented 2 years ago

Thanks all! 💖