Fan-out integration + fixes found by the test/acceptance pass: - FIX ring-buffer: chunks >= capacity skipped bytes now count into the monotonic offset (invariant: stream byte k lives at k % capacity) — window order was corrupted on unaligned big chunks - FIX auth: non-numeric cookie expiry no longer bypasses expiration - FIX protocol: safe-integer validation on ack.bytes / hello.protocol - FIX @fastify/websocket v11: websocket route must be registered in an encapsulated context after plugin load (handler got REST signature) - FIX flow-control deadlock found by e2e acceptance: client only ACKs on data receipt, so pausing with an unACKed residue in (LOW, ACK_EVERY] stalled both sides at 0.9 MB. ACK_EVERY now 64 KiB (<= LOW invariant, tested) + trailing debounced ACK in the web client - Web: Vue 3 + Vite + Pinia + Tailwind 4 + vue-i18n (EN/FR) + xterm 6 (fit + webgl fallback), multiplexed ws-client with reconnect/backoff and resync epochs - Tests: 100 vitest (protocol fuzz, ring edges, auth, pty-manager flow control with mocked pty, REST e2e) ; CI Node 22/24 + pack-smoke - scripts/acceptance-p1.mjs: real daemon + real WS client — boot, login, attach, stdin, 10 MB flood w/ ACK (13.7 MB/1.9s, RSS bounded), brutal disconnect + replay resync, kill broadcast, SIGTERM drain
32 lines
1.4 KiB
JavaScript
32 lines
1.4 KiB
JavaScript
#!/usr/bin/env node
|
|
// Embarque la SPA buildée (packages/web/dist) dans public/ du package server,
|
|
// pour que le tarball npm soit autonome. Branché sur le hook "prepack".
|
|
// ARBORETUM_PACK_NO_WEB=1 : mode tolérant (CI/smoke) — placeholder à la place du front.
|
|
import { cpSync, existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
import { join, dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
const webDist = join(serverDir, '..', 'web', 'dist');
|
|
const publicDir = join(serverDir, 'public');
|
|
|
|
if (!existsSync(webDist)) {
|
|
if (process.env.ARBORETUM_PACK_NO_WEB === '1') {
|
|
rmSync(publicDir, { recursive: true, force: true });
|
|
mkdirSync(publicDir, { recursive: true });
|
|
writeFileSync(
|
|
join(publicDir, 'index.html'),
|
|
'<!doctype html>\n<html lang="en">\n<head><meta charset="utf-8"><title>Arboretum</title></head>\n' +
|
|
'<body><p>Arboretum server is running, but this package was built without the web UI.</p></body>\n</html>\n',
|
|
);
|
|
console.log('copy-web: ARBORETUM_PACK_NO_WEB=1 — wrote placeholder public/index.html');
|
|
process.exit(0);
|
|
}
|
|
console.error(`copy-web: ${webDist} not found — run npm run build -w @arboretum/web first`);
|
|
process.exit(1);
|
|
}
|
|
|
|
rmSync(publicDir, { recursive: true, force: true });
|
|
cpSync(webDist, publicDir, { recursive: true });
|
|
console.log(`copy-web: copied ${webDist} -> ${publicDir}`);
|