From f6a1be5e803af44059be6245116c6396118f8d69 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 30 Nov 2025 21:16:49 -0600 Subject: [PATCH] Replace backend build script in package.json with a Node.js script for improved compatibility and maintainability. Added new build-backend.js script to handle the backend build process using Python. --- package.json | 2 +- scripts/build-backend.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 scripts/build-backend.js diff --git a/package.json b/package.json index 2a3ca5e..14d2fcf 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "watch": "npm run build-frontend -- --watch", "build-frontend": "vite build", - "build-backend": "venv/bin/python setup.py build", + "build-backend": "node scripts/build-backend.js", "build": "npm run build-frontend && npm run build-backend", "electron-postinstall": "electron-builder install-app-deps", "electron": "npm run electron-postinstall && npm run build && electron .", diff --git a/scripts/build-backend.js b/scripts/build-backend.js new file mode 100755 index 0000000..c4a28bd --- /dev/null +++ b/scripts/build-backend.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +const { execSync } = require('child_process'); +const path = require('path'); +const os = require('os'); + +const platform = os.platform(); +const venvPython = platform === 'win32' + ? path.join('venv', 'Scripts', 'python.exe') + : path.join('venv', 'bin', 'python'); + +try { + execSync(`${venvPython} setup.py build`, { stdio: 'inherit' }); +} catch (error) { + console.error('Build failed:', error.message); + process.exit(1); +} +