openvibers/openvibe.tools Commits

deploy.sh: apps/_shared is not an app. Now that it has a package.json (37e6cf3), the install, dependency and guard-preflight loops over apps/*/ took it for one, and the guard preflight aborted the deploy (nothing restarted) trying to load better-sqlite3 from it. Each loop skips apps/_*; version.test.js checks they keep doing so.

OP OpenVibers committed 26 Sept 2026 · 9102d600e0 · 2 files, +10 −0


Changes

ddiff --git a/apps/_shared/test/version.test.js b/apps/_shared/test/version.test.js
iindex cc14ad0..f9cbb87 100644
---- a/apps/_shared/test/version.test.js
++++ b/apps/_shared/test/version.test.js
@@@ -50,4 +50,11 @@ assert.throws(() => requireShared('next', { appsDir: dir, version: '1.0.0' }), /
assert.throws(() => require('../release').toolsRelease('no-such-app', require), /declares no "openvibeToolsShared" range/, 'toolsRelease refuses an undeclared app before anything else');
fs.rmSync(dir, { recursive: true, force: true });
++// deploy.sh walks apps/*/ to install, resolve and preflight each app; _shared has a package.json now
++// but is not an app (2026-09-26: the guard preflight tried to load better-sqlite3 from it and aborted).
++const deploy = fs.readFileSync(path.join(APPS, '..', 'deploy', 'scripts', 'deploy.sh'), 'utf8');
++const loops = deploy.split('\n').map((l, i, all) => [l, all[i + 1] || '']).filter(([l]) => /^for app in apps\/\*\/; do/.test(l));
++assert.ok(loops.length >= 3, 'deploy.sh has its app loops');
++for (const [, next] of loops) assert.match(next, /case "\$app" in apps\/_\*\) continue ;; esac/, 'each app loop in deploy.sh skips apps/_*');
++
console.log('_shared version: all checks passed');
ddiff --git a/deploy/scripts/deploy.sh b/deploy/scripts/deploy.sh
iindex 431f3a2..8970924 100755
---- a/deploy/scripts/deploy.sh
++++ b/deploy/scripts/deploy.sh
@@@ -13,6 +13,7 @@ for f in $(git diff --name-only HEAD "origin/$(git rev-parse --abbrev-ref HEAD)"
done
git pull -q --ff-only; AFTER=$(git rev-parse HEAD)
for app in apps/*/; do
++ case "$app" in apps/_*) continue ;; esac # apps/_shared is a package the apps require, not an app
[ -f "$app/package.json" ] || continue
if git diff --name-only "$BEFORE" "$AFTER" -- "$app/package.json" | grep -q . || [ ! -d "$app/node_modules" ]; then (cd "$app" && npm install --omit=dev --no-audit --no-fund --loglevel=error); fi
done
@@@ -20,6 +21,7 @@ done
# file: link can leave an empty directory npm treats as installed (2026-09-23: vendor/openvibe-shared
# kept an untracked lockfile, every unit crash-looped on 'openvibe-shared/brand'); reinstall those.
for app in apps/*/; do
++ case "$app" in apps/_*) continue ;; esac # apps/_shared is a package the apps require, not an app
[ -f "$app/package.json" ] || continue
for dep in $(node -e 'console.log(Object.keys(require("./"+process.argv[1]+"package.json").dependencies||{}).join(" "))' "$app"); do
if [ ! -f "$app/node_modules/$dep/package.json" ]; then
@@@ -39,6 +41,7 @@ done
# Every app keeps its guard (apps/_shared/guard) state in data/guard.db through its own better-sqlite3;
# the units' ReadWritePaths name each data directory, which must exist before systemd starts them.
for app in apps/*/; do
++ case "$app" in apps/_*) continue ;; esac # apps/_shared is a package the apps require, not an app
[ -f "$app/package.json" ] || continue
mkdir -p "$app/data"
(cd "$app" && node -e "const D=require('better-sqlite3'); new D(':memory:').close(); require('../_shared/guard')") \