Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"changelog": "bun ./packages/meta/bin/update-changelog.ts",
"deploy:docs": "gh-pages -d dist/docs/build -t true",
"dev": "nx dev playground-website",
"dev:experimental-posix-kernel": "nx dev-experimental-posix-kernel playground-website",
"format": "nx format",
"format:uncommitted": "nx format --fix --parallel --uncommitted",
"lint": "nx run-many --all --target=lint",
Expand Down
8 changes: 8 additions & 0 deletions packages/playground/remote/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
}
}
},
"dev-experimental-posix-kernel": {
"executor": "nx:run-commands",
"continuous": true,
"options": {
"command": "vite --config vite.posix-kernel.config.ts",
"cwd": "packages/playground/remote"
}
},
"preview": {
"executor": "@nx/vite:preview-server",
"defaultConfiguration": "production",
Expand Down
94 changes: 94 additions & 0 deletions packages/playground/remote/remote-posix-kernel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!doctype html>
<html>
<head>
<title>WordPress Playground — Experimental POSIX Kernel</title>
<style>
* {
box-sizing: border-box;
}

html,
body,
#wp {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
border: 0;
}

html,
body {
overflow: hidden;
}

body.has-error {
padding: 15px;
background: #f1f1f1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 20px;
font-family: Arial, Helvetica, sans-serif;
line-height: 1.4;
}
body.has-error .error-message {
padding: 20px;
max-width: 800px;
}
body.has-error button {
margin-top: 15px;
margin-bottom: 15px;
font-size: 20px;
padding: 5px 10px;
cursor: pointer;
}

@media (prefers-color-scheme: dark) {
body.is-loading,
body.has-error {
background: #1e1e1e;
color: #fff;
}
}
</style>
</head>
<body class="is-loading">
<iframe
id="wp"
title="The WordPress site"
sandbox="allow-same-origin allow-scripts allow-popups allow-forms allow-downloads allow-modals"
></iframe>
<script type="module">
if (window.top != window.self) {
document.body.classList.add('is-embedded');
}
import { bootPlaygroundRemote } from './src/lib/posix-kernel/index';
try {
window.playground = await bootPlaygroundRemote();
} catch (e) {
console.error(e);
document.body.className = 'has-error';
document.body.innerHTML = '';

const div = document.createElement('div');
div.className = 'error-message';
div.innerHTML =
'Ooops! WordPress Playground (POSIX kernel mode) had a hiccup! <br/><br/> ' +
(e?.userFriendlyMessage ||
'See the developer tools for error details.');
document.body.append(div);

const button = document.createElement('button');
button.innerText = 'Try again';
button.onclick = () => {
window.location.reload();
};
document.body.append(button);
} finally {
document.body.classList.remove('is-loading');
}
</script>
</body>
</html>
Loading
Loading