+
Skip to content

Q00/BBB

Repository files navigation

Contributing to BBB (Big Beautiful Blog)

Thank you for your interest in contributing to BBB! We welcome contributions from developers of all skill levels.

🚀 Ways to Contribute

  • 🐛 Bug Reports - Report bugs and issues
  • 💡 Feature Requests - Suggest new features
  • 📝 Documentation - Improve docs and examples
  • 🔧 Code Contributions - Submit bug fixes and features
  • 🎨 Design - Improve UI/UX
  • 🧪 Testing - Add or improve tests

🛠️ Development Setup

Prerequisites

  • Node.js 18+
  • pnpm (recommended)
  • Git

Setup Steps

  1. Fork the repository

    # Click the "Fork" button on GitHub, then:
    git clone https://github.com/yourusername/BBB.git
    cd BBB
  2. Install dependencies

    pnpm install
  3. Create environment file

    cp example .env.local
  4. Start development server

    pnpm dev
  5. Create a new branch

    git checkout -b feature/your-feature-name
    # or
    git checkout -b fix/your-bug-fix

📋 Contribution Guidelines

Code Style

We use the following tools to maintain code quality:

  • TypeScript - Strict type checking
  • ESLint - Code linting
  • Prettier - Code formatting
  • Tailwind CSS - Utility-first CSS

Naming Conventions

  • Files: Use kebab-case (my-component.tsx)
  • Components: Use PascalCase (MyComponent)
  • Variables/Functions: Use camelCase (myVariable)
  • Constants: Use UPPER_SNAKE_CASE (MY_CONSTANT)

Commit Messages

We follow Conventional Commits:

feat: add search functionality
fix: resolve navigation bug on mobile
docs: update installation guide
style: format code with prettier
refactor: restructure component logic
test: add unit tests for markdown editor
chore: update dependencies

TypeScript Guidelines

  • Use strict TypeScript settings
  • Define proper interfaces and types
  • Avoid any type unless absolutely necessary
  • Use meaningful type names

Example:

interface BlogPost {
  id: string;
  title: string;
  content: string;
  tags: string[];
  publishedAt: Date;
  featured: boolean;
}

Component Guidelines

  • Use functional components with hooks
  • Keep components small and focused
  • Use TypeScript interfaces for props
  • Include proper JSDoc comments

Example:

interface ButtonProps {
  /**
   * The button variant
   */
  variant?: "primary" | "secondary";
  /**
   * Button click handler
   */
  onClick?: () => void;
  /**
   * Button content
   */
  children: React.ReactNode;
}

/**
 * A reusable button component
 */
export function Button({
  variant = "primary",
  onClick,
  children,
}: ButtonProps) {
  // Component implementation
}

🧪 Testing

Running Tests

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run tests with coverage
pnpm test:coverage

Writing Tests

  • Write unit tests for utility functions
  • Write integration tests for components
  • Use descriptive test names
  • Follow the AAA pattern (Arrange, Act, Assert)

Example:

import { render, screen } from "@testing-library/react";
import { Button } from "./Button";

describe("Button Component", () => {
  it("should render with correct text", () => {
    // Arrange
    const buttonText = "Click me";

    // Act
    render(<Button>{buttonText}</Button>);

    // Assert
    expect(screen.getByText(buttonText)).toBeInTheDocument();
  });
});

📝 Pull Request Process

Before Submitting

  1. Test your changes

    pnpm test
    pnpm build
    pnpm lint
  2. Update documentation if needed

  3. Add tests for new features

  4. Update CHANGELOG.md if applicable

PR Guidelines

  1. Create descriptive PR title

    feat: add dark mode toggle to navigation
    fix: resolve mobile menu overlap issue
    
  2. Fill out PR template with:

    • Description of changes
    • Type of change (bug fix, feature, docs, etc.)
    • Testing instructions
    • Screenshots (if UI changes)
  3. Link related issues

    Closes #123
    Fixes #456
    
  4. Request review from maintainers

PR Review Process

  • All PRs require at least one approval
  • PRs must pass all CI checks
  • Address reviewer feedback promptly
  • Keep PRs focused and atomic

🐛 Bug Reports

When reporting bugs, please include:

  • Environment details (OS, browser, Node.js version)
  • Steps to reproduce the issue
  • Expected behavior
  • Actual behavior
  • Screenshots or error messages
  • Minimal reproduction if possible

Bug Report Template

**Bug Description**
A clear description of the bug.

**Steps to Reproduce**

1. Go to '...'
2. Click on '...'
3. See error

**Expected Behavior**
What you expected to happen.

**Screenshots**
If applicable, add screenshots.

**Environment**

- OS: [e.g. macOS 12.0]
- Browser: [e.g. Chrome 95]
- Node.js: [e.g. 18.0.0]
- Version: [e.g. 1.0.0]

💡 Feature Requests

When suggesting features:

  • Use clear, descriptive titles
  • Explain the use case and problem it solves
  • Provide examples or mockups if helpful
  • Consider implementation complexity
  • Check existing issues to avoid duplicates

📖 Documentation

Help improve our documentation:

  • Fix typos and grammatical errors
  • Add missing information
  • Create tutorials and examples
  • Improve code comments
  • Update outdated content

🏷️ Labels

We use the following labels to organize issues and PRs:

Type

  • bug - Something isn't working
  • feature - New feature request
  • documentation - Documentation improvements
  • enhancement - Improve existing feature

Priority

  • critical - Critical issue requiring immediate attention
  • high - High priority
  • medium - Medium priority
  • low - Low priority

Status

  • good first issue - Good for newcomers
  • help wanted - Extra attention needed
  • needs review - Waiting for review
  • work in progress - Currently being worked on

🤝 Code of Conduct

This project follows our Code of Conduct. Please read it before contributing.

🎉 Recognition

Contributors will be:

  • Listed in our README
  • Mentioned in release notes
  • Invited to join our Discord community
  • Eligible for contributor swag (when available)

📞 Getting Help

Need help with contributing?

📚 Resources


Thank you for contributing to BBB! 🚀

About

No description, website, or topics provided.

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载