Thank you for your interest in contributing to asknot-rocky! This guide will help you get started with contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Branch Management Guidelines
- Submitting Changes
- Code Style
- Testing
- Project Structure
- Contributing Translations
By participating in this project, you are expected to uphold our Code of Conduct, which promotes a respectful and inclusive environment for all contributors.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/asknot-rocky.git cd asknot-rocky
- Add the upstream repository as a remote:
git remote add upstream https://github.com/rocky-linux/asknot-rocky.git
- Ensure you have Node.js installed (latest LTS version recommended)
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Visit
http://localhost:4321
in your browser
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
- Make your changes
- Ensure your changes meet our code quality standards:
npm run lint # Run ESLint npm run format # Run Prettier npm run typecheck # Run TypeScript checks npm run test # Run tests
We follow a strict branch management policy to maintain code quality and project organization:
-
Never Commit Directly to Main
- All changes must go through feature branches
- Direct commits to the main branch are prohibited
- Main branch is protected and requires pull request reviews
-
Feature Branch Naming Convention
- Use the following prefixes based on the type of change:
feature/
- For new features or enhancementsfix/
- For bug fixesdocs/
- For documentation updatesrefactor/
- For code refactoringtest/
- For adding or updating testschore/
- For maintenance tasks
- Follow the prefix with a descriptive name using kebab-case
- Examples:
feature/add-dark-mode fix/language-selector-bug docs/update-readme refactor/question-tree-logic test/add-i18n-tests chore/update-dependencies
- Use the following prefixes based on the type of change:
-
Branch Lifecycle
- Create branches from the latest main
- Keep branches focused and single-purpose
- Delete branches after merging
- Regularly update feature branches with changes from main
-
Branch Hygiene
- Keep branches short-lived (ideally less than a week)
- Regularly rebase long-running branches on main
- Clean up stale branches that are no longer needed
- Commit your changes with a clear and descriptive commit message
- Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request from your fork to our main repository
- Ensure all CI checks pass
- Wait for review from maintainers
We use several tools to maintain code quality:
- ESLint for code linting
- Prettier for code formatting
- TypeScript for type checking
Our automated workflows will check these when you submit a PR. You can run them locally:
npm run lint:fix # Fix linting issues
npm run format # Format code
npm run typecheck # Check types
We use Vitest for testing. Write tests for new features and ensure existing tests pass:
npm run test # Run tests
npm run test:coverage # Run tests with coverage report
asknot-rocky/
├── src/ # Source files
│ ├── components/ # React components (Button, QuestionNode, etc.)
│ ├── i18n/ # Internationalization files and language support
│ ├── layouts/ # Page layouts
│ ├── pages/ # Astro pages
│ ├── questions/ # Question tree logic and configuration
│ ├── styles/ # Global styles
│ └── test/ # Test utilities and shared test code
├── public/ # Static assets
Key files:
src/pages/index.astro
– Main application pagesrc/components/QuestionNode.tsx
– Core question navigation componentsrc/questions/questions.ts
– Question tree configuration and typessrc/i18n/LanguageContext.tsx
– Internationalization context and logicsrc/i18n/{langCode}.json
– Translations
We welcome contributions to make asknot-rocky accessible in more languages! The project currently supports English (en) and Spanish (es), with room for more languages.
Translations are stored in JSON files in the src/i18n
directory, with each language having its own file (e.g., en.json
, es.json
). The translation files follow a specific structure defined in src/i18n/types.ts
.
Key areas that need translation include:
- Home page content
- Question categories and options
- Error messages
- UI elements (footer, language selector)
- Create a new JSON file in
src/i18n
named with your language code (e.g.,fr.json
for French) - Copy the structure from
en.json
as a template - Add your language code and name to the
LANGUAGE_NAMES
object insrc/i18n/types.ts
:export const LANGUAGE_NAMES: Record<LanguageCode, string> = { en: 'English', es: 'Español', fr: 'Français', // Your new language } as const;
- Update the
LanguageCode
type insrc/i18n/types.ts
:export type LanguageCode = 'en' | 'es' | 'fr'; // Add your language code
- Translate all strings in your new language file
The language will be automatically loaded and available in the language selector once you've completed these steps. The application uses Vite's dynamic imports to automatically discover and load all language files in the src/i18n
directory.
- Maintain the same JSON structure as the English version
- Keep special placeholders and HTML tags intact
- Ensure all keys are present and match exactly
- Test the UI with your translations to verify layout and formatting
- Include regional variations only if necessary (e.g.,
pt-BR
vspt-PT
)
After adding or modifying translations:
- Run
npm run typecheck
to ensure type safety - Start the development server and test the UI in your language
- Verify all interactive elements work correctly
- Check text formatting and layout in different screen sizes
If you need help or have questions, please:
- Check existing issues on GitHub
- Create a new issue if needed
- Join the Rocky Linux community channels
Thank you for contributing to asknot-rocky!