Rebranded plugbox to PlugOS (plugos)

pull/3/head
Zef Hemel 2022-03-27 11:31:12 +02:00
parent 621e55dbcf
commit cb809d2d03
45 changed files with 42 additions and 51 deletions

View File

@ -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

View File

@ -1,7 +1,7 @@
import * as plugbox from "../plugbox/types";
import { EndpointHook } from "../plugbox/feature/endpoint";
import { CronHook } from "../plugbox/feature/node_cron";
import { EventHook } from "../plugbox/feature/event";
import * as plugos from "../plugos/types";
import { EndpointHook } from "../plugos/feature/endpoint";
import { CronHook } from "../plugos/feature/node_cron";
import { EventHook } from "../plugos/feature/event";
export type CommandDef = {
name: string;
@ -21,4 +21,4 @@ export type SilverBulletHooks = {
CronHook &
EventHook;
export type Manifest = plugbox.Manifest<SilverBulletHooks>;
export type Manifest = plugos.Manifest<SilverBulletHooks>;

View File

@ -6,15 +6,15 @@
"@lezer/common": "https://github.com/zefhemel/common.git#046c880d1fcab713cadad327a5b7d8bb5de6522c"
},
"bin": {
"plugbox-bundle": "./dist/plugbox/plugbox-bundle.js",
"plugbox-server": "./dist/plugbox/plugbox-server.js",
"plugos-bundle": "./dist/plugos/plugos-bundle.js",
"plugos-server": "./dist/plugos/plugos-server.js",
"silverbullet": "./dist/server/server.js"
},
"scripts": {
"watch": "rm -rf .parcel-cache && parcel watch",
"build": "parcel build",
"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",
"test": "jest"
},
@ -36,10 +36,10 @@
"isLibrary": true,
"context": "node"
},
"plugbox": {
"plugos": {
"source": [
"plugbox/bin/plugbox-bundle.ts",
"plugbox/bin/plugbox-server.ts"
"plugos/bin/plugos-bundle.ts",
"plugos/bin/plugos-server.ts"
],
"outputFormat": "commonjs",
"isLibrary": true,
@ -47,10 +47,10 @@
},
"test": {
"source": [
"plugbox/runtime.test.ts",
"plugbox/feature/endpoint.test.ts",
"plugbox/syscall/store.knex_node.test.ts",
"plugbox/syscall/store.dexie_browser.test.ts",
"plugos/runtime.test.ts",
"plugos/feature/endpoint.test.ts",
"plugos/syscall/store.knex_node.test.ts",
"plugos/syscall/store.dexie_browser.test.ts",
"server/api.test.ts"
],
"outputFormat": "commonjs",

View File

@ -99,7 +99,7 @@ async function run() {
.parse();
if (args._.length === 0) {
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);
}

View File

@ -27,7 +27,7 @@ let args = yargs(hideBin(process.argv))
.parse();
if (!args._.length) {
console.error("Usage: plugbox-server <path-to-plugs>");
console.error("Usage: plugos-server <path-to-plugs>");
process.exit(1);
}
@ -42,7 +42,7 @@ safeRun(async () => {
const db = knex({
client: "better-sqlite3",
connection: {
filename: "plugbox.db",
filename: "plugos.db",
},
useNullAsDefault: true,
});

View File

@ -6,7 +6,7 @@ import request from "supertest";
import { EndpointFeature, EndpointHook } from "./endpoint";
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 plug = await system.load(
"test",

View File

@ -1,7 +1,7 @@
import {
EndpointRequest,
EndpointResponse,
} from "../../plugbox/feature/endpoint";
} from "../../plugos/feature/endpoint";
export function endpointTest(req: EndpointRequest): EndpointResponse {
console.log("I'm running on the server!", req);

View File

@ -7,7 +7,7 @@ import { SocketServer } from "./api_server";
import * as path from "path";
import * as fs from "fs";
import { SilverBulletHooks } from "../common/manifest";
import { System } from "../plugbox/system";
import { System } from "../plugos/system";
describe("Server test", () => {
let io: Server,

View File

@ -6,7 +6,7 @@ import { PageApi } from "./page_api";
import { SilverBulletHooks } from "../common/manifest";
import pageIndexSyscalls from "./syscalls/page_index";
import { safeRun } from "./util";
import { System } from "../plugbox/system";
import { System } from "../plugos/system";
export class ClientConnection {
openPages = new Set<string>();

View File

@ -1,8 +1,8 @@
import { Express } from "express";
import { SilverBulletHooks } from "../common/manifest";
import { EndpointFeature } from "../plugbox/feature/endpoint";
import { EndpointFeature } from "../plugos/feature/endpoint";
import { readFile } from "fs/promises";
import { System } from "../plugbox/system";
import { System } from "../plugos/system";
export class ExpressServer {
app: Express;

View File

@ -10,8 +10,8 @@ import path from "path";
import { stat } from "fs/promises";
import { Cursor, cursorEffect } from "../webapp/cursorEffect";
import { SilverBulletHooks } from "../common/manifest";
import { System } from "../plugbox/system";
import { EventFeature } from "../plugbox/feature/event";
import { System } from "../plugos/system";
import { EventFeature } from "../plugos/feature/event";
export class PageApi implements ApiProvider {
openPages: Map<string, Page>;

View File

@ -8,10 +8,10 @@ import yargs from "yargs";
import {hideBin} from "yargs/helpers";
import {SilverBulletHooks} from "../common/manifest";
import {ExpressServer} from "./express_server";
import {DiskPlugLoader} from "../plugbox/plug_loader";
import {NodeCronFeature} from "../plugbox/feature/node_cron";
import shellSyscalls from "../plugbox/syscall/shell.node";
import {System} from "../plugbox/system";
import {DiskPlugLoader} from "../plugos/plug_loader";
import {NodeCronFeature} from "../plugos/feature/node_cron";
import shellSyscalls from "../plugos/syscall/shell.node";
import {System} from "../plugos/system";
let args = yargs(hideBin(process.argv))
.option("port", {
@ -21,7 +21,7 @@ let args = yargs(hideBin(process.argv))
.parse();
if (!args._.length) {
console.error("Usage: silverbullet <path-to-pages>");
console.error("Usage: silverbullet <path-to-pages>");
process.exit(1);
}

View File

@ -1,5 +1,5 @@
import { Knex } from "knex";
import { SysCallMapping } from "../../plugbox/system";
import { SysCallMapping } from "../../plugos/system";
type IndexItem = {
page: string;

View File

@ -1,5 +1,5 @@
{
"include": ["webapp/**/*", "server/**/*", "plugbox/**/*", "plugs/**/*"],
"include": ["webapp/**/*", "server/**/*", "plugos/**/*", "plugs/**/*"],
"compilerOptions": {
"target": "esnext",
"strict": true,

View File

@ -21,7 +21,7 @@ import {
} from "@codemirror/view";
import React, { useEffect, useReducer } from "react";
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 { CollabDocument, collabExtension } from "./collab";
import * as commands from "./commands";
@ -49,8 +49,8 @@ import {
} from "./types";
import { SilverBulletHooks } from "../common/manifest";
import { safeRun } from "./util";
import { System } from "../plugbox/system";
import { EventFeature } from "../plugbox/feature/event";
import { System } from "../plugos/system";
import { EventFeature } from "../plugos/feature/event";
import { systemSyscalls } from "./syscalls/system";
class PageState {

View File

@ -7,7 +7,7 @@ import { CollabDocument, CollabEvents } from "./collab";
import { cursorEffect } from "./cursorEffect";
import { EventEmitter } from "../common/event";
import { Manifest } from "../common/manifest";
import { SystemJSON } from "../plugbox/system";
import { SystemJSON } from "../plugos/system";
export type SpaceEvents = {
connect: () => void;

View File

@ -1,7 +1,7 @@
import { Editor } from "../editor";
import { syntaxTree } from "@codemirror/language";
import { Transaction } from "@codemirror/state";
import { SysCallMapping } from "../../plugbox/system";
import { SysCallMapping } from "../../plugos/system";
type SyntaxNode = {
name: string;

View File

@ -1,6 +1,6 @@
import { Space } from "../space";
import { SysCallMapping } from "../../plugbox/system";
import { transportSyscalls } from "../../plugbox/syscall/transport";
import { SysCallMapping } from "../../plugos/system";
import { transportSyscalls } from "../../plugos/syscall/transport";
export default function indexerSyscalls(space: Space): SysCallMapping {
return transportSyscalls(

View File

@ -1,6 +1,6 @@
import { Editor } from "../editor";
import { PageMeta } from "../types";
import { SysCallMapping } from "../../plugbox/system";
import { SysCallMapping } from "../../plugos/system";
export default (editor: Editor): SysCallMapping => ({
listPages: (): PageMeta[] => {

View File

@ -1,4 +1,4 @@
import { SysCallMapping } from "../../plugbox/system";
import { SysCallMapping } from "../../plugos/system";
import { Space } from "../space";
export function systemSyscalls(space: Space): SysCallMapping {