@monodog/backend 1.2.9 → 1.3.2

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.
@@ -50,12 +50,16 @@ function loadConfig() {
50
50
  // 1. Determine the path to the config file
51
51
  // We assume the backend package is running from the monorepo root (cwd is root)
52
52
  // or that we can navigate up to the root from the current file's location.
53
- const rootPath = path.resolve(process.cwd()); // Adjust based on your workspace folder depth from root if needed
54
- const configPath = path.resolve(rootPath, 'monodog-conf.json');
53
+ let rootPath = path.resolve(process.cwd()); // Adjust based on your workspace folder depth from root if needed
54
+ let configPath = path.resolve(rootPath, 'monodog-conf.json');
55
55
  if (!fs.existsSync(configPath)) {
56
- console.error(`ERROR: Configuration file not found at ${configPath}`);
57
- // A missing config is a critical failure, so we exit
58
- process.exit(1);
56
+ // console.error(`ERRORu: Configuration file not found at ${configPath}`);
57
+ rootPath = path.resolve('../../'); //get root config, Adjust based on your workspace folder depth from root if needed
58
+ configPath = path.resolve(rootPath, 'monodog-conf.json');
59
+ if (!fs.existsSync(configPath)) {
60
+ console.error(`ERRORp: Configuration file not found at ${configPath}`);
61
+ process.exit(1);
62
+ }
59
63
  }
60
64
  try {
61
65
  // 2. Read and parse the JSON file
@@ -0,0 +1,12 @@
1
+ {
2
+ "workspace": {
3
+ "root_dir": "../../"
4
+ },
5
+ "database": {
6
+ "path": "file:./monolite.db"
7
+ },
8
+ "server": {
9
+ "host": "0.0.0.0",
10
+ "port": 4002
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monodog/backend",
3
- "version": "1.2.9",
3
+ "version": "1.3.2",
4
4
  "description": "Backend API server for monodog monorepo dashboard",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  "clean": "rm -rf dist node_modules/.cache",
18
18
  "lint": "eslint .",
19
19
  "lint:fix": "eslint . --fix",
20
- "db:url": "ts-node src/get-db-url.ts",
20
+ "db:url": "node dist/get-db-url.ts",
21
21
  "generate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma generate",
22
22
  "migrate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate dev",
23
23
  "serve": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') node dist/cli.js --serve" },
@@ -35,13 +35,18 @@ export function loadConfig(): MonodogConfig {
35
35
  // 1. Determine the path to the config file
36
36
  // We assume the backend package is running from the monorepo root (cwd is root)
37
37
  // or that we can navigate up to the root from the current file's location.
38
- const rootPath = path.resolve(process.cwd()); // Adjust based on your workspace folder depth from root if needed
39
- const configPath = path.resolve(rootPath, 'monodog-conf.json');
38
+ let rootPath = path.resolve(process.cwd()); // Adjust based on your workspace folder depth from root if needed
39
+ let configPath = path.resolve(rootPath, 'monodog-conf.json');
40
40
 
41
41
  if (!fs.existsSync(configPath)) {
42
- console.error(`ERROR: Configuration file not found at ${configPath}`);
43
- // A missing config is a critical failure, so we exit
44
- process.exit(1);
42
+ // console.error(`ERRORu: Configuration file not found at ${configPath}`);
43
+ rootPath = path.resolve('../../'); //get root config, Adjust based on your workspace folder depth from root if needed
44
+ configPath = path.resolve(rootPath, 'monodog-conf.json');
45
+
46
+ if (!fs.existsSync(configPath)) {
47
+ console.error(`ERRORp: Configuration file not found at ${configPath}`);
48
+ process.exit(1);
49
+ }
45
50
  }
46
51
 
47
52
  try {