Thank you for considering contributing to the VS Code TinyPNG extension! This document provides guidelines for contributing to the project.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/vscode-tinypng.git - Install dependencies:
npm install - Create a feature branch:
git checkout -b feature/your-feature-name
- Node.js 22 (as specified in
.nvmrc) - npm or yarn
- VS Code
npm run compilenpm test- Press
F5in VS Code to open a new Extension Development Host window - Test your changes in this window
- View debug logs in the Debug Console
This project follows Conventional Commits specification. This is important because our automated release workflow uses commit messages to determine version bumps and generate changelogs.
<type>(<scope>): <subject>
<body>
<footer>
| Type | Description | Version Bump |
|---|---|---|
feat |
New feature | minor (0.x.0) |
fix |
Bug fix | patch (0.0.x) |
docs |
Documentation changes | patch (0.0.x) |
style |
Code style changes (formatting, etc.) | patch (0.0.x) |
refactor |
Code refactoring | patch (0.0.x) |
perf |
Performance improvements | patch (0.0.x) |
test |
Adding or updating tests | patch (0.0.x) |
chore |
Build process or auxiliary tool changes | patch (0.0.x) |
ci |
CI configuration changes | patch (0.0.x) |
Add ! after the type or include BREAKING CHANGE: in the footer:
feat!: remove support for legacy compression API
BREAKING CHANGE: The old compression API has been removed.
Use the new queue-based API instead.
This will trigger a major version bump (x.0.0).
Scopes help categorize changes:
compression- Compression service changesqueue- Queue service changesconfig- Configuration changesui- UI/UX changescommands- VS Code command changes
Good commit messages:
feat(compression): add WebP format support
Implements WebP compression using TinyPNG API.
Adds configuration option for WebP quality settings.
Closes #123
fix(queue): prevent duplicate file processing
Fixes an issue where files could be added to the
compression queue multiple times if clicked rapidly.
docs: update README with new features
- Add queue system documentation
- Update configuration examples
- Fix broken links
Bad commit messages:
updated stuff
fix bug
WIP
minor changes
- Use TypeScript strict mode
- Follow existing code formatting (enforced by ESLint)
- Run
npm run lintbefore committing - Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Write unit tests for new features
- Ensure all tests pass before submitting PR
- Test the extension manually in VS Code
- Test with various image formats (PNG, JPEG, WebP)
-
Update your branch with the latest develop branch:
git checkout develop git pull origin develop git checkout your-feature-branch git rebase develop
-
Ensure all checks pass:
- Tests pass:
npm test - Linting passes:
npm run lint - Build succeeds:
npm run compile
- Tests pass:
-
Create a pull request:
- Use a descriptive title following conventional commit format
- Reference any related issues
- Provide a clear description of changes
- Include screenshots for UI changes
-
Address review feedback:
- Make requested changes
- Push updates to your branch
- Respond to comments
-
Squash commits (if requested):
- Combine related commits for a cleaner history
- Maintain conventional commit format
vscode-tinypng/
├── src/
│ ├── extension.ts # Main extension entry point
│ ├── commands/ # VS Code command handlers
│ │ ├── compressFile.ts
│ │ ├── compressFolder.ts
│ │ ├── compressGitStage.ts
│ │ └── getCompressionCount.ts
│ ├── services/ # Business logic services
│ │ ├── compressionService.ts
│ │ ├── configService.ts
│ │ └── queueService.ts
│ ├── utils/ # Utility functions
│ │ ├── errorHandler.ts
│ │ └── fileUtils.ts
│ └── types/ # TypeScript type definitions
├── test/ # Tests
├── .github/
│ └── workflows/ # GitHub Actions workflows
├── package.json # Extension manifest
└── tsconfig.json # TypeScript configuration
- Check for existing issues - Avoid duplicate work
- Discuss major changes - Open an issue first for significant features
- Follow the architecture - Use existing patterns (services, commands, utils)
- Update documentation - README, JSDoc comments, and this guide
- Add tests - Cover new functionality
- Update CHANGELOG - Not needed! It's auto-generated from commits
Use GitHub Issues with the following information:
- VS Code version
- Extension version
- Operating system
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs
Open a GitHub Issue with:
- Clear description of the feature
- Use cases and benefits
- Possible implementation approach
- Willingness to contribute
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help others learn and grow
- Open an issue for general questions
- Check existing issues and documentation first
- Be specific and provide context
By contributing, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing! 🎉