Skip to content

Latest commit

 

History

History
202 lines (146 loc) · 3.42 KB

File metadata and controls

202 lines (146 loc) · 3.42 KB

Contributing to MCP Market

English | 中文

🔧 Development Guide

Project Setup

  1. Clone the repository:

    git clone https://github.com/CherryHQ/mcpmarket.git
    cd mcpmarket
  2. Install dependencies:

    pnpm install

Code Style and Formatting

We use ESLint and Prettier for code formatting and linting to maintain consistent code style across the project.

  1. Format your code:

    pnpm format
  2. Lint your code:

    pnpm lint
  3. Check and auto-fix issues:

    pnpm lint:check

Key formatting rules:

  • Indent: 2 spaces
  • Quote style: single quotes
  • Max line length: 100 characters
  • Trailing comma: all
  • Semicolons: always required

Creating a New Package

  1. Create package directory:

    mkdir -p packages/your-package
    cd packages/your-package
  2. Initialize package:

    pnpm init
  3. Package naming conventions:

    • Must start with @mcpmarket/
    • Use descriptive names, e.g., @mcpmarket/vanilla-server
    • Keep it simple and clear
  4. Required package.json fields:

    {
      "name": "@mcpmarket/your-package",
      "version": "0.0.1",
      "publishConfig": {
        "access": "public"
      },
      "files": ["dist"],
      "scripts": {
        "build": "tsc",
        "test": "jest",
        "clean": "rimraf dist"
      }
    }

Development Best Practices

  1. Use TypeScript

    • Provide complete type definitions
    • Enable strict mode in tsconfig.json
    • Document public APIs
  2. Documentation

    • Write clear README.md
    • Include usage examples
    • Document configuration options
  3. [] Testing

    • Write unit tests
    • Include integration tests if needed
    • Test with different Node.js versions

📦 Publishing Guide

Prerequisites

  1. Login to npm:

    pnpm login
  2. Verify organization access:

    npm whoami --registry=https://registry.npmjs.org/

Publishing Workflows

Single Package

# 1. Build the package
pnpm build --filter @mcpmarket/your-package

# 2. Publish
pnpm publish:single --filter @mcpmarket/your-package

Batch Publishing

# 1. Create changeset
pnpm changeset
# Follow prompts:
# - Select packages
# - Choose version type (patch/minor/major)
# - Write change description

# 2. Commit changeset
git add .
git commit -m "chore: add changeset"

# 3. Update versions & generate changelog
pnpm version

# 4. Build all packages
pnpm build

# 5. Publish
pnpm publish:all

Version Management

  • patch (0.0.x): Bug fixes
  • minor (0.x.0): New features (backward compatible)
  • major (x.0.0): Breaking changes

Unpublishing

Can unpublish within 72 hours:

# Specific version
npm unpublish @mcpmarket/your-package@0.0.1 --force

# Entire package
npm unpublish @mcpmarket/your-package --force

Restrictions:

  • Version numbers cannot be reused
  • Package name reserved for 24 hours
  • Cannot unpublish if other packages depend on it

🤝 Pull Request Process

  1. Fork the repository
  2. Create feature branch
  3. Make changes
  4. Add changeset:
    pnpm changeset
  5. Commit changes
  6. Push to your fork
  7. Create Pull Request

PR Guidelines

  1. Keep changes focused
  2. Follow existing code style
  3. Add tests for new features
  4. Update documentation
  5. Verify all tests pass
  6. Include changeset for version management