Skip to content

Commit

Permalink
Remove @runno/host dependency (#274)
Browse files Browse the repository at this point in the history
* Move host types into runtime and remove deprecated host package

* Remove host from package.json
  • Loading branch information
taybenlor authored Sep 23, 2023
1 parent 0fd2386 commit 5d8bd9a
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 387 deletions.
2 changes: 1 addition & 1 deletion examples/src/check-element.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CompleteResult, RuntimeMethods } from "@runno/host";
import { CompleteResult, RuntimeMethods } from "@runno/runtime";
import { RunElement } from "@runno/runtime";
import { html, css, LitElement, svg } from "lit";
import { customElement, property, state } from "lit/decorators.js";
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
"build:docs:wasi": "npm run build:docs --workspace=@runno/wasi && rm -rf packages/website/docs/wasi && mkdir -p packages/website/docs && cp -R packages/wasi/docs packages/website/docs/wasi",
"build:docs:runtime": "npm run build:docs --workspace=@runno/runtime && rm -rf packages/website/docs/runtime && mkdir -p packages/website/docs && cp -R packages/runtime/docs packages/website/docs/runtime",
"build:docs": "npm run build:docs:runtime && npm run build:docs:wasi",
"build:host": "cd packages/host && npm run build",
"build:client": "cd packages/client && npm run build",
"build:wasi": "cd packages/wasi && npm run build",
"build:runtime": "cd packages/runtime && npm run build",
"build:website": "cd packages/website && npm run build",
"build": "npm run build:host && npm run build:wasi && npm run build:runtime && npm run build:client && npm run build:docs && npm run build:website",
"build": "npm run build:wasi && npm run build:runtime && npm run build:client && npm run build:docs && npm run build:website",
"build:deploy": "npm run bootstrap && npm run build",
"test:client": "cd packages/client && npm run test",
"test:wasi": "cd packages/wasi && npm run test:prepare && npm run test",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/messaging.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChildHandshake, WindowMessenger } from "post-me";
import { RuntimeMethods } from "@runno/host";
import { RuntimeMethods } from "@runno/runtime";

const messenger = new WindowMessenger({
localWindow: window,
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/params.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { decode } from "url-safe-base64";

import { Runtime, RuntimeMethods, runtimeToSyntax } from "@runno/host";
import { Runtime, RuntimeMethods, runtimeToSyntax } from "@runno/runtime";

function isTruthy(param: string | null | undefined) {
if (param === null || param === undefined) {
Expand Down
33 changes: 32 additions & 1 deletion packages/client/tests/smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
import { test, expect } from "@playwright/test";
import { generateEmbedURL } from "@runno/host";
import type { TerminalElement } from "@runno/runtime";
import { encode } from "url-safe-base64";

function generateEmbedURL(
code: string,
runtime: string,
options?: {
showControls?: boolean; // Default: true
showEditor?: boolean; // Default: true
autorun?: boolean; // Default: false
baseUrl?: string; // Default: "https://runno.run/"
}
): URL {
const showEditor =
options?.showEditor === undefined ? true : options?.showEditor;
const showControls =
options?.showControls === undefined ? true : options?.showControls;
const autorun = options?.autorun || false;
const baseUrl = options?.baseUrl || "https://runno.run/";
const url = new URL(baseUrl);
if (showEditor) {
url.searchParams.append("editor", "1");
}
if (autorun) {
url.searchParams.append("autorun", "1");
}
if (!showControls) {
url.searchParams.append("controls", "0");
}
url.searchParams.append("runtime", runtime);
url.searchParams.append("code", encode(btoa(code)));
return url;
}

const baseURL = "http://localhost:5678/";

Expand Down
3 changes: 0 additions & 3 deletions packages/host/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions packages/host/LICENSE

This file was deleted.

57 changes: 0 additions & 57 deletions packages/host/README.md

This file was deleted.

42 changes: 0 additions & 42 deletions packages/host/package.json

This file was deleted.

155 changes: 0 additions & 155 deletions packages/host/src/index.ts

This file was deleted.

33 changes: 0 additions & 33 deletions packages/host/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/runtime/lib/commands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Runtime } from "@runno/host";
import type { Runtime } from "./types";
import { WASIFS } from "@runno/wasi";
import { assertUnreachable } from "./helpers";

Expand Down
Loading

0 comments on commit 5d8bd9a

Please sign in to comment.