Contributing to Spry
Learn how to contribute to Spry - from reporting bugs to submitting pull requests
Thank you for your interest in contributing to Spry! We welcome contributions in all forms - whether it's reporting bugs, suggesting features, improving documentation, or submitting code.
Ways to Contribute
There are many ways to contribute to Spry:
- Report Bugs - Help us identify and fix issues
- Suggest Features - Share ideas for new capabilities
- Improve Documentation - Help make our docs clearer and more comprehensive
- Write Code - Submit pull requests to fix bugs or add features
- Help Others - Answer questions in discussions and issues
- Share Examples - Show the community what you've built with Spry
Getting Started
Prerequisites
Before contributing to Spry, ensure you have:
- Deno 2.5+ installed
- Git installed
- A GitHub account
- Familiarity with TypeScript and Markdown
Setting Up Your Development Environment
Fork the repository
Visit github.com/programmablemd/spry and click the "Fork" button.
Clone your fork
git clone https://github.com/YOUR_USERNAME/spry.git
cd spryAdd upstream remote
git remote add upstream https://github.com/programmablemd/spry.gitInstall dependencies
deno cache --reload lib/mod.tsVerify your setup
deno testDevelopment Workflow
Creating a Branch
Always create a new branch for your work:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fixUse descriptive branch names:
feature/add-python-supportfix/sql-parsing-errordocs/improve-quickstart
Making Changes
Write clean, maintainable code
- Follow TypeScript best practices
- Use meaningful variable and function names
- Add comments for complex logic
- Keep functions focused and small
Test your changes
deno testUpdate documentation
- Update relevant
.mdfiles - Add examples if introducing new features
- Update API documentation if needed
Commit your changes
git add .
git commit -m "feat: add Python execution support"Commit Message Guidelines
We follow the Conventional Commits specification:
| Prefix | Description |
|---|---|
feat: | A new feature |
fix: | A bug fix |
docs: | Documentation only changes |
style: | Code style changes (formatting, missing semicolons, etc.) |
refactor: | Code refactoring without changing functionality |
perf: | Performance improvements |
test: | Adding or updating tests |
chore: | Maintenance tasks |
Examples:
feat: add PostgreSQL connection pooling
fix: resolve SQL injection vulnerability
docs: update installation guide for Windows
refactor: simplify task dependency resolutionSubmitting Pull Requests
Before Submitting
Sync with upstream
git fetch upstream
git rebase upstream/mainRun tests
deno testFormat your code
deno fmtLint your code
deno lintCreating the Pull Request
Push your branch
git push origin feature/your-feature-nameOpen a pull request
- Go to your fork on GitHub
- Click "New Pull Request"
- Select your branch
- Fill in the PR template
PR Title and Description
- Use a clear, descriptive title
- Reference related issues (e.g., "Fixes #123")
- Describe what changed and why
- Include screenshots/examples if applicable
PR Template
## Description
Brief description of changes
## Related Issues
Fixes #123
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
How has this been tested?
## Checklist
- [ ] Tests pass locally
- [ ] Code follows project style
- [ ] Documentation updated
- [ ] Commit messages follow conventionsCode Style Guidelines
TypeScript
- Use TypeScript for all source code
- Enable strict mode
- Prefer
constoverlet, avoidvar - Use descriptive type names
- Document public APIs with JSDoc comments
/**
* Executes a Markdown code block as a task
* @param cell - The code block to execute
* @param context - Execution context
* @returns Promise resolving to execution result
*/
export async function executeCell(
cell: CodeCell,
context: ExecutionContext
): Promise<ExecutionResult> {
// Implementation
}Markdown
- Use ATX-style headers (
#syntax) - Add blank lines around code blocks
- Use fenced code blocks with language identifiers
- Keep lines under 100 characters when possible
- Use reference-style links for readability
File Organization
Directory structure:
lib/- Core library codecore/- Core functionalityparsers/- Markdown parsersexecutors/- Code execution enginessqlpage/- SQLPage integration
tests/- Test filesdocs/- Documentationexamples/- Example Spryfiles
Testing
Writing Tests
- Write tests for all new features
- Use descriptive test names
- Follow the Arrange-Act-Assert pattern
- Test edge cases and error conditions
Deno.test("executeCell: handles SQL queries correctly", async () => {
// Arrange
const cell = createSQLCell("SELECT 1");
const context = createTestContext();
// Act
const result = await executeCell(cell, context);
// Assert
assertEquals(result.success, true);
assertEquals(result.output, "1");
});Running Tests
# Run all tests
deno test
# Run specific test file
deno test tests/parser_test.ts
# Run tests with coverage
deno test --coverage=coverage
# Generate coverage report
deno coverage coverageDocumentation
Documentation Standards
- Write clear, concise documentation
- Include practical examples
- Keep the audience in mind (beginners vs advanced users)
- Update docs alongside code changes
- Use proper Markdown formatting
Documentation Types
- API Documentation - JSDoc comments in code
- User Guides - Step-by-step tutorials
- Reference - Comprehensive feature documentation
- Examples - Working
Spryfile.mdexamples
Community Guidelines
Code of Conduct
We are committed to providing a welcoming and inclusive environment. Please:
- Be respectful and considerate
- Accept constructive criticism gracefully
- Focus on what's best for the community
- Show empathy towards other community members
Communication
- Use GitHub Issues for bug reports and feature requests
- Use GitHub Discussions for questions and ideas
- Join Discord for real-time chat
- Be patient - maintainers are often volunteers
Review Process
Initial Review
Maintainers will review within 1-2 weeks
Feedback
Address any requested changes
Approval
Once approved, PR will be merged
Release
Changes included in next release
Questions?
If you have questions about contributing:
- Ask in GitHub Discussions
- Reach out on Discord
How is this guide?
Last updated on