Dependency builds for plugos

This commit is contained in:
Zef Hemel
2022-05-13 14:36:26 +02:00
parent 8c974161c3
commit 3c5048ac25
29 changed files with 309 additions and 76 deletions
-5
View File
@@ -1,8 +1,3 @@
declare global {
function syscall(name: string, ...args: any[]): Promise<any>;
// function require(moduleName: string): any;
}
window.addEventListener("message", (message) => {
const data = message.data;
switch (data.type) {
+13
View File
@@ -59,6 +59,7 @@ import { FilterList } from "./components/filter";
import { FilterOption } from "@silverbulletmd/common/types";
import { syntaxTree } from "@codemirror/language";
import sandboxSyscalls from "@plugos/plugos/syscalls/sandbox";
import globalModules from "../common/dist/global.plug.json";
class PageState {
constructor(
@@ -131,6 +132,18 @@ export class Editor {
clientStoreSyscalls(),
sandboxSyscalls(this.system)
);
this.system.on({
plugLoaded: (plug) => {
safeRun(async () => {
for (let [modName, code] of Object.entries(
globalModules.dependencies
)) {
await plug.sandbox.loadDependency(modName, code);
}
});
},
});
}
get currentPage(): string | undefined {
+3
View File
@@ -1,5 +1,8 @@
import { Action, AppViewState } from "./types";
let m = new Map();
m.size;
export default function reducer(
state: AppViewState,
action: Action
+1
View File
@@ -171,6 +171,7 @@
cursor: pointer;
}
.wiki-link {
cursor: pointer;
color: #a8abbd;
}