feat: migrate scripts to Bun runtime
- Updated shebangs in user-message-hook.js, worker-cli.js, and worker-service.cjs to use Bun instead of Node. - Modified build-hooks.js to generate Bun-compatible shebangs in built scripts. - Enhanced sync-marketplace.cjs to trigger a worker restart after syncing files via an HTTP request. - Improved worker-cli.ts to exit with appropriate status codes after executing commands. - Added build-worker-binary.js to create a Windows executable for the worker service using Bun's compile feature.
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Build Windows executable for claude-mem worker service
|
||||
* Uses Bun's compile feature to create a standalone exe
|
||||
*/
|
||||
|
||||
import { execSync } from 'child_process';
|
||||
import fs from 'fs';
|
||||
|
||||
const version = JSON.parse(fs.readFileSync('package.json', 'utf-8')).version;
|
||||
const outDir = 'dist/binaries';
|
||||
|
||||
fs.mkdirSync(outDir, { recursive: true });
|
||||
|
||||
console.log(`Building Windows exe v${version}...`);
|
||||
|
||||
try {
|
||||
execSync(
|
||||
`bun build --compile --minify --target=bun-windows-x64 ./src/services/worker-service.ts --outfile ${outDir}/worker-service-v${version}-win-x64.exe`,
|
||||
{ stdio: 'inherit' }
|
||||
);
|
||||
console.log(`\nBuilt: ${outDir}/worker-service-v${version}-win-x64.exe`);
|
||||
} catch (error) {
|
||||
console.error('Failed to build Windows binary:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user