mioku-service-webui 4.0.3 → 4.0.5
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/package.json +1 -1
- package/system.ts +18 -3
package/package.json
CHANGED
package/system.ts
CHANGED
|
@@ -2240,7 +2240,22 @@ export function updateMiokuConfig(config: Partial<MiokuConfig>): MiokuConfig {
|
|
|
2240
2240
|
}
|
|
2241
2241
|
|
|
2242
2242
|
export function getAvailablePlugins(): string[] {
|
|
2243
|
-
const
|
|
2244
|
-
|
|
2245
|
-
|
|
2243
|
+
const modulesPath = NODE_MODULES_DIR;
|
|
2244
|
+
if (!fs.existsSync(modulesPath)) {
|
|
2245
|
+
// Fallback to config-based reading
|
|
2246
|
+
const rootPkg = readRootPackageJson();
|
|
2247
|
+
const miokiConfig = rootPkg?.mioki || {};
|
|
2248
|
+
return Array.isArray(miokiConfig.plugins) ? miokiConfig.plugins : [];
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
const plugins: string[] = [];
|
|
2252
|
+
const entries = fs.readdirSync(modulesPath, { withFileTypes: true });
|
|
2253
|
+
for (const entry of entries) {
|
|
2254
|
+
if (!entry.name.startsWith("mioku-plugin-")) continue;
|
|
2255
|
+
const fullPath = path.join(modulesPath, entry.name);
|
|
2256
|
+
const stat = fs.lstatSync(fullPath);
|
|
2257
|
+
if (!stat.isDirectory() && !stat.isSymbolicLink()) continue;
|
|
2258
|
+
plugins.push(entry.name.replace(/^mioku-plugin-/, ""));
|
|
2259
|
+
}
|
|
2260
|
+
return plugins.sort((a, b) => a.localeCompare(b));
|
|
2246
2261
|
}
|