Thank you for your interest in contributing to pnpm-catalog-updates! This document provides guidelines and information about contributing to this project.
- Node.js >= 22.0.0
- pnpm >= 10.0.0
- Git
-
Fork and Clone
git clone https://github.com/houko/pnpm-catalog-updates.git cd pnpm-catalog-updates -
Install Dependencies
pnpm install
-
Build the Project
pnpm build
-
Run Tests
pnpm test -
Start Development
pnpm dev --help
Use descriptive branch names with prefixes:
feat/description- New featuresfix/description- Bug fixesdocs/description- Documentation changesrefactor/description- Code refactoringtest/description- Test improvementschore/description- Maintenance tasks
We follow Conventional Commits specification:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksperf: Performance improvementsci: CI/CD changesbuild: Build system changes
Examples:
feat(cli): add interactive update mode
fix(parser): handle malformed yaml files
docs: update installation instructions
test(workspace): add catalog parsing tests- TypeScript: All code must be written in TypeScript with proper type definitions
- ESLint: Code must pass ESLint checks (
pnpm lint) - Prettier: Code must be formatted with Prettier (
pnpm format) - Tests: New features must include tests
- Coverage: Maintain test coverage above 80%
# Type checking
pnpm typecheck
# Linting
pnpm lint
pnpm lint:fix
# Formatting
pnpm format
pnpm format:check
# All quality checks
pnpm lint && pnpm typecheck && pnpm format:check-
Unit Tests (
test/unit/)- Test individual functions and classes
- Mock external dependencies
- Fast execution
-
Integration Tests (
test/integration/)- Test component interactions
- Use real file system (in temp directories)
- Mock external APIs
-
E2E Tests (
test/e2e/)- Test complete CLI workflows
- Use built binary
- Test real scenarios
// Unit test example
import { describe, it, expect } from 'vitest';
import { VersionParser } from '@pcu/core';
describe('VersionParser', () => {
it('should parse semantic version', () => {
const parser = new VersionParser();
const version = parser.parse('1.2.3');
expect(version.major).toBe(1);
expect(version.minor).toBe(2);
expect(version.patch).toBe(3);
});
});// E2E test example
import { describe, it, expect } from 'vitest';
describe('CLI E2E', () => {
it('should check for updates', async () => {
const workspace = await global.createE2EWorkspace({
'pnpm-workspace.yaml': 'catalog:\n react: ^17.0.0',
});
const result = await global.runCLI(['check'], workspace);
expect(result.exitCode).toBe(0);
await global.cleanupE2EWorkspace(workspace);
});
});# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with coverage
pnpm test:coverage
# Run E2E tests only
pnpm test:e2e
# Run specific test file
pnpm test packages/core/src/domain/entities/Workspace.test.tsThis project is organized as a pnpm monorepo with clean architecture:
-
Apps (
apps/)cli/- CLI application with commands, formatters, and UI
-
Packages (
packages/)core/- Core business logic following DDD principlesutils/- Shared utilities and configuration
The core package follows DDD principles:
-
Domain Layer (
packages/core/src/domain/)- Contains business logic
- No dependencies on external frameworks
- Pure TypeScript with minimal dependencies
-
Application Layer (
packages/core/src/application/)- Orchestrates domain objects
- Handles use cases
- Coordinates with infrastructure
-
Infrastructure Layer (
packages/core/src/infrastructure/)- Implements repository interfaces
- Handles external services
- File system operations
-
CLI Layer (
apps/cli/src/cli/)- User interface
- Command parsing
- Output formatting
-
Start with Domain Model
// packages/core/src/domain/entities/NewEntity.ts export class NewEntity { constructor(private id: EntityId) {} // Business methods }
-
Add Repository Interface
// packages/core/src/domain/repositories/NewEntityRepository.ts export interface NewEntityRepository { save(entity: NewEntity): Promise<void>; findById(id: EntityId): Promise<NewEntity | null>; }
-
Implement Repository
// packages/core/src/infrastructure/repositories/FileNewEntityRepository.ts export class FileNewEntityRepository implements NewEntityRepository { // Implementation }
-
Add Application Service
// packages/core/src/application/services/NewEntityService.ts export class NewEntityService { constructor(private repository: NewEntityRepository) {} // Use cases }
-
Add CLI Command
// apps/cli/src/cli/commands/NewCommand.ts export class NewCommand { // CLI handling }
When reporting bugs, please include:
-
Environment Information
- Node.js version
- pnpm version
- Operating system
- Project setup
-
Steps to Reproduce
- Exact commands run
- Expected behavior
- Actual behavior
-
Additional Context
- Error messages
- Log output
- Configuration files
Use the bug report template:
### Bug Description
A clear description of the bug.
### Steps to Reproduce
1. Step 1
2. Step 2
3. Step 3
### Expected Behavior
What should happen.
### Actual Behavior
What actually happens.
### Environment
- Node.js version:
- pnpm version:
- OS:
- Project type:
### Additional Context
Any additional information.For feature requests, please:
- Check Existing Issues - Search for existing feature requests
- Provide Use Case - Explain why this feature is needed
- Suggest Implementation - If you have ideas on how to implement it
- Consider Scope - Keep features focused and well-defined
-
Code Documentation
- TSDoc comments for public APIs
- README files for complex modules
- Inline comments for complex logic
-
User Documentation
- README.md updates
- CLI help text
- Configuration examples
-
Developer Documentation
- Architecture decisions
- API documentation
- Contributing guidelines
/**
* Parses a version string into semantic version components.
*
* @param versionString - The version string to parse (e.g., "1.2.3")
* @returns Parsed version object with major, minor, patch properties
* @throws {InvalidVersionError} When the version string is malformed
*
* @example
* ```typescript
* const parser = new VersionParser();
* const version = parser.parse("1.2.3");
* console.log(version.major); // 1
* ```
*/
public parse(versionString: string): SemanticVersion {
// Implementation
}The project includes recommended extensions in .vscode/extensions.json:
- TypeScript and JavaScript support
- ESLint and Prettier
- Testing extensions
- Git integration
- Utilities for productivity
- TypeScript: Static type checking
- ESLint: Code linting
- Prettier: Code formatting
- Vitest: Testing framework
- Husky: Git hooks
- lint-staged: Pre-commit linting
We use Changesets for version management:
-
Add Changeset
pnpm changeset
-
Version Packages
pnpm changeset version
-
Publish
pnpm changeset publish
- Major (1.0.0 → 2.0.0): Breaking changes
- Minor (1.0.0 → 1.1.0): New features (backward compatible)
- Patch (1.0.0 → 1.0.1): Bug fixes (backward compatible)
We are committed to providing a welcoming and inclusive experience for everyone.
- Be Respectful: Treat everyone with respect and kindness
- Be Collaborative: Work together constructively
- Be Patient: Help others learn and grow
- Be Inclusive: Welcome diverse perspectives
- Harassment or discrimination
- Trolling or insulting comments
- Personal attacks
- Publishing others' private information
Report unacceptable behavior to the project maintainers. All reports will be reviewed and investigated promptly.
- Documentation: Check the README and docs
- Issues: Search existing issues or create a new one
- Discussions: Use GitHub Discussions for questions
- Discord: Join our community Discord (link in README)
Contributors will be recognized in:
- README contributors section
- Release notes
- Hall of fame (for significant contributions)
Thank you for contributing to pnpm-catalog-updates! 🙏