Skip to content

Preserve .gitkeep in web directory and improve build process#35

Merged
jamesbconner merged 1 commit intomainfrom
v1.3.2
Feb 22, 2026
Merged

Preserve .gitkeep in web directory and improve build process#35
jamesbconner merged 1 commit intomainfrom
v1.3.2

Conversation

@jamesbconner
Copy link
Copy Markdown
Owner

@jamesbconner jamesbconner commented Feb 22, 2026

  • 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

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 .gitkeep and updating .gitignore to ignore all built web artifacts except that placeholder.

Updates the Makefile build-release copy step to preserve any existing .gitkeep content when replacing the web/ directory with the Next.js export, and adds an explicit Hatch editable target config. Bumps version to 1.3.2 and documents the changes in CHANGELOG.md.

Written by Cursor Bugbot for commit d687b15. This will update automatically on new commits. Configure here.

- 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-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jamesbconner jamesbconner merged commit 16f2474 into main Feb 22, 2026
4 checks passed
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants