@monodog/backend 1.2.7 → 1.2.9
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/cli.js +2 -2
- package/dist/config-loader.js +1 -1
- package/dist/get-db-url.js +11 -0
- package/package.json +1 -1
- package/src/cli.ts +2 -2
- package/src/config-loader.ts +1 -1
- package/{get-db-url.ts → src/get-db-url.ts} +1 -1
package/dist/cli.js
CHANGED
|
@@ -133,8 +133,8 @@ function copyPackageToWorkspace(rootDir) {
|
|
|
133
133
|
console.error("Error: Please provide the package name as an argument if you want to setup dashboard.");
|
|
134
134
|
console.log("Usage: pnpm monodog-cli @monodog/dashboard --serve --root .");
|
|
135
135
|
}
|
|
136
|
-
if (packageName !== '@monodog/
|
|
137
|
-
console.log("\n--- Skipping workspace setup for @monodog/
|
|
136
|
+
if (packageName !== '@monodog/backend') {
|
|
137
|
+
console.log("\n--- Skipping workspace setup for @monodog/backend to avoid self-copying. ---");
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
// const rootDir = process.cwd();
|
package/dist/config-loader.js
CHANGED
|
@@ -50,7 +50,7 @@ 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(
|
|
53
|
+
const rootPath = path.resolve(process.cwd()); // Adjust based on your workspace folder depth from root if needed
|
|
54
54
|
const configPath = path.resolve(rootPath, 'monodog-conf.json');
|
|
55
55
|
if (!fs.existsSync(configPath)) {
|
|
56
56
|
console.error(`ERROR: Configuration file not found at ${configPath}`);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_loader_1 = require("./config-loader");
|
|
4
|
+
function generateUrl() {
|
|
5
|
+
const appConfig = (0, config_loader_1.loadConfig)();
|
|
6
|
+
const DATABASE_URL = `${appConfig.database.path}`;
|
|
7
|
+
process.env.DATABASE_URL = DATABASE_URL;
|
|
8
|
+
process.env.DATABASE_PORT = `${appConfig.database.port}`;
|
|
9
|
+
process.stdout.write(DATABASE_URL);
|
|
10
|
+
}
|
|
11
|
+
generateUrl();
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -108,8 +108,8 @@ function copyPackageToWorkspace(rootDir: string): void {
|
|
|
108
108
|
console.error("Error: Please provide the package name as an argument if you want to setup dashboard.");
|
|
109
109
|
console.log("Usage: pnpm monodog-cli @monodog/dashboard --serve --root .");
|
|
110
110
|
}
|
|
111
|
-
if(packageName !== '@monodog/
|
|
112
|
-
console.log("\n--- Skipping workspace setup for @monodog/
|
|
111
|
+
if(packageName !== '@monodog/backend'){
|
|
112
|
+
console.log("\n--- Skipping workspace setup for @monodog/backend to avoid self-copying. ---");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
|
package/src/config-loader.ts
CHANGED
|
@@ -35,7 +35,7 @@ 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
|
-
|
|
38
|
+
const rootPath = path.resolve(process.cwd()); // Adjust based on your workspace folder depth from root if needed
|
|
39
39
|
const configPath = path.resolve(rootPath, 'monodog-conf.json');
|
|
40
40
|
|
|
41
41
|
if (!fs.existsSync(configPath)) {
|