-
Clone the repository:
git clone https://github.com/CherryHQ/mcpmarket.git cd mcpmarket -
Install dependencies:
pnpm install
We use ESLint and Prettier for code formatting and linting to maintain consistent code style across the project.
-
Format your code:
pnpm format
-
Lint your code:
pnpm lint
-
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
-
Create package directory:
mkdir -p packages/your-package cd packages/your-package -
Initialize package:
pnpm init
-
Package naming conventions:
- Must start with
@mcpmarket/ - Use descriptive names, e.g.,
@mcpmarket/vanilla-server - Keep it simple and clear
- Must start with
-
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" } }
-
Use TypeScript
- Provide complete type definitions
- Enable strict mode in tsconfig.json
- Document public APIs
-
Documentation
- Write clear README.md
- Include usage examples
- Document configuration options
-
[] Testing
- Write unit tests
- Include integration tests if needed
- Test with different Node.js versions
-
Login to npm:
pnpm login
-
Verify organization access:
npm whoami --registry=https://registry.npmjs.org/
# 1. Build the package
pnpm build --filter @mcpmarket/your-package
# 2. Publish
pnpm publish:single --filter @mcpmarket/your-package# 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- patch (0.0.x): Bug fixes
- minor (0.x.0): New features (backward compatible)
- major (x.0.0): Breaking changes
Can unpublish within 72 hours:
# Specific version
npm unpublish @mcpmarket/your-package@0.0.1 --force
# Entire package
npm unpublish @mcpmarket/your-package --forceRestrictions:
- Version numbers cannot be reused
- Package name reserved for 24 hours
- Cannot unpublish if other packages depend on it
- Fork the repository
- Create feature branch
- Make changes
- Add changeset:
pnpm changeset
- Commit changes
- Push to your fork
- Create Pull Request
- Keep changes focused
- Follow existing code style
- Add tests for new features
- Update documentation
- Verify all tests pass
- Include changeset for version management