nextemos 5.0.32 → 5.0.34

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.
@@ -36,42 +36,5 @@ export declare const defaultConfig: {
36
36
  STOCK: string;
37
37
  };
38
38
  };
39
- declare const NEXTEMOS_CONFIG: {
40
- API_URL: string;
41
- USE_API_URL: boolean;
42
- CDN_URL: string;
43
- CDN_PROVIDER: string;
44
- VIDEO_CDN_URL: string;
45
- THUMBOR_SOURCE: string;
46
- DEFAULT_LANGUAGE: string;
47
- FETCH_OPTIONS: {
48
- LOG_LEVEL: string;
49
- CACHE: string;
50
- };
51
- KEYCLOAK: {
52
- URL: string;
53
- REALM: string;
54
- CLIENT_ID: string;
55
- CLIENT_SECRET: string;
56
- GRANT_TYPE: string;
57
- };
58
- K8S_NAMESPACE: string;
59
- K8S_SERVICE_NAMES: {
60
- ADDRESS: string;
61
- BANNER: string;
62
- BLOG: string;
63
- CAMPAIGN: string;
64
- ENVIRONMENT: string;
65
- LOCALIZATION: string;
66
- MEMBER: string;
67
- NOTIFICATION: string;
68
- ORDER_MANAGEMENT: string;
69
- PAYMENT: string;
70
- PREDICTION: string;
71
- PRODUCT: string;
72
- ROUTE: string;
73
- SHOPPING_CART: string;
74
- STOCK: string;
75
- };
76
- };
77
- export default NEXTEMOS_CONFIG;
39
+ declare const _default: typeof defaultConfig;
40
+ export default _default;
@@ -39,47 +39,16 @@ exports.defaultConfig = {
39
39
  STOCK: "stock",
40
40
  },
41
41
  };
42
- class ConfigStore {
43
- constructor() {
44
- // Constructor'ı private tutuyoruz ama boş bırakıyoruz
45
- }
46
- static initialize() {
47
- if (!this.config) {
48
- try {
49
- const configPath = process.env.NODE_ENV === "development"
50
- ? "../../../../nextemos-config.json" // Development path
51
- : "./nextemos-config.json"; // Production path
52
- const loadedConfig = require(configPath);
53
- console.log("nextemos-config.json Config initialized successfully");
54
- this.config = Object.assign(Object.assign({}, exports.defaultConfig), loadedConfig);
55
- }
56
- catch (error) {
57
- console.warn("nextemos-config.json Config could not be loaded, using defaults:", error);
58
- this.config = exports.defaultConfig;
59
- }
60
- }
61
- }
62
- static getInstance() {
63
- if (!ConfigStore.instance) {
64
- ConfigStore.instance = new ConfigStore();
65
- this.initialize();
66
- }
67
- return ConfigStore.instance;
68
- }
69
- getConfig() {
70
- return ConfigStore.config;
71
- }
72
- // Debug için config'i loglama metodu
73
- logConfig() {
74
- console.log("Current Config:", JSON.stringify(ConfigStore.config, null, 2));
75
- }
42
+ // Try to read the config file synchronously at build time
43
+ let loadedConfig;
44
+ try {
45
+ // Using require to load the config file at build time
46
+ // require will resolve the path relative to the current file
47
+ loadedConfig = require("../../../../nextemos-config.json");
76
48
  }
77
- // Singleton instance'ı oluştur
78
- const configStore = ConfigStore.getInstance();
79
- // Debug için config'i logla (development'ta)
80
- if (process.env.NODE_ENV === "development") {
81
- configStore.logConfig();
49
+ catch (error) {
50
+ loadedConfig = exports.defaultConfig;
82
51
  }
83
- // Final config'i export et
84
- const NEXTEMOS_CONFIG = configStore.getConfig();
52
+ // Merge with default config to ensure all required fields exist
53
+ const NEXTEMOS_CONFIG = Object.assign(Object.assign({}, exports.defaultConfig), loadedConfig);
85
54
  exports.default = NEXTEMOS_CONFIG;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "5.0.32",
3
+ "version": "5.0.34",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",