Getting started
Prerequisites
- Node.js 20 (matches
serverless.ymlruntime) - AWS CLI with profiles
AbstractPlayDevandAbstractPlayProdin~/.aws/credentials - Access to the
@abstractplayGitHub Packages scope
Install and build
npm install
npm run build:layers # required before deploy — builds gameslib Lambda layer
npm run build # ESLint
npm test # vitest (summarizeHelpers unit tests)
GitHub Packages
Private packages require a .npmrc:
@abstractplay:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=<PAT with read:packages>
CI creates this from the PAT_READ_PACKAGES secret (see .github/workflows/deploy-dev.js.yml).
Local gameslib development
To test against a local rules engine build:
npm install /path/to/gameslib.tgz
npm run build:layers
Or pin the dev tag (as CI does on develop):
npm i @abstractplay/gameslib@development
npm run build:layers
Invoking a function locally
With AWS credentials configured for the target stage:
serverless invoke -f summarize --stage prod
serverless invoke -f records --stage prod
Most batch functions expect prod S3 buckets and a completed DB dump. For code changes, prefer unit tests (src/functions/summarizeHelpers.test.ts) or invoke against dev stacks with caution — schedules are disabled on dev.
Project layout
src/functions/ Lambda handlers (one file per function)
src/types/ Shared TypeScript types
src/locales/ apback i18n strings
scripts/ build-layers.cjs
serverless.yml Function definitions and schedules
docs/ Developer documentation (published at /crons/)