Releases: bartTC/tailwhip
v0.13.0
Changed
-
Sorting: Complete overhaul with list-based configuration system
THE GOLDEN RULE: If it's not in the TOML, it doesn't affect sorting.
Every sort decision can now be traced back to an ordered list in the configuration file.
No more regex patterns for utility groups - everything is explicit and predictable.New configuration structure:
component_orderdefines comparison priority:["variant", "prefix", "direction", "size", "value", "color", "shade", "alpha"]variantslist for variant ordering (breakpoints, states, pseudo-elements)prefixeslist for utility prefix ordering (layout, spacing, typography, etc.)directionslist for directional modifiers (x, y, t, r, b, l, etc.)sizeslist for size modifiers (xs, sm, md, lg, xl, etc.)numericslist for spacing/sizing values (0, 1, 2, 4, 8, etc.)colorslist for color orderingshadeslist for color shade ordering (50-950)alphaslist for opacity values
Sorting behavior:
- Non-Tailwind classes sort first (preserves external library classes)
- No-direction utilities sort before directional variants (
border-1beforeborder-t-1) - Base utilities sort before modified variants (
blurbeforeblur-sm) - Variants support prefix matching (
min-[320px]:matchesminin variants list)
Configuration improvements:
- Grouped
flex/inline-flexandgrid/inline-gridtogether - Added missing utilities:
text-wrap,text-pretty,underline,uppercase,italic, etc. - Added
inset-x,inset-yfor positioning - Added
grid-flow-row,grid-flow-col,grid-flow-densevariants - Added
min/maxto variants for arbitrary breakpoint support - Removed duplicate
contententry - Removed mutually exclusive values (border styles,
auto,none) - they don't need ordering since you can't have bothborder-solidandborder-dashed
Benefits:
- Fully declarative - every ordering decision is visible in the TOML
- Predictable - no hidden regex magic
- Extensible - add new utilities by adding to the appropriate list
- Debuggable - trace any sort order to a specific list position
-
Performance: Optimized sorting hot path for ~45% faster execution
- Added
slots=TruetoParsedClassdataclass for reduced memory and faster attribute access - Replaced dict construction with if/elif chain in
_component_rank()(called 6x per class) - Moved
_MAX_RANKconstant to module level to avoid repeated allocation - Changed list comprehension to generator expression in diff output
Benchmark results (median of 10 pytest runs):
Before After Improvement 1.81s 0.99s 45% faster - Added
-
Colors: Colors and custom_colors are now merged and sorted alphabetically
- Custom colors integrate naturally with built-in colors (e.g.,
brandsorts betweenblueandcurrent) - Removed unused
all_colorsset from configuration
- Custom colors integrate naturally with built-in colors (e.g.,
v0.12.0
Added
-
Configuration: Added "?" to default
skip_expressionsfor JavaScript ternary operator support- Prevents sorting of class attributes containing ternary expressions (e.g.,
condition ? "class-a" : "class-b") - Updated documentation in README.md, example.tailwhip.toml, and configuration.toml
- Updated test expectations to reflect new default
- Prevents sorting of class attributes containing ternary expressions (e.g.,
-
CI/CD: GitHub Actions workflow for automated documentation deployment
- Added
.github/workflows/deploy-docs.ymlfor generating and deploying documentation - Uses Microdocs to convert README.md and CHANGELOG.md into HTML documentation site
- Automatically deploys to GitHub Pages on push to main branch
- Includes comprehensive inline documentation explaining each workflow step
- Manual workflow dispatch option available from Actions tab
- Added
Changed
- Documentation: Updated documentation URL in
pyproject.tomlto point to GitHub Pages- Changed from GitHub README link to
https://barttc.github.io/tailwhip/ - Provides users with a dedicated documentation site instead of raw markdown
- Changed from GitHub README link to
v0.11
Added
- Pre-commit Integration: Git pre-commit hook support for automatic class sorting
- Added
.pre-commit-hooks.yamlfor seamless pre-commit integration - Users can reference tailwhip directly:
repo: https://github.com/bartTC/tailwhip - Automatically sorts Tailwind classes in HTML and CSS files before each commit
- Documentation includes setup instructions and customization examples
- Added
pre-committo dev dependencies
- Added
Changed
-
CLI Output: Simplified output messaging for better usability
- Removed verbose flag hints from normal output (cluttered default experience)
- Moved dry run warning and completion message to verbose mode only
- Cleaner default output focuses on essential information
-
Documentation: Added usage examples to CLI help text
- Examples demonstrate common workflows: single files, multiple files, directories
- Shows write mode, verbose diff preview, and stdin/stdout usage
- Improves discoverability of key features for new users
-
Testing: Added test coverage for stdin behavior when no input is provided
- New test
test_no_stdin_and_no_filesverifies proper error handling - Ensures clean exit with appropriate error message (no traceback)
- New test
v0.10.1
v0.10.0
Added
- Editor Integration: STDIN/STDOUT filter mode for text editor integrations
- Tailwhip now reads from stdin and writes to stdout when no file paths are provided
- Enables direct integration with Vim/Neovim (
:%!tailwhip), Emacs, VSCode, and other editors - No configuration or file I/O needed - just pipe text through tailwhip
- Added comprehensive test suite in
test_stdin.pywith 4 test cases - Updated documentation with editor integration examples for Vim, VSCode, and Emacs
Changed
-
Documentation: Added additional project metadata URLs to
pyproject.toml- Added direct link to project documentation (README.md)
- Added direct link to changelog (CHANGELOG.md)
- Added direct link to bug tracker (GitHub Issues)
-
Refactoring: Moved
all_colorscomputation to configuration module- Added
all_colorsattribute toTailwhipConfigclass - Computed once during pattern recompilation instead of on every sort
- Simplified function signatures by removing
all_colorsparameter passing is_color_utility()andsort_key()now useconfig.all_colorsdirectly
- Added
-
Testing: Simplified test suite for better maintainability
- Removed redundant integration tests (
test_kitchen_sink_example,test_css_apply_advanced) - Added focused
test_deduplicationtest for duplicate class handling - Updated test documentation to reflect current coverage
- Removed redundant integration tests (
v0.9.4
Added
- Development: Claude Code project configuration
- Added PROJECT.md with development workflow guidelines
- Added slash commands:
/release,/changelogand/verify - Configured hooks to enforce workflow: tests → linting → changelog
- Automated reminders after code changes to ensure quality standards
- Shared settings in
settings.jsonfor all contributors - Added
.claude/settings.local.jsonto.gitignorefor personal overrides
Changed
-
Performance: File processing now starts immediately when scanning large directories
- Removed eager materialization of file list in
apply_changes() - Files are now processed as they are discovered by the generator
- Significantly reduces startup delay for large codebases
- Removed eager materialization of file list in
-
Reliability: Added 60-second timeout to file processing
- Prevents indefinite hangs when processing files
as_completed()now uses timeout parameter inapply_changes()
-
Documentation: Restructured comments in configuration arrays
- All comments in
utility_groupsandvariant_groupsnow consistently appear above their patterns - Clear separation between major groups with blank lines
- Improved readability and maintainability of configuration structure
- All comments in
v0.9.3
v0.9.2
Removed
- Configuration: Removed "primary" from default
custom_colorslist- The default config should not include example custom colors
- Users should add their own custom colors as needed
Added
- Tests: Added tests for custom pattern configuration
test_custom_pattern_from_pyproject: Tests custom patterns viapyproject.tomltest_custom_pattern_from_config_file: Tests custom patterns via custom config file- Both tests verify JSX
classNamepattern as example of extensibility - Ensures all patterns (HTML, CSS, custom) work correctly together
- Demonstrates correct TOML syntax for both configuration methods
Changed
- Documentation: Clarified that
class_patternsreplace (not extend) defaults- Updated README.md with explicit warning about replacement behavior
- Updated configuration.toml with IMPORTANT note about preserving defaults
- Updated example.tailwhip.toml with complete example showing default patterns
- Added JSX example showing how to include defaults when adding custom patterns
v0.9.1
Added
-
CI/CD: GitHub Actions workflow for linting
- Runs ruff check to verify code quality
- Runs ruff format check to ensure consistent code formatting
- Added ruff to dev dependencies
-
Documentation: PyPI version badge in README
-
Pattern System: Extensible pattern matching for multiple syntaxes
- New
class_patternsconfiguration with regex and template support - Built-in support for HTML
classand CSS@apply - Users can add custom patterns for JSX, Vue, Svelte, and other frameworks
- All patterns use consistent
(?P<classes>...)named group requirement - Template-based reconstruction using named groups from regex matches
- New
Changed
-
Configuration: Updated
example.tailwhip.tomlwith comprehensive documentation- Aligned structure and descriptions with main
configuration.toml - Added clearer usage examples for common customization scenarios
- Improved comments and organization for better user guidance
- Aligned structure and descriptions with main
-
Architecture: Unified pattern processing system
- Replaced separate
class_regexandapply_regexwithclass_patternslist - Single
process_pattern()function handles all syntax types - New
Patterndataclass for compiled regex patterns - Compiled patterns stored in
config.APPLY_PATTERNS
- Replaced separate
Removed
- Deprecated Functions: Removed
process_html()andprocess_css()- All functionality now available through
process_text() - Tests updated to use unified
process_text()function
- All functionality now available through
v0.9
Added
-
CI/CD: GitHub Actions workflow for automated testing
- Python matrix testing across versions 3.11, 3.12, 3.13, and 3.14
- Runs on push and pull requests to main branch
- Uses uv for fast dependency management
-
Documentation Enhancements
- CI/CD status badge in README
- Python version support badge
- MIT license badge
- Direct link to CHANGELOG.md from README
-
Testing Infrastructure
- Comprehensive tests for file writing functionality
- Edge case coverage for file operations
- Coverage configuration with proper exclusions
-
Verbosity Levels: New DIFF mode for showing changes
- Enhanced output options for reviewing modifications
- Better visibility into what will be changed
Changed
- Configuration Access: Refactored to use direct attribute access instead of dictionary keys
- Cleaner, more Pythonic API
- Better IDE autocomplete support
Fixed
- Documentation: Corrected README usage example for
--configurationflag syntax
Removed
- Code Cleanup: Removed unused
datatypes.pymodule