@optique/core 1.3.0-dev.2357 → 1.3.0-dev.2359
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.
|
@@ -26,7 +26,7 @@ var DependencyRuntimeContextImpl = class {
|
|
|
26
26
|
}
|
|
27
27
|
this.registry = new FailedAwareRegistry(registry, this.#failedSources);
|
|
28
28
|
}
|
|
29
|
-
registerSource(sourceId, value
|
|
29
|
+
registerSource(sourceId, value) {
|
|
30
30
|
this.registry.set(sourceId, value);
|
|
31
31
|
}
|
|
32
32
|
hasSource(sourceId) {
|
|
@@ -262,7 +262,7 @@ function collectExplicitSourceValues(nodes, runtime) {
|
|
|
262
262
|
}
|
|
263
263
|
function registerExplicitSourceValue(sourceId, result, runtime) {
|
|
264
264
|
if (result == null) return;
|
|
265
|
-
if (result.success) runtime.registerSource(sourceId, result.value
|
|
265
|
+
if (result.success) runtime.registerSource(sourceId, result.value);
|
|
266
266
|
else runtime.markSourceFailed(sourceId);
|
|
267
267
|
}
|
|
268
268
|
function isPromiseLike(value) {
|
|
@@ -332,7 +332,7 @@ function fillMissingSourceDefaults(nodes, runtime) {
|
|
|
332
332
|
continue;
|
|
333
333
|
}
|
|
334
334
|
if (isPromiseLike(result)) throw new TypeError(`fillMissingSourceDefaults() received an async getMissingSourceValue() result for ${String(meta.source.sourceId)}. Use fillMissingSourceDefaultsAsync() instead.`);
|
|
335
|
-
if (result.success) runtime.registerSource(meta.source.sourceId, result.value
|
|
335
|
+
if (result.success) runtime.registerSource(meta.source.sourceId, result.value);
|
|
336
336
|
else failures.push({
|
|
337
337
|
sourceId: meta.source.sourceId,
|
|
338
338
|
path: node.path,
|
|
@@ -376,7 +376,7 @@ async function fillMissingSourceDefaultsAsync(nodes, runtime) {
|
|
|
376
376
|
});
|
|
377
377
|
continue;
|
|
378
378
|
}
|
|
379
|
-
if (result.success) runtime.registerSource(meta.source.sourceId, result.value
|
|
379
|
+
if (result.success) runtime.registerSource(meta.source.sourceId, result.value);
|
|
380
380
|
else failures.push({
|
|
381
381
|
sourceId: meta.source.sourceId,
|
|
382
382
|
path: node.path,
|
|
@@ -538,7 +538,7 @@ function collectSourcesFromState(state, runtime, visited = /* @__PURE__ */ new W
|
|
|
538
538
|
if (require_internal_dependency.isDependencySourceState(state)) {
|
|
539
539
|
const depId = state[require_internal_dependency.dependencyId];
|
|
540
540
|
const result = state.result;
|
|
541
|
-
if (depId != null && result.success) runtime.registerSource(depId, result.value
|
|
541
|
+
if (depId != null && result.success) runtime.registerSource(depId, result.value);
|
|
542
542
|
else if (depId != null) runtime.markSourceFailed(depId);
|
|
543
543
|
return;
|
|
544
544
|
}
|
|
@@ -4,13 +4,6 @@ import { ParserDependencyMetadata } from "./dependency-metadata.cjs";
|
|
|
4
4
|
|
|
5
5
|
//#region src/dependency-runtime.d.ts
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* The origin of a dependency source value.
|
|
9
|
-
*
|
|
10
|
-
* @internal
|
|
11
|
-
* @since 1.0.0
|
|
12
|
-
*/
|
|
13
|
-
type DependencyValueOrigin = "cli" | "default" | "config" | "env" | "prompt" | "derived-precomplete";
|
|
14
7
|
/**
|
|
15
8
|
* A request to resolve one or more dependency values.
|
|
16
9
|
*
|
|
@@ -119,8 +112,8 @@ interface RuntimeNode {
|
|
|
119
112
|
interface DependencyRuntimeContext {
|
|
120
113
|
/** The underlying registry (for bridge interop). */
|
|
121
114
|
readonly registry: DependencyRegistryLike;
|
|
122
|
-
/** Register a source value
|
|
123
|
-
registerSource(sourceId: symbol, value: unknown
|
|
115
|
+
/** Register a source value. */
|
|
116
|
+
registerSource(sourceId: symbol, value: unknown): void;
|
|
124
117
|
/** Check if a source has been registered. */
|
|
125
118
|
hasSource(sourceId: symbol): boolean;
|
|
126
119
|
/** Get a registered source value. */
|
|
@@ -341,4 +334,4 @@ declare function buildRuntimeNodesFromArray(parsers: ReadonlyArray<{
|
|
|
341
334
|
readonly initialState?: unknown;
|
|
342
335
|
}>, stateArray: readonly unknown[], parentPath?: readonly PropertyKey[]): readonly RuntimeNode[];
|
|
343
336
|
//#endregion
|
|
344
|
-
export { DependencyRequest, DependencyResolution, DependencyRuntimeContext,
|
|
337
|
+
export { DependencyRequest, DependencyResolution, DependencyRuntimeContext, ReplayKey, RuntimeNode, SourceDefaultFailure, buildRuntimeNodesFromArray, buildRuntimeNodesFromPairs, collectExplicitSourceValues, collectExplicitSourceValuesAsync, collectSourcesFromState, createDependencyFingerprint, createDependencyRuntimeContext, createReplayKey, extractRawInputFromState, fillMissingSourceDefaults, fillMissingSourceDefaultsAsync, replayDerivedParser, replayDerivedParserAsync, resolveStateWithRuntime, resolveStateWithRuntimeAsync };
|
|
@@ -4,13 +4,6 @@ import { ParserDependencyMetadata } from "./dependency-metadata.js";
|
|
|
4
4
|
|
|
5
5
|
//#region src/dependency-runtime.d.ts
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* The origin of a dependency source value.
|
|
9
|
-
*
|
|
10
|
-
* @internal
|
|
11
|
-
* @since 1.0.0
|
|
12
|
-
*/
|
|
13
|
-
type DependencyValueOrigin = "cli" | "default" | "config" | "env" | "prompt" | "derived-precomplete";
|
|
14
7
|
/**
|
|
15
8
|
* A request to resolve one or more dependency values.
|
|
16
9
|
*
|
|
@@ -119,8 +112,8 @@ interface RuntimeNode {
|
|
|
119
112
|
interface DependencyRuntimeContext {
|
|
120
113
|
/** The underlying registry (for bridge interop). */
|
|
121
114
|
readonly registry: DependencyRegistryLike;
|
|
122
|
-
/** Register a source value
|
|
123
|
-
registerSource(sourceId: symbol, value: unknown
|
|
115
|
+
/** Register a source value. */
|
|
116
|
+
registerSource(sourceId: symbol, value: unknown): void;
|
|
124
117
|
/** Check if a source has been registered. */
|
|
125
118
|
hasSource(sourceId: symbol): boolean;
|
|
126
119
|
/** Get a registered source value. */
|
|
@@ -341,4 +334,4 @@ declare function buildRuntimeNodesFromArray(parsers: ReadonlyArray<{
|
|
|
341
334
|
readonly initialState?: unknown;
|
|
342
335
|
}>, stateArray: readonly unknown[], parentPath?: readonly PropertyKey[]): readonly RuntimeNode[];
|
|
343
336
|
//#endregion
|
|
344
|
-
export { DependencyRequest, DependencyResolution, DependencyRuntimeContext,
|
|
337
|
+
export { DependencyRequest, DependencyResolution, DependencyRuntimeContext, ReplayKey, RuntimeNode, SourceDefaultFailure, buildRuntimeNodesFromArray, buildRuntimeNodesFromPairs, collectExplicitSourceValues, collectExplicitSourceValuesAsync, collectSourcesFromState, createDependencyFingerprint, createDependencyRuntimeContext, createReplayKey, extractRawInputFromState, fillMissingSourceDefaults, fillMissingSourceDefaultsAsync, replayDerivedParser, replayDerivedParserAsync, resolveStateWithRuntime, resolveStateWithRuntimeAsync };
|
|
@@ -26,7 +26,7 @@ var DependencyRuntimeContextImpl = class {
|
|
|
26
26
|
}
|
|
27
27
|
this.registry = new FailedAwareRegistry(registry, this.#failedSources);
|
|
28
28
|
}
|
|
29
|
-
registerSource(sourceId, value
|
|
29
|
+
registerSource(sourceId, value) {
|
|
30
30
|
this.registry.set(sourceId, value);
|
|
31
31
|
}
|
|
32
32
|
hasSource(sourceId) {
|
|
@@ -262,7 +262,7 @@ function collectExplicitSourceValues(nodes, runtime) {
|
|
|
262
262
|
}
|
|
263
263
|
function registerExplicitSourceValue(sourceId, result, runtime) {
|
|
264
264
|
if (result == null) return;
|
|
265
|
-
if (result.success) runtime.registerSource(sourceId, result.value
|
|
265
|
+
if (result.success) runtime.registerSource(sourceId, result.value);
|
|
266
266
|
else runtime.markSourceFailed(sourceId);
|
|
267
267
|
}
|
|
268
268
|
function isPromiseLike(value) {
|
|
@@ -332,7 +332,7 @@ function fillMissingSourceDefaults(nodes, runtime) {
|
|
|
332
332
|
continue;
|
|
333
333
|
}
|
|
334
334
|
if (isPromiseLike(result)) throw new TypeError(`fillMissingSourceDefaults() received an async getMissingSourceValue() result for ${String(meta.source.sourceId)}. Use fillMissingSourceDefaultsAsync() instead.`);
|
|
335
|
-
if (result.success) runtime.registerSource(meta.source.sourceId, result.value
|
|
335
|
+
if (result.success) runtime.registerSource(meta.source.sourceId, result.value);
|
|
336
336
|
else failures.push({
|
|
337
337
|
sourceId: meta.source.sourceId,
|
|
338
338
|
path: node.path,
|
|
@@ -376,7 +376,7 @@ async function fillMissingSourceDefaultsAsync(nodes, runtime) {
|
|
|
376
376
|
});
|
|
377
377
|
continue;
|
|
378
378
|
}
|
|
379
|
-
if (result.success) runtime.registerSource(meta.source.sourceId, result.value
|
|
379
|
+
if (result.success) runtime.registerSource(meta.source.sourceId, result.value);
|
|
380
380
|
else failures.push({
|
|
381
381
|
sourceId: meta.source.sourceId,
|
|
382
382
|
path: node.path,
|
|
@@ -538,7 +538,7 @@ function collectSourcesFromState(state, runtime, visited = /* @__PURE__ */ new W
|
|
|
538
538
|
if (isDependencySourceState(state)) {
|
|
539
539
|
const depId = state[dependencyId];
|
|
540
540
|
const result = state.result;
|
|
541
|
-
if (depId != null && result.success) runtime.registerSource(depId, result.value
|
|
541
|
+
if (depId != null && result.success) runtime.registerSource(depId, result.value);
|
|
542
542
|
else if (depId != null) runtime.markSourceFailed(depId);
|
|
543
543
|
return;
|
|
544
544
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/core",
|
|
3
|
-
"version": "1.3.0-dev.
|
|
3
|
+
"version": "1.3.0-dev.2359",
|
|
4
4
|
"description": "Type-safe combinatorial command-line interface parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
"fast-check": "^4.7.0",
|
|
226
226
|
"tsdown": "^0.13.0",
|
|
227
227
|
"typescript": "^5.8.3",
|
|
228
|
-
"@optique/env": "1.3.0-dev.
|
|
228
|
+
"@optique/env": "1.3.0-dev.2359+541355d4"
|
|
229
229
|
},
|
|
230
230
|
"scripts": {
|
|
231
231
|
"build": "tsdown",
|