This guide helps contributors work effectively in this repository. It summarizes structure, workflows, and conventions tailored to ChittyConnect.
- App and APIs:
src/(Hono worker, routes undersrc/api/routes/*) - Middleware & utils:
src/middleware/*,src/lib/* - Integrations & intelligence:
src/integrations/*,src/intelligence/* - GitHub/MCP tooling:
mcp-server.js,src/github/* - Config:
wrangler*.toml,package.json - CI:
.github/workflows/* - Docs: top‑level
README.md; release notes via Release Drafter
npm install— install dependenciesnpm run dev— local worker via Wranglernpm run deploy[:staging|:production]— deploy to Cloudflarenpm test/npm run test:watch— run unit tests (Vitest)npm run lint— ESLint forsrc/npm run format— Prettier formattingnpm pack --dry-run— preview published files
- Language: modern JavaScript (ESM,
type: module) - Indentation: 2 spaces; no trailing whitespace
- Filenames:
kebab-case.jsfor modules; test files under__tests__or*.test.js - Imports: absolute within
src/only when readable; prefer named exports - Tools: ESLint, Prettier; run
npm run lint && npm run formatbefore PRs
- Framework: Vitest
- Location:
src/**/__tests__/*and*.test.js - Naming: mirror source paths (e.g.,
src/api/router.test.js) - Run:
npm test; add focused tests for routes/middleware you touch
- Commits: conventional style preferred (e.g.,
feat:,fix:,chore:) - Scope clear, messages imperative; small, atomic changes
- PRs: include description, linked issues, test plan, and any config changes
- CI must pass; format and lint clean before request
- Secrets via Wrangler secrets and GitHub Actions secrets; never commit keys
- For npm publish, CI loads tokens via GitHub/chittysecrets; local publishes require
--access publicfor scoped packages