@mostajs/setup 1.4.13 → 1.4.14
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.
|
@@ -24,18 +24,23 @@ export function createWireModuleHandler() {
|
|
|
24
24
|
return Response.json({ error: { code: 'VALIDATION_ERROR', message: "action doit etre 'install' ou 'uninstall'" } }, { status: 400 });
|
|
25
25
|
}
|
|
26
26
|
try {
|
|
27
|
-
// Dynamic import to avoid
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const socle = await import(/* webpackIgnore: true */ pkg);
|
|
27
|
+
// Dynamic import from specific paths to avoid barrel missing exports
|
|
28
|
+
const installPkg = '@mostajs' + '/socle/lib/install-module';
|
|
29
|
+
const uninstallPkg = '@mostajs' + '/socle/lib/uninstall-module';
|
|
31
30
|
const logs = [];
|
|
32
31
|
const opts = {
|
|
33
32
|
projectRoot: process.cwd(),
|
|
34
33
|
log: (msg) => logs.push(msg),
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
let result;
|
|
36
|
+
if (action === 'install') {
|
|
37
|
+
const mod = await import(/* webpackIgnore: true */ installPkg);
|
|
38
|
+
result = mod.installModule(moduleName, opts);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
const mod = await import(/* webpackIgnore: true */ uninstallPkg);
|
|
42
|
+
result = mod.uninstallModule(moduleName, opts);
|
|
43
|
+
}
|
|
39
44
|
return Response.json({
|
|
40
45
|
data: {
|
|
41
46
|
ok: result.success,
|
package/package.json
CHANGED