Thank you for your interest in contributing to laroux! This document provides guidelines and instructions for contributing to the project.
Be respectful, inclusive, and collaborative. We're all here to build something great together.
- Deno v2.6 or later
- Git
- Basic understanding of React Server Components
- Familiarity with TypeScript
- Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/laroux.git
cd laroux- Explore the codebase
# View the project structure
ls -R packages/
# Read the implementation plan
cat docs/implementation.md
# Check out the user guide
cat docs/user-guide.md- Run the tests
# Run all tests
deno test --unstable-bundle --allow-all
# Run specific test file
deno test packages/laroux-bundler/chunk-manifest.test.ts- Try the CLI locally
# Create a test project
deno run --unstable-bundle --allow-all packages/laroux/cli.ts init test-app
# Start dev server
cd test-app
deno run --unstable-bundle --allow-all ../packages/laroux/cli.ts devlaroux/
├── packages/
│ ├── laroux/ # CLI package
│ │ ├── cli.ts # Main entry point
│ │ ├── commands/ # CLI commands
│ │ └── templates/ # Project templates
│ ├── laroux-core/ # Core runtime
│ │ ├── runtime/ # Server, RSC handler, actions
│ │ ├── config/ # Configuration system
│ │ ├── cli-formatting.ts
│ │ └── error-formatting.ts
│ ├── laroux-bundler/ # Build system
│ │ ├── runtime-bundler.ts
│ │ ├── prebuilt-bundler.ts
│ │ └── client/ # Client components
│ ├── laroux-server/ # Server orchestration
│ └── laroux-rsc/ # RSC implementation
├── docs/ # Documentation
└── tests/ # Integration tests
- Check existing issues to avoid duplicates
- Create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Deno version, OS)
- Error messages and stack traces
- Check existing issues for similar suggestions
- Create a feature request with:
- Clear use case
- Proposed API or behavior
- Why it would benefit the project
- Potential implementation approach (if applicable)
- Look for issues labeled
good first issueorhelp wanted - Comment on the issue to let others know you're working on it
- Ask questions if anything is unclear
# Create a feature branch
git checkout -b feature/your-feature-name
# Or a bugfix branch
git checkout -b fix/issue-descriptionFollow these guidelines:
Code Style
- Use TypeScript for all code
- Follow existing code patterns and conventions
- Use descriptive variable and function names
- Add JSDoc comments for public APIs
File Naming
- Use domain-specific names (NOT "utils", "helpers", "common")
- Examples:
- ✅
cli-formatting.ts,error-formatting.ts,chunk-manifest.ts - ❌
utils.ts,helpers.ts,common.ts
- ✅
Imports
- Use explicit imports from specific modules
- Avoid barrel exports when possible
- Group imports: external → internal → relative
Error Handling
- Use structured error classes from
error-formatting.ts - Provide helpful error messages with hints
- Include relevant context in errors
Example:
import { ConfigError, errors } from "@eser/laroux-core/error-formatting";
// Use error factories
throw errors.invalidConfig(
"./laroux.config.ts",
"Export must be a default export",
);
// Or create custom errors
throw new ConfigError(
"Invalid port number",
"Port must be between 1024 and 65535",
);Testing
- Add tests for new features
- Ensure existing tests pass
- Use descriptive test names
Deno.test("ChunkManifest - should register chunk with dependencies", () => {
const manifest = new ChunkManifest();
manifest.addChunk("counter", {
path: "/chunks/counter-abc123.js",
dependencies: ["react", "shared"],
});
const chunk = manifest.getChunk("counter");
assertEquals(chunk.dependencies, ["react", "shared"]);
});Use conventional commit messages:
# Format: type(scope): description
git commit -m "feat(bundler): add CSS processing support"
git commit -m "fix(cli): resolve template path on Windows"
git commit -m "docs(readme): update installation instructions"
git commit -m "test(config): add tests for config merging"Commit types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringperf: Performance improvementschore: Maintenance tasks
# Push your branch
git push origin feature/your-feature-name
# Create a pull request on GitHubPull Request Guidelines
- Reference related issues (e.g., "Fixes #123")
- Describe what changed and why
- Include screenshots for UI changes
- Check that all tests pass
- Respond to review feedback
# Run all tests
deno test --unstable-bundle --allow-all
# Run with coverage
deno test --unstable-bundle --allow-all --coverage=coverage
# Watch mode
deno test --unstable-bundle --allow-all --watch# Create a test project
deno run --unstable-bundle --allow-all packages/laroux/cli.ts init test-app
# Test dev command
cd test-app
deno run --unstable-bundle --allow-all ../packages/laroux/cli.ts dev
# Test build command
deno run --unstable-bundle --allow-all ../packages/laroux/cli.ts build
# Test serve command
deno run --unstable-bundle --allow-all ../packages/laroux/cli.ts serve# Enable debug logging
deno run --unstable-bundle --allow-all packages/laroux/cli.ts dev --log-level=debug
# Use Deno's debugger
deno run --inspect-brk --unstable-bundle --allow-all packages/laroux/cli.ts dev- Keep runtime code performant
- Minimize dependencies
- Document all exported APIs
- Add helpful error messages
- Optimize bundle sizes
- Support incremental compilation
- Test with various project structures
- Handle edge cases gracefully
- Provide clear, actionable feedback
- Use colored output for better UX
- Include progress indicators for long operations
- Handle errors gracefully with helpful hints
- Keep templates minimal but functional
- Include comments explaining key concepts
- Use best practices
- Test on multiple platforms
- Keep package READMEs up to date
- Include usage examples
- Document all public APIs
- Link to related documentation
Update docs/user-guide.md when:
- Adding new features
- Changing CLI commands
- Updating configuration options
- Adding new templates
(For maintainers)
- Update version in all
jsr.jsonfiles - Update CHANGELOG.md with release notes
- Run all tests and ensure they pass
- Create a git tag (e.g.,
v3.0.0) - Publish to JSR:
# Publish each package
cd packages/laroux-core
deno publish
cd ../laroux-bundler
deno publish
cd ../laroux
deno publish- Documentation: Check the User Guide
- Issues: Search existing issues
- Discussions: Start a discussion for questions
Contributors will be:
- Listed in the project README
- Credited in release notes
- Thanked in the community
Thank you for contributing to laroux! 🦕