mirror of
https://github.com/mue/mue.git
synced 2026-07-15 21:13:54 +02:00
4.5 KiB
4.5 KiB
Mue Project Guidelines for GitHub Copilot
Project Overview
Mue is a fast, open-source browser extension that provides a customizable new tab page for Chrome, Firefox, Edge, and Safari. Built with React and Vite, it emphasizes privacy, performance, and extensibility.
Technical Stack
- Framework: React 19 with hooks and functional components
- Build Tool: Vite with SWC
- Package Manager: Bun >= 1.3.0 (ALWAYS use Bun, never npm or yarn)
- Styling: SCSS with component-scoped styles
- Target: Browser extensions (Manifest V3)
- Testing: Manual testing across Chrome, Firefox, and Safari
Code Style & Quality
- Follow ESLint configuration in
eslint.config.js - Run
bun run lint:fixbefore committing - Run
bun run prettyto format code with Prettier - Use conventional commits:
feat:,fix:,chore:,docs:, etc. - All commits must pass commitlint validation
File Organization
src/
├── components/ # Reusable UI components (Elements, Form, Layout)
├── features/ # Feature-specific code (background, weather, etc.)
├── utils/ # Utility functions and helpers
├── contexts/ # React Context providers
├── hooks/ # Custom React hooks
├── i18n/ # Internationalization files
└── scss/ # Global styles, variables, mixins
Critical Rules
1. Translation Files (IMPORTANT!)
en_GB.jsonis the base translation file- Never edit other locale files directly
- Workflow: Edit
en_GB.json→ Runbun run translations - This ensures consistent formatting across all 30+ locales
- Translation files are in
src/i18n/locales/
2. Branch Strategy
dev (active development)
↓
beta (release candidates)
↓
main (production/stable)
- All PRs target the
devbranch - Never commit directly to
betaormain - See
CONTRIBUTING.mdfor full workflow
3. Package Manager
- ALWAYS use Bun, never npm or yarn
- Commands:
bun install,bun run <script> - Project requires Bun >= 1.3.0
4. Multi-Browser Support
- Test changes in Chrome, Firefox, and Safari when possible
- Browser-specific builds are in
build/chrome/,build/firefox/, etc. - Manifest files:
manifest/chrome.json,manifest/firefox.json
5. State Management
- Use
useLocalStorageStatehook for persistent settings - Use React Context for shared state (see
src/contexts/) - Store user data in localStorage or IndexedDB (via
customBackgroundDB.js)
6. Styling
- SCSS files in
src/scss/ - Use existing variables from
_variables.scss - Use mixins from
_mixins.scss(especially for responsive design) - Mobile styles in
_mobile.scss
Development Commands
bun run dev # Start dev server
bun run dev:host # Dev server accessible on network
bun run build # Build for production (all browsers)
bun run lint # Run linters
bun run lint:fix # Auto-fix linting issues
bun run pretty # Format code
bun run translations # Update translation files
Common Patterns
Component Structure
import { useState } from 'react';
import './ComponentName.scss';
export default function ComponentName({ prop1, prop2 }) {
const [state, setState] = useState();
return <div className="component-name">{/* JSX content */}</div>;
}
Using localStorage
import { useLocalStorageState } from 'utils/useLocalStorageState';
const [value, setValue] = useLocalStorageState('settingKey', defaultValue);
Using Translations
import { useContext } from 'react';
import { TranslationContext } from 'contexts';
const { t } = useContext(TranslationContext);
const text = t('translation.key');
Things to Avoid
- ❌ Don't use npm or yarn (use Bun)
- ❌ Don't edit locale files other than
en_GB.json - ❌ Don't commit directly to
betaormainbranches - ❌ Don't introduce new dependencies without discussion
- ❌ Don't skip linting/formatting before commits
- ❌ Don't use class components (use functional components only)
When Making Changes
- Check which files need updates (component, styles, utils)
- Follow existing patterns in similar components
- Update translations in
en_GB.jsonif adding new text - Run
bun run lint:fixandbun run pretty - Test in at least Chrome and Firefox
- Write conventional commit message
Additional Resources
- See
CONTRIBUTING.mdfor full contribution guidelines - See
docs/RELEASE_PROCESS.mdfor release procedures - Check existing components in
src/components/for patterns