Thank you for your interest in contributing to OpenBrowser! This document provides guidelines and instructions for contributing to the project.
- Node.js (>= 18.0.0)
- pnpm (latest stable version)
- Git
This project uses pnpm as its package manager. Please ensure you have it installed.
-
Fork the repository
-
Clone your fork:
git clone https://github.com/your-username/openbrowser.git cd openbrowser -
Install dependencies:
pnpm install
-
Run tests:
pnpm test
pnpm test: Run testspnpm run build: Build the projectpnpm run format: Format code using Prettierpnpm run format:check: Check if files are properly formatted
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 dependencieschore: Maintenance tasks, tooling, or housekeepingci: 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 Prettier to enforce consistent code formatting. The project comes with pre-configured Prettier settings.
- Use 2 spaces for indentation
- Maximum line length of 80 characters
- Double quotes for strings
- Semicolons are required
- No trailing commas
- Explicit function return types (enforced by TypeScript)
- 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 the Prettier VS Code extension
-
VS Code will automatically use the project's Prettier configuration
-
Enable format on save in VS Code settings:
{ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }
pnpm run format: Format code using Prettierpnpm 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 OpenBrowser!