@lark-apaas/fullstack-cli 1.1.16 → 1.1.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/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2803,6 +2803,7 @@ var actionPluginCommandGroup = {
|
|
|
2803
2803
|
|
|
2804
2804
|
// src/commands/capability/utils.ts
|
|
2805
2805
|
import fs9 from "fs";
|
|
2806
|
+
import { createRequire as createRequire2 } from "module";
|
|
2806
2807
|
import path7 from "path";
|
|
2807
2808
|
var CAPABILITIES_DIR = "server/capabilities";
|
|
2808
2809
|
function getProjectRoot2() {
|
|
@@ -2882,7 +2883,10 @@ function hasValidParamsSchema(paramsSchema) {
|
|
|
2882
2883
|
}
|
|
2883
2884
|
async function loadPlugin(pluginKey) {
|
|
2884
2885
|
try {
|
|
2885
|
-
const
|
|
2886
|
+
const userRequire = createRequire2(path7.join(getProjectRoot2(), "package.json"));
|
|
2887
|
+
const resolvedPath = userRequire.resolve(pluginKey);
|
|
2888
|
+
const pluginModule = await import(resolvedPath);
|
|
2889
|
+
const pluginPackage = pluginModule.default ?? pluginModule;
|
|
2886
2890
|
if (!pluginPackage || typeof pluginPackage.create !== "function") {
|
|
2887
2891
|
throw new Error(`Plugin ${pluginKey} does not export a valid create function`);
|
|
2888
2892
|
}
|