cal.com
cal.com copied to clipboard
`app-store create` doesn't add import to the `appStore` object
Issue Summary
All app store packages are exported from /packages/app-store/index.ts
. When creating a new app using the CLI (app-store create
), the resulting package is not automatically added to this exports list.
Steps to Reproduce
-
yarn app-store create
and make an app calledexample
- open
/packages/app-store/index.ts
->example: import("./example")
not there
Maybe this is intentional, as most apps might not need their stuff exported in this way. But this tripped me up when I tried developing an app. It's not clear that the package needs to be manually added to this object.
Can you please assign me this issue
hi @AbleLincoln I have don this Issues ,can you can you assign
I'm sorry I don't have the power to assign. Ask @PeerRich
That is actually intentional. We don't want to use packages/app-store/index.ts. It has some legacy apps exports there but no new app should need it. If you can explain why you needed to add your export there, maybe I can suggest an alternate way or maybe that creates a new requirement that I would like to consider.
I'm working on the new PayPal payment app. The PaymentService
is handled via this appStore
object, as seen here https://github.com/calcom/cal.com/blob/99f736b317cf5a0e404f176ec7281a03d4765540/packages/lib/payment/handlePayment.ts#L27-L33
Ah got it. The payment app is pretty old and that's why it's like this. There are many generated files that are exposing certain modules for each app. Maybe we can generate apps.lib.generated.ts
. We don't want to use barrel files(like app-store/index.ts) as they bring with them unneeded depdencies increasing bundle size.
I think that would work. As far as I can the only reason the barrel file exists now is to import some apps' libs. I've seen it in:
- packages/app-store/_utils/getCalendar.ts
- packages/core/videoClient.ts
- packages/lib/payment/deletePayment.ts
- packages/trpc/server/routers/viewer/bookings/confirm.handler.ts
- packages/trpc/server/routers/viewer/payments/chargeCard.handler.ts
I do want to note that apparently this file was changed in a recent pull request to allow async imports of the appStore packages. Not sure if the change you're suggesting would interfere with any of this?