Skip to content

Commit 3ad696f

Browse files
committed
feat(management): add documentation and usability improvements
- Enhanced all command help text with detailed examples and use cases - Added actionable error messages with specific solutions for common issues - Created comprehensive configuration documentation in config.py module - Added new config command to display current configuration settings - Implemented new setup command for interactive setup guidance - Added new troubleshoot command with solutions for 7 common issues - Improved error handling with helper functions for specific guidance - Enhanced main command help with practical getting-started examples
1 parent 058d935 commit 3ad696f

File tree

3 files changed

+732
-10
lines changed

3 files changed

+732
-10
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
- Enhanced error handling validation across all management commands and utility functions
6060
- Fixed config tests to properly clear cache and mock network requests for consistent fallback behavior
6161
- Improved test coverage to 89% with comprehensive error scenario validation
62+
- Improved documentation and usability for enhanced developer experience.
63+
- Enhanced all command help text with detailed examples and common use cases
64+
- Added actionable error messages with specific solutions for configuration and system issues
65+
- Created comprehensive configuration documentation with complete settings reference and examples
66+
- Added new `config` command to display current configuration settings in formatted output
67+
- Implemented new `setup` command providing interactive step-by-step setup guidance for new projects
68+
- Added new `troubleshoot` command with solutions for 7 common issues including debugging steps
69+
- Improved error handling with helper functions providing specific guidance for different error types
70+
- Enhanced main command help with practical examples for getting started quickly
6271

6372
## 4.2.4
6473

src/django_tailwind_cli/config.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
1+
"""Configuration management for django-tailwind-cli.
2+
3+
This module handles all configuration aspects of the Tailwind CSS integration,
4+
including version management, path resolution, and Django settings validation.
5+
6+
Configuration Settings:
7+
The following Django settings are recognized:
8+
9+
Core Settings:
10+
STATICFILES_DIRS (required): List of directories for static files
11+
Example: STATICFILES_DIRS = [BASE_DIR / 'assets']
12+
13+
TAILWIND_CLI_VERSION (optional): Tailwind CSS version to use
14+
Default: 'latest'
15+
Example: TAILWIND_CLI_VERSION = '4.1.3'
16+
Special: 'latest' fetches newest version from GitHub
17+
18+
Path Settings:
19+
TAILWIND_CLI_PATH (optional): Path to CLI binary or directory
20+
Default: '.django_tailwind_cli' (in project root)
21+
Example: TAILWIND_CLI_PATH = '/usr/local/bin/tailwindcss'
22+
23+
TAILWIND_CLI_SRC_CSS (optional): Input CSS file path
24+
Default: '.django_tailwind_cli/source.css' (auto-created)
25+
Example: TAILWIND_CLI_SRC_CSS = 'src/styles/main.css'
26+
27+
TAILWIND_CLI_DIST_CSS (optional): Output CSS file path
28+
Default: 'css/tailwind.css' (relative to STATICFILES_DIRS[0])
29+
Example: TAILWIND_CLI_DIST_CSS = 'dist/main.css'
30+
31+
Advanced Settings:
32+
TAILWIND_CLI_USE_DAISY_UI (optional): Enable DaisyUI components
33+
Default: False
34+
Example: TAILWIND_CLI_USE_DAISY_UI = True
35+
36+
TAILWIND_CLI_SRC_REPO (optional): Custom Tailwind CLI repository
37+
Default: 'tailwindlabs/tailwindcss' (or DaisyUI variant)
38+
Example: TAILWIND_CLI_SRC_REPO = 'custom/tailwind-fork'
39+
40+
TAILWIND_CLI_ASSET_NAME (optional): CLI asset name for downloads
41+
Default: 'tailwindcss' (or 'tailwindcss-extra' for DaisyUI)
42+
Example: TAILWIND_CLI_ASSET_NAME = 'tailwind-custom'
43+
44+
TAILWIND_CLI_AUTOMATIC_DOWNLOAD (optional): Auto-download CLI
45+
Default: True
46+
Example: TAILWIND_CLI_AUTOMATIC_DOWNLOAD = False
47+
48+
TAILWIND_CLI_REQUEST_TIMEOUT (optional): Network request timeout
49+
Default: 10 (seconds)
50+
Example: TAILWIND_CLI_REQUEST_TIMEOUT = 30
51+
52+
Examples of complete settings configuration:
53+
54+
# Minimal configuration
55+
STATICFILES_DIRS = [BASE_DIR / 'assets']
56+
57+
# Production configuration
58+
STATICFILES_DIRS = [BASE_DIR / 'static']
59+
TAILWIND_CLI_VERSION = '4.1.3' # Pin to specific version
60+
TAILWIND_CLI_DIST_CSS = 'css/app.css'
61+
62+
# Development with DaisyUI
63+
STATICFILES_DIRS = [BASE_DIR / 'assets']
64+
TAILWIND_CLI_USE_DAISY_UI = True
65+
TAILWIND_CLI_SRC_CSS = 'src/styles/main.css'
66+
67+
# Custom CLI setup
68+
STATICFILES_DIRS = [BASE_DIR / 'static']
69+
TAILWIND_CLI_PATH = '/opt/tailwindcss/bin/tailwindcss'
70+
TAILWIND_CLI_AUTOMATIC_DOWNLOAD = False
71+
"""
72+
173
import os
274
import platform
375
import tempfile

0 commit comments

Comments
 (0)