@arc-js/config-manager 0.0.95 → 0.0.96
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/core/ConfigService.js
CHANGED
|
@@ -1085,13 +1085,9 @@ class ConfigService {
|
|
|
1085
1085
|
findConfig(key, moduleName) {
|
|
1086
1086
|
const configs = this.configs[this.currentScope];
|
|
1087
1087
|
if (!configs) {
|
|
1088
|
-
console.error(`❌ No configs found for scope: ${this.currentScope}`);
|
|
1089
|
-
console.error('Available scopes:', Object.keys(this.configs));
|
|
1090
1088
|
return undefined;
|
|
1091
1089
|
}
|
|
1092
1090
|
if (!configs[moduleName]) {
|
|
1093
|
-
console.error(`❌ Module "${moduleName}" not found in configs for scope ${this.currentScope}`);
|
|
1094
|
-
console.error('Available modules:', Object.keys(configs));
|
|
1095
1091
|
return undefined;
|
|
1096
1092
|
}
|
|
1097
1093
|
const result = key.split('.').reduce((acc, part) => {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.96",
|
|
7
7
|
"description": "CONFIG-MANAGER est un système de gestion de configuration modulaire pour les applications React avec TypeScript/JavaScript. Il fournit une gestion centralisée des configurations, un chargement dynamique des modules, et une intégration transparente avec les variables d'environnement.",
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"keywords": [],
|
|
@@ -7,8 +7,7 @@ const useArcConfigValue = (configManagerConfig, supportedScopes = [DEFAULT_SCOPE
|
|
|
7
7
|
const [service] = useState(() => new ConfigService(supportedScopes, configManagerConfig));
|
|
8
8
|
const [currentScope, setCurrentScope] = useState(getSavedScope());
|
|
9
9
|
const [isLoading, setIsLoading] = useState(true);
|
|
10
|
-
const [initialized, setInitialized] = useState(false)
|
|
11
|
-
|
|
10
|
+
const [initialized, setInitialized] = useState(false);
|
|
12
11
|
useEffect(() => {
|
|
13
12
|
const initialize = async () => {
|
|
14
13
|
setIsLoading(true);
|
|
@@ -29,8 +28,7 @@ const useArcConfigValue = (configManagerConfig, supportedScopes = [DEFAULT_SCOPE
|
|
|
29
28
|
initialize();
|
|
30
29
|
}, 0);
|
|
31
30
|
return () => clearTimeout(timer);
|
|
32
|
-
}, [currentScope, service, initialized])
|
|
33
|
-
|
|
31
|
+
}, [currentScope, service, initialized]);
|
|
34
32
|
useEffect(() => {
|
|
35
33
|
if (!initialized || isLoading || !configManagerConfig.modules) return;
|
|
36
34
|
const loadAllModules = async () => {
|
|
@@ -14,7 +14,6 @@ const useArcConfigValue = (
|
|
|
14
14
|
const [isLoading, setIsLoading] = useState(true);
|
|
15
15
|
const [initialized, setInitialized] = useState(false);
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
useEffect(() => {
|
|
19
18
|
const initialize = async () => {
|
|
20
19
|
setIsLoading(true);
|
|
@@ -39,7 +38,6 @@ const useArcConfigValue = (
|
|
|
39
38
|
return () => clearTimeout(timer);
|
|
40
39
|
}, [currentScope, service, initialized]);
|
|
41
40
|
|
|
42
|
-
|
|
43
41
|
useEffect(() => {
|
|
44
42
|
if (!initialized || isLoading || !configManagerConfig.modules) return;
|
|
45
43
|
|