Problem
scripts/watch-help.js's deployImages() function had two shortcomings that left help images missing on the dev test site:
- Non-recursive. The function iterated top-level files only with
if (fs.statSync(src).isFile()), silently skipping any subdirectory. All v5 screenshots live in img/v5/, so every image referenced from a v5 doc page 404'd on xmp5dev.
- One-shot at startup. Even when the watch is running, image changes during a session are not re-mirrored. Adding a new screenshot requires stopping and restarting the watcher.
Production packaging (Build-XmpV5.ps1 line 494) uses Copy-Item -Recurse so installed packages are unaffected — this is purely a local dev-deployment bug.
Status
- ✅ Recursion fix — landed in the same change that swapped the in-app help renderer to markdown-it.
deployImages() now walks subdirectories with an inner mirrorDir() helper.
- ⏳ Watch-for-changes — still TODO. Either chokidar-watch the
img/ tree alongside the markdown files, or accept one-shot and document a manual remirror command (e.g. npm run help:images).
Repro (pre-fix)
- Add a screenshot to
XModPro.Help/img/v5/
- Run
npm run help:watch
- Observe: file is not copied to
C:/TestSites/xmp5dev/DesktopModules/XModPro/help/img/v5/
- Image 404s in the in-app help viewer
Suggested next step
Add a chokidar watcher for the img/ subtree that re-runs mirrorDir() (or a single-file copy) on add/change/unlink events. Debounce by file path the same way the markdown rebuild does.
Problem
scripts/watch-help.js'sdeployImages()function had two shortcomings that left help images missing on the dev test site:if (fs.statSync(src).isFile()), silently skipping any subdirectory. All v5 screenshots live inimg/v5/, so every image referenced from a v5 doc page 404'd onxmp5dev.Production packaging (
Build-XmpV5.ps1line 494) usesCopy-Item -Recurseso installed packages are unaffected — this is purely a local dev-deployment bug.Status
deployImages()now walks subdirectories with an innermirrorDir()helper.img/tree alongside the markdown files, or accept one-shot and document a manual remirror command (e.g.npm run help:images).Repro (pre-fix)
XModPro.Help/img/v5/npm run help:watchC:/TestSites/xmp5dev/DesktopModules/XModPro/help/img/v5/Suggested next step
Add a chokidar watcher for the
img/subtree that re-runsmirrorDir()(or a single-file copy) onadd/change/unlinkevents. Debounce by file path the same way the markdown rebuild does.