Thanks for your interest in contributing!
- Node.js 20.x or higher
- npm 10.x or higher
- Git
# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/home.git
cd home
npm install
# Create a branch
git checkout -b feature/your-feature-name
# Start dev server
npm run devVisit http://localhost:4321
- Make your changes in
src/ - Test locally with
npm run dev - Run tests:
npm test - Build:
npm run build - Commit with conventional commits (see below)
- Use TypeScript for all code
- No
anytypes - Add JSDoc for complex functions
/**
* Formats a date string
* @param date - The date to format
* @param format - The desired format
* @returns Formatted date string
*/
function formatDate(date: Date, format: string): string {
// Implementation
}interface Props {
title: string;
description?: string;
}
export default function Component({ title, description }: Props) {
return (
<div>
<h1>{title}</h1>
{description && <p>{description}</p>}
</div>
);
}---
interface Props {
title: string;
}
const { title } = Astro.props;
---
<h1>{title}</h1>Use Tailwind utilities or predefined classes from global.css:
<div class="card-hover">
<h2 class="section-title">Title</h2>
<button class="btn-primary">Click Me</button>
</div>We use Conventional Commits:
<type>(<scope>): <description>
# Examples:
feat(components): add dark mode toggle
fix(layout): correct responsive spacing
docs(readme): update installation steps
test(utils): add theme utility testsfeat- New featurefix- Bug fixdocs- Documentationstyle- Code formattingrefactor- Code refactoringtest- Testschore- Maintenance
- Use present tense ("add" not "added")
- Use imperative mood ("move cursor" not "moves cursor")
- First line max 72 characters
- Reference issues when applicable
feat(nav): add mobile menu
- Implement hamburger menu
- Add responsive breakpoints
- Update navigation styles
Closes #123# Run tests
npm test
# Watch mode
npm run test:ui
# Coverage
npm run test:coverageimport { describe, it, expect } from 'vitest';
import { render } from '@testing-library/react';
describe('Component', () => {
it('renders correctly', () => {
const { getByText } = render(<Component title="Test" />);
expect(getByText('Test')).toBeDefined();
});
});- Tests pass (
npm test) - Build succeeds (
npm run build) - Code follows style guidelines
- Commits follow conventional commits
- Documentation updated (if needed)
- Push to your fork
- Create PR on GitHub
- Fill out PR template
- Link related issues
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
How was this tested?
## Checklist
- [ ] Tests pass
- [ ] Build succeeds
- [ ] Documentation updated- Automated checks must pass
- At least one approval required
- Address review comments promptly
src/
components/ # React components
layouts/ # Astro layouts
pages/ # File-based routes
services/ # Business logic
styles/ # Global styles
utils/ # Utility functions
Create file in src/pages/:
---
import Layout from '../layouts/Layout.astro';
---
<Layout title="New Page">
<h1>Content</h1>
</Layout>Page available at /your-filename
Create file in src/components/:
interface Props {
message: string;
}
export default function NewComponent({ message }: Props) {
return <div>{message}</div>;
}Use in Astro page:
---
import NewComponent from '../components/NewComponent';
---
<NewComponent client:load message="Hello" />Husky runs automatically:
- Commit message validation
- Type checking
- Tests
- Astro
- Tailwind CSS IntelliSense
- GitLens
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing!