arc.codes
arc.codes copied to clipboard
Add missing steps for installing Node.js runtime helpers
Thank you for helping out! ✨
We really appreciate your commitment to improving Architect
To maintain a high standard of quality in our releases, before merging every pull request we ask that you've completed the following:
- [X] Forked the repo and created your branch from
main
- [X] Made sure tests pass (run
npm it
from the repo root) - [X] Updated relevant documentation internal to this repo (e.g.
readme.md
, help docs, inline docs & comments, etc.) - [X] Linked to any related issues, PRs, etc. below that may relate to, consume, or necessitate these changes
Please also be sure to completed the CLA as it's required for your PR to be merged. A github comment will prompt you if you haven't already.
Learn more about contributing to Architect here.
Thanks again!
@architect/functions
(or any Node package) can be installed at the root of an Arc project and then required in any function. This works in Sandbox since the entire project is run in a single service from the root.
Upon deployment, Arc will look at each function's syntax tree and decide what needs to be present in each deployed Lambda.
It is possible to use a package.json
in individual functions but is not necessary for most use cases and is a bit more arduous/error prone.
@jcohenho as @tbeseda pointed out in his last comment it's not necessary to cd into the lambda to install dependencies. You can do it if you want to manually manage the deps. My follow up question is did you run into a problem where it was necessary to install the deps in each lambda?
@macdonst you can follow all of the discussions related to this here, there are several differences in opinions and strategies it seems: https://discord.com/channels/880272256100601927/884128364531699754/953787371101487144
Personally, I was confused about needing to install dependencies per package for different runtimes but for node you can use the project-level package.json, and choose later if you want to use a package.json
per lambda.