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.
Changes
@@@ -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');@@@ -13,6 +13,7 @@ for f in $(git diff --name-only HEAD "origin/$(git rev-parse --abbrev-ref HEAD)"donegit 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" ] || continueif 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); fidone@@@ -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" ] || continuefor dep in $(node -e 'console.log(Object.keys(require("./"+process.argv[1]+"package.json").dependencies||{}).join(" "))' "$app"); doif [ ! -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" ] || continuemkdir -p "$app/data"(cd "$app" && node -e "const D=require('better-sqlite3'); new D(':memory:').close(); require('../_shared/guard')") \
@@ -50,4 +50,11 @@ assert.throws(() => requireShared('next', { appsDir: dir, version: '1.0.0' }), /
@@ -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');
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 });
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');
console.log('_shared version: all checks passed');
@@ -13,6 +13,7 @@ for f in $(git diff --name-only HEAD "origin/$(git rev-parse --abbrev-ref HEAD)"
@@ -13,6 +13,7 @@ for f in $(git diff --name-only HEAD "origin/$(git rev-parse --abbrev-ref HEAD)"
done
done
git pull -q --ff-only; AFTER=$(git rev-parse HEAD)
git pull -q --ff-only; AFTER=$(git rev-parse HEAD)
for app in apps/*/; do
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
[ -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
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
done
@@ -20,6 +21,7 @@ done
@@ -20,6 +21,7 @@ done
# file: link can leave an empty directory npm treats as installed (2026-09-23: vendor/openvibe-shared
# 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.
# kept an untracked lockfile, every unit crash-looped on 'openvibe-shared/brand'); reinstall those.
for app in apps/*/; do
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
[ -f "$app/package.json" ] || continue
for dep in $(node -e 'console.log(Object.keys(require("./"+process.argv[1]+"package.json").dependencies||{}).join(" "))' "$app"); do
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
if [ ! -f "$app/node_modules/$dep/package.json" ]; then
@@ -39,6 +41,7 @@ done
@@ -39,6 +41,7 @@ done
# Every app keeps its guard (apps/_shared/guard) state in data/guard.db through its own better-sqlite3;
# 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.
# the units' ReadWritePaths name each data directory, which must exist before systemd starts them.
for app in apps/*/; do
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
[ -f "$app/package.json" ] || continue
mkdir -p "$app/data"
mkdir -p "$app/data"
(cd "$app" && node -e "const D=require('better-sqlite3'); new D(':memory:').close(); require('../_shared/guard')") \
(cd "$app" && node -e "const D=require('better-sqlite3'); new D(':memory:').close(); require('../_shared/guard')") \