zapier / zapier-platform

The SDK for you to build an integration on Zapier
https://platform.zapier.com
Other
344 stars 188 forks source link

feat(core): Allow relative paths via z.require() [PDE-5116] #809

Closed kreddlear closed 3 months ago

kreddlear commented 3 months ago

Based on the POC patch logic here: https://gitlab.com/zapier/zapier/-/merge_requests/57310/diffs#note_1923825583

z.require('./constants') should work relative to the app root rather than to node_modules/zapier-platform-core/src/app-middlewares/before.

eliangcs commented 3 months ago

@kreddlear the changes themselves look good. Can you add some tests to make sure it works as expected? Thanks!

You might want to create a separate PR for the loadApp change because it will need tests too and it'd be easier to review separately.

kreddlear commented 3 months ago

@eliangcs Definitely, I started adding tests yesterday but didn't quite finish. I'll split this up to make it easier to review as well, and ping you and Zac directly when it's ready for review.