You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(runserver): replace hand-copied options with typer passthrough
`tailwind runserver` used to declare every runserver / runserver_plus
flag as its own typer.Option and ship a translation helper to turn them
back into argv — two sources of truth that had already drifted (the
wrapper was missing ~7 runserver_plus flags including --extra-file,
--reloader-interval and --browser).
Use Click's `ignore_unknown_options` + `allow_extra_args` so only
`--force-default-runserver` is caught by typer; every other positional
and flag falls into `ctx.args` and is forwarded verbatim to the
subprocess. Argument parsing goes back to Django where it belongs.
Trade-off: `tailwind runserver --help` no longer lists the upstream
flags — the docstring now points at `runserver --help` /
`runserver_plus --help` for the authoritative list.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@
22
22
-**Type checking**: Switched from `pyright` to `basedpyright` in pre-commit, added `django-stubs` as a dev dependency, and resolved a latent pre-existing baseline so the type checker runs clean on all files.
23
23
-**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).
24
24
-**Test coverage**: Raised `config.py` to 100% and `http.py` from 67% to 100%, covering the previously-untested download body (chunked writes with progress callbacks), 200/redirect responses, HTTP 4xx/5xx paths, generic `URLError` branches, and the `NoRedirectHandler` redirect methods.
25
+
-**`tailwind runserver` is now a transparent passthrough wrapper**. Instead of declaring every `runserver` / `runserver_plus` flag by hand, the command forwards all unknown options to the underlying Django command. This removes ~120 lines of duplication, fixes the silent gap where several `runserver_plus` flags (`--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 of `tailwind runserver --help` now points users at `runserver --help` for the full flag list.
Run `python manage.py tailwind runserver` to start the Django debug server in parallel to a tailwind watcher process. If `django-extensions` plus `werkzeug` are installed, `runserver_plus` is used automatically; otherwise the vanilla `runserver` command runs.
36
+
37
+
This command is a transparent passthrough wrapper: **every** positional argument and option other than the tailwind-specific `--force-default-runserver` is forwarded verbatim to the underlying server command. That includes flags the wrapper itself does not know about (e.g. `runserver_plus`'s `--extra-file`, `--reloader-interval`, `--browser`, `--exclude-pattern`, …).
38
+
39
+
For the exhaustive list of forwarded flags, run:
40
+
41
+
```bash
42
+
python manage.py runserver --help
43
+
python manage.py runserver_plus --help # with django-extensions
0 commit comments