Preserve .gitkeep in web directory and improve build process#35
Preserve .gitkeep in web directory and improve build process#35jamesbconner merged 1 commit intomainfrom
Conversation
- Update .gitignore to allow .gitkeep file in web directory while excluding built artifacts - Modify build-release target to preserve .gitkeep content during web UI rebuild - Add editable install configuration to pyproject.toml for development workflows - Bump version to 1.3.2 - Ensures web directory structure is maintained across clean builds and editable installs
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
| build-release: build-web ## Build Next.js UI and copy into the Python package for distribution | ||
| uv run python -c "import shutil,pathlib; w=pathlib.Path('src/SVG2DrawIOLib/web'); shutil.rmtree(w,ignore_errors=True); shutil.copytree('web-ui/out',w); [(p.rename(p.parent.parent/(p.parent.name+'.__PAGE__.txt')),p.parent.rmdir()) for p in list(w.rglob('__PAGE__.txt')) if p.parent.name.startswith('__next.')]" | ||
| uv run python -c "import shutil,pathlib; w=pathlib.Path('src/SVG2DrawIOLib/web'); gitkeep=w/'.gitkeep'; gitkeep_content=gitkeep.read_text() if gitkeep.exists() else ''; shutil.rmtree(w,ignore_errors=True); shutil.copytree('web-ui/out',w); [(p.rename(p.parent.parent/(p.parent.name+'.__PAGE__.txt')),p.parent.rmdir()) for p in list(w.rglob('__PAGE__.txt')) if p.parent.name.startswith('__next.')]; w.mkdir(exist_ok=True); gitkeep.write_text(gitkeep_content) if gitkeep_content else None" |
There was a problem hiding this comment.
Empty .gitkeep file won't be preserved during build
Low Severity
The build-release logic conflates "file exists with empty content" and "file doesn't exist." The variable gitkeep_content is used both to track existence and content, but an empty .gitkeep (the standard convention) produces '', which is falsy. The final conditional gitkeep.write_text(gitkeep_content) if gitkeep_content else None then skips recreating it. A separate boolean tracking existence is needed so that empty .gitkeep files are also preserved.


Note
Low Risk
Packaging/build-system-only changes; low runtime risk, with main risk being accidental omission/mis-packaging of static web assets in releases.
Overview
Ensures
src/SVG2DrawIOLib/web/is always present for editable installs by adding a tracked.gitkeepand updating.gitignoreto ignore all built web artifacts except that placeholder.Updates the
Makefilebuild-releasecopy step to preserve any existing.gitkeepcontent when replacing theweb/directory with the Next.js export, and adds an explicit Hatcheditabletarget config. Bumps version to1.3.2and documents the changes inCHANGELOG.md.Written by Cursor Bugbot for commit d687b15. This will update automatically on new commits. Configure here.