Contributing
Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to this broadcast production toolkit.
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Code Style
- Commit Messages
- Pull Requests
- Testing
Code of Conduct
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
Getting Started
Prerequisites
- Node.js 20+
- npm 10+
- Google account (for Apps Script development)
- Cloudflare account (for Worker development)
- Supabase account (for database development)
Repository Structure
the-public-service/├── *.gs # Google Apps Script files├── worker/ # Cloudflare Worker (TypeScript)├── studio-app/ # React PWA for iPad├── supabase/ # Database schema└── docs/ # DocumentationDevelopment Setup
Google Apps Script
- Create a new Google Sheet
- Open Extensions → Apps Script
- Copy
.gsfiles into the script editor - Configure Script Properties with required secrets
For local development with version control:
npm install -g @google/claspclasp loginclasp clone <script-id>Cloudflare Worker
cd workernpm installnpm run dev # Local developmentnpm run typecheck # Type checkingnpm run deploy # Deploy to CloudflareStudio PWA
cd studio-appnpm installnpm run dev # Local development (port 7700)npm run build # Production buildnpm run preview # Preview production buildMaking Changes
Branch Naming
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringchore/- Maintenance tasks
Example: feature/add-export-functionality
Before You Start
- Check existing issues and PRs
- Open an issue to discuss significant changes
- Fork the repository
- Create a feature branch from
main
Code Style
Language Policy
All code, comments, and documentation must be in British English.
- Use “colour” not “color”
- Use “initialise” not “initialize”
- Use “behaviour” not “behavior”
- Use “programme” not “program” (when referring to broadcast content)
TypeScript
- Strict mode enabled
- No
anytypes (use proper typing orunknown) - Explicit return types on functions
- Use Zod for runtime validation
Formatting
This project uses ESLint and Prettier. Run before committing:
npm run lint:fixnpm run formatConfiguration:
- 2 space indentation
- Single quotes
- No semicolons
- 100 character line width
- Trailing commas
Error Handling
- Never swallow errors silently
- Use custom error classes from
worker/src/errors.ts - Log detailed errors server-side
- Return safe messages to clients
Commit Messages
We use Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]Types
feat:- New featurefix:- Bug fixdocs:- Documentationstyle:- Formatting (no code change)refactor:- Code restructuringperf:- Performance improvementtest:- Adding testschore:- Maintenanceci:- CI/CD changesbuild:- Build system changes
Scopes
worker- Cloudflare Workerstudio- Studio PWAsheets- Google Apps Scriptdb- Database/Supabasedocs- Documentation
Examples
feat(worker): add Zod validation for sync payloadsfix(studio): correct timer drift with performance.now()docs: update API documentation with new endpointschore(ci): add CodeQL security scanningRules
- Present tense (“add feature” not “added feature”)
- Lowercase first letter
- No period at the end
- Reference issues when relevant:
fixes #123
Pull Requests
Before Submitting
-
Ensure all checks pass:
Terminal window npm run check # Runs lint, format check, and typecheck -
Update documentation if needed
-
Add tests for new functionality (when test framework is in place)
PR Template
Your PR should include:
- Clear description of changes
- Type of change (bug fix, feature, etc.)
- Related issues
- Testing performed
- Screenshots (for UI changes)
- Breaking changes (if any)
Review Process
- Automated checks must pass
- At least one maintainer review required
- All conversations must be resolved
- Branch must be up to date with
main
Testing
Current Status
The test suite is being developed. When contributing:
- Ensure existing functionality isn’t broken
- Test manually in appropriate environment
- Document testing steps in PR
Running Checks
# All checksnpm run check
# Individual checksnpm run lintnpm run format:checknpm run typecheckManual Testing
- Apps Script: Test in a copy of the production sheet
- Worker: Use
wrangler devfor local testing - Studio PWA: Test in Chrome DevTools mobile emulation
Questions?
- Open a Discussion
- Check the FAQ
- Review existing Issues
Thank you for contributing to open broadcast infrastructure!