Thank you for your interest in contributing to the Datum Inc. website! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
If you find a bug, please create an issue with:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected vs. actual behavior
- Screenshots if applicable
- Environment details (browser, OS, Node.js version)
Feature suggestions are welcome! Please create an issue with:
- A clear description of the feature
- Use cases and benefits
- Any mockups or examples if available
-
Fork the repository and create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following our coding standards
-
Test your changes:
npm run typecheck npm run lint npm run test:e2e
-
Commit your changes using our commit message conventions (see below)
-
Push to your fork and create a pull request
-
Ensure all checks pass - CI will run type checking, linting, and tests
- Node.js (version specified in
package.json) - npm or compatible package manager
-
Clone the repository:
git clone https://github.com/your-org/datum.net.git cd datum.net -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Build for pagefind (required for dev mode):
npm run build
-
Start the development server:
npm run dev
The site will be available at http://localhost:4321
- Use TypeScript for all new code
- Follow strict TypeScript rules
- Use
@ts-expect-errorinstead of@ts-ignorewhen suppressing errors - Define types in
src/types/for reusable types
- Use PascalCase for component file names
- Keep components focused and reusable
- Use TypeScript for component scripts
- Follow Astro best practices for component structure
- Use Tailwind CSS for styling
- Use
--as the separator in CSS class names (not__) - Follow mobile-first responsive design principles
- Keep styles scoped to components when possible
- Place components in
src/components/organized by feature - Place utilities in
src/utils/ - Place types in
src/types/ - Place content in
src/content/following the content structure
- Components: PascalCase (e.g.,
Button.astro) - Utilities: camelCase (e.g.,
dateUtils.ts) - Types: camelCase (e.g.,
brand.ts) - Content: kebab-case (e.g.,
our-purpose.mdx)
This project uses Conventional Commits for commit messages.
-
fix:- Bug fixesgit commit -m "fix: resolve bug in search functionality" -
feat:- New featuresgit commit -m "feat: add new search feature" -
feat!:orBREAKING CHANGE:- Breaking changesgit commit -m "feat!: completely redesign the UI" # or git commit -m "feat: new API design BREAKING CHANGE: This changes the entire API structure"
-
docs:- Documentation changesgit commit -m "docs: update README" -
chore:- Maintenance tasksgit commit -m "chore: update dependencies" -
style:- Code style changes (formatting, etc.)git commit -m "style: format code" -
refactor:- Code refactoringgit commit -m "refactor: restructure components" -
test:- Test additions or changesgit commit -m "test: add e2e tests for homepage" -
perf:- Performance improvementsgit commit -m "perf: optimize image loading"
<type>: <subject>
[optional body]
[optional footer]
Examples:
fix: resolve navigation menu overflow issuefeat: add dark mode supportdocs: update contributing guidelines
Before committing, ensure all checks pass:
npm run precommitThis runs:
- TypeScript type checking
- ESLint linting
- Markdown linting
- Code formatting checks
You can run individual checks:
npm run typecheck # TypeScript checking
npm run lint # Linting
npm run lint:md # Markdown linting
npm run format:check # Format checkingMany issues can be auto-fixed:
npm run lint:fix # Fix linting issues
npm run lint:md:fix # Fix markdown issues
npm run format # Format codeWe use Playwright for end-to-end testing:
# Run all tests
npm run test:e2e
# Run tests with UI (recommended for development)
npm run test:e2e:ui
# Run tests in debug mode
npm run test:e2e:debug
# Show test report
npm run test:e2e:report- Place tests in
tests/e2e/ - Follow the existing test structure
- Test critical user flows
- Ensure tests are deterministic and reliable
Example test structure:
import { test, expect } from '@playwright/test';
test.describe('Feature Name', () => {
test('should do something specific', async ({ page }) => {
await page.goto('/');
// Test implementation
});
});-
Ensure your PR:
- Follows the code style guidelines
- Includes tests if applicable
- Updates documentation if needed
- Passes all CI checks
-
Write a clear PR description:
- What changes were made
- Why the changes were made
- How to test the changes
- Any breaking changes
-
Keep PRs focused:
- One feature or fix per PR
- Keep changes reasonably sized
- Avoid unrelated changes
-
Respond to feedback:
- Address review comments promptly
- Be open to suggestions
- Update the PR as needed
If you have questions about contributing:
- Check existing issues and PRs
- Create a new issue with the
questionlabel - Reach out to maintainers
Thank you for contributing! 🎉