Thank you for your interest in contributing to Bearnie! We welcome contributions of all kinds, including bug reports, feature requests, documentation improvements, and code contributions.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project, you agree to abide by its terms.
We do not accept pull requests that are fully generated by AI tools (Claude, ChatGPT, Copilot, etc.) without meaningful human review and understanding.
Why?
- We value contributions from people who understand the codebase
- AI-generated code often lacks context and can introduce subtle bugs
- We want contributors to learn and grow, not just copy-paste AI output
What's acceptable:
- Using AI as a coding assistant while you write and understand the code
- AI-assisted code that you've reviewed, tested, and can explain
What's not acceptable:
- Submitting AI-generated PRs without understanding the changes
- Using AI bots to automatically create issues or PRs
PRs that appear to be fully AI-generated without human oversight will be closed.
- Node.js 18+ and npm 9+
- Git
- Basic familiarity with Astro and Tailwind CSS
- Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/bearnie.git
cd bearnie
npm install- Create a feature branch
git checkout -b feature/your-feature-name- Start the development server
npm run devThe site will be available at http://localhost:4321
- Build the CLI locally
npm run cli:build
npm run cli:linkNow you can test the CLI with bearnie command.
- Check if the issue already exists in Issues
- Provide a clear, descriptive title
- Describe the exact steps to reproduce the problem
- Explain what you expected to happen vs. what actually happened
- Include screenshots or error messages if applicable
Example:
Title: Button component doesn't apply variant styles
Steps to reproduce:
1. Add button component: npx bearnie add button
2. Use <Button variant="destructive">Delete</Button>
3. The button appears with default styling, not destructive
Expected: Destructive red styling should be applied
Actual: Button has default blue styling
- Open an issue with the tag
enhancement - Describe the feature and why it would be useful
- Provide examples if applicable
- Wait for feedback before starting work
Create a new directory in src/components/ui/:
mkdir src/components/ui/my-component
touch src/components/ui/my-component/MyComponent.astroComponent template:
---
import { cn } from "@/utils/cn";
import type { HTMLAttributes } from "astro/types";
export interface Props extends HTMLAttributes<"div"> {
variant?: "default" | "secondary";
}
const {
variant = "default",
class: className,
...props
} = Astro.props;
const baseStyles = "inline-flex items-center gap-2";
const variantStyles = {
default: "bg-primary text-white",
secondary: "bg-secondary text-gray-900",
};
const classes = cn(baseStyles, variantStyles[variant], className);
---
<div class={classes} {...props}>
<slot />
</div>Edit scripts/generate-registry.ts and add to COMPONENT_META:
"my-component": {
description: "Brief description of the component",
category: "form", // or layout, navigation, feedback, disclosure, display
registryDependencies: [], // Other components this depends on
},npm run generate-registryCreate src/content/components/my-component.mdx:
---
title: MyComponent
description: A brief description of what this component does.
---
import MyComponent from "@/components/ui/my-component/MyComponent.astro";
## Overview
Describe what the component does and when to use it.
## Basic Usage
<MyComponent>Content here</MyComponent>
## Variants
<MyComponent variant="secondary">Content here</MyComponent>
## Props
- `variant` - The style variant (default, secondary)
- `class` - Additional CSS classes# Test adding the component
BEARNIE_REGISTRY_PATH=./public/registry bearnie add my-componentgit add .
git commit -m "feat: add MyComponent component"
git push origin feature/my-component- Navigate to the relevant
.mdxfile insrc/content/components/ - Make improvements to examples, descriptions, or add new sections
- Test locally with
npm run dev - Create a pull request with your changes
- Create a branch for the fix:
git checkout -b fix/bug-description - Make your changes
- Test thoroughly
- Create a pull request with:
- Clear description of the bug
- Link to related issue
- Steps to verify the fix
- Update your branch with the latest main:
git fetch origin
git rebase origin/main- Run tests and checks:
npm run build
npm run cli:build- Commit with meaningful messages:
git commit -m "feat: add support for X"
git commit -m "fix: resolve issue with Y"
git commit -m "docs: improve Z documentation"Use conventional commits:
feat:- A new featurefix:- A bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, semicolons, etc.)refactor:- Code refactoringtest:- Adding testschore:- Build process, dependencies
- Create the pull request:
- Provide a clear title and description
- Link to any related issues
- Request a review from maintainers
- Use TypeScript for all new code
- Avoid
anytypes when possible - Provide proper interfaces for props
- Use
.astroextension - Export a
Propsinterface - Use semantic HTML
- Support the
classprop for customization
- Use Tailwind CSS for styling
- Support color theming via CSS variables
- Ensure accessibility with proper contrast ratios
- Use semantic HTML elements
- Include proper ARIA labels when needed
- Test with keyboard navigation
- Ensure sufficient color contrast
src/
├── components/
│ ├── ui/ # Component implementations
│ ├── blog/ # Blog components
│ ├── global/ # Layout components
│ └── landing/ # Homepage components
├── content/
│ └── components/ # MDX documentation
├── pages/
├── styles/
└── utils/
- Discussions: Open a discussion in GitHub Discussions
- Issues: Use GitHub Issues for bugs and features
- Email: Contact the maintainers
By contributing to Bearnie, you agree that your contributions will be licensed under its MIT License.
Thank you for making Bearnie better! 🙏