Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.25 KB

File metadata and controls

45 lines (31 loc) · 1.25 KB

This is a demo project showing some of my tool's features:

  • Defining infrastructure using generated synapse-provider:* modules
  • Programmatically bundling individual closures into infra
  • Calling Zig functions from TypeScript
  • Deploying, testing, tearing down

Components

add.zig exports a function adding two arguments plus an environment value.

lambda.ts defines a class for creating Lambda functions from JS closures.

main.ts creates and tests two Lambdas.

Prerequisites

Commands

synapse test runs install, compile, and deploy automatically if needed, then executes the tests.

Example output:

Deploying (8/8)
✓ + fn <LambdaFunction> (17s)
✓ + test

aarch64 (EXTRA_VAL: 67) (589ms)
x64 (EXTRA_VAL: 21) (467ms)

On a fresh machine install can take a minute, mostly due to the large AWS Terraform provider.

Subsequent changes to the code will reuse the deployment, updating as little as possible.

synapse destroy tears everything down:

Destroying (8/8)
✓ - test
✓ - fn <LambdaFunction> (1s)