Skip to content

Latest commit

 

History

History
69 lines (46 loc) · 2.14 KB

File metadata and controls

69 lines (46 loc) · 2.14 KB

Contributing to Open Function Spec

Thank you for contributing! This repo defines and grows the Open Function Spec (OFS) — a universal standard for composable TypeScript backend modules.

There are two ways to contribute:

  1. Improve the Spec — propose clarifications, additions, or new compliance levels.
  2. Add an Example — contribute a reference implementation under examples/.

Contributing a New Example Module

Examples in this repo must be self-contained, copy-pasteable, and spec-compliant.

Checklist

Before opening a PR, verify:

  • Module lives in examples/<your-module-name>/
  • schema.ts uses Drizzle ORM — no raw SQL strings
  • core.ts has no framework imports (hono, express, etc.)
  • core.ts has no process.env — passes via ctx.env only
  • core.ts throws Error, never returns HTTP responses
  • adapter-hono.ts works on Cloudflare Workers
  • README.md lists endpoints, env vars, and DB tables
  • Passes npx tsc --noEmit (no TypeScript errors)

Proposing a Spec Change

  1. Open an issue using the Spec Change Proposal template.
  2. Describe the problem, the proposed rule change, and the migration path.
  3. Get discussion/approval from maintainers before opening a PR.

Example Module Structure

examples/<module-name>/
  schema.ts        — Drizzle table definitions
  core.ts          — Pure business logic
  adapter-hono.ts  — Hono adapter (Cloudflare Workers)
  adapter-express.ts (optional) — Node.js adapter
  README.md        — Usage, endpoints, env vars

Code Style

  • TypeScript only (.ts extension).
  • Explicit return types on all exported functions.
  • JSDoc comments on exported functions explaining params and return values.
  • No any types in exported signatures.

Community


MIT License. All contributions are licensed under the same terms.