From b92350a6ac7c4c8df805e69b622320256a81f1b1 Mon Sep 17 00:00:00 2001 From: "a.tolmachev" Date: Sun, 12 Apr 2026 02:28:05 +0300 Subject: [PATCH] ui: add lightweight frontend build pipeline --- README.md | 1 + TASKS.md | 13 +- apps/ui/Dockerfile | 20 +- apps/ui/html/agents.html | 12 +- apps/ui/html/api-keys.html | 12 +- apps/ui/html/async-jobs.html | 12 +- apps/ui/html/login.html | 6 +- apps/ui/html/logs.html | 12 +- apps/ui/html/secrets.html | 12 +- apps/ui/html/settings.html | 12 +- apps/ui/html/stream-sessions.html | 12 +- apps/ui/html/usage.html | 12 +- apps/ui/html/wizard/index.html | 17 +- apps/ui/html/workspace-setup.html | 11 +- apps/ui/index.html | 12 +- apps/ui/js/wizard-state.js | 72 ++-- apps/ui/js/wizard.js | 28 +- apps/ui/package-lock.json | 487 +++++++++++++++++++++++- apps/ui/package.json | 5 +- apps/ui/scripts/build.js | 223 +++++++++++ apps/ui/scripts/playwright-stack.sh | 5 + apps/ui/scripts/playwright-ui-server.js | 4 +- 22 files changed, 809 insertions(+), 191 deletions(-) create mode 100644 apps/ui/scripts/build.js diff --git a/README.md b/README.md index 90576fb..9407cf4 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ Crank - платформа для публикации внешних API в в ```bash cd apps/ui npm ci +npm run build npm run e2e:install npm run e2e ``` diff --git a/TASKS.md b/TASKS.md index a4f7885..78a9ff4 100644 --- a/TASKS.md +++ b/TASKS.md @@ -2,20 +2,18 @@ ## Current -### `feat/frontend-build-pipeline` +### `feat/frontend-css-state-cleanup` Status: in_progress DoD: -- UI assets are bundled through a lightweight pipeline suitable for the current stack -- local source files remain readable, but shipped JS is no longer served as dozens of unbundled scripts -- vendor dependencies move under package-managed installation where practical -- Docker UI image builds the frontend assets before packaging them into nginx -- existing UI e2e coverage stays green after the build change +- button and control state visuals move from inline `element.style` mutations into CSS classes +- wizard navigation and similar interactive UI use semantic state classes instead of manual style strings +- existing UI e2e coverage stays green after the CSS-state cleanup ## Next -- `feat/frontend-css-state-cleanup` +- `feat/frontend-performance-polish` ## Backlog @@ -27,7 +25,6 @@ DoD: - `feat/frontend-template-safety-cleanup` - `feat/frontend-shell-unification` - `feat/frontend-wizard-modularization` -- `feat/frontend-build-pipeline` - `feat/frontend-css-state-cleanup` - `feat/frontend-performance-polish` - `feat/frontend-observability-and-testability` diff --git a/apps/ui/Dockerfile b/apps/ui/Dockerfile index 419229c..8130a9e 100644 --- a/apps/ui/Dockerfile +++ b/apps/ui/Dockerfile @@ -1,12 +1,18 @@ +FROM node:22-alpine AS build + +WORKDIR /app + +COPY apps/ui/package.json apps/ui/package-lock.json ./ +RUN npm ci + +COPY apps/ui ./ +COPY Crank.png ./Crank.png + +RUN npm run build + FROM nginx:1.27-alpine COPY apps/ui/nginx.conf /etc/nginx/conf.d/default.conf -COPY apps/ui/index.html /usr/share/nginx/html/index.html -COPY apps/ui/css /usr/share/nginx/html/css -COPY apps/ui/data /usr/share/nginx/html/data -COPY apps/ui/html /usr/share/nginx/html/html -COPY apps/ui/icons /usr/share/nginx/html/icons -COPY apps/ui/js /usr/share/nginx/html/js -COPY Crank.png /usr/share/nginx/html/Crank.png +COPY --from=build /app/dist /usr/share/nginx/html EXPOSE 3000 diff --git a/apps/ui/html/agents.html b/apps/ui/html/agents.html index 439f69d..8178a26 100644 --- a/apps/ui/html/agents.html +++ b/apps/ui/html/agents.html @@ -11,14 +11,7 @@ - - - - - - - - + @@ -393,7 +386,6 @@ - - + diff --git a/apps/ui/html/api-keys.html b/apps/ui/html/api-keys.html index 28a02a7..4d5c7c4 100644 --- a/apps/ui/html/api-keys.html +++ b/apps/ui/html/api-keys.html @@ -23,14 +23,7 @@ .scope-checkbox-name { font-size: 13px; font-weight: 500; color: var(--text-primary); } .scope-checkbox-desc { font-size: 11.5px; color: var(--text-muted); } - - - - - - - - + @@ -277,8 +270,7 @@ - - + diff --git a/apps/ui/html/async-jobs.html b/apps/ui/html/async-jobs.html index 87847b5..5d8debc 100644 --- a/apps/ui/html/async-jobs.html +++ b/apps/ui/html/async-jobs.html @@ -9,14 +9,7 @@ - - - - - - - - +