mirror of
https://github.com/kerberos-io/agent.git
synced 2026-11-21 22:50:39 +00:00
react-scripts 5 is unmaintained and pins vulnerable versions of
webpack-dev-server, webpack-dev-middleware, postcss 7 and svgo.
- build and dev server: Vite 8 with @vitejs/plugin-react
- tests: Vitest 4 with jsdom (jest.* -> vi.*; mocked default exports
now return { default })
- index.html moves to ui/ and loads src/index.jsx as a module
- REACT_APP_ENVIRONMENT is replaced by import.meta.env.PROD/MODE, and
REACT_APP_AGENT_API_PORT is renamed to VITE_AGENT_API_PORT
- bundled output goes to static/ so it does not mix with public/assets
- package.json is not "type": "module": that would switch CommonJS
interop to Node semantics and break default imports such as
@giantmachines/redux-websocket
- sass 1.54 -> 1.108 (Vite needs the modern compiler API); sass-loader
removed
- requires Node >= 20.19
`yarn build` still writes to machinery/www, so the Dockerfile and CI
workflow are unchanged.
Clears the remaining 9 react-scripts Dependabot alerts. Five alerts for
svgo 1 and decode-uri-component 0.2 remain; they come from build-tool
dependencies of @kerberos-io/ui and are not part of the bundle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
Kerberos Agent UI
The web interface of the Kerberos Agent: a React app built with Vite and tested with Vitest. Requires Node.js 20.19 or newer.
Scripts
| Command | What it does |
|---|---|
yarn start |
Starts the dev server on http://localhost:3000 with hot reload. |
yarn build |
Builds for production and moves the output to ../machinery/www, where the Agent serves it. |
yarn preview |
Serves the production build from ../machinery/www on port 3000. Run yarn build first. |
yarn test |
Runs the test suite once. yarn test:watch keeps it running. |
yarn lint |
Lints src/ with ESLint. |
yarn format |
Formats the code with Prettier. |
Configuration
In development the UI talks to the Agent API on port 8082 of the same host.
Override it with VITE_AGENT_API_PORT:
VITE_AGENT_API_PORT=9090 yarn start
In production builds the UI uses the host and port it was served from.
Runtime settings that differ per deployment (such as demo mode) live in
public/env.js, which the Agent can replace without rebuilding the UI.
Layout
index.html: the HTML entry point; Vite injects the bundle here.src/: application code.src/index.jsxis the entry module.public/: copied unchanged to the build root (favicons, fonts, locales,env.js).- Bundled JS, CSS and assets go to
static/in the build, so they don't mix with theassets/folder frompublic/.