Skip to content

Commit

Permalink
prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kumavis committed Jan 1, 2024
1 parent ec4d42b commit 2dc1f52
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ public
scripts
test-results
*.config.js

components/apps/Ocaps/dist
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
touch out/.nojekyll
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: out
folder: out
8 changes: 4 additions & 4 deletions components/apps/NoodJs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const defaultRuntime = `{
}`;

export type RuntimeConfig = {
libs: string[],
runtime: string,
transformInputSource?: (source: string) => string,
libs: string[];
runtime: string;
transformInputSource?: (source: string) => string;
};

export const defaultRuntimeConfig: RuntimeConfig = {
Expand Down Expand Up @@ -141,5 +141,5 @@ const Browser: FC<NoodjsProps> = ({
export default Browser;

function escapeForScriptTag(str: string): string {
return str.replace(/<\/script>/gi, '<\\/script>');
return str.replace(/<\/script>/gi, "<\\/script>");
}
18 changes: 9 additions & 9 deletions components/apps/Ocaps/daemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { HelloPortMessage, type RpcMessage } from "./util";

main();

async function main () {
async function main() {
// @ts-ignore
const { connectGuestPort } = await globalThis.startDaemon({
makeWebWorker () {
console.log('making endo worker in subworker')
const worker = new Worker(new URL('./worker.ts', import.meta.url));
makeWebWorker() {
console.log("making endo worker in subworker");
const worker = new Worker(new URL("./worker.ts", import.meta.url));
return worker;
}
})
},
});

console.log("hello from daemon!");

console.log('hello from daemon!')

addEventListener("message", (event) => {
if (typeof event.data !== "object") return;
/* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
Expand All @@ -26,7 +26,7 @@ async function main () {
const message = event.data as HelloPortMessage;
const { appId } = message.params;
const port = event.ports[0];
console.log('daemon HELLO PORT', port, appId);
console.log("daemon HELLO PORT", port, appId);
connectGuestPort(port, appId);
}
});
Expand Down
17 changes: 10 additions & 7 deletions components/apps/Ocaps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ import type { ComponentProcessProps } from "components/system/Apps/RenderCompone
import { useProcesses } from "contexts/process";
import { MessageEventHandler } from "hooks/usePostMessage";
import { useCallback, type FC } from "react";
import WorkerEnvSource from './dist/dist-worker-env-bundle.js.raw';
import WorkerEnvSource from "./dist/dist-worker-env-bundle.js.raw";
import { HelloPortMessage, RpcMessage } from "./util";
/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
// @ts-ignore

// no SSR
let daemonWebWorker: Worker;
if (typeof window !== 'undefined') {
daemonWebWorker = new Worker(new URL('./daemon.ts', import.meta.url));
if (typeof window !== "undefined") {
daemonWebWorker = new Worker(new URL("./daemon.ts", import.meta.url));
}

const Browser: FC<ComponentProcessProps> = (props) => {
const { id } = props;
const {
processes: { [id]: process },
} = useProcesses();
const url = process?.url || '';
const url = process?.url || "";

const libs: string[] = [];
const runtime = `${WorkerEnvSource}`
const runtime = `${WorkerEnvSource}`;

const runtimeConfig: RuntimeConfig = {
libs,
Expand All @@ -36,11 +36,14 @@ const Browser: FC<ComponentProcessProps> = (props) => {
const message = event.data as RpcMessage;
if (message.type === "HELLO_PORT") {
const port = event.ports[0];
const appId = url === '/Users/Public/Start Menu/Endo/cat-wallet.ocaps' ? 'HOST' : url;
const appId =
url === "/Users/Public/Start Menu/Endo/cat-wallet.ocaps"
? "HOST"
: url;
const helloPortMessage: HelloPortMessage = {
type: "HELLO_PORT",
params: {
appId,
appId,
},
};
daemonWebWorker.postMessage(helloPortMessage, [port]);
Expand Down
2 changes: 1 addition & 1 deletion components/apps/Ocaps/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export type HelloPortMessage = RpcMessage & {
type: "HELLO_PORT";
params: {
appId: string;
}
};
};
3 changes: 1 addition & 2 deletions components/apps/Ocaps/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
import "./dist/dist-worker-init-bundle.js";
// import "../../../../endo/packages/daemon/dist-worker-init-bundle";

console.log('hello from worker!')

console.log("hello from worker!");
3 changes: 2 additions & 1 deletion components/apps/OldMacFileExplorer/StyledWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const StyledWindow = styled(motion.section)<StyledWindowProps>`
@font-face {
font-family: "ChicagoRegular";
src: url("./System/Fonts/bitchicago12-webfont.eot?iefix") format("eot"),
src:
url("./System/Fonts/bitchicago12-webfont.eot?iefix") format("eot"),
url("./System/Fonts/bitchicago12-webfont.woff") format("woff"),
url("./System/Fonts/bitchicago12-webfont.ttf") format("truetype"),
url("./System/Fonts/bitchicago12-webfont.svg#webfontvbCjnPDX")
Expand Down
6 changes: 3 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const nextConfig = {
);
config.module.rules.push({
test: /\.js\.raw$/,
type: 'asset/source'
type: "asset/source",
});

config.resolve.fallback = config.resolve.fallback || {};
Expand All @@ -63,6 +63,6 @@ const nextConfig = {

module.exports = bundleAnalyzer
? require("@next/bundle-analyzer")({
enabled: isProduction,
})(nextConfig)
enabled: isProduction,
})(nextConfig)
: nextConfig;

0 comments on commit 2dc1f52

Please sign in to comment.