Files
vibe-kanban/package.json
Alex Netsch 0627cd031c Perfect! I have successfully implemented the requested feature. Here's a summary of what I accomplished: (#113)
## Summary

I added an environment variable `DISABLE_WORKTREE_ORPHAN_CLEANUP` to control worktree orphan cleanup behavior:

1. **Modified `execution_monitor.rs:252`** - Added a check at the beginning of the `cleanup_orphaned_worktrees` function that returns early if the environment variable is set, with a debug log message.

2. **Updated `package.json`** - Modified the `npm run dev` script to export `DISABLE_WORKTREE_ORPHAN_CLEANUP=1`, which disables orphan cleanup when running in development mode.

3. **Verified the implementation** - The backend builds successfully and the code correctly checks for the environment variable.

The implementation defaults to cleanup being enabled (as requested), but when `npm run dev` is run, it automatically disables the orphan cleanup to prevent worktrees from being cleaned up during development. This allows developers to work with persistent worktrees while still maintaining the cleanup functionality in production environments.
2025-07-09 17:40:28 +01:00

33 lines
1.7 KiB
JSON

{
"name": "vibe-kanban",
"version": "0.0.41",
"private": true,
"scripts": {
"dev": "export FRONTEND_PORT=$(node scripts/setup-dev-environment.js frontend) && export BACKEND_PORT=$(node scripts/setup-dev-environment.js backend) && export DISABLE_WORKTREE_ORPHAN_CLEANUP=1 && concurrently \"npm run backend:dev:watch\" \"npm run frontend:dev\"",
"build": "npm run frontend:build && npm run backend:build",
"build:single": "npm run frontend:build && npm run backend:build:single",
"build:npm": "./build-npm-package.sh",
"test:npm": "./test-npm-package.sh",
"frontend:dev": "cd frontend && npm run dev -- --port ${FRONTEND_PORT:-3000} --open",
"frontend:build": "cd frontend && npm run build",
"cargo": "node scripts/cargo.js",
"backend:dev": "BACKEND_PORT=$(node scripts/setup-dev-environment.js backend) npm run backend:dev:watch",
"backend:dev:watch": "npm run cargo -- watch -w backend -x 'run --manifest-path backend/Cargo.toml'",
"backend:build": "npm run cargo -- build --release --manifest-path backend/Cargo.toml && npm run cargo -- build --release --bin mcp_task_server --manifest-path backend/Cargo.toml",
"backend:build:single": "npm run cargo -- build --release --manifest-path backend/Cargo.toml",
"backend:run": "npm run cargo -- run --manifest-path backend/Cargo.toml",
"backend:test": "npm run cargo -- test --lib",
"generate-types": "cd backend && cargo run --bin generate_types",
"prepare-db": "node scripts/prepare-db.js",
"dev:clear-ports": "node scripts/setup-dev-environment.js clear"
},
"devDependencies": {
"concurrently": "^8.2.2",
"vite": "^6.3.5"
},
"engines": {
"node": ">=18",
"pnpm": ">=8"
}
}