Clean up build system and remove unused dependencies

- Remove all Jest-related dependencies (using Vitest)
- Remove pre-commit hooks (husky, lint-staged) and related files
- Consolidate test configuration into single vitest.config.ts
- Fix build-native.js to use correct entry point (src/cli.ts)
- Add bun.lock to .gitignore (generated during native build)
- Update README.md with simplified, accurate documentation
- Make npm run build include native executable build
- Remove unused type declarations and test setup files

The build system is now minimal, clean, and consistent.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mario Zechner 2025-06-21 17:04:52 +02:00
parent 9f3fcb3bb8
commit 5180298bb5
10 changed files with 38 additions and 2037 deletions

5
web/.gitignore vendored
View file

@ -110,4 +110,7 @@ temp/
lint_output.txt lint_output.txt
# Native build output # Native build output
native/ native/
# Bun lockfile (generated during native build)
bun.lock

View file

@ -1,55 +1,48 @@
# VibeTunnel # VibeTunnel Web
Web-based terminal multiplexer with distributed architecture support. Web terminal interface and server for VibeTunnel.
## Quick Start ## Quick Start
Production users: Use the pre-built VibeTunnel executable from the main app.
## Development
```bash ```bash
npm install npm install
npm run dev # Starts server + auto-rebuilds npm run dev # Watch mode: server + client
npm run dev:client # Watch mode: client only (for debugging server)
``` ```
Open http://localhost:3000 Open http://localhost:3000
## Server Modes ### Build Commands
```bash ```bash
# Standalone server npm run clean # Remove build artifacts
npm run dev npm run build # Build everything (including native executable)
# HQ server (manages remote servers)
npm run dev -- --hq
# Remote server (connects to HQ)
npm run dev -- --hq-url http://hq-server:3000 --name remote1
```
## Build & Test
```bash
npm run build # Production build
npm run lint # Check code style npm run lint # Check code style
npm run lint:fix # Fix code style
npm run typecheck # Type checking npm run typecheck # Type checking
npm test # Run tests npm run test # Run all tests (unit + e2e)
npm run format # Format code
``` ```
## fwd Tool ## Production Build
CLI that spawns PTY sessions integrated with VibeTunnel:
```bash ```bash
# Forward a command to VibeTunnel npm run build
npx tsx src/fwd.ts <command> [args...] ./native/vibetunnel # Run standalone executable
# Monitor-only mode (no input)
npx tsx src/fwd.ts --monitor-only <command>
``` ```
Creates persistent sessions accessible via the web UI.
## Architecture ## Architecture
- **Server**: Express + node-pty for terminal sessions See [spec.md](./spec.md) for detailed architecture documentation.
- **Client**: Lit web components + xterm.js
- **Streaming**: SSE for output, WebSocket for binary buffers ## Key Features
- **Protocol**: Binary-optimized terminal state synchronization
- Terminal sessions via node-pty
- Real-time streaming (SSE + WebSocket)
- Binary-optimized buffer updates
- Multi-session support
- File browser integration

View file

@ -99,7 +99,7 @@ try {
console.log('Compiling with Bun...'); console.log('Compiling with Bun...');
const buildDate = new Date().toISOString(); const buildDate = new Date().toISOString();
const buildTimestamp = Date.now(); const buildTimestamp = Date.now();
const compileCmd = `BUILD_DATE="${buildDate}" BUILD_TIMESTAMP="${buildTimestamp}" bun build src/index.ts --compile --outfile native/vibetunnel`; const compileCmd = `BUILD_DATE="${buildDate}" BUILD_TIMESTAMP="${buildTimestamp}" bun build src/cli.ts --compile --outfile native/vibetunnel`;
console.log(`Running: ${compileCmd}`); console.log(`Running: ${compileCmd}`);
console.log(`Build date: ${buildDate}`); console.log(`Build date: ${buildDate}`);

File diff suppressed because it is too large Load diff

View file

@ -8,15 +8,12 @@
"dev": "node scripts/dev.js", "dev": "node scripts/dev.js",
"dev:client": "node scripts/dev.js --client-only", "dev:client": "node scripts/dev.js --client-only",
"build": "node scripts/build.js", "build": "node scripts/build.js",
"build:native": "node scripts/build.js --native",
"lint": "eslint 'src/**/*.{ts,tsx}'", "lint": "eslint 'src/**/*.{ts,tsx}'",
"lint:fix": "eslint 'src/**/*.{ts,tsx}' --fix", "lint:fix": "eslint 'src/**/*.{ts,tsx}' --fix",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"test": "vitest", "test": "vitest",
"test:e2e": "vitest run --config vitest.config.e2e.ts",
"format": "prettier --write 'src/**/*.{ts,tsx,js,jsx,json,css,md}'", "format": "prettier --write 'src/**/*.{ts,tsx,js,jsx,json,css,md}'",
"format:check": "prettier --check 'src/**/*.{ts,tsx,js,jsx,json,css,md}'", "format:check": "prettier --check 'src/**/*.{ts,tsx,js,jsx,json,css,md}'"
"pre-commit": "./scripts/pre-commit-check.sh"
}, },
"dependencies": { "dependencies": {
"@homebridge/node-pty-prebuilt-multiarch": "^0.12.0", "@homebridge/node-pty-prebuilt-multiarch": "^0.12.0",
@ -32,7 +29,6 @@
"@eslint/js": "^9.29.0", "@eslint/js": "^9.29.0",
"@testing-library/dom": "^10.4.0", "@testing-library/dom": "^10.4.0",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"@types/jest": "^30.0.0",
"@types/mime-types": "^3.0.1", "@types/mime-types": "^3.0.1",
"@types/node": "^24.0.3", "@types/node": "^24.0.3",
"@types/supertest": "^6.0.3", "@types/supertest": "^6.0.3",
@ -51,16 +47,12 @@
"eslint-config-prettier": "^10.1.5", "eslint-config-prettier": "^10.1.5",
"eslint-plugin-prettier": "^5.5.0", "eslint-plugin-prettier": "^5.5.0",
"happy-dom": "^18.0.1", "happy-dom": "^18.0.1",
"husky": "^9.1.7",
"jest": "^30.0.0",
"lint-staged": "^16.1.2",
"node-fetch": "^3.3.2", "node-fetch": "^3.3.2",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"prettier": "^3.5.3", "prettier": "^3.5.3",
"puppeteer": "^24.10.2", "puppeteer": "^24.10.2",
"supertest": "^7.1.1", "supertest": "^7.1.1",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"ts-jest": "^29.4.0",
"tsx": "^4.20.3", "tsx": "^4.20.3",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"typescript-eslint": "^8.34.1", "typescript-eslint": "^8.34.1",

View file

@ -25,10 +25,8 @@ execSync('esbuild src/client/test-terminals-entry.ts --bundle --outfile=public/b
console.log('Building server...'); console.log('Building server...');
execSync('tsc', { stdio: 'inherit' }); execSync('tsc', { stdio: 'inherit' });
// Build native executable if requested // Build native executable
if (process.argv.includes('--native')) { console.log('Building native executable...');
console.log('Building native executable...'); execSync('node build-native.js', { stdio: 'inherit' });
execSync('node build-native.js', { stdio: 'inherit' });
}
console.log('Build completed successfully!'); console.log('Build completed successfully!');

View file

@ -1,50 +0,0 @@
#!/bin/bash
# VibeTunnel Pre-commit Check Script
# Can be run manually: npm run pre-commit
set -e
echo "🔍 Running pre-commit checks..."
# Check if we're in a git repository
if ! git rev-parse --git-dir > /dev/null 2>&1; then
echo "❌ Not in a git repository"
exit 1
fi
# Get staged files or all TypeScript files if not in a commit
if git diff --cached --quiet; then
echo "📁 No staged files, checking all TypeScript files..."
TS_FILES=$(find src -name "*.ts" -o -name "*.tsx" | tr '\n' ' ')
else
echo "📁 Checking staged TypeScript files..."
TS_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(ts|tsx)$' | tr '\n' ' ')
fi
if [ -z "$TS_FILES" ]; then
echo "✅ No TypeScript files to check"
exit 0
fi
echo "Files to check: $TS_FILES"
# Run ESLint
echo "🔧 Running ESLint..."
npm run lint
if [ $? -ne 0 ]; then
echo "❌ ESLint failed. Run 'npm run lint:fix' to auto-fix issues."
exit 1
fi
# Run Prettier check
echo "✨ Checking Prettier formatting..."
npm run format:check
if [ $? -ne 0 ]; then
echo "❌ Prettier formatting issues found. Run 'npm run format' to fix."
exit 1
fi
echo "✅ All checks passed!"

View file

@ -1,18 +0,0 @@
import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
globals: true,
environment: 'node',
// NO SETUP FILES - we want raw, unmocked environment
include: ['src/test/e2e/**/*.test.ts'],
testTimeout: 60000, // E2E tests need more time
hookTimeout: 30000, // Cleanup hooks need time too
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
});

View file

@ -5,7 +5,7 @@ export default defineConfig({
test: { test: {
globals: true, globals: true,
environment: 'node', environment: 'node',
setupFiles: ['./src/test/setup.ts'], include: ['src/**/*.test.ts'],
coverage: { coverage: {
provider: 'v8', provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'], reporter: ['text', 'json', 'html', 'lcov'],
@ -29,9 +29,8 @@ export default defineConfig({
branches: 80, branches: 80,
statements: 80, statements: 80,
}, },
testTimeout: 10000, testTimeout: 60000, // 60s for e2e tests
// Separate test suites hookTimeout: 30000, // 30s for setup/teardown
includeSource: ['src/**/*.{js,ts}'],
}, },
resolve: { resolve: {
alias: { alias: {

11
web/vitest.d.ts vendored
View file

@ -1,11 +0,0 @@
/// <reference types="vitest" />
// Custom matchers for Vitest
declare module 'vitest' {
interface Assertion {
toBeValidSession(): this;
}
interface AsymmetricMatchersContaining {
toBeValidSession(): unknown;
}
}