Thank you for considering contributing to UI Builder! This document outlines the process for contributing to the project.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
pnpm test - Commit your changes following our commit convention
- We recommend using our Commitizen setup:
pnpm commit
- We recommend using our Commitizen setup:
- Push to your branch:
git push origin feature/amazing-feature - Open a Pull Request
If you are contributing support for a new blockchain ecosystem, please follow the detailed instructions in the main README.md under the "Adding New Adapters" section.
Key steps include:
- Familiarize Yourself: Read the Adapter Architecture Guide to understand the modular structure and responsibilities.
- Package Setup: Create a new
packages/adapter-<chain-name>package with appropriatepackage.json(depending on@openzeppelin/ui-types) andtsconfig.json. - Network Configurations: Define
YourEcosystemNetworkConfigobjects insrc/networks/, ensuring they provide all necessary details (RPC URLs, chain IDs, etc.). Export a combined list (e.g.,export const suiNetworks = [...]) and individual configurations fromsrc/networks/index.ts. - Adapter Implementation: Implement the capability interfaces from
@openzeppelin/ui-typesundersrc/capabilities/, expose them throughecosystemDefinition.capabilities, and compose profile runtimes throughcreateRuntime(profile, networkConfig, options). - Exports: Export your capability/profile subpaths plus
ecosystemDefinitionand the main networks array (and ideally individual network configs) from your adapter package'ssrc/index.ts. - Ecosystem Registration: Register your new ecosystem in
apps/builder/src/core/ecosystemManager.tsby:- Adding an entry to the ecosystem/module registry for the adapter package and its exported network list.
- Updating the dynamic import switch so the builder can load the package's
ecosystemDefinitionand network exports.
- Testing: Add comprehensive unit and integration tests for your adapter's logic and network configurations.
- Documentation: Update any relevant documentation.
Before proposing architectural changes, adding new adapters, or modifying core tooling, read and comply with the project constitution:
- Ensure your code follows the style guidelines of the project
- Update the README.md with details of changes if applicable
- The PR should work for Node.js version 20.11.1 or higher
- Include tests for new features or bug fixes
- Link any relevant issues in the PR description
- Confirm compliance with the constitution (architecture boundaries, adapter rules, tooling non-negotiables)
# Clone your fork
git clone https://github.com/your-username/ui-builder.git
# Navigate to the project directory
cd ui-builder
# Install dependencies
pnpm install
# Start the development server
pnpm devpnpm dev- Start the development serverpnpm build- Build for productionpnpm lint- Run ESLintpnpm lint:fix- Fix ESLint issuespnpm test- Run testspnpm test:watch- Run tests in watch modepnpm test:coverage- Run tests with coverage reportpnpm storybook- Start Storybook development serverpnpm build-storybook- Build Storybook for productionpnpm commit- Interactive commit message builder (Commitizen)
- Follow the existing code style
- Write tests for your changes
- Keep pull requests focused on a single topic
- Add proper documentation for new features
- Use the shared Prettier configuration at the root of the repository
- Don't add package-specific
.prettierrcfiles - Run
pnpm formatto format all code before committing - When making CSS changes with Tailwind, use the
fix-allscript:pnpm fix-all
- Don't add package-specific
All library packages in this monorepo use tsup for building. Key points to remember:
- tsup Configuration: Each package has its own
tsup.config.tsfile. - Two-Stage Build: The
buildscript in each package'spackage.jsonfirst runstsupto bundle the code, then runstsc --emitDeclarationOnlyto generate TypeScript declaration files. - ES Modules: All packages output both ES modules and CommonJS formats.
- Building Packages: Run
pnpm buildat the root to build all packages, orpnpm --filter <package-name> buildfor a specific package. - TypeScript: Each package has its own
tsconfig.jsonthat extends the base configuration.
When creating new packages:
- Create a
tsup.config.tsfile for the package. - Update the
buildscript inpackage.jsonto betsup && tsc --emitDeclarationOnly --outDir dist. - Ensure your
package.jsonhas properexportsconfiguration for both ESM and CJS. - Set
"type": "module"in yourpackage.json.
We follow Conventional Commits. See our COMMIT_CONVENTION.md for more details.
To make it easier to follow the convention, we've integrated Commitizen. Instead of using git commit, you can use:
pnpm commitThis will guide you through an interactive process to create a properly formatted commit message.
By contributing, you agree that your contributions will be licensed under the project's license.