Development
Development setup
Before you start contributing, make sure you have the right tools and environment set up. This guide will help you get up and running with the project quickly.
Prerequisites
- Node.js 18.14.1 or higher
- npm, pnpm, or Yarn
- Git
Local development
Getting the development environment running is straightforward. Follow these steps to start contributing:
- Install dependencies:
- Start development server:
- Run tests:
Project structure
Understanding the project structure helps you navigate the codebase more effectively. Here’s an overview of our main directories:
Coding standards
We maintain high coding standards to ensure our components are accessible, performant, and maintainable. Here are our key guidelines:
TypeScript
- Use TypeScript for all new code
- Include proper type definitions
- Avoid
any
types where possible
Components
- Follow the WAI-ARIA guidelines
- Include proper ARIA attributes
- Support keyboard navigation
- Test with screen readers
CSS
- Use logical properties
- Follow mobile-first approach
- Support dark mode
- Respect user preferences
Testing
Quality assurance is crucial for our components. We use different types of tests to ensure everything works as expected:
Unit tests
Integration tests
Accessibility tests
Building
When you’re ready to create a production build:
Common tasks
Here are some frequent development tasks and how to handle them:
Adding a new component
- Create component file:
- Add tests:
- Update documentation:
Updating dependencies
Regular dependency updates help keep the project secure and up-to-date:
- Check for updates:
- Update packages:
- Test thoroughly after updates
Troubleshooting
When you run into issues, here are some common solutions:
Common issues
-
Build errors
- Clear the cache:
npm run clean
- Remove node_modules:
rm -rf node_modules
- Fresh install:
npm install
- Clear the cache:
-
Test failures
- Check test coverage:
npm run test:coverage
- Run specific tests:
npm run test NewComponent.test.ts
- Check test coverage:
Performance
Performance is a key aspect of accessibility. Keep these principles in mind:
- Use lazy loading where appropriate
- Optimize images and assets
- Keep bundle size minimal
- Monitor performance metrics
Resources
Here are some helpful resources to learn more: