More

Development and testing

#Root scripts

CommandPurpose
npm run setupInstall root/web dependencies and build everything.
npm run buildTypeScript backend → dist/.
npm run build:webInterface TypeScript and Vite SPA.
npm run build:allBackend and interface.
npm startBuilt CLI; default bind 0.0.0.0.
npm run typecheckRoot type checking without output.
npm testConfigured Vitest suite, including discovered tests/ files.
npm run test:e2eThe two smoke/frontend and workspace-control files in the script, not every tests/e2e/ test.
npm run test:watchWatch mode.
npm run test:coverageCoverage; may need a provider matching the Vitest version.
npm run prepublishOnlyPre-publication build hook; does not publish by itself.

#Interface development

After npm run setup, use two terminals at the root. Backend:

node bin/cockpit.js --host 127.0.0.1 --port 4000 --headless --no-open

Vite:

npm --prefix web run dev

Open http://localhost:5173. The proxy sends /api and /ws to 127.0.0.1:4000; changing the port requires updating web/vite.config.ts. Backend changes require npm run build and a restart; no backend watch script is declared.

Other web scripts:

npm --prefix web run build
npm --prefix web run preview

Preview serves the built SPA, not a replacement backend. The proxy above belongs to the development server.

#Checks

npm run typecheck
npm run build:all
npx playwright install chromium
npm run test:e2e

Browser tests need Playwright Chromium. On Linux, missing system libraries may require npx playwright install --with-deps chromium with installation permissions.

Select suites:

npx vitest run tests/unit
npx vitest run tests/integration
npx vitest run tests/e2e

Some tests create servers, processes, and temporary repositories. Read suites before adapting your environment. Having tests does not establish that all are validated on native Windows or macOS.

Report generator:

node scripts/generate-compliance-report.js

Writes .cockpit/compliance/audit-report.json and .cockpit/compliance/audit-report.md. The script assembles declared passing checks and predefined metadata; it does not run tests. Generating a report does not prove compliance for the current revision. Run relevant checks separately and inspect the script before automation.