mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 23:19:43 +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:
@@ -312,6 +312,20 @@ if (isGlobalInstall) {
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 4b. Fetch gesture-overlay runtime assets (MediaPipe wasm + model) for dev mode
|
||||
// (src/web/public/gesture/). Opt-in feature (CODEMAN_GESTURE=1); non-fatal.
|
||||
// Large binaries kept out of git; the build copies them into dist/.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
if (!isGlobalInstall) {
|
||||
try {
|
||||
execSync(`node "${join(import.meta.dirname, 'fetch-gesture-assets.mjs')}"`, { stdio: 'inherit' });
|
||||
} catch {
|
||||
// Non-fatal — the gesture overlay is opt-in.
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 5. Install git pre-commit hook (format check)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user