@scriptdb/server 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +37 -4
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2890,8 +2890,6 @@ try {
|
|
|
2890
2890
|
if (fs2.existsSync(configPath)) {
|
|
2891
2891
|
const configContent = fs2.readFileSync(configPath, "utf8");
|
|
2892
2892
|
fileConfig = JSON.parse(configContent);
|
|
2893
|
-
console.log("Loaded config from:", configPath);
|
|
2894
|
-
console.log("Config users:", fileConfig.users);
|
|
2895
2893
|
} else {
|
|
2896
2894
|
console.log("No config file found at:", configPath, "- using defaults");
|
|
2897
2895
|
}
|
|
@@ -4358,7 +4356,7 @@ import { spawn } from "node:child_process";
|
|
|
4358
4356
|
import Storage from "@scriptdb/storage";
|
|
4359
4357
|
var pkgData = `{
|
|
4360
4358
|
"name": "scriptdb-workspace",
|
|
4361
|
-
"version": "1.0.
|
|
4359
|
+
"version": "1.0.7",
|
|
4362
4360
|
"description": "ScriptDB workspace for custom scripts, services, and databases",
|
|
4363
4361
|
"private": true,
|
|
4364
4362
|
"devDependencies": {
|
|
@@ -4405,6 +4403,31 @@ var dotGitignoreData = `
|
|
|
4405
4403
|
# Ignore all files in this directory
|
|
4406
4404
|
node_modules/
|
|
4407
4405
|
`;
|
|
4406
|
+
var ecosystemData = `
|
|
4407
|
+
module.exports = {
|
|
4408
|
+
apps: [{
|
|
4409
|
+
name: 'scriptdb',
|
|
4410
|
+
script: process.platform === 'win32'
|
|
4411
|
+
? require('path').join(require('os').homedir(), '.scriptdb', 'bin', 'scriptdb.exe')
|
|
4412
|
+
: 'scriptdb',
|
|
4413
|
+
args: 'start --force',
|
|
4414
|
+
cwd: require('path').join(require('os').homedir(), '.scriptdb'),
|
|
4415
|
+
instances: 1,
|
|
4416
|
+
autorestart: true,
|
|
4417
|
+
watch: false,
|
|
4418
|
+
max_memory_restart: '1G',
|
|
4419
|
+
env: {
|
|
4420
|
+
NODE_ENV: 'production'
|
|
4421
|
+
},
|
|
4422
|
+
error_file: require('path').join(require('os').homedir(), '.scriptdb', 'pm2-error.log'),
|
|
4423
|
+
out_file: require('path').join(require('os').homedir(), '.scriptdb', 'pm2-out.log'),
|
|
4424
|
+
log_file: require('path').join(require('os').homedir(), '.scriptdb', 'pm2-combined.log'),
|
|
4425
|
+
time: true,
|
|
4426
|
+
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
|
4427
|
+
merge_logs: true
|
|
4428
|
+
}]
|
|
4429
|
+
};
|
|
4430
|
+
`;
|
|
4408
4431
|
var configDefault = {
|
|
4409
4432
|
PORT: 3800,
|
|
4410
4433
|
HOST: "127.0.0.1",
|
|
@@ -4495,11 +4518,13 @@ async function setupDir() {
|
|
|
4495
4518
|
const databasesDir = path2.join(scriptdbDir, "databases");
|
|
4496
4519
|
const servicesDir = path2.join(scriptdbDir, "services");
|
|
4497
4520
|
const clientsDir = path2.join(scriptdbDir, "clients");
|
|
4521
|
+
const binDir = path2.join(scriptdbDir, "bin");
|
|
4498
4522
|
const configFile = path2.join(scriptdbDir, "config.json");
|
|
4499
4523
|
const gitignoreFile = path2.join(scriptdbDir, ".gitignore");
|
|
4500
4524
|
const packageJsonFile = path2.join(scriptdbDir, "package.json");
|
|
4501
4525
|
const tsconfigFile = path2.join(scriptdbDir, "tsconfig.json");
|
|
4502
|
-
const
|
|
4526
|
+
const ecosystemFile = path2.join(scriptdbDir, "ecosystem.config.js");
|
|
4527
|
+
const isFullySetup = fs3.existsSync(scriptdbDir) && fs3.existsSync(databasesDir) && fs3.existsSync(servicesDir) && fs3.existsSync(clientsDir) && fs3.existsSync(binDir) && fs3.existsSync(configFile) && fs3.existsSync(gitignoreFile) && fs3.existsSync(packageJsonFile) && fs3.existsSync(tsconfigFile) && fs3.existsSync(ecosystemFile);
|
|
4503
4528
|
if (isFullySetup) {
|
|
4504
4529
|
console.log("ScriptDB directory already fully configured:", scriptdbDir);
|
|
4505
4530
|
return;
|
|
@@ -4510,10 +4535,12 @@ async function setupDir() {
|
|
|
4510
4535
|
fs3.mkdirSync(databasesDir, { recursive: true });
|
|
4511
4536
|
fs3.mkdirSync(servicesDir, { recursive: true });
|
|
4512
4537
|
fs3.mkdirSync(clientsDir, { recursive: true });
|
|
4538
|
+
fs3.mkdirSync(binDir, { recursive: true });
|
|
4513
4539
|
fs3.writeFileSync(configFile, JSON.stringify(configDefault, null, 2), "utf8");
|
|
4514
4540
|
fs3.writeFileSync(gitignoreFile, dotGitignoreData, "utf8");
|
|
4515
4541
|
fs3.writeFileSync(packageJsonFile, pkgData, "utf8");
|
|
4516
4542
|
fs3.writeFileSync(tsconfigFile, tsconfigData, "utf8");
|
|
4543
|
+
fs3.writeFileSync(ecosystemFile, ecosystemData, "utf8");
|
|
4517
4544
|
console.log("Created:", scriptdbDir);
|
|
4518
4545
|
await installPackage(scriptdbDir);
|
|
4519
4546
|
await setupStorage(scriptdbDir);
|
|
@@ -4527,6 +4554,9 @@ async function setupDir() {
|
|
|
4527
4554
|
if (!fs3.existsSync(clientsDir)) {
|
|
4528
4555
|
fs3.mkdirSync(clientsDir, { recursive: true });
|
|
4529
4556
|
}
|
|
4557
|
+
if (!fs3.existsSync(binDir)) {
|
|
4558
|
+
fs3.mkdirSync(binDir, { recursive: true });
|
|
4559
|
+
}
|
|
4530
4560
|
if (!fs3.existsSync(configFile)) {
|
|
4531
4561
|
fs3.writeFileSync(configFile, JSON.stringify(configDefault, null, 2), "utf8");
|
|
4532
4562
|
}
|
|
@@ -4539,6 +4569,9 @@ async function setupDir() {
|
|
|
4539
4569
|
if (!fs3.existsSync(tsconfigFile)) {
|
|
4540
4570
|
fs3.writeFileSync(tsconfigFile, tsconfigData, "utf8");
|
|
4541
4571
|
}
|
|
4572
|
+
if (!fs3.existsSync(ecosystemFile)) {
|
|
4573
|
+
fs3.writeFileSync(ecosystemFile, ecosystemData, "utf8");
|
|
4574
|
+
}
|
|
4542
4575
|
if (!fs3.existsSync(path2.join(scriptdbDir, "node_modules"))) {
|
|
4543
4576
|
await installPackage(scriptdbDir);
|
|
4544
4577
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scriptdb/server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "server module resolver for script database",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"typescript": "^5.0.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@scriptdb/client": "^1.0.
|
|
45
|
-
"@scriptdb/storage": "^1.0.
|
|
46
|
-
"@scriptdb/system-modules": "^1.0.
|
|
47
|
-
"@scriptdb/vm": "^1.0.
|
|
44
|
+
"@scriptdb/client": "^1.0.7",
|
|
45
|
+
"@scriptdb/storage": "^1.0.7",
|
|
46
|
+
"@scriptdb/system-modules": "^1.0.7",
|
|
47
|
+
"@scriptdb/vm": "^1.0.7",
|
|
48
48
|
"@types/ws": "^8.18.1",
|
|
49
49
|
"bcryptjs": "^3.0.3",
|
|
50
50
|
"bottleneck": "^2.19.5",
|