claude-ws 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,6 +53,52 @@ if (!fs.existsSync(DB_DIR)) {
53
53
  fs.mkdirSync(DB_DIR, { recursive: true });
54
54
  }
55
55
 
56
+ async function runMigrations() {
57
+ console.log('[Claude Workspace] Initializing database...');
58
+
59
+ // Simple approach: just require the db module which auto-runs initDb()
60
+ const dbPath = path.join(packageRoot, 'src', 'lib', 'db', 'index.ts');
61
+
62
+ try {
63
+ // Find tsx binary (should already be installed by this point)
64
+ let tsxCmd;
65
+ const possiblePaths = [
66
+ path.join(packageRoot, 'node_modules', '.bin', 'tsx'),
67
+ path.join(packageRoot, '..', '.bin', 'tsx'),
68
+ ];
69
+
70
+ for (const tsxPath of possiblePaths) {
71
+ if (fs.existsSync(tsxPath)) {
72
+ tsxCmd = tsxPath;
73
+ break;
74
+ }
75
+ }
76
+
77
+ if (!tsxCmd) {
78
+ // Try global tsx
79
+ try {
80
+ const { execSync } = require('child_process');
81
+ execSync('which tsx', { stdio: 'ignore' });
82
+ tsxCmd = 'tsx';
83
+ } catch {
84
+ throw new Error('tsx not found - this should not happen after dependency installation');
85
+ }
86
+ }
87
+
88
+ const { execSync } = require('child_process');
89
+ execSync(`"${tsxCmd}" -e "require('${dbPath}'); console.log('[Claude Workspace] ✓ Database ready');"`, {
90
+ cwd: packageRoot,
91
+ stdio: 'inherit',
92
+ env: { ...process.env }
93
+ });
94
+
95
+ console.log('');
96
+ } catch (error) {
97
+ console.error('[Claude Workspace] Database initialization failed:', error.message);
98
+ throw error;
99
+ }
100
+ }
101
+
56
102
  async function startServer() {
57
103
  console.log('[Claude Workspace] Starting server...');
58
104
  console.log('[Claude Workspace] Database location:', DB_PATH);
@@ -86,6 +132,12 @@ async function startServer() {
86
132
  console.error('[Claude Workspace] Failed to install dependencies:', error.message);
87
133
  process.exit(1);
88
134
  }
135
+
136
+ // Run migrations after dependencies are installed
137
+ await runMigrations();
138
+ } else {
139
+ // Dependencies already installed, run migrations
140
+ await runMigrations();
89
141
  }
90
142
 
91
143
  // Check if .next directory has valid build (check BUILD_ID file)
@@ -221,9 +273,7 @@ async function main() {
221
273
  console.log('='.repeat(60));
222
274
  console.log('');
223
275
 
224
- // Database will be auto-initialized by src/lib/db/index.ts on first import
225
- // No need to run separate migration - initDb() handles it all
226
-
276
+ // Migrations will be run inside startServer() after dependencies are installed
227
277
  await startServer();
228
278
 
229
279
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-ws",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "private": false,
5
5
  "description": "A beautifully crafted workspace interface for Claude Code with real-time streaming and local SQLite database",
6
6
  "keywords": [
@@ -135,9 +135,7 @@
135
135
  "@tailwindcss/postcss": "^4",
136
136
  "tailwindcss": "^4",
137
137
  "tw-animate-css": "^1.4.0",
138
- "drizzle-kit": "^0.31.8"
139
- },
140
- "devDependencies": {
138
+ "drizzle-kit": "^0.31.8",
141
139
  "@types/adm-zip": "^0.5.7",
142
140
  "@types/better-sqlite3": "^7.6.13",
143
141
  "@types/node": "^20",
@@ -116,7 +116,7 @@ export function TaskCard({ task, attemptCount = 0 }: TaskCardProps) {
116
116
  </button>
117
117
  )}
118
118
 
119
- <div className="pl-3.5">
119
+ <div className={cn('pl-3.5', showDeleteButton && 'pr-6')}>
120
120
  {/* Header: Project badge - smaller */}
121
121
  {showProjectBadge && projectName && (
122
122
  <div style={{ marginBottom: '5px', lineHeight: '10px' }}>