First off, thank you for considering contributing to OpenWebContainer! It's people like you that make OpenWebContainer such a great tool.
- Code of Conduct
- Project Structure
- Development Setup
- Development Workflow
- Pull Request Process
- Commit Guidelines
- Testing Guidelines
- Documentation
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [project maintainers].
open-web-container/
.
├── apps/ # Application packages
│ └── playground/ # Web-based playground
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── Editor/
│ │ │ ├── FileExplorer/
│ │ │ └── Terminal/
│ │ ├── hooks/ # React hooks
│ │ └── ...
│ └── ...
├── packages/ # Core packages
│ └── core/ # Main container implementation
│ ├── src/
│ │ ├── filesystem/ # Virtual filesystem implementation
│ │ ├── interfaces/ # TypeScript interfaces
│ │ ├── process/ # Process management
│ │ │ ├── base/
│ │ │ ├── executors/
│ │ │ └── manager/
│ │ └── shell/ # Shell implementation
│ └── ...
└── ...
-
packages/core/
: The main container implementationfilesystem/
: Virtual file system implementationprocess/
: Process management and typesshell/
: Shell command implementationinterfaces/
: Core TypeScript interfaces
-
apps/playground/
: Web playground applicationcomponents/
: React componentshooks/
: Custom React hooks
-
Prerequisites
- Node.js (v16 or higher)
- pnpm (v8 or higher)
- Git
-
Initial Setup
# Clone the repository git clone https://github.com/thecodacus/OpenWebContainer.git cd OpenWebContainer # Install dependencies pnpm install
-
Development Commands
# Start development of all packages pnpm dev # Start only the playground pnpm playground # Build all packages pnpm build # Run tests pnpm test # Lint code pnpm lint
-
Create a new branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write code
- Add tests
- Update documentation
- Run tests locally
-
Commit your changes We use conventional commits. Format your commit messages as:
type(scope): description [optional body] [optional footer]
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation
- chore: Maintenance
- refactor: Code restructuring
- test: Adding tests
- style: Formatting
-
Create a Pull Request
- Ensure your code follows our style guide and passes all tests
- Update documentation if needed
- Add tests for new features
- Ensure the PR description clearly describes the problem and solution
- Reference any relevant issues
We use Conventional Commits. Each commit message should be structured as:
type(scope): description
[optional body]
[optional footer]
Examples:
feat(shell): add pipe operator support
fix(filesystem): correct path resolution
docs(readme): update installation instructions
-
Write tests for new features
describe('VirtualFileSystem', () => { it('should create directories', () => { // Test code }); });
-
Run tests before submitting PR
pnpm test
-
Ensure good test coverage
- Unit tests for utilities
- Integration tests for features
- End-to-end tests for workflows
-
Code Documentation
- Use JSDoc comments for functions and classes
- Explain complex logic
- Add usage examples
-
README Updates
- Keep installation instructions updated
- Document new features
- Update API references
-
Example Updates
- Add examples for new features
- Keep existing examples up to date
-
Core Package
- Add new features in appropriate directories
- Update interfaces if needed
- Add tests
- Update documentation
-
Playground
- Add new components in
apps/playground/src/components
- Update playground to showcase new features
- Ensure responsive design
- Add new components in
-
Core Package
// Enable debug logs import { setDebugMode } from '@open-web-container/core'; setDebugMode(true);
-
Playground
- Use React DevTools
- Check console logs
- Use browser debugger
If you have questions, please:
- Check existing issues
- Create a new issue with the 'question' label
- Join our community discussions
Thank you for contributing! 🎉