Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to this project.
- Node.js: >= 18.0.0
- pnpm: >= 8.0.0 (required - this project uses pnpm workspaces)
-
Fork and Clone
git clone https://github.com/YOUR_USERNAME/prisma-effect-kysely.git cd prisma-effect-kysely -
Install Dependencies
pnpm install
-
Run Tests
pnpm test -
Build
pnpm run build
That's it! You're ready to contribute.
main- Production-ready codefeature/*- New featuresfix/*- Bug fixesdocs/*- Documentation updates
-
Create a branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow the coding standards (enforced by ESLint/Prettier)
- Add tests for new functionality
- Update documentation if needed
-
Run quality checks
pnpm run lint # Check code style pnpm run typecheck # Check TypeScript types pnpm run test # Run tests
-
Commit your changes
git add . git commit -m "feat: add amazing feature"
Note: Pre-commit hooks will automatically run lint and format checks. Commits will be blocked if checks fail.
-
Push and create PR
git push origin feature/your-feature-name
- Strict Mode: All code must pass TypeScript strict mode
- No Type Coercion: Never use
asoranyunless absolutely necessary - Explicit Types: Prefer explicit return types for public APIs
- ESLint: Configuration in
eslint.config.js - Prettier: Configuration in
.prettierrc.json - Auto-fix: Pre-commit hooks auto-fix most issues
Run manually:
pnpm run lint:fix # Fix linting issues
pnpm run format # Format all filesWe follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation onlyrefactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
Examples:
feat: add support for Decimal type mapping
fix: resolve UUID detection for Int fields
docs: update README with installation steps
test: add edge cases for enum generation- Coverage: Maintain > 90% code coverage
- Test Structure: Use AAA pattern (Arrange, Act, Assert)
- Naming: Descriptive test names using
describeandit
pnpm test # Run all tests
pnpm run test:watch # Watch mode
pnpm run test:coverage # Coverage reportdescribe('FeatureName', () => {
it('should handle expected input correctly', () => {
// Arrange
const input = ...
// Act
const result = ...
// Assert
expect(result).toBe(...)
});
});src/
├── generator/ # Generator entry point and orchestration
│ ├── index.ts # Prisma generator handler
│ └── orchestrator.ts # Coordinates generation flow
├── prisma/ # Prisma domain logic (DMMF parsing)
│ ├── generator.ts # Prisma data extraction
│ ├── type.ts # Type utilities
│ ├── enum.ts # Enum utilities
│ └── relation.ts # Relation detection
├── effect/ # Effect Schema generation
│ ├── generator.ts # Effect schema orchestration
│ ├── type.ts # Type schema generation
│ ├── enum.ts # Enum schema generation
│ └── join-table.ts # Join table schemas
├── kysely/ # Kysely integration
│ ├── generator.ts # Kysely-specific generation
│ ├── type.ts # Kysely type mappings
│ └── helpers.ts # Runtime helpers (exported)
├── utils/ # Shared utilities
│ ├── naming.ts # Naming conventions
│ ├── templates.ts # Code formatting
│ └── annotations.ts # Custom type annotations
└── __tests__/ # Test files
- Domain-Driven Design: Separate Prisma, Effect, and Kysely concerns
- Zero Type Coercion: Use exact DMMF types from Prisma
- Deterministic Output: Alphabetically sorted for consistency
- Pure Functions: No side effects in core logic
- Test-Driven Development: Write tests before implementation
- Search existing issues to avoid duplicates
- Use the bug template when creating an issue
- Include:
- Minimal reproduction case
- Expected vs actual behavior
- Your environment (Node, pnpm, Prisma versions)
- Relevant schema snippet
- Check existing feature requests first
- Open a discussion to gather feedback
- Explain the use case and why it's valuable
- Consider contributing the implementation!
- README: User-facing documentation
- CLAUDE.md: Developer/AI assistant instructions
- Code Comments: For complex logic only
- JSDoc: For public APIs
See SECURITY.md for reporting security vulnerabilities.
Before submitting your PR, ensure:
- Code follows project style (ESLint/Prettier pass)
- All tests pass (
pnpm test) - TypeScript compiles (
pnpm run typecheck) - Test coverage maintained (> 90%)
- New features have tests
- Breaking changes are documented
- Commit messages follow conventional commits
- PR description explains changes clearly
Contributors will be:
- Listed in release notes
- Credited in CHANGELOG.md
- Added to GitHub contributors list
- Questions: Open a GitHub Discussion
- Bugs: Open a GitHub Issue
- Security: See SECURITY.md
- Chat: GitHub Discussions
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing! Every contribution, no matter how small, is valued and appreciated. 🙏