Releases: django-commons/django-tailwind-cli
Releases · django-commons/django-tailwind-cli
v4.6.0
💥 Breaking Changes
- Removed
list_templatescommand: Tailwind CSS 4.x handles template discovery via@sourcedirectives in your CSS source file, making this command redundant. If you need to enumerate templates programmatically, use Django'sdjango.template.utils.get_app_template_dirs()directly.
🎯 New Features
- Configurable minification: New
TAILWIND_CLI_AUTOMATIC_MINIFYsetting and--minify/--no-minifyflag ontailwind buildfor projects whose asset pipelines already minify CSS. Defaults preserve existing behavior. - System binary support: New
TAILWIND_CLI_USE_SYSTEM_BINARYsetting letsdjango-tailwind-cliuse a Tailwind CSS CLI that is already installed onPATH(e.g. via Homebrew), skipping the auto-download. Pairs with optionalTAILWIND_CLI_SYSTEM_BINARY_NAMEoverride. Emits a warning if the installed binary's version differs from an explicitly pinnedTAILWIND_CLI_VERSION. - Auto
@sourcefor editable external apps (opt-in): NewTAILWIND_CLI_AUTO_SOURCE_EXTERNAL_APPSsetting (defaultFalse). When enabled, the auto-generated default source CSS receives one@sourcedirective per installed Django app whose path lives outside bothBASE_DIRand site-packages — typically editable-installed packages that ship their own templates. This removes the need for fragile@source "../../../../../..."workarounds. Addresses #187. - Watch mode auto-reload:
python manage.py tailwind watchnow runs under Django's own auto-reloader (the same machineryrunserveruses). Changingsettings.pyor any Python file restarts the watch process, regenerates the source CSS (picking up newINSTALLED_APPS), and restarts the Tailwind CLI subprocess. Pass--noreloadto disable.
🛠️ Developer Experience
- Gitignore cleanup: Trimmed
.gitignoreto project-relevant entries only - Managed
.django_tailwind_cli/is now git-ignored by default: On first use the directory gets a.gitignorecontaining*, so the downloaded CLI binary and the auto-generatedsource.cssare silently skipped bygit add .without any project-level.gitignoretweak from the user. Existing.gitignorefiles in that directory are preserved. No-op whenTAILWIND_CLI_PATHpoints at a custom location.
🐛 Bug Fixes
- Tox matrix: Django 4.2/5.2/6.0 factors in
tox.iniwere ignored becauseuv sync --lockedreinstalled Django fromuv.lockafter tox'sdeps. The matrix now excludes Django from the sync and installs the factor-specific version viacommands_pre, sojust test-allactually covers all supported Django versions. - HTTP error reporting:
download_with_progressandget_content_syncnow surfaceHTTPErrorfor 4xx/5xx responses as intended. Previously the internalHTTPErrorwas caught by the generic fallback handler and re-wrapped as aRequestError("Unexpected error: …"), hiding the real status code from callers. runservershutdown message newline:ProcessManager._signal_handlerprinted a literal\ninstead of a real newline, so the Ctrl+C shutdown message got stapled onto the previous terminal output.runserverwatch subprocess deadlock:ProcessManagerandMultiWatchProcessManagerspawned the Tailwind CLI watch subprocess with a captured stdout pipe that was never read. Once the OS pipe buffer filled up (~64 KB on Linux), the watcher blocked on its next write and silently stopped rebuilding. Watch subprocesses now inherit the parent's stdout/stderr, which also means you can see rebuild progress live duringtailwind runserver.
🔧 Technical Improvements
- Type checking: Switched from
pyrighttobasedpyrightin pre-commit, addeddjango-stubsas a dev dependency, and resolved a latent pre-existing baseline so the type checker runs clean on all files. - Pre-commit hooks: Bumped all hooks to their latest releases (pre-commit-hooks 6.0.0, ruff 0.15.10, pyupgrade 3.21.2, django-upgrade 1.30.0, djade 1.9.0, uv-secure 0.17.1).
- Test coverage: Raised
config.pyto 100% andhttp.pyfrom 67% to 100%, covering the previously-untested download body (chunked writes with progress callbacks), 200/redirect responses, HTTP 4xx/5xx paths, genericURLErrorbranches, and theNoRedirectHandlerredirect methods. tailwind runserveris now a transparent passthrough wrapper. Instead of declaring everyrunserver/runserver_plusflag by hand, the command forwards all unknown options to the underlying Django command. This removes ~120 lines of duplication, fixes the silent gap where severalrunserver_plusflags (--extra-file,--reloader-interval,--browser, …) were not exposed, and stays in sync with future upstream changes automatically. Existing invocations keep working unchanged; the reduced output oftailwind runserver --helpnow points users atrunserver --helpfor the full flag list.
4.5.1
chore: release 4.5.1
4.5.0
chore: release 4.5.0
chore(release): prepare 4.4.2 release
- Updated CHANGELOG.md with test isolation bug fix - Fixes cache interference causing test failures in Django 4.1 with Python 3.10
chore(release): prepare 4.4.1 release
- Updated CHANGELOG.md with DaisyUI version detection bug fix
v4.4.0: Release 4.4.0
Technical improvements release focused on code quality and reliability: 🔧 Technical Improvements: - Removed requests dependency, replaced with custom HTTP implementation - Fixed exception naming to follow Python conventions - Added comprehensive HTTP module tests (coverage 82% → 85%) - Complete test coverage for network error handling - Fixed all pyright typing errors for better type safety - Added Django 6.0 support to testing matrix This release enhances the robustness and maintainability of the codebase while removing external dependencies and improving error handling.
2.22.1
Release 2.22.1 - Fix PyPI publish action compatibility
Release version 4.3.0
New features: - Interactive setup command for guided configuration - Configuration viewer to inspect current settings - Troubleshooting guide for common issues - Performance optimization tips - Enhanced verbose mode with detailed diagnostics Performance improvements: - Smart rebuilds with file modification checks - Version caching to reduce API requests - Optimized process handling and file operations Developer experience enhancements: - Better error messages with actionable solutions - Colorized output with visual feedback - Improved help text and documentation - Enhanced template scanning capabilities Quality assurance: - 58+ new tests covering integration workflows - Comprehensive error scenario testing - Performance optimizations and reliability improvements
4.2.4
Bumped version to 4.2.4
4.2.3
Moved default storage location BASE_DIR/.django_tailwind_cli