Skip to content

Releases: bartTC/tailwhip

v0.13.0

24 Nov 22:41

Choose a tag to compare

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_order defines comparison priority: ["variant", "prefix", "direction", "size", "value", "color", "shade", "alpha"]
    • variants list for variant ordering (breakpoints, states, pseudo-elements)
    • prefixes list for utility prefix ordering (layout, spacing, typography, etc.)
    • directions list for directional modifiers (x, y, t, r, b, l, etc.)
    • sizes list for size modifiers (xs, sm, md, lg, xl, etc.)
    • numerics list for spacing/sizing values (0, 1, 2, 4, 8, etc.)
    • colors list for color ordering
    • shades list for color shade ordering (50-950)
    • alphas list for opacity values

    Sorting behavior:

    • Non-Tailwind classes sort first (preserves external library classes)
    • No-direction utilities sort before directional variants (border-1 before border-t-1)
    • Base utilities sort before modified variants (blur before blur-sm)
    • Variants support prefix matching (min-[320px]: matches min in variants list)

    Configuration improvements:

    • Grouped flex/inline-flex and grid/inline-grid together
    • Added missing utilities: text-wrap, text-pretty, underline, uppercase, italic, etc.
    • Added inset-x, inset-y for positioning
    • Added grid-flow-row, grid-flow-col, grid-flow-dense variants
    • Added min/max to variants for arbitrary breakpoint support
    • Removed duplicate content entry
    • Removed mutually exclusive values (border styles, auto, none) - they don't need ordering since you can't have both border-solid and border-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=True to ParsedClass dataclass for reduced memory and faster attribute access
    • Replaced dict construction with if/elif chain in _component_rank() (called 6x per class)
    • Moved _MAX_RANK constant 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
  • Colors: Colors and custom_colors are now merged and sorted alphabetically

    • Custom colors integrate naturally with built-in colors (e.g., brand sorts between blue and current)
    • Removed unused all_colors set from configuration

v0.12.0

23 Nov 19:25

Choose a tag to compare

Added

  • Configuration: Added "?" to default skip_expressions for 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
  • CI/CD: GitHub Actions workflow for automated documentation deployment

    • Added .github/workflows/deploy-docs.yml for 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

Changed

  • Documentation: Updated documentation URL in pyproject.toml to 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

v0.11

12 Nov 13:04

Choose a tag to compare

Added

  • Pre-commit Integration: Git pre-commit hook support for automatic class sorting
    • Added .pre-commit-hooks.yaml for 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-commit to dev dependencies

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_files verifies proper error handling
    • Ensures clean exit with appropriate error message (no traceback)

v0.10.1

12 Nov 13:05

Choose a tag to compare

Fixed

  • Reliability: Fixed crash when no pyproject.toml is found in current or parent directories

v0.10.0

06 Nov 17:14

Choose a tag to compare

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.py with 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_colors computation to configuration module

    • Added all_colors attribute to TailwhipConfig class
    • Computed once during pattern recompilation instead of on every sort
    • Simplified function signatures by removing all_colors parameter passing
    • is_color_utility() and sort_key() now use config.all_colors directly
  • Testing: Simplified test suite for better maintainability

    • Removed redundant integration tests (test_kitchen_sink_example, test_css_apply_advanced)
    • Added focused test_deduplication test for duplicate class handling
    • Updated test documentation to reflect current coverage

v0.9.4

05 Nov 04:11

Choose a tag to compare

Added

  • Development: Claude Code project configuration
    • Added PROJECT.md with development workflow guidelines
    • Added slash commands: /release, /changelog and /verify
    • Configured hooks to enforce workflow: tests → linting → changelog
    • Automated reminders after code changes to ensure quality standards
    • Shared settings in settings.json for all contributors
    • Added .claude/settings.local.json to .gitignore for 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
  • Reliability: Added 60-second timeout to file processing

    • Prevents indefinite hangs when processing files
    • as_completed() now uses timeout parameter in apply_changes()
  • Documentation: Restructured comments in configuration arrays

    • All comments in utility_groups and variant_groups now consistently appear above their patterns
    • Clear separation between major groups with blank lines
    • Improved readability and maintainability of configuration structure

v0.9.3

04 Nov 19:56

Choose a tag to compare

Changed

  • Sorting: Position utilities (top, right, bottom, left) now sort clockwise
    • Split combined positioning pattern into separate utility groups
    • Order: top → right → bottom → left (clockwise direction)

v0.9.2

04 Nov 17:13

Choose a tag to compare

Removed

  • Configuration: Removed "primary" from default custom_colors list
    • 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 via pyproject.toml
    • test_custom_pattern_from_config_file: Tests custom patterns via custom config file
    • Both tests verify JSX className pattern 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_patterns replace (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

04 Nov 16:02

Choose a tag to compare

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_patterns configuration with regex and template support
    • Built-in support for HTML class and 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

Changed

  • Configuration: Updated example.tailwhip.toml with 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
  • Architecture: Unified pattern processing system

    • Replaced separate class_regex and apply_regex with class_patterns list
    • Single process_pattern() function handles all syntax types
    • New Pattern dataclass for compiled regex patterns
    • Compiled patterns stored in config.APPLY_PATTERNS

Removed

  • Deprecated Functions: Removed process_html() and process_css()
    • All functionality now available through process_text()
    • Tests updated to use unified process_text() function

v0.9

04 Nov 15:20

Choose a tag to compare

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 --configuration flag syntax

Removed

  • Code Cleanup: Removed unused datatypes.py module