@friggframework/core 2.0.0--canary.461.74b99c9.0 → 2.0.0--canary.461.862ddf0.0
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/database/config.js
CHANGED
|
@@ -4,27 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Determines database type from
|
|
7
|
+
* Determines database type from environment or app definition
|
|
8
8
|
*
|
|
9
9
|
* Detection order:
|
|
10
|
-
* 1.
|
|
10
|
+
* 1. DB_TYPE environment variable (set for migration handlers)
|
|
11
11
|
* 2. App definition (backend/index.js Definition.database configuration)
|
|
12
12
|
*
|
|
13
13
|
* @returns {'mongodb'|'postgresql'} Database type
|
|
14
14
|
* @throws {Error} If database type cannot be determined or app definition missing
|
|
15
15
|
*/
|
|
16
16
|
function getDatabaseType() {
|
|
17
|
-
// First,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (databaseUrl.startsWith('postgresql://') || databaseUrl.startsWith('postgres://')) {
|
|
21
|
-
return 'postgresql';
|
|
22
|
-
}
|
|
23
|
-
if (databaseUrl.startsWith('mongodb://') || databaseUrl.startsWith('mongodb+srv://')) {
|
|
24
|
-
return 'mongodb';
|
|
25
|
-
}
|
|
17
|
+
// First, check DB_TYPE environment variable (migration handlers set this)
|
|
18
|
+
if (process.env.DB_TYPE) {
|
|
19
|
+
return process.env.DB_TYPE;
|
|
26
20
|
}
|
|
27
|
-
|
|
21
|
+
|
|
28
22
|
// Fallback: Load app definition
|
|
29
23
|
try {
|
|
30
24
|
const path = require('node:path');
|
|
@@ -28,7 +28,7 @@ describe('Database Migration Router - Adapter Layer', () => {
|
|
|
28
28
|
it('should load without requiring app definition (critical bug fix)', () => {
|
|
29
29
|
// Before fix: createProcessRepository() → getDatabaseType() → loads app definition → requires integrations → CRASH
|
|
30
30
|
// After fix: ProcessRepositoryPostgres instantiated directly → no app definition → SUCCESS
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
expect(() => {
|
|
33
33
|
require('./db-migration');
|
|
34
34
|
}).not.toThrow();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.461.
|
|
4
|
+
"version": "2.0.0--canary.461.862ddf0.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@friggframework/eslint-config": "2.0.0--canary.461.
|
|
41
|
-
"@friggframework/prettier-config": "2.0.0--canary.461.
|
|
42
|
-
"@friggframework/test": "2.0.0--canary.461.
|
|
40
|
+
"@friggframework/eslint-config": "2.0.0--canary.461.862ddf0.0",
|
|
41
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.862ddf0.0",
|
|
42
|
+
"@friggframework/test": "2.0.0--canary.461.862ddf0.0",
|
|
43
43
|
"@prisma/client": "^6.17.0",
|
|
44
44
|
"@types/lodash": "4.17.15",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "862ddf0cb0533978e97dfc69f6c33c622979436c"
|
|
83
83
|
}
|