Buildcheck checks the content of the build files for all lambdas during CI.
The expected content is defined programmatically in typescript, similar to how CDK defines cloudformation.
After editing the build definition, refresh the build files using pnpm snapshot:update.
- open data/build.ts
- add it to the dependencies section of your lambda definition
- run
pnpm snapshot:update
- open data/dependencies.ts
- edit the version number accordingly
- run
pnpm snapshot:update
- run
pnpm snapshot:updateto refresh the full set of build files - review (if necessary update the build definition and run snapshot:update again)
- commit and push
The benefits are similar to CDK or SBT:
- prevent inconsistencies between lambdas/modules including dependency versions and pnpm scripts
- have a central list of recommended dependencies (with auto complete/type checking/static analysis)
- files can be generated where necessary e.g. adding a new handler
- allows more fine grained modules to be manageable improving build times and organisation
- easier to review new lambda boilerplate as it's guaranteed to be standard