feat: build bundled plugins from TypeScript

This commit is contained in:
Federico Jaramillo Martinez
2026-05-19 12:50:42 +02:00
parent b637add6ec
commit fb9e524e5b
12 changed files with 266 additions and 32 deletions
+6 -1
View File
@@ -150,12 +150,17 @@ export class PiWebPluginService {
function defaultPluginRoots(): LocalPluginRoot[] {
const moduleDir = dirname(fileURLToPath(import.meta.url));
const packageRoot = join(moduleDir, "..", "..");
return [
{ path: join(moduleDir, "..", "..", "pi-web-plugins"), source: "bundled", scope: "bundled" },
{ path: bundledPluginRoot(packageRoot), source: "bundled", scope: "bundled" },
{ path: join(piWebDataDir(), "plugins"), source: "local", scope: "local" },
];
}
function bundledPluginRoot(packageRoot: string): string {
return join(packageRoot, "dist", "pi-web-plugins");
}
async function discoverLocalRoot(root: LocalPluginRoot): Promise<PluginRecord[]> {
if (!existsSync(root.path)) return [];
const entries = await readdir(root.path, { withFileTypes: true }).catch(() => []);