feat(web): add shell-first runbook UI and mock demo (#2)
Add notebook parameters, literal highlighted scripts, copy helpers, streamed runs, host-key confirmation, artifacts, conditional notes, login and optimistic Markdown editing. Keep the temporary core renderer isolated to mock mode. Use React and Vite for the UI, react-markdown for safe Markdown rendering, highlight.js for shell syntax, and CodeMirror 6 for Markdown editing. Add Testing Library, jsdom and Vitest for component and event-state coverage. Validate pnpm install, root typecheck and test (29 web tests, 1 server test), plus normal and mock web builds. Core contracts remain unchanged; real backend execution awaits the parallel core/server implementations.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const mock =
|
||||
loadEnv(mode, process.cwd(), "").VITE_MOCK === "1" ||
|
||||
process.env.VITE_MOCK === "1";
|
||||
return {
|
||||
plugins: [react()],
|
||||
build: { target: "es2022" },
|
||||
// TEMPORARY: delete this alias and src/mock/core.ts once M0 lands.
|
||||
resolve: {
|
||||
alias: mock
|
||||
? [
|
||||
{
|
||||
find: /^@shellbook\/core$/,
|
||||
replacement: fileURLToPath(
|
||||
new URL("./src/mock/core.ts", import.meta.url),
|
||||
),
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
server: {
|
||||
proxy: { "/api": { target: "http://127.0.0.1:8080", ws: true } },
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user