fix: update nodemon and start scripts to include --no-node-snapshot option; add prepare-native-deps script for isolated-vm management

This commit is contained in:
Nawaz Dhandala
2026-04-02 23:24:12 +01:00
parent 8d07271aa1
commit 46a698b4be
4 changed files with 31 additions and 3 deletions

View File

@@ -16,5 +16,5 @@
"TS_NODE_TRANSPILE_ONLY": "1",
"TS_NODE_FILES": "false"
},
"exec": "node -r ts-node/register/transpile-only Index.ts"
}
"exec": "node --no-node-snapshot -r ts-node/register/transpile-only Index.ts"
}

View File

@@ -26,7 +26,7 @@
"watch-frontend:status-page": "bash ./scripts/frontend-run.sh FeatureSet/StatusPage dev-build --watch",
"watch-frontend:public-dashboard": "bash ./scripts/frontend-run.sh FeatureSet/PublicDashboard dev-build --watch",
"dev:api": "npx nodemon",
"start": "export NODE_OPTIONS='--max-old-space-size=8096' && node --require ts-node/register Index.ts",
"start": "export NODE_OPTIONS='--max-old-space-size=8096' && node --no-node-snapshot --require ts-node/register Index.ts",
"compile": "tsc",
"clear-modules": "rm -rf node_modules && rm package-lock.json && npm install",
"dev": "bash ./scripts/dev.sh",

View File

@@ -31,6 +31,8 @@ pids+=($!)
npm run watch-frontend:public-dashboard &
pids+=($!)
bash ./scripts/prepare-native-deps.sh
npm run dev:api &
pids+=($!)

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
common_dir="/usr/src/Common"
if [ ! -d "${common_dir}/node_modules/isolated-vm" ]; then
echo "Installing Common dependencies..."
npm --prefix "${common_dir}" install
fi
if (
cd "${common_dir}" &&
node --no-node-snapshot -e "require('isolated-vm')"
) >/dev/null 2>&1; then
exit 0
fi
echo "Rebuilding isolated-vm for Node $(node -p 'process.version')..."
npm --prefix "${common_dir}" rebuild isolated-vm
(
cd "${common_dir}" &&
node --no-node-snapshot -e "require('isolated-vm')"
) >/dev/null