@optique/config 0.10.0-dev.378 → 0.10.0
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.cjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { bindConfig, clearActiveConfig, configKey, createConfigContext, getActiveConfig, setActiveConfig } from "./src-
|
|
1
|
+
import { bindConfig, clearActiveConfig, configKey, createConfigContext, getActiveConfig, setActiveConfig } from "./src-BM0vQxHd.js";
|
|
2
2
|
|
|
3
3
|
export { bindConfig, clearActiveConfig, configKey, createConfigContext, getActiveConfig, setActiveConfig };
|
package/dist/run.cjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
const require_src = require('./src-
|
|
1
|
+
const require_src = require('./src-D2CgNyXF.cjs');
|
|
2
2
|
const node_fs_promises = require_src.__toESM(require("node:fs/promises"));
|
|
3
3
|
const node_path = require_src.__toESM(require("node:path"));
|
|
4
4
|
const node_process = require_src.__toESM(require("node:process"));
|
|
5
5
|
const __optique_core_facade = require_src.__toESM(require("@optique/core/facade"));
|
|
6
6
|
|
|
7
7
|
//#region src/run.ts
|
|
8
|
+
function isErrnoException(error) {
|
|
9
|
+
return typeof error === "object" && error !== null && "code" in error;
|
|
10
|
+
}
|
|
8
11
|
/**
|
|
9
12
|
* Helper function to create a wrapper SourceContext for config loading.
|
|
10
13
|
* @internal
|
|
@@ -53,11 +56,11 @@ function createConfigSourceContext(context, options) {
|
|
|
53
56
|
}
|
|
54
57
|
configData = validationResult.value;
|
|
55
58
|
} catch (error) {
|
|
56
|
-
if (error
|
|
57
|
-
|
|
59
|
+
if (isErrnoException(error) && error.code === "ENOENT") configData = void 0;
|
|
60
|
+
else throw error;
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
|
-
if (configData) {
|
|
63
|
+
if (configData !== void 0 && configData !== null) {
|
|
61
64
|
require_src.setActiveConfig(context.id, configData);
|
|
62
65
|
return { [require_src.configKey]: configData };
|
|
63
66
|
}
|
package/dist/run.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { clearActiveConfig, configKey, setActiveConfig } from "./src-
|
|
1
|
+
import { clearActiveConfig, configKey, setActiveConfig } from "./src-BM0vQxHd.js";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { basename } from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { runWith } from "@optique/core/facade";
|
|
6
6
|
|
|
7
7
|
//#region src/run.ts
|
|
8
|
+
function isErrnoException(error) {
|
|
9
|
+
return typeof error === "object" && error !== null && "code" in error;
|
|
10
|
+
}
|
|
8
11
|
/**
|
|
9
12
|
* Helper function to create a wrapper SourceContext for config loading.
|
|
10
13
|
* @internal
|
|
@@ -53,11 +56,11 @@ function createConfigSourceContext(context, options) {
|
|
|
53
56
|
}
|
|
54
57
|
configData = validationResult.value;
|
|
55
58
|
} catch (error) {
|
|
56
|
-
if (error
|
|
57
|
-
|
|
59
|
+
if (isErrnoException(error) && error.code === "ENOENT") configData = void 0;
|
|
60
|
+
else throw error;
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
|
-
if (configData) {
|
|
63
|
+
if (configData !== void 0 && configData !== null) {
|
|
61
64
|
setActiveConfig(context.id, configData);
|
|
62
65
|
return { [configKey]: configData };
|
|
63
66
|
}
|
|
@@ -180,13 +180,13 @@ function bindConfig(parser, options) {
|
|
|
180
180
|
success: true,
|
|
181
181
|
value: res.value
|
|
182
182
|
};
|
|
183
|
-
return
|
|
183
|
+
return res;
|
|
184
184
|
});
|
|
185
185
|
if (innerResult.success) return {
|
|
186
186
|
success: true,
|
|
187
187
|
value: innerResult.value
|
|
188
188
|
};
|
|
189
|
-
return
|
|
189
|
+
return innerResult;
|
|
190
190
|
}
|
|
191
191
|
return getConfigOrDefault(state, options);
|
|
192
192
|
},
|
|
@@ -203,13 +203,13 @@ function bindConfig(parser, options) {
|
|
|
203
203
|
success: true,
|
|
204
204
|
value: res.value
|
|
205
205
|
};
|
|
206
|
-
return
|
|
206
|
+
return res;
|
|
207
207
|
});
|
|
208
208
|
if (innerResult.success) return {
|
|
209
209
|
success: true,
|
|
210
210
|
value: innerResult.value
|
|
211
211
|
};
|
|
212
|
-
return
|
|
212
|
+
return innerResult;
|
|
213
213
|
}
|
|
214
214
|
return getConfigOrDefault(state, options);
|
|
215
215
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/config",
|
|
3
|
-
"version": "0.10.0
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Configuration file support for Optique with Standard Schema validation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@standard-schema/spec": "^1.1.0"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@optique/core": "0.10.0
|
|
70
|
+
"@optique/core": "0.10.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@standard-schema/spec": "^1.1.0",
|