@o-lang/olang 1.0.17 → 1.0.18
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/cli.js +15 -2
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -86,8 +86,14 @@ function createResolverChain(resolvers, verbose = false) {
|
|
|
86
86
|
return wrapped;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Load a single resolver — NO fallback to defaultMockResolver
|
|
91
|
+
*/
|
|
89
92
|
function loadSingleResolver(specifier) {
|
|
90
|
-
|
|
93
|
+
// ❌ Remove fallback: do NOT return defaultMockResolver
|
|
94
|
+
if (!specifier) {
|
|
95
|
+
throw new Error('Empty resolver specifier provided');
|
|
96
|
+
}
|
|
91
97
|
try {
|
|
92
98
|
const resolver = require(specifier);
|
|
93
99
|
if (typeof resolver !== 'function') throw new Error(`Resolver must export a function`);
|
|
@@ -186,10 +192,17 @@ program
|
|
|
186
192
|
console.log(' 📄 Parsed Workflow:', JSON.stringify(workflow, null, 2));
|
|
187
193
|
}
|
|
188
194
|
|
|
189
|
-
// ✅ Pass allowedResolvers to loadResolverChain
|
|
190
195
|
const allowedSet = new Set(workflow.allowedResolvers.map(r => r.trim()));
|
|
191
196
|
const resolver = loadResolverChain(options.resolver, options.verbose, allowedSet);
|
|
192
197
|
|
|
198
|
+
// 🔔 Warn if allowed resolvers declared but none loaded
|
|
199
|
+
if (workflow.allowedResolvers.length > 0 && resolver._chain.length === 0) {
|
|
200
|
+
console.warn(
|
|
201
|
+
`\n⚠️ Warning: Workflow allows [${workflow.allowedResolvers.join(', ')}],\n` +
|
|
202
|
+
` but no matching resolvers were loaded. Use -r <path> to provide them.\n`
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
193
206
|
const result = await execute(workflow, options.input, resolver, options.verbose);
|
|
194
207
|
console.log('\n=== Workflow Result ===');
|
|
195
208
|
console.log(JSON.stringify(result, null, 2));
|
package/package.json
CHANGED