@optique/core 1.3.0-dev.2392 → 1.3.0-dev.2394

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.
@@ -104,13 +104,19 @@ function expandEffectfulRuntimeNodes(nodes) {
104
104
  const expanded = [];
105
105
  const visit = (node) => {
106
106
  const meta = node.parser.dependencyMetadata;
107
- if (meta?.source?.completeSource != null || meta?.derived != null) {
107
+ const schedulingNodes = node.parser[require_dependency_runtime.effectfulSchedulingNodesKey];
108
+ const expandsThroughHook = schedulingNodes != null && meta?.derived == null && node.parser[require_dependency_runtime.sourceCollectionExpansionKey] === true;
109
+ if (!expandsThroughHook && (meta?.source?.completeSource != null || meta?.derived != null)) {
108
110
  expanded.push(node);
109
111
  return;
110
112
  }
111
- const schedulingNodes = node.parser[require_dependency_runtime.effectfulSchedulingNodesKey];
112
113
  if (schedulingNodes != null) {
113
- for (const child of schedulingNodes(node.state, node.path)) visit(child);
114
+ const children = schedulingNodes(node.state, node.path);
115
+ if (children.length === 0 && meta?.source != null) {
116
+ expanded.push(node);
117
+ return;
118
+ }
119
+ for (const child of children) visit(child);
114
120
  return;
115
121
  }
116
122
  const pairs = node.parser[fieldParsersKey];
@@ -104,13 +104,19 @@ function expandEffectfulRuntimeNodes(nodes) {
104
104
  const expanded = [];
105
105
  const visit = (node) => {
106
106
  const meta = node.parser.dependencyMetadata;
107
- if (meta?.source?.completeSource != null || meta?.derived != null) {
107
+ const schedulingNodes = node.parser[effectfulSchedulingNodesKey];
108
+ const expandsThroughHook = schedulingNodes != null && meta?.derived == null && node.parser[sourceCollectionExpansionKey] === true;
109
+ if (!expandsThroughHook && (meta?.source?.completeSource != null || meta?.derived != null)) {
108
110
  expanded.push(node);
109
111
  return;
110
112
  }
111
- const schedulingNodes = node.parser[effectfulSchedulingNodesKey];
112
113
  if (schedulingNodes != null) {
113
- for (const child of schedulingNodes(node.state, node.path)) visit(child);
114
+ const children = schedulingNodes(node.state, node.path);
115
+ if (children.length === 0 && meta?.source != null) {
116
+ expanded.push(node);
117
+ return;
118
+ }
119
+ for (const child of children) visit(child);
114
120
  return;
115
121
  }
116
122
  const pairs = node.parser[fieldParsersKey];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.3.0-dev.2392",
3
+ "version": "1.3.0-dev.2394",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",
@@ -221,7 +221,7 @@
221
221
  },
222
222
  "sideEffects": false,
223
223
  "devDependencies": {
224
- "@optique/env": "1.3.0-dev.2392+e285c4e9",
224
+ "@optique/env": "1.3.0-dev.2394+c9cc5af6",
225
225
  "@types/node": "^24.0.0",
226
226
  "fast-check": "^4.7.0",
227
227
  "tsdown": "^0.13.0",