Thank you for your interest in contributing to Deckflow CLI! This document provides guidelines and instructions for contributing.
- Node.js >= 18.0.0
- npm or yarn
- Git
# Clone the repository
git clone <repository-url>
cd nodejs-deckflow-cli
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm testgit checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Write clean, readable code
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
# Run all tests
npm test
# Run specific test file
npm test -- tests/unit/your-test.test.ts
# Run with coverage
npm run test:coverage
# Build to ensure no errors
npm run buildWe follow conventional commit messages:
git commit -m "feat: add new feature"
git commit -m "fix: resolve bug in file upload"
git commit -m "docs: update README"
git commit -m "test: add tests for API client"Commit types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringperf: Performance improvementschore: Maintenance tasks
git push origin feature/your-feature-nameThen create a pull request on GitHub.
All new features should include tests:
Unit Tests (tests/unit/):
import { describe, it, expect } from 'vitest';
import { YourModule } from '../../src/your-module.js';
describe('YourModule', () => {
it('should do something', () => {
const result = YourModule.doSomething();
expect(result).toBe(expected);
});
});E2E Tests (tests/e2e/):
import { runCLI } from './helpers.js';
it('should handle command correctly', async () => {
const result = await runCLI(['your', 'command']);
expect(result.exitCode).toBe(0);
});Aim for:
- 100% coverage for core modules (config, api-client, file-uploader)
- 80%+ coverage for command modules
- All critical paths tested in E2E tests
- Use TypeScript strict mode
- Define types for all parameters and return values
- Use interfaces for complex types
- Avoid
anytype when possible
We use Prettier for code formatting:
# Format code
npm run format
# Check formatting
npm run lintKey rules:
- 2 spaces for indentation
- Single quotes for strings
- Semicolons required
- 100 character line length
- Files: kebab-case (
api-client.ts,file-uploader.ts) - Classes: PascalCase (
APIClient,FileUploader) - Functions: camelCase (
uploadFile,getTask) - Constants: UPPER_SNAKE_CASE (
DEFAULT_TIMEOUT,CHUNK_SIZE) - Types/Interfaces: PascalCase (
Task,UploadAuthResponse)
src/
├── core/ # Core business logic
├── commands/ # CLI command implementations
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
├── context.ts # Global CLI context
└── cli.ts # Main entry point
tests/
├── unit/ # Unit tests (match src/ structure)
├── e2e/ # End-to-end tests
└── fixtures/ # Test data
When reporting bugs, please include:
- Description: Clear description of the bug
- Steps to reproduce: Numbered steps
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Environment: Node.js version, OS, etc.
- Logs: Any error messages or logs
Example:
### Bug Description
File upload fails for files > 20MB
### Steps to Reproduce
1. Run `deckflow file upload large-file.mp4`
2. File is 25MB
3. Upload fails with timeout error
### Expected
File should upload successfully
### Actual
Error: "Task did not complete within 300s"
### Environment
- Node.js: 18.0.0
- OS: macOS 14.0
- deckflow: 0.2.0We welcome feature requests! Please:
- Check existing issues first
- Describe the use case
- Explain why it's valuable
- Suggest implementation if possible
When contributing, update documentation:
- README.md: For user-facing features
- Code comments: For complex logic
- JSDoc: For public APIs
- CHANGELOG.md: For all changes
Before submitting:
- Code follows style guidelines
- Tests added and passing
- Documentation updated
- Commit messages follow convention
- No merge conflicts
- Build succeeds (
npm run build) - All tests pass (
npm test)
- Maintainer reviews your PR
- Feedback provided (if needed)
- You address feedback
- PR approved and merged
Review criteria:
- Code quality and style
- Test coverage
- Documentation
- Performance impact
- Breaking changes
By contributing, you agree that your contributions will be licensed under the MIT License.
Feel free to:
- Open an issue for questions
- Join our discussions
- Reach out to maintainers
Thank you for contributing! 🎉