Open
Conversation
The emoji feature provides: - **Separate emoji configuration**: Define emojis as a separate field in your prefix configuration - **Optional emoji usage**: Control whether emojis are displayed using the `useEmojis` flag - **Backward compatibility**: Existing configurations continue to work without changes
Refactored the prefix options by introducing dynamic formatting of descriptions using lipgloss for better visual alignment. The default prefix options are now more flexible and support dynamic emoji column sizing, ensuring consistent presentation in different contexts. Added comprehensive test cases to ensure correctness and stability of the modified functionality.
Refactored the `OptionsWithEmojis` function within `prefix.go` to optimize column width measurement and emoji alignment. Implemented single-pass width measurement with `measureColumnWidths` and centralized style creation using `createColumnStyles`. This update ensures efficient processing by reducing duplicate calculations and enhancing the readability of the code. Each prefix now uses a unified option-building function `buildPrefixOption` to render prefix options, maintaining dynamic width adjustment and supporting optional emoji integration. Improved code maintainability and performance with these structural adjustments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Add Emoji Support to Meteor
🎯 Overview
This PR introduces comprehensive emoji support to Meteor, allowing users to enhance their conventional commit workflows with visual flair while maintaining full backward compatibility with existing configurations.
✨ What's New
Core Features
emojifield in prefix configurationsuseEmojisflag to enable/disable emoji displayConfiguration Example
{ "useEmojis": true, "prefixes": [ { "type": "feat", "description": "a new feature", "emoji": "✨" }, { "type": "fix", "description": "a bug fix", "emoji": "🐛" }, { "type": "docs", "description": "documentation changes", "emoji": "📚" } ] }Visual Enhancement
useEmojisistrue: Options display as "feat ✨ - a new feature"useEmojisisfalse: Traditional display without emojis🚀 Implementation Highlights
Performance Optimizations
measureColumnWidthsfunctioncreateColumnStylesfor consistencybuildPrefixOptionfunctionCode Quality Improvements
🔧 Technical Changes
Modified Files
README.md: Added emoji configuration documentation and examplesconfig.go: AddedUseEmojisfield to configuration structpkg/config/config.go: Enhanced default configuration handlingpkg/config/prefix.go: Major refactor for emoji support and formattingpkg/config/prefix_test.go: Comprehensive test suite additionsKey Functions
OptionsWithEmojis(): Optimized emoji-aware option renderingmeasureColumnWidths(): Efficient column width calculationcreateColumnStyles(): Centralized styling for consistent presentationbuildPrefixOption(): Unified prefix option construction🎭 User Experience
This enhancement makes commit type selection more visually appealing and intuitive while preserving the clean, professional experience users expect from Meteor. The emoji integration is:
🧪 Testing
This PR transforms Meteor's user interface while respecting existing workflows, making conventional commits more engaging and visually distinctive! 🚀