@lark-apaas/fullstack-cli 1.1.13 → 1.1.14-alpha.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 +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2280,6 +2280,7 @@ var actionPluginCommandGroup = {
|
|
|
2280
2280
|
|
|
2281
2281
|
// src/commands/capability/utils.ts
|
|
2282
2282
|
import fs8 from "fs";
|
|
2283
|
+
import { createRequire as createRequire2 } from "module";
|
|
2283
2284
|
import path7 from "path";
|
|
2284
2285
|
var CAPABILITIES_DIR = "server/capabilities";
|
|
2285
2286
|
function getProjectRoot2() {
|
|
@@ -2347,7 +2348,10 @@ function hasValidParamsSchema(paramsSchema) {
|
|
|
2347
2348
|
}
|
|
2348
2349
|
async function loadPlugin(pluginKey) {
|
|
2349
2350
|
try {
|
|
2350
|
-
const
|
|
2351
|
+
const userRequire = createRequire2(path7.join(getProjectRoot2(), "package.json"));
|
|
2352
|
+
const resolvedPath = userRequire.resolve(pluginKey);
|
|
2353
|
+
const pluginModule = await import(resolvedPath);
|
|
2354
|
+
const pluginPackage = pluginModule.default ?? pluginModule;
|
|
2351
2355
|
if (!pluginPackage || typeof pluginPackage.create !== "function") {
|
|
2352
2356
|
throw new Error(`Plugin ${pluginKey} does not export a valid create function`);
|
|
2353
2357
|
}
|