prici-io / prici

manage plans and pricing for any SaaS application
https://prici.io
MIT License
37 stars 5 forks source link

Feature/10 - Add A Nest Guard #25

Closed eladabramovich closed 6 months ago

eladabramovich commented 6 months ago

Resolves #10, adding support for NestJs guard. Added a new nest guard as part of the SDK library as well as a NestJs demo app and documentation for using PriciSDK with NestJs and using the guard to help new users understand how the integration works.

Please note that to run the demo app server you will need to manually transpile the SDK folder from TS to JS.

netlify[bot] commented 6 months ago

Deploy Preview for dashing-meerkat-19c0fa ready!

Name Link
Latest commit 5ac3b5ae811c1c64f6e0bb2da4bdf9c62d568dac
Latest deploy log https://app.netlify.com/sites/dashing-meerkat-19c0fa/deploys/65b0328abdfd3e00085a7ea9
Deploy Preview https://deploy-preview-25--dashing-meerkat-19c0fa.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

davidmeirlevy commented 6 months ago

Thanks! I'll run it today and check. Probably I need to check other demos to make sure they're still work.

davidmeirlevy commented 6 months ago

@eladabramovich sorry for the conflicts.. i released the new docs. please rebase to fix the conflicts. 🙏

eladabramovich commented 6 months ago

@davidmeirlevy, Done.

davidmeirlevy commented 6 months ago

@eladabramovich main was updated with the build steps. rebase again, please. : 🙏

eladabramovich commented 6 months ago

@davidmeirlevy Rebase is done

davidmeirlevy commented 6 months ago

@eladabramovich in order to make it work, add this code to libs/sdk/package.json:

"exports": {
    ".": "./dist/index.js",
    "./*": "./dist/*/index.js"
  },
eladabramovich commented 6 months ago

Can you please explain your intention for "In order to make it work"? After rebasing I tested both demo apps and ran the test suite without any problem.

davidmeirlevy commented 6 months ago

The demo app nest didn't work. It had problems with the guard location. After adding the exports - everything works great.

eladabramovich commented 6 months ago

I created a fresh clone of my fork and was able to reproduce the situation you talked about, seems like something in my original clone made it pass without falling 😅 Anyway, I pushed the change you requested.

davidmeirlevy commented 6 months ago

Whenever I have those issues, I run: npx npkill

It will change your life :)