@hardkas/config 0.9.3-alpha → 0.9.4-alpha
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/dist/index.d.ts +1 -0
- package/dist/index.js +5 -4
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -60,15 +60,16 @@ async function loadHardkasConfig(options = {}) {
|
|
|
60
60
|
"hardkas.config.js",
|
|
61
61
|
"hardkas.config.mjs"
|
|
62
62
|
];
|
|
63
|
-
let current = cwd;
|
|
64
|
-
const
|
|
65
|
-
while (
|
|
63
|
+
let current = options.workspaceRoot ?? cwd;
|
|
64
|
+
const stopAt = options.workspaceRoot ? path.resolve(options.workspaceRoot) : path.parse(current).root;
|
|
65
|
+
while (true) {
|
|
66
66
|
for (const indicator of indicators) {
|
|
67
67
|
const p = path.join(current, indicator);
|
|
68
68
|
if (fs.existsSync(p)) {
|
|
69
69
|
return loadConfigFile(p, current);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
if (current === stopAt) break;
|
|
72
73
|
const parent = path.dirname(current);
|
|
73
74
|
if (parent === current) break;
|
|
74
75
|
current = parent;
|
|
@@ -99,7 +100,7 @@ async function loadConfigFile(filePath, cwd) {
|
|
|
99
100
|
}
|
|
100
101
|
} catch (e) {
|
|
101
102
|
}
|
|
102
|
-
const jiti = createJiti(
|
|
103
|
+
const jiti = createJiti(filePath, jitiOptions);
|
|
103
104
|
const module = await jiti.import(filePath);
|
|
104
105
|
const userConfig = module.default || module.config || module;
|
|
105
106
|
const mergedConfig = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hardkas/config",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4-alpha",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"jiti": "^2.4.2",
|
|
21
|
-
"@hardkas/core": "0.9.
|
|
21
|
+
"@hardkas/core": "0.9.4-alpha"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"tsup": "^8.3.5",
|