@@ -21,11 +21,8 @@ local function check_backend_health(callback)
2121 if backend_bin_path == " " then
2222 error (conf .development_mode .backend .. " executable not found in PATH" )
2323 end
24- cwd = payload .get_absolute_plugin_path (" backend" , conf .development_mode .backend )
25- if not vim .fn .isdirectory (cwd ) then
26- error (" Backend directory not found: " .. cwd )
27- end
28- system_args = { backend_bin_path , " run" , " src/index.ts" , " health" }
24+ cwd = payload .get_absolute_plugin_path ()
25+ system_args = { backend_bin_path , " run" , " backend/bun/src/index.ts" , " health" }
2926 end
3027 end
3128
@@ -86,12 +83,12 @@ local function install_backend(progress_callback, completion_callback)
8683 if backend_bin_path == " " then
8784 error (conf .development_mode .backend .. " executable not found in PATH" )
8885 end
89- cwd = payload .get_absolute_plugin_path (" backend " , conf . development_mode . backend )
86+ cwd = payload .get_absolute_plugin_path ()
9087 if not vim .fn .isdirectory (cwd ) then
9188 error (" Backend directory not found: " .. cwd )
9289 end
9390 -- Use src/index.ts explicitly to ensure command line arguments are passed correctly
94- system_args = { backend_bin_path , " run" , " src/index.ts" , " install" }
91+ system_args = { backend_bin_path , " run" , " backend/bun/ src/index.ts" , " install" }
9592 end
9693 end
9794
@@ -115,15 +112,17 @@ local function install_backend(progress_callback, completion_callback)
115112 debounce_timer = vim .fn .timer_start (150 , function ()
116113 if pending_progress and progress_callback then
117114 -- Only report 100% or "completed" once
118- if ( pending_progress .progress == 100 or pending_progress .status == " completed" ) then
115+ if pending_progress .progress == 100 or pending_progress .status == " completed" then
119116 if not progress_100_reported then
120117 progress_callback (pending_progress )
121118 progress_100_reported = true
122119 end
123120 else
124121 -- Only report if status or progress value changed
125- if pending_progress .status ~= last_progress_status or
126- (pending_progress .progress and pending_progress .progress ~= last_progress_value ) then
122+ if
123+ pending_progress .status ~= last_progress_status
124+ or (pending_progress .progress and pending_progress .progress ~= last_progress_value )
125+ then
127126 progress_callback (pending_progress )
128127 last_progress_status = pending_progress .status
129128 last_progress_value = pending_progress .progress
@@ -195,7 +194,9 @@ local function install_backend(progress_callback, completion_callback)
195194 end
196195 -- Flush any pending progress immediately
197196 if pending_progress and progress_callback then
198- if not (pending_progress .progress == 100 or pending_progress .status == " completed" ) or not progress_100_reported then
197+ if
198+ not (pending_progress .progress == 100 or pending_progress .status == " completed" ) or not progress_100_reported
199+ then
199200 progress_callback (pending_progress )
200201 if pending_progress .progress == 100 or pending_progress .status == " completed" then
201202 progress_100_reported = true
@@ -294,11 +295,11 @@ local function run_backend_export(opts, export_type, success_message)
294295 if backend_bin_path == " " then
295296 error (conf .development_mode .backend .. " executable not found in PATH" )
296297 end
297- cwd = payload .get_absolute_plugin_path (" backend " , conf . development_mode . backend )
298+ cwd = payload .get_absolute_plugin_path ()
298299 if not vim .fn .isdirectory (cwd ) then
299300 error (" Backend directory not found: " .. cwd )
300301 end
301- system_args = { backend_bin_path , " run" , " . " }
302+ system_args = { backend_bin_path , " run" , " backend/bun/src/index.ts " }
302303 end
303304 end
304305
0 commit comments