nextemos 5.0.26 → 5.0.28

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.
@@ -41,29 +41,34 @@ exports.defaultConfig = {
41
41
  };
42
42
  class ConfigStore {
43
43
  constructor() {
44
- try {
45
- // Build time'da config'i yükle
46
- const loadedConfig = require("../../../../nextemos-config.json");
47
- console.log("'nextemos-config.json' config loaded successfully");
48
- this.config = Object.assign(Object.assign({}, exports.defaultConfig), loadedConfig);
49
- }
50
- catch (error) {
51
- console.warn("'nextemos-config.json' config could not be loaded, using defaults:", error);
52
- this.config = exports.defaultConfig;
44
+ // Constructor'ı private tutuyoruz ama boş bırakıyoruz
45
+ }
46
+ static initialize() {
47
+ if (!this.config) {
48
+ try {
49
+ const loadedConfig = require("../../../../nextemos-config.json");
50
+ console.log("nextemos-config.json Config initialized successfully");
51
+ this.config = Object.assign(Object.assign({}, exports.defaultConfig), loadedConfig);
52
+ }
53
+ catch (error) {
54
+ console.warn("nextemos-config.json Config could not be loaded, using defaults:", error);
55
+ this.config = exports.defaultConfig;
56
+ }
53
57
  }
54
58
  }
55
59
  static getInstance() {
56
60
  if (!ConfigStore.instance) {
57
61
  ConfigStore.instance = new ConfigStore();
62
+ this.initialize();
58
63
  }
59
64
  return ConfigStore.instance;
60
65
  }
61
66
  getConfig() {
62
- return this.config;
67
+ return ConfigStore.config;
63
68
  }
64
69
  // Debug için config'i loglama metodu
65
70
  logConfig() {
66
- console.log("Current Config:", JSON.stringify(this.config, null, 2));
71
+ console.log("Current Config:", JSON.stringify(ConfigStore.config, null, 2));
67
72
  }
68
73
  }
69
74
  // Singleton instance'ı oluştur
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "5.0.26",
3
+ "version": "5.0.28",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",