@umituz/react-native-settings 5.2.38 → 5.2.40
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.40",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@types/react": "~19.1.10",
|
|
73
73
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
74
74
|
"@typescript-eslint/parser": "^7.18.0",
|
|
75
|
-
"@umituz/react-native-auth": "
|
|
75
|
+
"@umituz/react-native-auth": "*",
|
|
76
76
|
"@umituz/react-native-design-system": "latest",
|
|
77
77
|
"@umituz/react-native-firebase": "^2.4.1",
|
|
78
78
|
"@umituz/react-native-sentry": "latest",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
2
3
|
import { getLangDisplayName } from './translation-config.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -8,7 +9,9 @@ import { getLangDisplayName } from './translation-config.js';
|
|
|
8
9
|
|
|
9
10
|
export function parseTypeScriptFile(filePath) {
|
|
10
11
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
// Match: export default { ... } OR export const NAME = { ... }
|
|
14
|
+
const match = content.match(/export\s+(?:default|const\s+\w+\s*=)\s*(\{[\s\S]*\});?\s*$/);
|
|
12
15
|
|
|
13
16
|
if (!match) {
|
|
14
17
|
throw new Error(`Could not parse TypeScript file: ${filePath}`);
|
|
@@ -17,12 +20,35 @@ export function parseTypeScriptFile(filePath) {
|
|
|
17
20
|
const objectStr = match[1].replace(/;$/, '');
|
|
18
21
|
|
|
19
22
|
try {
|
|
20
|
-
// Basic evaluation for simple objects
|
|
23
|
+
// Basic evaluation for simple objects (works for generated language files like tr-TR.ts
|
|
24
|
+
// and sub-module files like common.ts, home.ts, etc.)
|
|
21
25
|
// eslint-disable-next-line no-eval
|
|
22
26
|
return eval(`(${objectStr})`);
|
|
23
27
|
} catch (error) {
|
|
28
|
+
// File might be a barrel file with named imports (e.g., en-US.ts that imports sub-modules)
|
|
29
|
+
// Try to resolve each import and merge into a single object
|
|
30
|
+
const dir = path.dirname(filePath);
|
|
31
|
+
const importMatches = [...content.matchAll(/import\s*\{\s*(\w+)\s*\}\s*from\s*["']\.\/(\w+)["']/g)];
|
|
32
|
+
|
|
33
|
+
if (importMatches.length > 0) {
|
|
34
|
+
const result = {};
|
|
35
|
+
for (const [, varName, moduleName] of importMatches) {
|
|
36
|
+
const subFilePath = path.join(dir, `${moduleName}.ts`);
|
|
37
|
+
if (fs.existsSync(subFilePath)) {
|
|
38
|
+
try {
|
|
39
|
+
result[varName] = parseTypeScriptFile(subFilePath);
|
|
40
|
+
} catch {
|
|
41
|
+
// ignore individual sub-file parse errors
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (Object.keys(result).length > 0) {
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
24
50
|
console.warn(`\n⚠️ Warning: Could not fully parse ${filePath}. Files with complex imports/spreads are currently limited.`);
|
|
25
|
-
return {};
|
|
51
|
+
return {};
|
|
26
52
|
}
|
|
27
53
|
}
|
|
28
54
|
|