NuroDev / lemonsqueezy.ts

πŸ‹ JavaScript / TypeScript SDK for the Lemon Squeezy API
https://paka.dev/npm/lemonsqueezy.ts
MIT License
158 stars 17 forks source link

Types that are found, but not exported in package.json #33

Open adxmcollins opened 10 months ago

adxmcollins commented 10 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch lemonsqueezy.ts@0.1.7 for the project I'm working on.

Because of some changes with TypeScript (moduleResolution = bundler), the types are not working with newer versions of TypeScript. The following change needs to be made to make sure the types are exported in a way which works with bundler.

More details can be found here: https://github.com/microsoft/TypeScript/issues/52363

It's only a small change to fix it. Here is the diff that solved the problem:

diff --git a/node_modules/lemonsqueezy.ts/package.json b/node_modules/lemonsqueezy.ts/package.json
index e5a0751..bc84638 100644
--- a/node_modules/lemonsqueezy.ts/package.json
+++ b/node_modules/lemonsqueezy.ts/package.json
@@ -32,7 +32,10 @@
   },
   "exports": {
     ".": {
-      "import": "./dist/index.mjs",
+      "import": {
+        "types": "./dist/index.d.ts",
+        "default": "./dist/index.mjs"
+      },
       "require": "./dist/index.js"
     },
     "./checkout": {

This issue body was partially generated by patch-package.

hellofaizan commented 2 weeks ago

@NuroDev merge this Pull Request

hellofaizan commented 2 weeks ago

@JulianBerger Itworked, can you tell me one thing, i hosted website on vercel, but i cant make changes in node_module in vercel, need help with that, build failed on vercel due to this issue