Shopify / js-buy-sdk

The JS Buy SDK is a lightweight library that allows you to build ecommerce into any website. It is based on Shopify's API and provides the ability to retrieve products and collections from your shop, add products to a cart, and checkout.
https://shopify.github.io/js-buy-sdk
MIT License
987 stars 262 forks source link

The types @types/shopify-buy #930

Closed loick closed 1 year ago

loick commented 1 year ago

Hi everyone, I'm not sure how to qualify it (bug or feature request).

I don't know if the Typescript types are generated from the code or not, but it seems the library @types/shopify-buy is outdated with the current version of shopify-buy.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/49e6a83e5402ab15cbfdf70e9a5cab2948772d5e/types/shopify-buy/index.d.ts It seems to be related to the version 2.10.

Is there a process to update it?

On my end, I have a situation with the images as you can see below:

CleanShot 2022-11-28 at 16 05 42@2x

However, the data exists in reality: CleanShot 2022-11-28 at 16 05 58@2x

Should I add a PR in order to add the missing properties within the repository of the types? Or should it be all upgraded at once?

Thanks :)

loick commented 1 year ago

Actually, the same issue seems to occur for the prices, which used to be strings and now are objects.

loick commented 1 year ago

Okay, If some people land here, I found this other ongoing issue recommending to use https://www.npmjs.com/package/@brandboostinggmbh/shopify-buy-types while the PR on DefinitelyTyped is ongoing.

https://github.com/Shopify/js-buy-sdk/issues/883