Dependency builds for plugos
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { Action, AppViewState } from "./types";
|
||||
|
||||
let m = new Map();
|
||||
m.size;
|
||||
|
||||
export default function reducer(
|
||||
state: AppViewState,
|
||||
action: Action
|
||||
|
||||
@@ -171,6 +171,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
.wiki-link {
|
||||
cursor: pointer;
|
||||
color: #a8abbd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user