Thank you for your interest in contributing to NanoEdgeRT! 🎉
This document provides guidelines and information for contributors.
-
Fork and clone the repository:
git clone https://github.com/your-username/nanoedgert.git cd nanoedgert -
Initialize the development environment:
deno task init
-
Start the development server:
deno task dev
-
Run tests to ensure everything works:
deno task test
Use descriptive branch names with prefixes:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test improvements
Examples:
feature/add-websocket-supportfix/jwt-token-validationdocs/update-api-examples
Follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat- New featurefix- Bug fixdocs- Documentationstyle- Code style changesrefactor- Code refactoringtest- Adding or updating testschore- Maintenance tasks
Examples:
feat(auth): add OAuth2 supportfix(service-manager): resolve worker memory leakdocs(readme): update installation instructions
Before submitting a PR, ensure your code meets our standards:
# Format code
deno task fmt
# Lint code
deno task lint
# Type check
deno task check
# Run all tests
deno task test-
Unit Tests (
tests/unit/)- Test individual functions/classes in isolation
- Mock external dependencies
- Fast execution
-
Integration Tests (
tests/integration/)- Test component interactions
- Use real implementations where possible
- Test configuration and startup
-
E2E Tests (
tests/e2e/)- Test complete user workflows
- Require running server
- Test real API endpoints
import { assertEquals, assertExists } from "../test_utils.ts";
Deno.test("Feature - should work correctly", () => {
// Arrange
const input = "test";
// Act
const result = processInput(input);
// Assert
assertEquals(result, "expected");
});
Deno.test({
name: "Async Feature - should handle async operations",
async fn() {
// Test async functionality
const result = await asyncOperation();
assertExists(result);
},
sanitizeResources: false, // If needed
sanitizeOps: false, // If needed
});- Aim for at least 80% code coverage
- Test both success and error scenarios
- Include edge cases and boundary conditions
- Mock external dependencies appropriately
- Use JSDoc comments for public APIs
- Document complex algorithms and business logic
- Include examples for public functions
/**
* Validates a JWT token and returns the decoded payload.
*
* @param token - The JWT token to validate
* @param secret - The secret key for validation
* @returns Promise resolving to decoded payload or null if invalid
*
* @example
* ```typescript
* const payload = await validateToken("eyJ...", "secret");
* if (payload) {
* console.log(`User: ${payload.sub}`);
* }
* ```
*/
async function validateToken(token: string, secret: string): Promise<Payload | null> {
// Implementation
}- Update OpenAPI specs for API changes
- Include request/response examples
- Document error conditions
- Update feature lists for new functionality
- Add examples for new CLI commands
- Update configuration documentation
When reporting bugs, please include:
- Clear Description: What happened vs. what was expected
- Steps to Reproduce: Minimal steps to reproduce the issue
- Environment: Deno version, OS, etc.
- Code Examples: Minimal code that demonstrates the issue
- Error Messages: Full error messages and stack traces
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Environment:**
- OS: [e.g. macOS 13.0]
- Deno version: [e.g. 1.37.0]
- NanoEdgeRT version: [e.g. 1.0.0]
**Additional context**
Add any other context about the problem here.When proposing new features:
- Use Case: Describe the problem you're solving
- Proposed Solution: High-level description of your idea
- Alternatives: Other solutions you considered
- Breaking Changes: Any potential breaking changes
**Is your feature request related to a problem?**
A clear and concise description of what the problem is.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions.
**Additional context**
Add any other context or screenshots about the feature request.- Use TypeScript with strict type checking
- Follow Deno's standard formatting (
deno fmt) - Prefer explicit types over
any - Use meaningful variable and function names
- Keep functions small and focused
- Separation of Concerns: Each module should have a single responsibility
- Dependency Injection: Avoid hard dependencies, use dependency injection
- Error Handling: Handle errors gracefully and provide meaningful messages
- Performance: Consider performance implications of changes
- Security: Follow security best practices
When adding example services:
- Create a new directory in
nanoedge/services/ - Include comprehensive error handling
- Add examples to documentation
- Test with both authenticated and unauthenticated requests
For breaking API changes:
- Discuss in an issue first
- Provide migration guide
- Update version according to semver
- Update all documentation
We follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
- Update version in
deno.json - Update CHANGELOG.md
- Run full test suite
- Create release PR
- Tag release after merge
- Update documentation
- Keep PRs focused and small
- Write clear PR descriptions
- Include tests for new functionality
- Update documentation as needed
- Be responsive to feedback
- Be constructive and respectful
- Focus on code quality and maintainability
- Check for test coverage
- Verify documentation updates
- Test the changes locally
If you need help:
- Check existing issues - Your question might already be answered
- Start a discussion - For general questions
- Join our community - Links in README
- Contact maintainers - For urgent issues
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes
- Annual contributor highlights
Thank you for making NanoEdgeRT better! 🙏