Vibecoded CI/CD
This commit is contained in:
36
AGENTS.md
36
AGENTS.md
@@ -63,10 +63,17 @@ its theme (live, same page), and the Goals/Messages pane.
|
||||
|
||||
`lean/Dockerfile` still builds lean4web (upstream's real Lean + Mathlib per session;
|
||||
`--build-arg LEAN4WEB_REF=<tag|branch>` pins it) and runs its websocket server on port 8080;
|
||||
the compose `lean` service runs it. Upstream asks for a dedicated machine, and the image is
|
||||
heavy (Mathlib). It runs `NO_BWRAP=true` — bubblewrap cannot nest in a container, so Docker
|
||||
itself is the sandbox; whoever reaches the port can run Lean. Build/run, TLS, security and
|
||||
projects: `lean/README.md`.
|
||||
the compose `lean` service runs it (image `git.aranroig.com/syndria98/mathew-lean:latest` —
|
||||
CI builds and pushes it, and deploys lean, only when `lean/**` changes: `deploy-lean.yml`;
|
||||
the regular deploy just pulls the tag). Upstream asks for a dedicated machine, so the build
|
||||
is **multi-stage**: dev tooling stays in the builder, and the pushed image is a slim runtime
|
||||
of node + elan toolchain + built client + Mathlib's compiled cache (~11GB — the cache is
|
||||
the bulk; upstream's second demo project `Stable` is dropped, its extra ~3GB toolchain was
|
||||
unused). `--build-arg BAKE_MATHLIB=false` ships Mathlib *out* of the image (~4GB) into a
|
||||
`.lake` volume, filled once at first start by `lean/entrypoint.sh` — see lean/README.md.
|
||||
It runs `NO_BWRAP=true` — bubblewrap cannot nest in a container, so Docker itself is the
|
||||
sandbox; whoever reaches the port can run Lean. Build/run, TLS, security and projects:
|
||||
`lean/README.md`.
|
||||
|
||||
- `frontend/app/utils/lean/lsp.ts` — a minimal LSP JSON-RPC client over a websocket
|
||||
(request/response pairing, notification dispatch, and auto-ack of the server→client
|
||||
@@ -206,6 +213,24 @@ carry `<code>`/`<span>` markup are drawn with `v-html` through `th()`
|
||||
(`useAppLocale`), which escapes interpolated values. Adding a language = add a catalog
|
||||
copy + an `APP_LANGUAGES` entry + the code in the backend's `SUPPORTED_LOCALES`.
|
||||
|
||||
- **The same bundle also ships as a desktop app** (Tauri 2, `src-tauri/`):
|
||||
`npm run desktop:dev` / `desktop:build` / `desktop:generate` / `desktop:icons`
|
||||
in `frontend/` (needs Rust and the WebKitGTK stack; the shell, the scripts and
|
||||
the build prerequisites are `src-tauri/README.md`). `nuxt.config.ts` changes
|
||||
shape on one flag — `MATHEW_DESKTOP=1`, implied too by the `TAURI_ENV_*` the
|
||||
Tauri CLI passes to its hooks: `ssr: false`, no `/api` proxy route, the
|
||||
pre-paint script from `public/preboot.js` instead of inline — and writes the
|
||||
files to `dist-desktop/public` (never over the web `.output/`), which is what
|
||||
`frontendDist` reads. Nothing in `app/` is desktop code: `utils/desktop.ts`
|
||||
asks at run time whether it is in a window (`__TAURI_INTERNALS__`) and only
|
||||
then does the window's thing — outward links leave through the `opener`
|
||||
plugin (`plugins/desktop.ts`), and the session token and interface language
|
||||
mirror into localStorage (`keepTokenRemembered`, since a webview is not owed
|
||||
a cookie jar for its own `tauri://localhost`). A desktop build bakes the API
|
||||
base to `https://mathew.aranroig.com` (`NUXT_PUBLIC_API_BASE` overrides, e.g.
|
||||
`http://localhost:5000` to test against this machine) and leaves `leanUrl`
|
||||
empty — a window on a random laptop has no `localhost:8080` to find.
|
||||
|
||||
- `app/pages/` — `/` (search), `/wiki/[lang]/[slug]` (one language version of an
|
||||
article — the address every version has, English included — drawn as a page of
|
||||
the open book), `/wiki/[slug]` (an address naming no language: the middleware
|
||||
@@ -425,5 +450,6 @@ copy + an `APP_LANGUAGES` entry + the code in the backend's `SUPPORTED_LOCALES`.
|
||||
A tool page like this is wired in step: `ToolPage`/`TOOL_PAGE_PATHS`
|
||||
(`utils/routes.ts`), the page file, `TOOL_LABEL_KEYS`, the `ToolPane` branch and spine
|
||||
glyph, the sidebar link, and the `PAGE_TOOLS` entry.
|
||||
- Frontend dev server may fall back to port 3001 if 3000 is taken.
|
||||
- Frontend dev server may fall back to port 3001 if 3000 is taken — the desktop
|
||||
shell's `devUrl` is fixed to 3000, so free the port before `npm run desktop:dev`.
|
||||
- `frontend/types/markdown-it-texmath.d.ts` provides types for the untyped texmath package.
|
||||
|
||||
Reference in New Issue
Block a user