@manojkmfsi/monodog 1.0.1

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.
Files changed (61) hide show
  1. package/.eslintrc.cjs +15 -0
  2. package/.turbo/turbo-build.log +4 -0
  3. package/CHANGELOG.md +79 -0
  4. package/LICENCE +21 -0
  5. package/README.md +55 -0
  6. package/dist/config-loader.js +116 -0
  7. package/dist/get-db-url.js +10 -0
  8. package/dist/gitService.js +242 -0
  9. package/dist/index.js +1370 -0
  10. package/dist/serve.js +103 -0
  11. package/dist/setup.js +155 -0
  12. package/dist/utils/ci-status.js +446 -0
  13. package/dist/utils/helpers.js +237 -0
  14. package/dist/utils/monorepo-scanner.js +486 -0
  15. package/dist/utils/utilities.js +414 -0
  16. package/monodog-conf.example.json +16 -0
  17. package/monodog-conf.json +16 -0
  18. package/monodog-dashboard/README.md +58 -0
  19. package/monodog-dashboard/dist/assets/index-2d967652.js +71 -0
  20. package/monodog-dashboard/dist/assets/index-504dc418.css +1 -0
  21. package/monodog-dashboard/dist/index.html +15 -0
  22. package/package.json +50 -0
  23. package/prisma/migrations/20251017041048_init/migration.sql +19 -0
  24. package/prisma/migrations/20251017083007_add_package/migration.sql +21 -0
  25. package/prisma/migrations/20251021083705_alter_package/migration.sql +37 -0
  26. package/prisma/migrations/20251022085155_test/migration.sql +2 -0
  27. package/prisma/migrations/20251022160841_/migration.sql +35 -0
  28. package/prisma/migrations/20251023130158_rename_column_name/migration.sql +34 -0
  29. package/prisma/migrations/20251023174837_/migration.sql +34 -0
  30. package/prisma/migrations/20251023175830_uodate_schema/migration.sql +32 -0
  31. package/prisma/migrations/20251024103700_add_dependency_info/migration.sql +13 -0
  32. package/prisma/migrations/20251025192150_add_dependency_info/migration.sql +19 -0
  33. package/prisma/migrations/20251025192342_add_dependency_info/migration.sql +40 -0
  34. package/prisma/migrations/20251025204613_add_dependency_info/migration.sql +8 -0
  35. package/prisma/migrations/20251026071336_add_dependency_info/migration.sql +25 -0
  36. package/prisma/migrations/20251027062626_add_commit/migration.sql +10 -0
  37. package/prisma/migrations/20251027062748_add_commit/migration.sql +23 -0
  38. package/prisma/migrations/20251027092741_add_commit/migration.sql +17 -0
  39. package/prisma/migrations/20251027112736_add_health_status/migration.sql +16 -0
  40. package/prisma/migrations/20251027140546_init_packages/migration.sql +16 -0
  41. package/prisma/migrations/20251029073436_added_package_heath_key/migration.sql +34 -0
  42. package/prisma/migrations/20251029073830_added_package_health_key/migration.sql +49 -0
  43. package/prisma/migrations/20251111091920_/migration.sql +16 -0
  44. package/prisma/migrations/20251211155036_cascade_on_auto_delete/migration.sql +48 -0
  45. package/prisma/migrations/migration_lock.toml +3 -0
  46. package/prisma/schema.prisma +114 -0
  47. package/release.config.js +41 -0
  48. package/src/config-loader.ts +119 -0
  49. package/src/get-db-url.ts +11 -0
  50. package/src/gitService.ts +277 -0
  51. package/src/index.ts +1554 -0
  52. package/src/serve.ts +87 -0
  53. package/src/setup.ts +164 -0
  54. package/src/types/monorepo-scanner.d.ts +32 -0
  55. package/src/utils/ci-status.ts +639 -0
  56. package/src/utils/helpers.js +203 -0
  57. package/src/utils/helpers.js.map +1 -0
  58. package/src/utils/helpers.ts +238 -0
  59. package/src/utils/monorepo-scanner.ts +599 -0
  60. package/src/utils/utilities.ts +483 -0
  61. package/tsconfig.json +16 -0
@@ -0,0 +1,34 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - Added the required column `packageHealthId` to the `Package` table without a default value. This is not possible if the table is not empty.
5
+
6
+ */
7
+ -- RedefineTables
8
+ PRAGMA defer_foreign_keys=ON;
9
+ PRAGMA foreign_keys=OFF;
10
+ CREATE TABLE "new_Package" (
11
+ "name" TEXT NOT NULL PRIMARY KEY,
12
+ "version" TEXT NOT NULL,
13
+ "type" TEXT NOT NULL,
14
+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
15
+ "lastUpdated" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
16
+ "dependencies" TEXT,
17
+ "maintainers" TEXT NOT NULL,
18
+ "path" TEXT NOT NULL,
19
+ "description" TEXT NOT NULL,
20
+ "license" TEXT NOT NULL,
21
+ "repository" TEXT,
22
+ "scripts" TEXT,
23
+ "status" TEXT NOT NULL DEFAULT '',
24
+ "devDependencies" TEXT,
25
+ "peerDependencies" TEXT,
26
+ "packageHealthId" INTEGER NOT NULL,
27
+ CONSTRAINT "Package_packageHealthId_fkey" FOREIGN KEY ("packageHealthId") REFERENCES "package_health" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
28
+ );
29
+ INSERT INTO "new_Package" ("createdAt", "dependencies", "description", "devDependencies", "lastUpdated", "license", "maintainers", "name", "path", "peerDependencies", "repository", "scripts", "status", "type", "version") SELECT "createdAt", "dependencies", "description", "devDependencies", "lastUpdated", "license", "maintainers", "name", "path", "peerDependencies", "repository", "scripts", "status", "type", "version" FROM "Package";
30
+ DROP TABLE "Package";
31
+ ALTER TABLE "new_Package" RENAME TO "Package";
32
+ CREATE UNIQUE INDEX "Package_name_key" ON "Package"("name");
33
+ PRAGMA foreign_keys=ON;
34
+ PRAGMA defer_foreign_keys=OFF;
@@ -0,0 +1,49 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `packageHealthId` on the `Package` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- RedefineTables
8
+ PRAGMA defer_foreign_keys=ON;
9
+ PRAGMA foreign_keys=OFF;
10
+ CREATE TABLE "new_Package" (
11
+ "name" TEXT NOT NULL PRIMARY KEY,
12
+ "version" TEXT NOT NULL,
13
+ "type" TEXT NOT NULL,
14
+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
15
+ "lastUpdated" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
16
+ "dependencies" TEXT,
17
+ "maintainers" TEXT NOT NULL,
18
+ "path" TEXT NOT NULL,
19
+ "description" TEXT NOT NULL,
20
+ "license" TEXT NOT NULL,
21
+ "repository" TEXT,
22
+ "scripts" TEXT,
23
+ "status" TEXT NOT NULL DEFAULT '',
24
+ "devDependencies" TEXT,
25
+ "peerDependencies" TEXT
26
+ );
27
+ INSERT INTO "new_Package" ("createdAt", "dependencies", "description", "devDependencies", "lastUpdated", "license", "maintainers", "name", "path", "peerDependencies", "repository", "scripts", "status", "type", "version") SELECT "createdAt", "dependencies", "description", "devDependencies", "lastUpdated", "license", "maintainers", "name", "path", "peerDependencies", "repository", "scripts", "status", "type", "version" FROM "Package";
28
+ DROP TABLE "Package";
29
+ ALTER TABLE "new_Package" RENAME TO "Package";
30
+ CREATE UNIQUE INDEX "Package_name_key" ON "Package"("name");
31
+ CREATE TABLE "new_package_health" (
32
+ "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
33
+ "packageName" TEXT NOT NULL,
34
+ "packageOverallScore" REAL NOT NULL,
35
+ "packageBuildStatus" TEXT NOT NULL,
36
+ "packageTestCoverage" REAL,
37
+ "packageLintStatus" TEXT NOT NULL,
38
+ "packageSecurity" TEXT NOT NULL,
39
+ "packageDependencies" TEXT NOT NULL,
40
+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
41
+ "updatedAt" DATETIME NOT NULL,
42
+ CONSTRAINT "package_health_packageName_fkey" FOREIGN KEY ("packageName") REFERENCES "Package" ("name") ON DELETE RESTRICT ON UPDATE CASCADE
43
+ );
44
+ INSERT INTO "new_package_health" ("createdAt", "id", "packageBuildStatus", "packageDependencies", "packageLintStatus", "packageName", "packageOverallScore", "packageSecurity", "packageTestCoverage", "updatedAt") SELECT "createdAt", "id", "packageBuildStatus", "packageDependencies", "packageLintStatus", "packageName", "packageOverallScore", "packageSecurity", "packageTestCoverage", "updatedAt" FROM "package_health";
45
+ DROP TABLE "package_health";
46
+ ALTER TABLE "new_package_health" RENAME TO "package_health";
47
+ CREATE UNIQUE INDEX "package_health_packageName_key" ON "package_health"("packageName");
48
+ PRAGMA foreign_keys=ON;
49
+ PRAGMA defer_foreign_keys=OFF;
@@ -0,0 +1,16 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the `Post` table. If the table is not empty, all the data it contains will be lost.
5
+ - You are about to drop the `User` table. If the table is not empty, all the data it contains will be lost.
6
+
7
+ */
8
+ -- DropTable
9
+ PRAGMA foreign_keys=off;
10
+ DROP TABLE "Post";
11
+ PRAGMA foreign_keys=on;
12
+
13
+ -- DropTable
14
+ PRAGMA foreign_keys=off;
15
+ DROP TABLE "User";
16
+ PRAGMA foreign_keys=on;
@@ -0,0 +1,48 @@
1
+ -- RedefineTables
2
+ PRAGMA defer_foreign_keys=ON;
3
+ PRAGMA foreign_keys=OFF;
4
+ CREATE TABLE "new_Commit" (
5
+ "hash" TEXT NOT NULL PRIMARY KEY,
6
+ "message" TEXT NOT NULL,
7
+ "author" TEXT NOT NULL,
8
+ "date" DATETIME,
9
+ "type" TEXT NOT NULL,
10
+ "packageName" TEXT NOT NULL,
11
+ CONSTRAINT "Commit_packageName_fkey" FOREIGN KEY ("packageName") REFERENCES "Package" ("name") ON DELETE CASCADE ON UPDATE CASCADE
12
+ );
13
+ INSERT INTO "new_Commit" ("author", "date", "hash", "message", "packageName", "type") SELECT "author", "date", "hash", "message", "packageName", "type" FROM "Commit";
14
+ DROP TABLE "Commit";
15
+ ALTER TABLE "new_Commit" RENAME TO "Commit";
16
+ CREATE TABLE "new_DependencyInfo" (
17
+ "name" TEXT NOT NULL,
18
+ "packageName" TEXT NOT NULL,
19
+ "version" TEXT NOT NULL,
20
+ "type" TEXT NOT NULL DEFAULT '',
21
+ "status" TEXT NOT NULL DEFAULT '',
22
+ "latest" TEXT,
23
+ "outdated" BOOLEAN NOT NULL DEFAULT false,
24
+ CONSTRAINT "DependencyInfo_packageName_fkey" FOREIGN KEY ("packageName") REFERENCES "Package" ("name") ON DELETE CASCADE ON UPDATE CASCADE
25
+ );
26
+ INSERT INTO "new_DependencyInfo" ("latest", "name", "outdated", "packageName", "status", "type", "version") SELECT "latest", "name", "outdated", "packageName", "status", "type", "version" FROM "DependencyInfo";
27
+ DROP TABLE "DependencyInfo";
28
+ ALTER TABLE "new_DependencyInfo" RENAME TO "DependencyInfo";
29
+ CREATE UNIQUE INDEX "DependencyInfo_name_packageName_key" ON "DependencyInfo"("name", "packageName");
30
+ CREATE TABLE "new_package_health" (
31
+ "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
32
+ "packageName" TEXT NOT NULL,
33
+ "packageOverallScore" REAL NOT NULL,
34
+ "packageBuildStatus" TEXT NOT NULL,
35
+ "packageTestCoverage" REAL,
36
+ "packageLintStatus" TEXT NOT NULL,
37
+ "packageSecurity" TEXT NOT NULL,
38
+ "packageDependencies" TEXT NOT NULL,
39
+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
40
+ "updatedAt" DATETIME NOT NULL,
41
+ CONSTRAINT "package_health_packageName_fkey" FOREIGN KEY ("packageName") REFERENCES "Package" ("name") ON DELETE CASCADE ON UPDATE CASCADE
42
+ );
43
+ INSERT INTO "new_package_health" ("createdAt", "id", "packageBuildStatus", "packageDependencies", "packageLintStatus", "packageName", "packageOverallScore", "packageSecurity", "packageTestCoverage", "updatedAt") SELECT "createdAt", "id", "packageBuildStatus", "packageDependencies", "packageLintStatus", "packageName", "packageOverallScore", "packageSecurity", "packageTestCoverage", "updatedAt" FROM "package_health";
44
+ DROP TABLE "package_health";
45
+ ALTER TABLE "new_package_health" RENAME TO "package_health";
46
+ CREATE UNIQUE INDEX "package_health_packageName_key" ON "package_health"("packageName");
47
+ PRAGMA foreign_keys=ON;
48
+ PRAGMA defer_foreign_keys=OFF;
@@ -0,0 +1,3 @@
1
+ # Please do not edit this file manually
2
+ # It should be added in your version-control system (i.e. Git)
3
+ provider = "sqlite"
@@ -0,0 +1,114 @@
1
+ // This is your Prisma schema file,
2
+ // learn more about it in the docs: https://pris.ly/d/prisma-schema
3
+
4
+ // Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
5
+ // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
6
+
7
+ generator client {
8
+ provider = "prisma-client-js"
9
+ }
10
+
11
+ datasource db {
12
+ provider = "sqlite"
13
+ url = env("DATABASE_URL")
14
+ }
15
+
16
+ // --- MONOREPO DATA MODEL ---
17
+
18
+ /// Represents a single package within the monorepo, based on the pnpm/package.json data.
19
+ model Package {
20
+ // Primary Key and Identity Field (using the package name as the unique ID)
21
+ // Example: '@monodog/dashboard'
22
+ name String @id @unique
23
+
24
+ // Core Package Metadata
25
+ version String
26
+ type String // e.g., 'app', 'package'
27
+
28
+ // Timestamps
29
+ createdAt DateTime @default(now())
30
+ lastUpdated DateTime @default(now())
31
+
32
+ // Key Metrics and Relationships
33
+ dependencies String? // The total number of direct dependencies
34
+ // Manual Serialization Required: Stores a JSON array string of maintainers, e.g., '["team-frontend"]'
35
+ maintainers String
36
+ // Manual Serialization Required: Stores a JSON array string of tags, e.g., '["core", "ui"]'
37
+ path String // The relative path in the file system, e.g., 'apps/dashboard'
38
+
39
+ // Descriptions and Configuration
40
+ description String
41
+ license String
42
+ repository String?
43
+
44
+ // Manual Serialization Required: Stores the scripts object as a JSON string
45
+ // Example: '{"dev": "vite", "build": "tsc && vite build"}'
46
+ scripts String?
47
+ status String @default("")
48
+
49
+ devDependencies String?
50
+ peerDependencies String?
51
+ dependenciesInfo DependencyInfo[]
52
+ commits Commit[]
53
+ packageHealth PackageHealth?
54
+ }
55
+
56
+ model DependencyInfo {
57
+ name String
58
+ packageName String
59
+ version String
60
+ type String @default("")
61
+ status String @default("")
62
+ latest String?
63
+ outdated Boolean @default(false)
64
+ package Package @relation(fields: [packageName], references: [name], onDelete: Cascade)
65
+
66
+ @@unique([name, packageName]) // Composite unique constraint
67
+ }
68
+
69
+ model Commit {
70
+ hash String @id
71
+ message String
72
+ author String
73
+ date DateTime?
74
+ type String
75
+ packageName String
76
+ package Package @relation(fields: [packageName], references: [name], onDelete: Cascade)
77
+ }
78
+
79
+ model HealthStatus {
80
+ id Int @id @default(autoincrement())
81
+
82
+ // Package reference (without formal relation)
83
+ packageName String @unique
84
+ // package Package @relation(fields: [packageName], references: [name], onDelete: Cascade)
85
+
86
+ // Health Metrics
87
+ overallScore Float // Overall health score (0-100)
88
+ buildStatus String // e.g., "passing", "failing", "unknown"
89
+ testCoverage Float // Test coverage percentage (0-100)
90
+ lintStatus String // e.g., "passing", "warning", "failing"
91
+ security String // e.g., "secure", "vulnerabilities", "unknown"
92
+ dependencies String // e.g., "up-to-date", "outdated", "vulnerable"
93
+ // Timestamps
94
+ createdAt DateTime @default(now())
95
+ updatedAt DateTime @updatedAt
96
+
97
+ @@map("health_status") // Optional: to specify the table name
98
+ }
99
+ model PackageHealth {
100
+ id Int @id @default(autoincrement())
101
+ packageName String @unique
102
+ packageOverallScore Float
103
+ packageBuildStatus String
104
+ packageTestCoverage Float?
105
+ packageLintStatus String
106
+ packageSecurity String // Changed from securityAudit to packageSecurity
107
+ packageDependencies String // Changed from dependencies to packageDependencies
108
+ createdAt DateTime @default(now())
109
+ updatedAt DateTime @updatedAt
110
+ package Package @relation(fields: [packageName], references: [name], onDelete: Cascade)
111
+
112
+ @@map("package_health")
113
+ }
114
+
@@ -0,0 +1,41 @@
1
+ // /**
2
+ // * Semantic Release configuration for a single package within a pnpm monorepo.
3
+ // * This configuration replaces the standard @semantic-release/npm plugin's
4
+ // * 'prepare' and 'publish' steps with pnpm commands via the @semantic-release/exec plugin
5
+ // * to avoid the "Cannot read properties of null (reading 'name')" error.
6
+ // */
7
+ // module.exports = {
8
+ // // Use the default commit analyzer and release notes generator
9
+ // plugins: [
10
+ // "@semantic-release/commit-analyzer",
11
+ // "@semantic-release/release-notes-generator",
12
+
13
+ // // --- FIX for pnpm ERROR ---
14
+ // // Instead of using the default "@semantic-release/npm", which fails
15
+ // // when running "npm version" in a pnpm workspace, we use @semantic-release/exec.
16
+ // [
17
+ // "@semantic-release/exec",
18
+ // {
19
+ // // 1. Prepare Step (Versioning)
20
+ // // Runs 'pnpm version' to update the package.json with the new version.
21
+ // // We use --no-git-tag-version because @semantic-release/git handles tags later.
22
+ // "prepareCmd": "pnpm version ${nextRelease.version} --no-git-tag-version --allow-same-version",
23
+
24
+ // // 2. Publish Step
25
+ // // Runs 'pnpm publish' to publish the package to the registry.
26
+ // "publishCmd": "pnpm publish"
27
+ // }
28
+ // ],
29
+
30
+ // // 3. Git Step
31
+ // // This plugin commits the updated package.json (from the prepareCmd)
32
+ // // and creates the Git tag for the release.
33
+ // [
34
+ // "@semantic-release/git",
35
+ // {
36
+ // "assets": ["package.json"], // Ensure the version bump is committed
37
+ // "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
38
+ // }
39
+ // ]
40
+ // ]
41
+ // };
@@ -0,0 +1,119 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+
4
+ // Define a type/interface for your configuration structure
5
+ interface MonodogConfig {
6
+ workspaces: [];
7
+ database: {
8
+ type: 'postgres' | 'mysql' | 'sqlite';
9
+ host: string;
10
+ port: number;
11
+ user: string;
12
+ path: string; // Used for SQLite path or general data storage path
13
+ };
14
+ dashboard: {
15
+ host: string;
16
+ port: number;
17
+ };
18
+ server: {
19
+ host: string;
20
+ port: number;
21
+ };
22
+ }
23
+
24
+ // Global variable to hold the loaded config
25
+ let config: MonodogConfig | null = null;
26
+
27
+ /**
28
+ * Loads the monodog-conf.json file from the monorepo root.
29
+ * This should be called only once during application startup.
30
+ * @returns The application configuration object.
31
+ */
32
+ function loadConfig(): MonodogConfig {
33
+ if (config) {
34
+ return config; // Return cached config if already loaded
35
+ }
36
+
37
+ // 1. Determine the path to the config file
38
+ // We assume the backend package is running from the monorepo root (cwd is root)
39
+ // or that we can navigate up to the root from the current file's location.
40
+ const rootPath = path.resolve(process.cwd()); // Adjust based on your workspace folder depth from root if needed
41
+ const configPath = path.resolve(rootPath, 'monodog-conf.json');
42
+ createConfigFileIfMissing(rootPath);
43
+
44
+ if (!fs.existsSync(configPath)) {
45
+ console.error(`ERROR1: Configuration file not found at ${configPath}`);
46
+ process.exit(1);
47
+ }
48
+
49
+ try {
50
+ // 2. Read and parse the JSON file
51
+ const fileContent = fs.readFileSync(configPath, 'utf-8');
52
+ const parsedConfig = JSON.parse(fileContent) as MonodogConfig;
53
+
54
+ // 3. Optional: Add validation logic here (e.g., check if ports are numbers)
55
+
56
+ // Cache and return
57
+ config = parsedConfig;
58
+ process.stderr.write('[Config] Loaded configuration from: ...\n');
59
+ return config;
60
+ } catch (error) {
61
+ console.error('ERROR: Failed to read or parse monodog-conf.json.');
62
+ console.error(error);
63
+ process.exit(1);
64
+ }
65
+ }
66
+
67
+ function createConfigFileIfMissing(rootPath: string): void {
68
+ // --- CONFIGURATION ---
69
+ const configFileName = 'monodog-conf.json';
70
+ const configFilePath = path.resolve(rootPath, configFileName);
71
+
72
+ // The default content for the configuration file
73
+ const defaultContent = {
74
+ workspaces: [],
75
+ database: {
76
+ path: 'file:./monodog.db', // SQLite database file path, relative to prisma schema location
77
+ },
78
+ dashboard: {
79
+ host: '0.0.0.0',
80
+ port: '3010',
81
+ },
82
+ server: {
83
+ host: '0.0.0.0', // Default host for the API server
84
+ port: 8999, // Default port for the API server
85
+ },
86
+ };
87
+
88
+ const contentString = JSON.stringify(defaultContent, null, 2);
89
+ // ---------------------
90
+
91
+ process.stderr.write(`\n[monodog] Checking for ${configFileName}...`);
92
+
93
+ if (fs.existsSync(configFilePath)) {
94
+ process.stderr.write(
95
+ `[monodog] ${configFileName} already exists at ${configFilePath}. Skipping creation.`
96
+ );
97
+ } else {
98
+ try {
99
+ // Write the default content to the file
100
+ fs.writeFileSync(configFilePath, contentString, 'utf-8');
101
+ process.stderr.write(
102
+ `[monodog] Successfully generated default ${configFileName} in the workspace root.`
103
+ );
104
+ process.stderr.write(
105
+ '[monodog] Please review and update settings like "host" and "port".'
106
+ );
107
+ } catch (err: unknown) {
108
+ const message = err instanceof Error ? err.message : String(err);
109
+ console.error(
110
+ `[monodog Error] Failed to generate ${configFileName}:`,
111
+ message
112
+ );
113
+ process.exit(1);
114
+ }
115
+ }
116
+ }
117
+ const appConfig = loadConfig();
118
+ export { appConfig };
119
+
@@ -0,0 +1,11 @@
1
+ import { appConfig } from './config-loader';
2
+
3
+ function generateUrl() {
4
+ // const appConfig = loadConfig();
5
+
6
+ const DATABASE_URL = `${appConfig.database.path}`;
7
+ process.env.DATABASE_URL = DATABASE_URL;
8
+ process.stdout.write(DATABASE_URL);
9
+ }
10
+
11
+ generateUrl();