Mara on PR#3315: "shouldnt the pattern be that the old dashboard has a dep on preact and has a preact instance running for the jobq view? then we could get rid of a lot of extra plumbing" - right: the plain h() authoring existed only to dodge adding JSX support to the dashboard's esbuild config, and that dodge is exactly the plumbing to remove now that the dashboard already depends on preact. - JobqGraph.js -> JobqGraph.jsx, rewritten in real JSX. - dashboard/build.mjs: added jsx: 'automatic', jsxImportSource: 'preact' to the JS-bundle esbuild call (esbuild already picks the jsx loader for .jsx by extension; this just sets the transform mode, matching swarm-ui's config). No other entry in that bundle uses JSX today. - shared/package.json: export target updated to the .jsx file. The CSS-as-page-level-@import structure is unchanged and stays that way regardless of JSX: dashboard bundles this component transitively through one esbuild call whose .css loader is 'text' (for the shadow-DOM components that need their CSS as a literal string), and esbuild's loader map is global per call, not per-module - importing CSS from this component would silently pick up that loader too. Explained in the file's own top comment. Verified: npm run build (whole workspace) and npm run typecheck (swarm-ui) clean. Re-ran the same headless-chromium screenshot against a mock GET /api/jobq/graph payload as the previous verification - pixel-identical to the h()-based version, confirming this is a pure authoring-style refactor with no behavior change.
37 lines
1.3 KiB
JSON
37 lines
1.3 KiB
JSON
{
|
|
"name": "@hive/shared",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"description": "Shared frontend modules used by both the dashboard and the per-agent UI: terminal log pane, Catppuccin palette, base typography. Imported by sibling workspaces; not bundled standalone.",
|
|
"type": "module",
|
|
"main": "./src/index.js",
|
|
"dependencies": {
|
|
"preact": "10.29.8"
|
|
},
|
|
"exports": {
|
|
".": "./src/index.js",
|
|
"./terminal.js": "./src/terminal/terminal.js",
|
|
"./tabs.js": "./src/tabs/tabs.js",
|
|
"./tabs.css": "./src/tabs/tabs.css",
|
|
"./hive-tab-strip.js": "./src/tabs/hive-tab-strip.js",
|
|
"./colors.css": "./src/colors.css",
|
|
"./theme.css": "./src/theme.css",
|
|
"./base.css": "./src/base.css",
|
|
"./terminal.css": "./src/terminal/terminal.css",
|
|
"./chrome.css": "./src/chrome.css",
|
|
"./pill.css": "./src/pill.css",
|
|
"./forms.js": "./src/forms.js",
|
|
"./prefs.js": "./src/prefs.js",
|
|
"./dom.js": "./src/dom.js",
|
|
"./modal.js": "./src/modal.js",
|
|
"./shadow-css.js": "./src/shadow-css.js",
|
|
"./hive-menu.js": "./src/hive-menu/hive-menu.js",
|
|
"./hive-warn.js": "./src/hive-warn/hive-warn.js",
|
|
"./side-panel.js": "./src/side-panel/hive-side-panel.js",
|
|
"./jobq-graph.js": "./src/jobq-graph/JobqGraph.jsx",
|
|
"./jobq-graph.css": "./src/jobq-graph/jobq-graph.css"
|
|
},
|
|
"files": [
|
|
"src/"
|
|
]
|
|
}
|