mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-07 07:59:42 +02:00
build(gesture): fetch MediaPipe wasm + model at install/build instead of committing
The self-hosted gesture assets (~27MB of wasm runtime + gesture_recognizer.task) were committed to the repo. Replace that with scripts/fetch-gesture-assets.mjs, which downloads them into src/web/public/gesture/ — idempotent (skips existing) and non-fatal (the overlay is opt-in via CODEMAN_GESTURE=1, so a fetch failure only warns). Wired into: - postinstall.js (dev: populates src/web/public/gesture for `npm run dev`) - build.mjs (before `cp -r src/web/public dist/web/`, so prod/dist gets them) The files are already covered by the bare `public` .gitignore rule, so they stay untracked. The overlay bundle (gesture-codeman.js) remains committed — it's built from a separate repo and is small. Pin @mediapipe wasm to 0.10.21 to match the bundled tasks-vision API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,9 @@ run('chmod dist/index.js', 'chmod +x dist/index.js');
|
||||
// 2. Copy static assets (clean first to remove stale hashed files from previous builds)
|
||||
run('clean public', 'rm -rf dist/web/public');
|
||||
run('prepare dirs', 'mkdir -p dist/web dist/templates dist/web/public/vendor');
|
||||
// Fetch the opt-in gesture overlay's MediaPipe wasm + model into src/ (idempotent,
|
||||
// non-fatal, kept out of git) so the copy below carries them into dist/.
|
||||
run('gesture assets', 'node scripts/fetch-gesture-assets.mjs');
|
||||
run('copy web assets', 'cp -r src/web/public dist/web/');
|
||||
run('copy template', 'cp src/templates/case-template.md dist/templates/');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user