Thank you for your interest in contributing to Eko! This document provides guidelines and instructions for contributing to the project.
- Node.js (>= 18.0.0)
- npm (latest stable version)
- Git
-
Fork the repository
-
Clone your fork:
git clone https://github.com/your-username/eko.git cd eko -
Install dependencies:
npm install
-
Start the TypeScript compiler in watch mode:
npm run dev
-
Run tests:
npm test
npm run dev: Start TypeScript compiler in watch modenpm test: Run testsnpm run test:watch: Run tests in watch modenpm run build: Build the projectnpm run lint: Run lintingnpm run format: Format code using Prettier
main: Production-ready codefeature/*: New features or enhancements (e.g.,feature/workflow-parser)fix/*: Bug fixes (e.g.,fix/parsing-error)refactor/*: Code refactoring without functionality changesdocs/*: Documentation changestest/*: Adding or modifying testschore/*: Maintenance tasksbuild/*: Changes affecting the build system
- Use lowercase letters and hyphens
- Start with the type followed by a descriptive name
- Examples:
feature/json-parserfix/validation-errorrefactor/typescript-migration
<type>(<scope>): <subject>
<body>
<footer>
Must be one of:
build: Changes affecting build system or external dependenciesci: CI configuration changesdocs: Documentation only changesfeat: A new featurefix: A bug fixperf: Performance improvementrefactor: Code change that neither fixes a bug nor adds a featurestyle: Changes not affecting code meaning (formatting, missing semicolons, etc.)test: Adding or correcting tests
- Use imperative, present tense: "change" not "changed" nor "changes"
- Don't capitalize the first letter
- No period (.) at the end
- Maximum 50 characters
- Optional
- Use imperative, present tense
- Include motivation for change and contrast with previous behavior
- Wrap at 72 characters
feat(parser): add JSON workflow parser implementation
Add parser class with validation and schema support.
Includes bidirectional conversion between JSON and runtime objects.
Closes #123
fix(validation): handle circular dependencies in workflow
Previously, the validator would hang on circular dependencies.
Now it detects and reports them as validation errors.
-
Rebase your branch onto the latest main:
git checkout main git pull upstream main git checkout your-branch git rebase main
-
Fix up commits to maintain clean history:
git rebase -i main
-
Ensure:
- All tests pass
- Code is properly formatted
- Documentation is updated
- Commit messages follow guidelines
-
Submit PR:
- Use a clear title following commit message format
- Include comprehensive description
- Reference any related issues
-
Address review feedback:
- Fix issues in the original commits where they appear
- Force push updates after rebasing
- Don't add "fix review comments" commits
We use ESLint and Prettier to enforce consistent code style. The project comes with pre-configured ESLint and Prettier settings.
- Use 2 spaces for indentation
- Maximum line length of 100 characters
- Single quotes for strings
- Semicolons are required
- Trailing commas in multiline objects
- Explicit function return types
- Explicit accessibility modifiers in classes
// Good
interface Config {
name: string;
options?: Record<string, unknown>;
}
export class Parser {
private readonly config: Config;
public constructor(config: Config) {
this.config = config;
}
public parse(input: string): Record<string, unknown> {
const result = this.processInput(input);
return {
name: this.config.name,
result,
};
}
}
// Bad - Various style issues
interface config {
name: string;
options?: any; // Avoid 'any'
}
export class parser {
config: config; // Missing accessibility modifier
constructor(config: config) {
// Missing explicit 'public'
this.config = config;
} // Missing semicolon
}-
Install required VS Code extensions:
- ESLint
- Prettier
-
VS Code will automatically use project's ESLint and Prettier configurations.
-
Enable format on save in VS Code settings:
{ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { "source.fixAll.eslint": true } }
npm run lint: Check code stylenpm run lint:fix: Fix auto-fixable style issuesnpm run format: Format code using Prettiernpm run format:check: Check if files are properly formatted
If you have questions or need help, please:
- Check existing issues and documentation
- Create a new issue for discussion
- Ask in the project's communication channels
Thank you for contributing to Eko!