Thank you for considering contributing to Docen! This document will guide you through the contribution process.
This project follows the Contributor Covenant. By participating, you are expected to uphold this code.
# Clone the repository
git clone https://github.com/docenjs/docen.git
cd docen
# Install dependencies
pnpm install
# Build the project
pnpm build
# Run tests
pnpm test
docen/
├── packages/
│ ├── docen/ # Core package
│ ├── processors/ # Official processors
│ └── cli/ # Command-line interface
├── docs/ # Documentation
├── examples/ # Usage examples
└── tests/ # Test suites
Before starting work:
- Check existing issues and PRs
- Create a new issue describing the change
- Wait for issue to be approved/discussed
Follow these steps:
- Create a new branch
- Make your changes
- Add tests
- Update documentation
- Run linting and tests
- Submit PR
We follow strict coding standards:
// Use TypeScript
// Follow ESLint rules
// Write JSDoc comments
// Use meaningful variable names
// Keep functions small and focused
All changes require tests:
// Unit tests for new features
describe("feature", () => {
it("should work correctly", () => {
// Test implementation
});
});
// Integration tests where needed
// Performance tests for critical paths
import { BaseProcessor } from "docen/core";
export class CustomProcessor extends BaseProcessor {
name = "custom";
supportedFormats = [".custom"];
async read(input: Buffer): Promise<Document> {
// Implementation
}
async write(document: Document): Promise<Buffer> {
// Implementation
}
}
describe("CustomProcessor", () => {
it("should read custom format", async () => {
const processor = new CustomProcessor();
const result = await processor.read(input);
expect(result).toMatchSnapshot();
});
});
Use JSDoc comments:
/**
* Converts a document from one format to another.
* @param input - Source document
* @param output - Target path
* @returns Promise resolving when complete
*/
async function convert(input: string, output: string): Promise<void> {
// Implementation
}
Keep documentation current:
- Update feature lists
- Add new examples
- Document breaking changes
- Update version information
Follow semver:
- MAJOR: Breaking changes
- MINOR: New features
- PATCH: Bug fixes
Update CHANGELOG.md:
## [1.1.0] - 2024-03-20
### Added
- New feature X
- Support for Y
### Fixed
- Bug in Z
- Performance issue
- GitHub Discussions
Include:
- Version information
- Environment details
- Minimal reproduction
- Expected behavior
- Actual behavior
- Review Core Concepts
- Check API Reference