This repository is a TypeScript monorepo set up with:
- pnpm for managing workspaces and dependencies
- Bun for building and testing code
- TypeScript for connecting package types using project references
packages/– source for all publishable packages (e.g.core,yieldstar,bun-http-server, etc.)examples/– small apps and workflow examplestest/– integration tests written usingbun:test- Workspace configuration is defined in
pnpm-workspace.yaml:
packages:
- packages/*
- examples
- test
Run pnpm install in the repo root. This installs all workspace dependencies using the lock file.
To type check all monorepo packages, just run bun dts, which also generates type declarations.
To compile all packages, run bun run bundle
This runs each package's build script (bun build) and then tsc -b to generate type declarations.
Execute all tests with Bun's test runner:
bun test
Tests live in the test/ folder and import from bun:test as shown below:
import { expect, test, mock } from "bun:test";Example workflows are stored in examples/workflows/. The helper script bun start currently only imports the chosen file and prints the module – the workflows themselves do
not run automatically. Consider this directory a work in progress.
To inspect an example interactively you can still run:
bun start
This will prompt you to select a workflow file to import.
The monorepo contains these packages:
core- Base types and runtime abstractionsyieldstar- Main workflow SDK and exportsbun-http-server- HTTP server runtime for Bunbun-postgres-runtime- PostgreSQL-backed runtime for Bunbun-sqlite-runtime- SQLite-backed runtime for Bunbun-worker-invoker- Worker-based step invoker for Buntest-invoker- Test utilities for step invocationtest-runtime- In-memory runtime for testingtest-utils- Shared testing utilities
Releases are handled by bin/release.sh which:
- Determines version from git describe
- Publishes scoped packages under
@yieldstar/*scope - Publishes the main
yieldstarpackage unscoped - Handles npm account switching between
yieldstarandnotationusers
Use these commands for releases:
bun run bump- Bump version with alpha pre-releasebun run prerelease- Install deps and bundle before releasebun run release- Execute the release script
Currently postgres test credentials are hard coded.