@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.cjs CHANGED
@@ -253,7 +253,7 @@ async function loadPluginModule(provider, basePath) {
253
253
  const importAsEsm = /* @__PURE__ */ __name(async (spec) => {
254
254
  try {
255
255
  const result = (await import(spec)).default;
256
- return result;
256
+ return typeof result?.generate === "function" ? result : void 0;
257
257
  } catch (err) {
258
258
  throw new CliError(`Failed to load plugin module from ${spec}: ${err.message}`);
259
259
  }
@@ -264,7 +264,7 @@ async function loadPluginModule(provider, basePath) {
264
264
  const result = await jiti.import(spec, {
265
265
  default: true
266
266
  });
267
- return result;
267
+ return typeof result?.generate === "function" ? result : void 0;
268
268
  } catch (err) {
269
269
  throw new CliError(`Failed to load plugin module from ${spec}: ${err.message}`);
270
270
  }
@@ -301,12 +301,12 @@ async function loadPluginModule(provider, basePath) {
301
301
  const result = await jiti.import(moduleSpec, {
302
302
  default: true
303
303
  });
304
- return result;
304
+ return typeof result.generate === "function" ? result : void 0;
305
305
  } catch {
306
306
  }
307
307
  try {
308
308
  const mod = await import(moduleSpec);
309
- return mod.default;
309
+ return typeof mod.default?.generate === "function" ? mod.default : void 0;
310
310
  } catch (err) {
311
311
  const errorCode = err?.code;
312
312
  if (errorCode === "ERR_MODULE_NOT_FOUND" || errorCode === "MODULE_NOT_FOUND") {