@zenstackhq/cli 3.5.0 → 3.5.1

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.js CHANGED
@@ -237,7 +237,7 @@ async function loadPluginModule(provider, basePath) {
237
237
  const importAsEsm = /* @__PURE__ */ __name(async (spec) => {
238
238
  try {
239
239
  const result = (await import(spec)).default;
240
- return result;
240
+ return typeof result?.generate === "function" ? result : void 0;
241
241
  } catch (err) {
242
242
  throw new CliError(`Failed to load plugin module from ${spec}: ${err.message}`);
243
243
  }
@@ -248,7 +248,7 @@ async function loadPluginModule(provider, basePath) {
248
248
  const result = await jiti.import(spec, {
249
249
  default: true
250
250
  });
251
- return result;
251
+ return typeof result?.generate === "function" ? result : void 0;
252
252
  } catch (err) {
253
253
  throw new CliError(`Failed to load plugin module from ${spec}: ${err.message}`);
254
254
  }
@@ -285,12 +285,12 @@ async function loadPluginModule(provider, basePath) {
285
285
  const result = await jiti.import(moduleSpec, {
286
286
  default: true
287
287
  });
288
- return result;
288
+ return typeof result.generate === "function" ? result : void 0;
289
289
  } catch {
290
290
  }
291
291
  try {
292
292
  const mod = await import(moduleSpec);
293
- return mod.default;
293
+ return typeof mod.default?.generate === "function" ? mod.default : void 0;
294
294
  } catch (err) {
295
295
  const errorCode = err?.code;
296
296
  if (errorCode === "ERR_MODULE_NOT_FOUND" || errorCode === "MODULE_NOT_FOUND") {