Thank you for your interest in contributing to React OnChain! This document provides guidelines and instructions for contributing.
Please be respectful and constructive in all interactions. We're building something cool together!
- Node.js 18+ (required for native fetch support)
- npm or yarn
- Git
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/react-onchain.git cd react-onchain - Install dependencies:
npm install
- Build the project:
npm run build
- Create a new branch for your feature or fix:
git checkout -b feature/your-feature-name
- Make your changes in the
src/directory - Format your code (required before committing):
npm run format
- Build and verify your changes compile:
npm run build
- Test your changes locally:
# Test with dry-run mode node dist/cli.js deploy --build-dir ./test-app/dist --dry-run
This project uses Prettier for consistent code formatting across all contributors.
Always format your code before committing:
npm run formatTo verify code is properly formatted without changing files:
npm run format:checkVS Code users: Format-on-save is automatically configured in .vscode/settings.json. Just save your files and Prettier will format them.
Other Editors: Install the Prettier plugin for your editor and enable format-on-save.
- TypeScript: Use TypeScript for all new code
- Naming: Use descriptive, meaningful names for variables and functions
- Functions: Keep functions focused and single-purpose
- Comments: Add JSDoc comments for public APIs and complex logic
- Imports: Use ES6 imports with
.jsextensions for local files - Error Handling: Use try-catch blocks and provide meaningful error messages
- Async/Await: Prefer async/await over promise chains
react-onchain/
├── src/
│ ├── cli.ts # CLI entry point
│ ├── orchestrator.ts # Main deployment orchestration
│ ├── inscriber.ts # File inscription logic
│ ├── analyzer.ts # Build directory analysis
│ ├── rewriter.ts # URL rewriting for inscribed files
│ ├── retryUtils.ts # Retry logic with exponential backoff
│ ├── config.ts # Configuration and environment variables
│ ├── types.ts # TypeScript type definitions
│ ├── versioningInscriptionHandler.ts # Inscription handling for versioning
├── tests/ # Test files
└── dist/ # Compiled JavaScript output
- Ensure your code is formatted:
npm run format
- Verify the project builds successfully:
npm run build
- Commit your changes with a clear, descriptive message:
git commit -m "feat: add exponential retry for UTXO errors" - Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request on GitHub
Use clear, descriptive commit messages:
feat: add new featurefix: resolve bug in inscriberdocs: update READMErefactor: simplify retry logictest: add tests for analyzerchore: update dependencies
Include in your PR description:
- What changes you made
- Why you made them
- How to test the changes
- Any related issues (e.g., "Fixes #123")
Currently, the project uses manual testing with dry-run mode:
node dist/cli.js deploy --build-dir ./test-app/dist --dry-runIf you're adding a major feature, consider adding test cases in the tests/ directory.
- Bug Reports: Open an issue with detailed reproduction steps
- Feature Requests: Open an issue describing the feature and use case
- Questions: Open a discussion on GitHub
By contributing, you agree that your contributions will be licensed under the ISC License.
Thank you for contributing to React OnChain! 🚀