chore: P0 skeleton
Bootstrap the Dashward repo per arch/UBUNTU-DASHBOARD-SPACE.md: - pnpm-workspaces monorepo (sdk, extension, container, widgets-builtin/*) - GNOME extension stub (metadata.json, src/*.ts placeholders for warden, guard, supervisor, entry UX, DBus service) - WebKit container stub (GJS main + page-side runtime + dashboard.html) - TypeScript widget SDK (defineWidget + types) - Builtin clock widget as the first SDK consumer example - DBus interface XML (proto/shell.iface.xml) and shared types - esbuild configs for extension and container; tsc for SDK - Design doc copied in at repo root for discoverability No functional logic yet -- all components are placeholders that compose in extension.ts so the build chain can be exercised. P1 (workspace warden) starts next. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
34
container/esbuild.config.js
Normal file
34
container/esbuild.config.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import esbuild from 'esbuild';
|
||||
|
||||
const watch = process.argv.includes('--watch');
|
||||
|
||||
const gjsOpts = {
|
||||
entryPoints: ['src/main.ts'],
|
||||
bundle: true,
|
||||
outfile: 'dist/main.js',
|
||||
format: 'esm',
|
||||
target: 'firefox128',
|
||||
platform: 'neutral',
|
||||
external: ['gi://*', 'system', 'cairo', 'gettext'],
|
||||
sourcemap: 'inline',
|
||||
logLevel: 'info',
|
||||
};
|
||||
|
||||
const runtimeOpts = {
|
||||
entryPoints: ['runtime/runtime.ts'],
|
||||
bundle: true,
|
||||
outfile: 'dist/runtime.js',
|
||||
format: 'esm',
|
||||
target: 'es2022',
|
||||
platform: 'browser',
|
||||
sourcemap: 'inline',
|
||||
logLevel: 'info',
|
||||
};
|
||||
|
||||
if (watch) {
|
||||
const c1 = await esbuild.context(gjsOpts);
|
||||
const c2 = await esbuild.context(runtimeOpts);
|
||||
await Promise.all([c1.watch(), c2.watch()]);
|
||||
} else {
|
||||
await Promise.all([esbuild.build(gjsOpts), esbuild.build(runtimeOpts)]);
|
||||
}
|
||||
16
container/package.json
Normal file
16
container/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "@dashward/container",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "WebKitGTK kiosk that hosts the Dashward dashboard page.",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "node esbuild.config.js",
|
||||
"dev": "node esbuild.config.js --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@girs/gjs": "4.0.0-next.1",
|
||||
"@girs/gtk-3.0": "3.24.0-next.1",
|
||||
"@girs/webkit2-4.1": "4.1.0-next.1"
|
||||
}
|
||||
}
|
||||
12
container/runtime/dashboard.html
Normal file
12
container/runtime/dashboard.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Dashward</title>
|
||||
<link rel="stylesheet" href="styles.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main id="grid"></main>
|
||||
<script type="module" src="runtime.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
15
container/runtime/runtime.ts
Normal file
15
container/runtime/runtime.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// Stub: page-side runtime (design §11).
|
||||
// Loads layout.json, instantiates widgets in iframes on the 12-column grid,
|
||||
// handles edit mode, persists changes via the shell bridge.
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__dashShell__?: {
|
||||
call(method: string, args?: unknown): Promise<unknown>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
console.info('[dashward-runtime] P0 stub loaded');
|
||||
|
||||
export {};
|
||||
22
container/runtime/styles.css
Normal file
22
container/runtime/styles.css
Normal file
@@ -0,0 +1,22 @@
|
||||
:root {
|
||||
--bg: #f5f5f7;
|
||||
--fg: #1c1c1e;
|
||||
--grid-gap: 16px;
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
--bg: #0f0f12;
|
||||
--fg: #f0f0f5;
|
||||
}
|
||||
|
||||
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--fg); }
|
||||
body { font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; }
|
||||
|
||||
#grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(12, 1fr);
|
||||
gap: var(--grid-gap);
|
||||
padding: var(--grid-gap);
|
||||
min-height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
4
container/src/bridge.ts
Normal file
4
container/src/bridge.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// Stub: WebKit UserContentManager wiring (design §8.2).
|
||||
// Registers script-message handlers; evaluates JS into the page for shell→page push.
|
||||
|
||||
export {};
|
||||
3
container/src/dbus-client.ts
Normal file
3
container/src/dbus-client.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// Stub: DBus client for top.hangmanlab.Dashward.Shell (design §8.1).
|
||||
|
||||
export {};
|
||||
10
container/src/main.ts
Normal file
10
container/src/main.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Stub: see design §7 — WebKit kiosk bootstrap.
|
||||
// Creates a GtkWindow, attaches a WebKitWebView, loads dashboard.html,
|
||||
// connects to the Shell DBus service.
|
||||
|
||||
import GLib from 'gi://GLib';
|
||||
|
||||
GLib.set_prgname('dashward-container');
|
||||
log('[dashward-container] P0 stub started');
|
||||
|
||||
declare function log(msg: string): void;
|
||||
4
container/src/window.ts
Normal file
4
container/src/window.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// Stub: GtkWindow + WebKitWebView setup (design §7).
|
||||
// Properties: undecorated, fullscreen on primary, app_id = top.hangmanlab.dashward.container.
|
||||
|
||||
export {};
|
||||
10
container/tsconfig.json
Normal file
10
container/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": ".",
|
||||
"noEmit": true,
|
||||
"types": []
|
||||
},
|
||||
"include": ["src/**/*", "runtime/**/*"]
|
||||
}
|
||||
Reference in New Issue
Block a user