Implement auto-download feature for syncback command

- Enhanced the `syncback` command to automatically download Roblox place files from the asset delivery API, allowing for zero-argument usage.
- Updated `Cargo.toml` to include compression features for `reqwest` and moved `tempfile` to dependencies.
- Introduced a new `download` argument in `SyncbackCommand` to specify place IDs for downloading.
- Implemented logic to resolve input file paths, prioritizing downloads when necessary.
- Added sourcemap generation after successful syncback and refreshed the git index if in a repository.
- Updated tests to validate the new download functionality and sourcemap creation.
This commit is contained in:
Joe 2026-02-01 09:46:34 -06:00
parent 8fe908740f
commit 2b2ada219e
32 changed files with 1180 additions and 125 deletions

View file

@ -75,7 +75,6 @@ fn run_syncback_test_impl(name: &str, incremental: bool, callback: impl FnOnce(&
project_path.to_str().unwrap(),
"--input",
input_file.to_str().unwrap(),
"--non-interactive",
"--list",
];
@ -118,11 +117,20 @@ fn run_syncback_test_impl(name: &str, incremental: bool, callback: impl FnOnce(&
// Normalize temp directory paths in the output to make snapshots deterministic.
// Paths like "C:/Users/Joe/AppData/Local/Temp/.tmpXXXXXX/test_name/..."
// or "\\?\C:\Users\Joe\AppData\Local\Temp\.tmpXXXXXX\test_name\..."
// become "<TEMP>/test_name/..."
let stdout = String::from_utf8_lossy(&output.stdout);
// Handle forward slash paths (Unix-style)
let temp_path_regex = Regex::new(r"[A-Za-z]:/[^\s]*/\.tmp[^/]*/").expect("Invalid regex");
let normalized_stdout = temp_path_regex.replace_all(&stdout, "<TEMP>/");
// Handle backslash paths with optional UNC prefix (Windows-style)
// Matches: \\?\C:\...\temp dir\ or C:\...\temp dir\
let windows_temp_regex =
Regex::new(r"(?:\\\\?\?\\)?[A-Za-z]:\\[^\s]*\\\.tmp[^\\]*\\").expect("Invalid regex");
let normalized_stdout = windows_temp_regex.replace_all(&normalized_stdout, "<TEMP>/");
settings.bind(|| assert_snapshot!(format!("{name}-stdout"), normalized_stdout));
settings.bind(|| callback(project_path.as_path()))