server: hatch build hook only watches package.json — wheel builds ship a stale frontend after source-only edits
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, python, typescript
- Domain
- build-system, devtools
Research direction
Start by reading src/profiles/web/build_hook.py and build.py, then compare how each build path decides whether to rebuild, installs dependencies, and reports failures. The issue points to the relevant functions and proposed fixes. Done means source or lockfile edits trigger fresh wheel assets, both paths handle npm consistently, and hook failures show useful error output.
Written by the indexing model from the issue text.
Description
Problem
The packaging staleness check ignores every frontend source file:
# src/profiles/web/build_hook.py:17-28
def _needs_rebuild(web_dir: Path, marker_file: Path) -> bool:
if not marker_file.exists():
return True
package_json = web_dir / "package.json"
…
return package_mtime > marker_mtime
Editing any .ts/.tsx/.css source after the last build and running hatch build / pip install . skips the rebuild entirely and packages the committed dist/ (possibly stale).
Related divergence between the two build paths (DRY violation per AGENTS.md):
build.py:141-149deliberately runsnpm install("Use npm install instead of npm ci to handle lock file sync issues") — which can silently mutatepackage-lock.jsonduring a "build" — while the hook runsnpm ci.build.pyalso doesn't watchpackage-lock.jsonfor staleness.build_hook._run_npm_buildusescapture_output=Trueand on failure prints onlyERROR: npm build failed: {e}(build_hook.py:74-76) —e.stdout/e.stderrare discarded, so a failed packaging build gives no reason.
Suggested fix
- Extract a shared
needs_rebuild()intoweb/build.py(scanning package.json + lock +**/*.{ts,tsx,css,html}) and havebuild_hookimport it — or simply always runnpm run buildin the hook when npm is available. - Standardize on
npm ci --no-audit --no-fundin both (escape-hatch flag for lock drift in build.py). - Print
e.stderr(tail) on hook failure.
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- Avg merge
- 4h 46m
- Merged PRs (30d)
- 55
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from falbany/ProFiles
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
falbany/ProFiles#187 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in falbany/ProFiles
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ip-tools/patzilla#219 · 2 comments ·
Maintainers usually reply within 1 day
-
EPSSClient commits to its SQLite cache once per score: a 100-CVE bulk fetch makes 101 disk flushesOpenpriority:p3 technical-debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jimmy058910/jmo-security-repo#1673 ·
Maintainers usually reply within 1 day
-
enhancement ready
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
integration: frontier_silicon
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
home-assistant/core#193176 · 2 comments ·
Maintainers usually reply within 1 day
-
task create and task update take --body-file and --stdinPossibly taken @JuanBarriosS claimed this today. Opencli enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
pyrite-wiki/pyrite#1687 · 1 comment ·
Maintainers usually reply within 1 day