?
PLOW-60
feature
Created: 2025-12-22 Updated: 2025-12-22
Relationships Loading...
Attachments
Loading...
Comments (3)
code-verification-qa · 2025-12-22
## QA Verification Complete - PASSED ✅ **All acceptance criteria verified:** - ✅ pip install includes working frontend assets (verified in wheel: 476B HTML, 193KB JS, 1.3KB CSS) - ✅ pip install -e . builds frontend via hatch hook (tested successfully) - ✅ Fresh clone + install serves working web UI (all endpoints returning 200) - ✅ CI/CD builds include frontend assets (build hook runs during wheel creation) **Test Results:** - 875/887 tests passed (5 failures unrelated to PLOW-60) - 69% code coverage maintained - All web endpoints tested and working: - GET /api: 200 ✓ - GET /health: 200 ✓ - GET /: 200 (serves index.html) ✓ - GET /static/vite.svg: 200 ✓ **Build System:** - Hatchling build hook works correctly - Vite outputs to correct location (../static/) - Makefile targets functional (build-frontend, clean-frontend) - Graceful error handling for missing npm **Documentation:** - Comprehensive CLAUDE.md updates - Build process fully documented - Development workflow instructions included See full QA report at /tmp/qa-PLOW-60.md
agent · 2025-12-22
## Implementation Complete ### What was implemented: **1. Vite Configuration (`frontend/vite.config.ts`)** - Set `outDir` to `../static/` to output built files alongside server.py - Added `/static/` base path for asset URLs - Added vitest reference for test configuration **2. Hatchling Build Hook (`hatch_build.py`)** - Runs during `pip install` or `uv build` - Checks for Node.js/npm availability - Installs frontend dependencies if needed - Runs `npm run build` to compile frontend - Skips build if assets are up-to-date - Gracefully handles missing npm (warns but continues) **3. pyproject.toml Updates** - Added `[tool.hatch.build.targets.wheel.hooks.custom]` for build hook - Added `[tool.hatch.build.targets.sdist]` configuration - Static files included automatically from `src/trckr_plow/web/static/` **4. Makefile Targets** - `make build-frontend` - Build frontend manually - `make install-frontend` - Install npm dependencies - `make clean-frontend` - Clean frontend artifacts **5. FastAPI Server Updates (`web/server.py`)** - Added static file serving with `StaticFiles` mount at `/static/` - Root `/` now serves `index.html` (SPA frontend) - Added `/api` endpoint for health check JSON - SPA routing fallback for client-side routing **6. .gitignore Updates** - Added `src/trckr_plow/web/frontend/node_modules/` - Static assets are committed for distribution **7. CLAUDE.md Documentation** - Added "Frontend Build System" section - Documented directory structure, build process, and requirements - Added development workflow instructions ### Test Results: - All 47 web tests pass - Updated tests to use `/api` instead of `/` for JSON responses - Frontend builds successfully to `web/static/` - Static files included in wheel package (verified with unzip -l) ### Verification: ``` GET / status: 200 (HTML) GET /health: {'status': 'healthy'} GET /api: {'status': 'ok', 'service': 'trckr-plow', 'connections': 0} GET /static/vite.svg status: 200 ``` All acceptance criteria met: - pip install trckr-plow includes working frontend assets - pip install -e . builds frontend (via hatch hook) - Fresh clone + install serves working web UI - Build includes frontend assets (verified in wheel)
triage-agent · 2025-12-22
## Feature Triage Complete **Status:** NOT IMPLEMENTED **Summary:** The feature requests adding frontend build automation to the Python package distribution. Currently, the React/Vite frontend exists but: - No build hook runs during pip install - No static assets directory exists - No Makefile target for frontend builds - pyproject.toml lacks package data configuration **Implementation Location:** - New: `hatch_build.py` (build hook) - New: `src/trckr_plow/web/static/` (built assets) - Modified: `pyproject.toml`, `Makefile`, `vite.config.ts`, `server.py` **Complexity:** MEDIUM - Well-documented hatchling patterns exist **Key Approach:** 1. Configure Vite to output to `web/static/` 2. Create hatchling build hook to run npm build 3. Add package data includes for static assets 4. Mount static files in FastAPI server See attached triage report (PLOW-60 Triage Report) for full details.