Rebranded plugbox to PlugOS (plugos)
parent
621e55dbcf
commit
cb809d2d03
9
Makefile
9
Makefile
|
@ -1,9 +0,0 @@
|
||||||
.PHONY: core
|
|
||||||
|
|
||||||
BUILD=../plugbox/bin/plugbox-bundle.mjs
|
|
||||||
|
|
||||||
core: core/*
|
|
||||||
${BUILD} --debug core/core.plug.json ../webapp/src/generated/core.plug.json
|
|
||||||
|
|
||||||
watch: *
|
|
||||||
ls -d core/* | entr make
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as plugbox from "../plugbox/types";
|
import * as plugos from "../plugos/types";
|
||||||
import { EndpointHook } from "../plugbox/feature/endpoint";
|
import { EndpointHook } from "../plugos/feature/endpoint";
|
||||||
import { CronHook } from "../plugbox/feature/node_cron";
|
import { CronHook } from "../plugos/feature/node_cron";
|
||||||
import { EventHook } from "../plugbox/feature/event";
|
import { EventHook } from "../plugos/feature/event";
|
||||||
|
|
||||||
export type CommandDef = {
|
export type CommandDef = {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -21,4 +21,4 @@ export type SilverBulletHooks = {
|
||||||
CronHook &
|
CronHook &
|
||||||
EventHook;
|
EventHook;
|
||||||
|
|
||||||
export type Manifest = plugbox.Manifest<SilverBulletHooks>;
|
export type Manifest = plugos.Manifest<SilverBulletHooks>;
|
||||||
|
|
20
package.json
20
package.json
|
@ -6,15 +6,15 @@
|
||||||
"@lezer/common": "https://github.com/zefhemel/common.git#046c880d1fcab713cadad327a5b7d8bb5de6522c"
|
"@lezer/common": "https://github.com/zefhemel/common.git#046c880d1fcab713cadad327a5b7d8bb5de6522c"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"plugbox-bundle": "./dist/plugbox/plugbox-bundle.js",
|
"plugos-bundle": "./dist/plugos/plugos-bundle.js",
|
||||||
"plugbox-server": "./dist/plugbox/plugbox-server.js",
|
"plugos-server": "./dist/plugos/plugos-server.js",
|
||||||
"silverbullet": "./dist/server/server.js"
|
"silverbullet": "./dist/server/server.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "rm -rf .parcel-cache && parcel watch",
|
"watch": "rm -rf .parcel-cache && parcel watch",
|
||||||
"build": "parcel build",
|
"build": "parcel build",
|
||||||
"clean": "rm -rf dist",
|
"clean": "rm -rf dist",
|
||||||
"plugs": "plugbox-bundle -w --dist plugs/dist plugs/*/*.plug.yaml",
|
"plugs": "./dist/plugos/plugos-bundle.js -w --dist plugs/dist plugs/*/*.plug.yaml",
|
||||||
"server": "nodemon -w dist/server dist/server/server.js pages",
|
"server": "nodemon -w dist/server dist/server/server.js pages",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
|
@ -36,10 +36,10 @@
|
||||||
"isLibrary": true,
|
"isLibrary": true,
|
||||||
"context": "node"
|
"context": "node"
|
||||||
},
|
},
|
||||||
"plugbox": {
|
"plugos": {
|
||||||
"source": [
|
"source": [
|
||||||
"plugbox/bin/plugbox-bundle.ts",
|
"plugos/bin/plugos-bundle.ts",
|
||||||
"plugbox/bin/plugbox-server.ts"
|
"plugos/bin/plugos-server.ts"
|
||||||
],
|
],
|
||||||
"outputFormat": "commonjs",
|
"outputFormat": "commonjs",
|
||||||
"isLibrary": true,
|
"isLibrary": true,
|
||||||
|
@ -47,10 +47,10 @@
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"source": [
|
"source": [
|
||||||
"plugbox/runtime.test.ts",
|
"plugos/runtime.test.ts",
|
||||||
"plugbox/feature/endpoint.test.ts",
|
"plugos/feature/endpoint.test.ts",
|
||||||
"plugbox/syscall/store.knex_node.test.ts",
|
"plugos/syscall/store.knex_node.test.ts",
|
||||||
"plugbox/syscall/store.dexie_browser.test.ts",
|
"plugos/syscall/store.dexie_browser.test.ts",
|
||||||
"server/api.test.ts"
|
"server/api.test.ts"
|
||||||
],
|
],
|
||||||
"outputFormat": "commonjs",
|
"outputFormat": "commonjs",
|
||||||
|
|
|
@ -99,7 +99,7 @@ async function run() {
|
||||||
.parse();
|
.parse();
|
||||||
if (args._.length === 0) {
|
if (args._.length === 0) {
|
||||||
console.log(
|
console.log(
|
||||||
"Usage: plugbox-bundle [--debug] [--dist <path>] <manifest.plug.yaml> <manifest2.plug.yaml> ..."
|
"Usage: plugos-bundle [--debug] [--dist <path>] <manifest.plug.yaml> <manifest2.plug.yaml> ..."
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@ let args = yargs(hideBin(process.argv))
|
||||||
.parse();
|
.parse();
|
||||||
|
|
||||||
if (!args._.length) {
|
if (!args._.length) {
|
||||||
console.error("Usage: plugbox-server <path-to-plugs>");
|
console.error("Usage: plugos-server <path-to-plugs>");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ safeRun(async () => {
|
||||||
const db = knex({
|
const db = knex({
|
||||||
client: "better-sqlite3",
|
client: "better-sqlite3",
|
||||||
connection: {
|
connection: {
|
||||||
filename: "plugbox.db",
|
filename: "plugos.db",
|
||||||
},
|
},
|
||||||
useNullAsDefault: true,
|
useNullAsDefault: true,
|
||||||
});
|
});
|
|
@ -6,7 +6,7 @@ import request from "supertest";
|
||||||
import { EndpointFeature, EndpointHook } from "./endpoint";
|
import { EndpointFeature, EndpointHook } from "./endpoint";
|
||||||
import { System } from "../system";
|
import { System } from "../system";
|
||||||
|
|
||||||
test("Run a plugbox endpoint server", async () => {
|
test("Run a plugos endpoint server", async () => {
|
||||||
let system = new System<EndpointHook>("server");
|
let system = new System<EndpointHook>("server");
|
||||||
let plug = await system.load(
|
let plug = await system.load(
|
||||||
"test",
|
"test",
|
|
@ -1,7 +1,7 @@
|
||||||
import {
|
import {
|
||||||
EndpointRequest,
|
EndpointRequest,
|
||||||
EndpointResponse,
|
EndpointResponse,
|
||||||
} from "../../plugbox/feature/endpoint";
|
} from "../../plugos/feature/endpoint";
|
||||||
|
|
||||||
export function endpointTest(req: EndpointRequest): EndpointResponse {
|
export function endpointTest(req: EndpointRequest): EndpointResponse {
|
||||||
console.log("I'm running on the server!", req);
|
console.log("I'm running on the server!", req);
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { SocketServer } from "./api_server";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { SilverBulletHooks } from "../common/manifest";
|
import { SilverBulletHooks } from "../common/manifest";
|
||||||
import { System } from "../plugbox/system";
|
import { System } from "../plugos/system";
|
||||||
|
|
||||||
describe("Server test", () => {
|
describe("Server test", () => {
|
||||||
let io: Server,
|
let io: Server,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { PageApi } from "./page_api";
|
||||||
import { SilverBulletHooks } from "../common/manifest";
|
import { SilverBulletHooks } from "../common/manifest";
|
||||||
import pageIndexSyscalls from "./syscalls/page_index";
|
import pageIndexSyscalls from "./syscalls/page_index";
|
||||||
import { safeRun } from "./util";
|
import { safeRun } from "./util";
|
||||||
import { System } from "../plugbox/system";
|
import { System } from "../plugos/system";
|
||||||
|
|
||||||
export class ClientConnection {
|
export class ClientConnection {
|
||||||
openPages = new Set<string>();
|
openPages = new Set<string>();
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Express } from "express";
|
import { Express } from "express";
|
||||||
import { SilverBulletHooks } from "../common/manifest";
|
import { SilverBulletHooks } from "../common/manifest";
|
||||||
import { EndpointFeature } from "../plugbox/feature/endpoint";
|
import { EndpointFeature } from "../plugos/feature/endpoint";
|
||||||
import { readFile } from "fs/promises";
|
import { readFile } from "fs/promises";
|
||||||
import { System } from "../plugbox/system";
|
import { System } from "../plugos/system";
|
||||||
|
|
||||||
export class ExpressServer {
|
export class ExpressServer {
|
||||||
app: Express;
|
app: Express;
|
||||||
|
|
|
@ -10,8 +10,8 @@ import path from "path";
|
||||||
import { stat } from "fs/promises";
|
import { stat } from "fs/promises";
|
||||||
import { Cursor, cursorEffect } from "../webapp/cursorEffect";
|
import { Cursor, cursorEffect } from "../webapp/cursorEffect";
|
||||||
import { SilverBulletHooks } from "../common/manifest";
|
import { SilverBulletHooks } from "../common/manifest";
|
||||||
import { System } from "../plugbox/system";
|
import { System } from "../plugos/system";
|
||||||
import { EventFeature } from "../plugbox/feature/event";
|
import { EventFeature } from "../plugos/feature/event";
|
||||||
|
|
||||||
export class PageApi implements ApiProvider {
|
export class PageApi implements ApiProvider {
|
||||||
openPages: Map<string, Page>;
|
openPages: Map<string, Page>;
|
||||||
|
|
|
@ -8,10 +8,10 @@ import yargs from "yargs";
|
||||||
import {hideBin} from "yargs/helpers";
|
import {hideBin} from "yargs/helpers";
|
||||||
import {SilverBulletHooks} from "../common/manifest";
|
import {SilverBulletHooks} from "../common/manifest";
|
||||||
import {ExpressServer} from "./express_server";
|
import {ExpressServer} from "./express_server";
|
||||||
import {DiskPlugLoader} from "../plugbox/plug_loader";
|
import {DiskPlugLoader} from "../plugos/plug_loader";
|
||||||
import {NodeCronFeature} from "../plugbox/feature/node_cron";
|
import {NodeCronFeature} from "../plugos/feature/node_cron";
|
||||||
import shellSyscalls from "../plugbox/syscall/shell.node";
|
import shellSyscalls from "../plugos/syscall/shell.node";
|
||||||
import {System} from "../plugbox/system";
|
import {System} from "../plugos/system";
|
||||||
|
|
||||||
let args = yargs(hideBin(process.argv))
|
let args = yargs(hideBin(process.argv))
|
||||||
.option("port", {
|
.option("port", {
|
||||||
|
@ -21,7 +21,7 @@ let args = yargs(hideBin(process.argv))
|
||||||
.parse();
|
.parse();
|
||||||
|
|
||||||
if (!args._.length) {
|
if (!args._.length) {
|
||||||
console.error("Usage: silverbullet <path-to-pages>");
|
console.error("Usage: silverbullet <path-to-pages>");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Knex } from "knex";
|
import { Knex } from "knex";
|
||||||
import { SysCallMapping } from "../../plugbox/system";
|
import { SysCallMapping } from "../../plugos/system";
|
||||||
|
|
||||||
type IndexItem = {
|
type IndexItem = {
|
||||||
page: string;
|
page: string;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"include": ["webapp/**/*", "server/**/*", "plugbox/**/*", "plugs/**/*"],
|
"include": ["webapp/**/*", "server/**/*", "plugos/**/*", "plugs/**/*"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
|
|
@ -21,7 +21,7 @@ import {
|
||||||
} from "@codemirror/view";
|
} from "@codemirror/view";
|
||||||
import React, { useEffect, useReducer } from "react";
|
import React, { useEffect, useReducer } from "react";
|
||||||
import ReactDOM from "react-dom";
|
import ReactDOM from "react-dom";
|
||||||
import { createSandbox as createIFrameSandbox } from "../plugbox/environment/iframe_sandbox";
|
import { createSandbox as createIFrameSandbox } from "../plugos/environment/iframe_sandbox";
|
||||||
import { AppEvent, AppEventDispatcher, ClickEvent } from "./app_event";
|
import { AppEvent, AppEventDispatcher, ClickEvent } from "./app_event";
|
||||||
import { CollabDocument, collabExtension } from "./collab";
|
import { CollabDocument, collabExtension } from "./collab";
|
||||||
import * as commands from "./commands";
|
import * as commands from "./commands";
|
||||||
|
@ -49,8 +49,8 @@ import {
|
||||||
} from "./types";
|
} from "./types";
|
||||||
import { SilverBulletHooks } from "../common/manifest";
|
import { SilverBulletHooks } from "../common/manifest";
|
||||||
import { safeRun } from "./util";
|
import { safeRun } from "./util";
|
||||||
import { System } from "../plugbox/system";
|
import { System } from "../plugos/system";
|
||||||
import { EventFeature } from "../plugbox/feature/event";
|
import { EventFeature } from "../plugos/feature/event";
|
||||||
import { systemSyscalls } from "./syscalls/system";
|
import { systemSyscalls } from "./syscalls/system";
|
||||||
|
|
||||||
class PageState {
|
class PageState {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { CollabDocument, CollabEvents } from "./collab";
|
||||||
import { cursorEffect } from "./cursorEffect";
|
import { cursorEffect } from "./cursorEffect";
|
||||||
import { EventEmitter } from "../common/event";
|
import { EventEmitter } from "../common/event";
|
||||||
import { Manifest } from "../common/manifest";
|
import { Manifest } from "../common/manifest";
|
||||||
import { SystemJSON } from "../plugbox/system";
|
import { SystemJSON } from "../plugos/system";
|
||||||
|
|
||||||
export type SpaceEvents = {
|
export type SpaceEvents = {
|
||||||
connect: () => void;
|
connect: () => void;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Editor } from "../editor";
|
import { Editor } from "../editor";
|
||||||
import { syntaxTree } from "@codemirror/language";
|
import { syntaxTree } from "@codemirror/language";
|
||||||
import { Transaction } from "@codemirror/state";
|
import { Transaction } from "@codemirror/state";
|
||||||
import { SysCallMapping } from "../../plugbox/system";
|
import { SysCallMapping } from "../../plugos/system";
|
||||||
|
|
||||||
type SyntaxNode = {
|
type SyntaxNode = {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Space } from "../space";
|
import { Space } from "../space";
|
||||||
import { SysCallMapping } from "../../plugbox/system";
|
import { SysCallMapping } from "../../plugos/system";
|
||||||
import { transportSyscalls } from "../../plugbox/syscall/transport";
|
import { transportSyscalls } from "../../plugos/syscall/transport";
|
||||||
|
|
||||||
export default function indexerSyscalls(space: Space): SysCallMapping {
|
export default function indexerSyscalls(space: Space): SysCallMapping {
|
||||||
return transportSyscalls(
|
return transportSyscalls(
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Editor } from "../editor";
|
import { Editor } from "../editor";
|
||||||
import { PageMeta } from "../types";
|
import { PageMeta } from "../types";
|
||||||
import { SysCallMapping } from "../../plugbox/system";
|
import { SysCallMapping } from "../../plugos/system";
|
||||||
|
|
||||||
export default (editor: Editor): SysCallMapping => ({
|
export default (editor: Editor): SysCallMapping => ({
|
||||||
listPages: (): PageMeta[] => {
|
listPages: (): PageMeta[] => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { SysCallMapping } from "../../plugbox/system";
|
import { SysCallMapping } from "../../plugos/system";
|
||||||
import { Space } from "../space";
|
import { Space } from "../space";
|
||||||
|
|
||||||
export function systemSyscalls(space: Space): SysCallMapping {
|
export function systemSyscalls(space: Space): SysCallMapping {
|
||||||
|
|
Loading…
Reference in New Issue