@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.
- package/dist/config-loader.js +9 -5
- package/monodog-conf.json +12 -0
- package/package.json +2 -2
- package/src/config-loader.ts +10 -5
package/dist/config-loader.js
CHANGED
|
@@ -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
|
-
|
|
54
|
-
|
|
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(`
|
|
57
|
-
//
|
|
58
|
-
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monodog/backend",
|
|
3
|
-
"version": "1.2
|
|
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": "
|
|
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" },
|
package/src/config-loader.ts
CHANGED
|
@@ -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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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 {
|