mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-03-25 09:25:50 +00:00
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:
parent
9f3fcb3bb8
commit
5180298bb5
10 changed files with 38 additions and 2037 deletions
5
web/.gitignore
vendored
5
web/.gitignore
vendored
|
|
@ -110,4 +110,7 @@ temp/
|
|||
lint_output.txt
|
||||
|
||||
# Native build output
|
||||
native/
|
||||
native/
|
||||
|
||||
# Bun lockfile (generated during native build)
|
||||
bun.lock
|
||||
|
|
@ -1,55 +1,48 @@
|
|||
# VibeTunnel
|
||||
# VibeTunnel Web
|
||||
|
||||
Web-based terminal multiplexer with distributed architecture support.
|
||||
Web terminal interface and server for VibeTunnel.
|
||||
|
||||
## Quick Start
|
||||
|
||||
Production users: Use the pre-built VibeTunnel executable from the main app.
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
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
|
||||
|
||||
## Server Modes
|
||||
### Build Commands
|
||||
|
||||
```bash
|
||||
# Standalone server
|
||||
npm run dev
|
||||
|
||||
# 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 clean # Remove build artifacts
|
||||
npm run build # Build everything (including native executable)
|
||||
npm run lint # Check code style
|
||||
npm run lint:fix # Fix code style
|
||||
npm run typecheck # Type checking
|
||||
npm test # Run tests
|
||||
npm run test # Run all tests (unit + e2e)
|
||||
npm run format # Format code
|
||||
```
|
||||
|
||||
## fwd Tool
|
||||
|
||||
CLI that spawns PTY sessions integrated with VibeTunnel:
|
||||
## Production Build
|
||||
|
||||
```bash
|
||||
# Forward a command to VibeTunnel
|
||||
npx tsx src/fwd.ts <command> [args...]
|
||||
|
||||
# Monitor-only mode (no input)
|
||||
npx tsx src/fwd.ts --monitor-only <command>
|
||||
npm run build
|
||||
./native/vibetunnel # Run standalone executable
|
||||
```
|
||||
|
||||
Creates persistent sessions accessible via the web UI.
|
||||
|
||||
## Architecture
|
||||
|
||||
- **Server**: Express + node-pty for terminal sessions
|
||||
- **Client**: Lit web components + xterm.js
|
||||
- **Streaming**: SSE for output, WebSocket for binary buffers
|
||||
- **Protocol**: Binary-optimized terminal state synchronization
|
||||
See [spec.md](./spec.md) for detailed architecture documentation.
|
||||
|
||||
## Key Features
|
||||
|
||||
- Terminal sessions via node-pty
|
||||
- Real-time streaming (SSE + WebSocket)
|
||||
- Binary-optimized buffer updates
|
||||
- Multi-session support
|
||||
- File browser integration
|
||||
|
|
@ -99,7 +99,7 @@ try {
|
|||
console.log('Compiling with Bun...');
|
||||
const buildDate = new Date().toISOString();
|
||||
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(`Build date: ${buildDate}`);
|
||||
|
|
|
|||
1905
web/bun.lock
1905
web/bun.lock
File diff suppressed because it is too large
Load diff
|
|
@ -8,15 +8,12 @@
|
|||
"dev": "node scripts/dev.js",
|
||||
"dev:client": "node scripts/dev.js --client-only",
|
||||
"build": "node scripts/build.js",
|
||||
"build:native": "node scripts/build.js --native",
|
||||
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
||||
"lint:fix": "eslint 'src/**/*.{ts,tsx}' --fix",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest",
|
||||
"test:e2e": "vitest run --config vitest.config.e2e.ts",
|
||||
"format": "prettier --write '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"
|
||||
"format:check": "prettier --check 'src/**/*.{ts,tsx,js,jsx,json,css,md}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@homebridge/node-pty-prebuilt-multiarch": "^0.12.0",
|
||||
|
|
@ -32,7 +29,6 @@
|
|||
"@eslint/js": "^9.29.0",
|
||||
"@testing-library/dom": "^10.4.0",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/mime-types": "^3.0.1",
|
||||
"@types/node": "^24.0.3",
|
||||
"@types/supertest": "^6.0.3",
|
||||
|
|
@ -51,16 +47,12 @@
|
|||
"eslint-config-prettier": "^10.1.5",
|
||||
"eslint-plugin-prettier": "^5.5.0",
|
||||
"happy-dom": "^18.0.1",
|
||||
"husky": "^9.1.7",
|
||||
"jest": "^30.0.0",
|
||||
"lint-staged": "^16.1.2",
|
||||
"node-fetch": "^3.3.2",
|
||||
"postcss": "^8.5.6",
|
||||
"prettier": "^3.5.3",
|
||||
"puppeteer": "^24.10.2",
|
||||
"supertest": "^7.1.1",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"ts-jest": "^29.4.0",
|
||||
"tsx": "^4.20.3",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.34.1",
|
||||
|
|
|
|||
|
|
@ -25,10 +25,8 @@ execSync('esbuild src/client/test-terminals-entry.ts --bundle --outfile=public/b
|
|||
console.log('Building server...');
|
||||
execSync('tsc', { stdio: 'inherit' });
|
||||
|
||||
// Build native executable if requested
|
||||
if (process.argv.includes('--native')) {
|
||||
console.log('Building native executable...');
|
||||
execSync('node build-native.js', { stdio: 'inherit' });
|
||||
}
|
||||
// Build native executable
|
||||
console.log('Building native executable...');
|
||||
execSync('node build-native.js', { stdio: 'inherit' });
|
||||
|
||||
console.log('Build completed successfully!');
|
||||
|
|
@ -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!"
|
||||
|
|
@ -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'),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@ export default defineConfig({
|
|||
test: {
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
setupFiles: ['./src/test/setup.ts'],
|
||||
include: ['src/**/*.test.ts'],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'json', 'html', 'lcov'],
|
||||
|
|
@ -29,9 +29,8 @@ export default defineConfig({
|
|||
branches: 80,
|
||||
statements: 80,
|
||||
},
|
||||
testTimeout: 10000,
|
||||
// Separate test suites
|
||||
includeSource: ['src/**/*.{js,ts}'],
|
||||
testTimeout: 60000, // 60s for e2e tests
|
||||
hookTimeout: 30000, // 30s for setup/teardown
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
|
|
|
|||
11
web/vitest.d.ts
vendored
11
web/vitest.d.ts
vendored
|
|
@ -1,11 +0,0 @@
|
|||
/// <reference types="vitest" />
|
||||
|
||||
// Custom matchers for Vitest
|
||||
declare module 'vitest' {
|
||||
interface Assertion {
|
||||
toBeValidSession(): this;
|
||||
}
|
||||
interface AsymmetricMatchersContaining {
|
||||
toBeValidSession(): unknown;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue