First off, thank you for considering contributing to the Willi-Mako Client SDK! 🎉
This document provides guidelines and instructions for contributing to this project. Following these guidelines helps maintain code quality and makes the contribution process smooth for everyone involved.
- Code of Conduct
- Getting Started
- How Can I Contribute?
- Development Workflow
- Coding Standards
- Commit Messages
- Pull Request Process
- Reporting Bugs
- Suggesting Features
This project adheres to a Code of Conduct that all contributors are expected to follow. Please read CODE_OF_CONDUCT.md before contributing.
- Node.js >= 18.0.0
- npm >= 9.0.0 or pnpm >= 8.0.0 (recommended)
- Git >= 2.0.0
- TypeScript knowledge (preferred)
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR-USERNAME/willi-mako-client.git cd willi-mako-client -
Add upstream remote:
git remote add upstream https://github.com/energychain/willi-mako-client.git
-
Install dependencies:
npm install
-
Build the project:
npm run build
-
Run tests:
npm test
We welcome various types of contributions:
- 🐛 Bug fixes: Fix issues reported in GitHub Issues
- ✨ New features: Add new functionality to the SDK
- 📚 Documentation: Improve or expand documentation
- 🧪 Tests: Add or improve test coverage
- 🎨 Code quality: Refactoring, performance improvements
- 🌍 Translations: Help translate documentation (especially German ↔ English)
- 💡 Examples: Add usage examples for different scenarios
Look for issues labeled good first issue or help wanted if you're new to the project. These are typically:
- Well-defined tasks
- Lower complexity
- Good entry points for new contributors
Always create a new branch for your work:
git checkout -b feature/my-feature-name
# or
git checkout -b fix/issue-123Branch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions or changes
- Write clean, readable code
- Follow the existing code style
- Add or update tests as needed
- Update documentation if you're changing APIs
# Run all tests
npm test
# Run tests in watch mode during development
npm run test:watch
# Type checking
npm run lint
# Build to ensure no compilation errors
npm run buildFollow our commit message conventions:
git add .
git commit -m "feat: add support for artifact filtering"git push origin feature/my-feature-nameThen create a Pull Request on GitHub.
- Use TypeScript for all source files
- Enable strict mode (
"strict": truein tsconfig.json) - Prefer
constoverlet, avoidvar - Use meaningful variable and function names
- Add JSDoc comments for all public APIs
We use consistent formatting across the codebase:
// ✅ Good
export interface WilliMakoClientOptions {
baseUrl?: string;
token?: string | null;
}
// ❌ Bad
export interface WilliMakoClientOptions
{
baseUrl?:string
token?:string|null
}All public APIs must include JSDoc comments:
/**
* Creates a new artifact to store data snapshots.
*
* @param payload - Artifact creation request with content and metadata
* @returns Promise resolving to the created artifact details
*
* @example
* ```typescript
* await client.createArtifact({
* sessionId: 'session-id',
* type: 'validation-report',
* name: 'report.json',
* mimeType: 'application/json',
* encoding: 'utf8',
* content: JSON.stringify(data)
* });
* ```
*/
public async createArtifact(payload: CreateArtifactRequest): Promise<CreateArtifactResponse> {
// Implementation
}- Write tests for new features
- Maintain or improve code coverage
- Use descriptive test names
- Follow the Arrange-Act-Assert pattern
it('throws a WilliMakoError on non-successful responses', async () => {
// Arrange
const fetchMock = vi.fn(async () =>
new Response(JSON.stringify({ error: 'forbidden' }), {
status: 403
})
);
const client = new WilliMakoClient({ token: 'secret', fetch: fetchMock });
// Act & Assert
await expect(client.getToolJob('job-1')).rejects.toBeInstanceOf(WilliMakoError);
});We follow the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks (dependencies, build config)perf: Performance improvements
feat(client): add support for batch artifact creation
Add a new method `createArtifactBatch` that allows creating
multiple artifacts in a single API call.
Closes #123
fix(cli): handle timeout errors gracefully
Previously, timeout errors would crash the CLI. This change
catches timeout exceptions and displays a user-friendly message.
Fixes #456
docs: add examples for MSCONS processing
Added comprehensive examples showing how to process MSCONS
meter reading messages using the sandbox API.
- Tests pass:
npm test - Code builds:
npm run build - Types are correct:
npm run lint - Documentation is updated
- Commit messages follow conventions
- Branch is up to date with
main
Use the same format as commit messages:
feat: add artifact filtering by tags
fix: resolve timeout issues in sandbox jobs
docs: improve quickstart guide
## Description
Brief description of what this PR does.
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## Related Issues
Closes #123
Related to #456
## How Has This Been Tested?
Describe the tests you ran and how to reproduce them.
## Screenshots (if applicable)
Add screenshots for UI changes.
## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes- Automated checks must pass (tests, linting, build)
- Code review by at least one maintainer
- Address feedback by pushing additional commits
- Approval from maintainer(s)
- Merge by maintainer
- Check the existing issues
- Try the latest version from the
mainbranch - Check the documentation and FAQ
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Create client with '...'
2. Call method '....'
3. See error
**Expected behavior**
What you expected to happen.
**Code sample**
```typescript
// Your code that reproduces the issue
const client = new WilliMakoClient({ token: 'xxx' });
// ...Environment:
- OS: [e.g. Ubuntu 22.04]
- Node.js version: [e.g. 18.17.0]
- Package version: [e.g. 0.2.0]
Additional context Any other context about the problem.
## Suggesting Features
### Feature Request Template
```markdown
**Is your feature request related to a problem?**
A clear description of the problem. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear description of what you want to happen.
**Describe alternatives you've considered**
Other solutions or features you've considered.
**Use case**
Describe your use case and why this feature would be valuable.
**Additional context**
Any other context, screenshots, or examples.
If you're contributing features or examples related to:
- EDIFACT/edi@energy formats
- Market communication processes
- Compliance requirements
- Energy data processing
Please consider:
- Context: Explain the energy sector context for reviewers unfamiliar with the domain
- Standards: Reference relevant BDEW or edi@energy specifications
- Examples: Provide realistic examples (with anonymized data)
- Documentation: Add both German and English explanations where helpful
If you have questions about contributing:
- 💬 Open a GitHub Discussion
- 📧 Email us at dev@stromdao.com
- 🌐 Visit stromhaltig.de
Your contributions make this project better for the entire energy sector community. We appreciate your time and effort!
Happy coding! ⚡
Made with ❤️ by the STROMDAO Community