From e342f00306d9753bf1eb84ce00c8517bfd19c114 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 1 Feb 2026 10:13:24 -0600 Subject: [PATCH] Enhance syncback logic to preserve nested project files - Updated the syncback loop to skip removal of nested project files, ensuring project structure is maintained. - Added logging to indicate when nested project files are being skipped during the syncback process. --- ...test__syncback_util__nested_projects_weird-stdout.snap | 2 -- src/syncback/mod.rs | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rojo-test/syncback-test-snapshots/end_to_end__rojo_test__syncback_util__nested_projects_weird-stdout.snap b/rojo-test/syncback-test-snapshots/end_to_end__rojo_test__syncback_util__nested_projects_weird-stdout.snap index 370ed871..b727e039 100644 --- a/rojo-test/syncback-test-snapshots/end_to_end__rojo_test__syncback_util__nested_projects_weird-stdout.snap +++ b/rojo-test/syncback-test-snapshots/end_to_end__rojo_test__syncback_util__nested_projects_weird-stdout.snap @@ -4,5 +4,3 @@ expression: normalized_stdout --- Writing src/modules/ClientModule.luau Writing src/modules/ServerModule.luau -Removing client-only.project.json5 -Removing server-only.project.json5 diff --git a/src/syncback/mod.rs b/src/syncback/mod.rs index e391c23b..be41b797 100644 --- a/src/syncback/mod.rs +++ b/src/syncback/mod.rs @@ -418,6 +418,14 @@ pub fn syncback_loop_with_stats( log::debug!("Skipping project file: {}", old_path.display()); continue; } + // Never remove any nested project files - they define project structure + // and may be referenced via $path from other project files + if let Some(file_name) = old_path_norm.file_name().and_then(|n| n.to_str()) { + if file_name.ends_with(".project.json5") || file_name.ends_with(".project.json") { + log::debug!("Skipping nested project file: {}", old_path.display()); + continue; + } + } // Skip if this exact path is being written to if added_paths.contains(&old_path_norm) { continue;