Skip to content

Latest commit

 

History

History
63 lines (42 loc) · 2.32 KB

File metadata and controls

63 lines (42 loc) · 2.32 KB

Contributing to Startup API Cloudflare

Thanks for your interest in improving Startup API! This guide is for developers working on the framework itself (the @startup-api/cloudflare package in this repository).

Building an application on top of Startup API? You don't need to clone this repo — scaffold a project with npm create startup-api instead. See the README.

Prerequisites

Clone and install

git clone https://github.com/StartupAPI/startup-api-cloudflare.git
cd startup-api-cloudflare
npm install

Local development

npm run dev      # start the worker locally (uses wrangler.local.jsonc)

This serves the worker at http://localhost:8787. Local configuration and secrets live in wrangler.local.jsonc and .dev.vars — never commit changes to .env or .dev.vars.

To deploy your own test worker to Cloudflare:

npm run deploy

Tests, linting, and formatting

npm test           # runs eslint then the vitest suite
npm run lint       # eslint only
npm run format     # prettier --write across the repo
  • When you add a feature, add tests that cover the new code.
  • Run npm run lint and fix anything it flags before committing.
  • Run npm run format after changes so the diff stays prettier-clean.
  • Every time you edit wrangler.jsonc, run npm run cf-typegen to regenerate the binding types.

Conventions

  • TypeScript strict mode; single quotes and trailing commas (enforced by prettier).
  • Internal worker routes are prefixed with the configured usersPath; non-admin API paths start with /${usersPath}/api/ and admin paths with /${usersPath}/admin/api/.
  • Call Durable Objects via RPC rather than fetch(), and name stub variables after the DO they refer to.

See AGENTS.md for the full set of repository conventions.

Submitting changes

  1. Create a branch for your change.
  2. Make sure npm test passes and the code is formatted.
  3. Open a Pull Request describing what changed and why.

License

By contributing, you agree that your contributions are licensed under the Apache License 2.0.