A TypeScript library implementing RFC 8621 JMAP for Mail using Effect-TS.
- Always use pnpm as the package manager (never npm, yarn, or bun)
- Use
pnpm dlxinstead ofnpxfor one-off commands
- Services via Context.Tag: Services are defined using
Context.Tag - Layers for dependency injection: Services are provided via
Layer - Effect.gen vs Effect.flatMap/pipe:
- Use
Effect.gen(function* () { ... })for complex flows with intermediate values or multiple steps - Use
Effect.flatMap/.pipe()for simple one-step service calls (e.g.,Effect.flatMap(Service, svc => svc.method(args)))
- Use
- Schema validation: Effect Schema for type-safe parsing
- Branded types: Use
Schema.brand()for type safety (e.g.,Id,State)
- ES modules with
.jsextensions in imports (for Node ESM compatibility) - Errors use
Data.TaggedErrorpattern
- Never push directly to main - Always use feature branches and pull requests
- Create a branch for your changes:
git checkout -b feature/description - Push the branch and create a PR via
gh pr create - Wait for CI checks and review before merging
- Sentence-case subjects:
fix: Correct the return type(notfix: correct...) - No "Generated with" banners or co-author attributions
- Both release and preview publishing live in
publish.ymlto share a single npm OIDC trusted publisher - Release (push to main): uses
semantic-releasewith OIDC token exchange - Preview (pull requests): publishes
0.0.0-pr.<number>.<sha>versions vianpm publish --provenancewith OIDC - Do not create separate publishing workflow files — npm only allows one trusted publisher per package
See docs/implementing-spec-features.md for the workflow.