mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-16 09:13:36 +00:00
fix: update legacy runtime path
- Changed the legacy runtime path from 'legacy-runtime.js' to 'index.js' in runtime configuration. - Added a new start script (start.js) to check for the existence of the built TypeScript server entrypoint and import it.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
// Load environment variables before other imports execute
|
||||
import './load-env.js';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname } from 'path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const distEntrypoint = path.join(__dirname, 'dist', 'bootstrap.js');
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const installMode = fs.existsSync(path.join(__dirname, '..', '.git')) ? 'git' : 'npm';
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@ export function getRuntimePaths(): RuntimePaths {
|
||||
serverSrcDir,
|
||||
serverDir,
|
||||
projectRoot: path.resolve(serverDir, '..'),
|
||||
legacyRuntimePath: path.join(serverDir, 'legacy-runtime.js'),
|
||||
legacyRuntimePath: path.join(serverDir, 'index.js'),
|
||||
bootstrapEntrypointPath: path.join(serverDir, 'dist', 'bootstrap.js'),
|
||||
};
|
||||
}
|
||||
|
||||
18
server/start.js
Normal file
18
server/start.js
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env node
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const distEntrypoint = path.join(__dirname, 'dist', 'bootstrap.js');
|
||||
|
||||
if (!fs.existsSync(distEntrypoint)) {
|
||||
console.error(
|
||||
'[server] Missing built TypeScript server entrypoint at server/dist/bootstrap.js. ' +
|
||||
'Run "npm run server" for development or "npm run server:build" before "npm run server:start".'
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await import('./dist/bootstrap.js');
|
||||
Reference in New Issue
Block a user