docs: do not gitignore assets#3877
Conversation
|
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Important
The committed assets under web/public/assets/.gen/ will be wiped and regenerated on every web build because web/plugins/generate-images.ts:115-117 calls fs.rmSync(outputDir, { force: true, recursive: true }) at module load time. Anyone running astro dev/astro build will end up with a dirty working tree (or modified binaries) immediately after pulling.
TL;DR — Un-ignores web/public/assets/.gen so the generated image assets can be committed to the repo, and checks in the 22 current outputs.
Key changes
- Negate
.gen/ignore for web assets — adds!web/public/assets/.genso files under that directory escape the global.gen/ignore. - Commit 22 generated images —
.png/.webp/.jpegvariants of hero, logo, and partner logos at multiple widths.
Summary | 23 files | 0 commits | base: main ← docs/pass-5
Generated assets get nuked on the next web build
Before:
web/public/assets/.gen/was ignored; assets were produced on demand by thegenerate-imagesVite plugin.
After: The directory is tracked and 22 binaries are committed, but the plugin still unconditionally deletes and regenerates the directory.
The deletion runs at module top-level (not inside buildStart), so it fires the moment Vite/Astro imports astro.config.mjs. The result is that the freshly-checked-in files disappear on the first local pnpm dev/pnpm build of web, leaving a dirty git status and risking accidental "re-commits" with byte-identical-but-timestamp-differing outputs. Either guard the wipe (skip when files exist, or only run when sources are newer), move the cleanup inside buildStart behind a flag, or keep the assets out of git and rely on the build step.
.gitignore · web/plugins/generate-images.ts
Claude Opus | 𝕏
|
|
||
| # test files | ||
| .gen/ | ||
| !web/public/assets/.gen |
There was a problem hiding this comment.
Un-ignoring this directory conflicts with web/plugins/generate-images.ts:115-117, which calls fs.rmSync(outputDir, { force: true, recursive: true }) at module top-level (not inside buildStart). Every time Astro/Vite loads the config, the committed files are deleted and rewritten — anyone running web locally will see a dirty tree right after checkout. Consider gating the wipe (e.g., skip when assets already exist) or keeping the directory ignored and producing assets only as a build step.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3877 +/- ##
=======================================
Coverage 39.58% 39.58%
=======================================
Files 532 532
Lines 19581 19581
Branches 5829 5835 +6
=======================================
Hits 7751 7751
Misses 9582 9582
Partials 2248 2248
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

No description provided.