nextemos 5.0.7 → 5.0.8
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.
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
|
|
1
|
+
export declare const getConfig: () => any;
|
|
2
|
+
declare const NEXT_CONFIG: any;
|
|
3
|
+
export default NEXT_CONFIG;
|
|
@@ -1,40 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
return path_1.default.dirname(require.main.filename);
|
|
14
|
-
}
|
|
15
|
-
return process.cwd();
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Ana projedeki nextemos-config.json dosyasını oku
|
|
19
|
-
*/
|
|
20
|
-
const loadConfig = () => {
|
|
21
|
-
const projectRoot = findProjectRoot();
|
|
22
|
-
const configPath = path_1.default.join(projectRoot, "nextemos-config.json");
|
|
23
|
-
try {
|
|
24
|
-
if (fs_1.default.existsSync(configPath)) {
|
|
25
|
-
const configData = fs_1.default.readFileSync(configPath, "utf-8");
|
|
26
|
-
return JSON.parse(configData);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
console.warn(`Config file not found at: ${configPath}`);
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
console.error("Failed to read config file:", error);
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
3
|
+
exports.getConfig = void 0;
|
|
4
|
+
const cosmiconfig_1 = require("cosmiconfig");
|
|
5
|
+
const getConfig = () => {
|
|
6
|
+
// `nextemos.config.js`, `.nextemosrc.json` vb. dosyalara bakar
|
|
7
|
+
const explorer = (0, cosmiconfig_1.cosmiconfigSync)("nextemos");
|
|
8
|
+
const result = explorer.search();
|
|
9
|
+
return result ? result.config : {};
|
|
37
10
|
};
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
exports.default =
|
|
11
|
+
exports.getConfig = getConfig;
|
|
12
|
+
const NEXT_CONFIG = (0, exports.getConfig)();
|
|
13
|
+
exports.default = NEXT_CONFIG;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextemos",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.8",
|
|
4
4
|
"description": "For helpers and hooks used in NextJS projects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"nextemos"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"cosmiconfig": "^9.0.0",
|
|
42
43
|
"html-entities": "^2.5.2"
|
|
43
44
|
}
|
|
44
45
|
}
|