From f76861a83f6f8c8823d44d3e17bc7b3d2c9e826b Mon Sep 17 00:00:00 2001 From: Tobias O Date: Mon, 13 Oct 2025 21:24:51 +1300 Subject: [PATCH] chore: migrate build commands to poe Signed-off-by: Tobias O --- README.md | 3 +++ pyproject.toml | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a5f59a6d..3db99700 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ uv run poe dev The application will be available at `http://localhost:8000`. +**Note:** The development server automatically starts a CSS watcher (`pnpm run dev`) alongside the Django server to rebuild CSS files when changes are detected. This ensures your styles are always up-to-date during development. + #### Other useful Poe commands: You can list all available commands by running `uv run poe --help`. @@ -68,6 +70,7 @@ uv run poe db-down # Stop PostgreSQL uv run poe migrate # Run migrations only uv run poe bootstrap # Bootstrap data only uv run poe shell # Open the Django shell +uv run poe build # Build frontend assets and collect static files uv run poe clean # Remove database volumes (WARNING: destroys all data) ``` diff --git a/pyproject.toml b/pyproject.toml index 146d96d1..8a28c054 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,8 @@ docstring-code-format = true [tool.poe.tasks] # Main tasks setup = { sequence = ["db-up", "migrate", "bootstrap"], help = "Complete setup: start database, run migrations, and bootstrap data" } -dev = { cmd = "python manage.py runserver", help = "Start the development server", deps = ["db-up"] } +dev = { cmd = "python manage.py runserver", help = "Start the development server with CSS watcher", deps = ["db-up"] } +build = { sequence = ["build-frontend", "collectstatic"], help = "Build frontend assets and collect static files" } # Database tasks db-up = { cmd = "docker compose -f docker-compose.dev.yml up -d", help = "Start PostgreSQL database using Docker Compose" } @@ -94,3 +95,7 @@ echo " Email: admin@envipath.com" echo " Password: SuperSafe" """, help = "Bootstrap initial data (anonymous user, packages, models)" } shell = { cmd = "python manage.py shell", help = "Open Django shell" } + +# Build tasks +build-frontend = { cmd = "pnpm run build", help = "Build frontend assets using pnpm" } +collectstatic = { cmd = "python manage.py collectstatic --noinput", help = "Collect static files for production" }