question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Guidance on using with Typescript and Yarn workspaces

See original GitHub issue

Hey there, Jetpack looks great and I am hoping to be able to use it after struggling with serverless-webpack for the last few days.

I have a typescript monorepo using yarn workspaces, and found this issue in which you say to build manually with a script. However, it’s not clear how to configure this with Jetpack. Right now I have

package:
  include:
    - "**/dist/**"
    - "!**/node_modules/aws-sdk/**"
    - "!**/node_modules/@prisma/**"
    - "!**/node_modules/.prisma/**"
    - "!**/node_modules/typescript/**"
    - "!**/node_modules/.cache/**"

custom:
  jetpack:
    # Search for hoisted dependencies to one parent above normal.
    base: "../.."

This is including my entire hoisted node_modules folder (including aws-sdk, typescript, other dev dependencies, etc) and so is too large for lambda. Further, it’s not clear how to connect it to the function.

Would it be:

functions:
  stripe:
    timeout: 30
    handler: dist/stripe-webhook.paymentIntentWebhook
    events:
      - http:
          path: '/webhooks/payment_intent'
          method: POST
          cors: true

???

Any guidance is much appreciated. Thanks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mikkel-pearlcommented, Jul 31, 2021

YES! It is working

Thank you for putting in all the time to figure this out with me. I spent over a week trying to get it to work and there are lots of people that have been trying to get similar setups going on the net, but nothing is consistently succeeding. I’ll be sure to write this up and show how it’s done.

0reactions
ryan-roemercommented, Jul 31, 2021

Awesome! Looking forward to the write up.

And thanks for taking the time to push example code to jetpack-test. Having something we can actually dig into makes debugging so much more tractable and efficient.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript Monorepos with Yarn - Semaphore CI
A tutorial showing how to configure TypeScript to work in a monorepo and building everything with CI/CD.
Read more >
TypeScript + Yarn Workspace Monorepo - DEV Community ‍ ‍
Setup yarn workspace in package.​​ Yarn workspace must set private to true . In workspaces field you either explicitly list the path of...
Read more >
A guide through The Wild Wild West of setting up a mono repo ...
In this part, I will explain step by step how to setup Lerna, Yarn Workspaces and Typescript in a mono repo. In the...
Read more >
TypeScript Monorepo with Yarn and Project References
Project references and Yarn workspaces in combination enable developing TypeScript projects as scale while keeping code modular and manageable.
Read more >
Step by Step Guide to create a Typescript Monorepo with Yarn ...
Here is a list of the tools and packages that we will use to make the magic happen: Yarn Workspaces; Lerna; Typescript; Jest;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found