diff --git a/TODO.txt b/TODO.txt index 1bc4c5bd..30f69e12 100644 --- a/TODO.txt +++ b/TODO.txt @@ -95,19 +95,6 @@ could we find an endpoint for downloading the "client side" of any game on the p [Crates] publish as a crate https://crates.io/crates/rojo -[syncback] -detect when the output file hash is the same, and dont write to it - -[sync] -manually selection Studio should NOT automatically stage changes! - -[auto select studio/atlas] -when things get added AFTER the fact because we send the git history hashes on connect rather than continiously, it auto-selects Studio for things that are being edited in real-time in the sync dialog -how should we handle new files? because it could have been that someone just deleted it in studio. we can actually check if its a truly new file in Studio, like A but not staged! - -[merge visualizer] -we should make the outline green or something to show when everything is ready to go. maybe the accept button - [tree reconciling spooky!] [INFO librojo::cli::serve] Listening: http://localhost:34873 [INFO librojo::change_processor] VFS event: WRITE d:\UserGenerated\escape-tsunami\src\ReplicatedStorage\Client\Controllers\UI\CurrenciesUI.luau @@ -352,3 +339,18 @@ this needs to be slugified when the name exactly matches init, ignoring case [fo [one shot mode change] new changes that come in / out during the review menu on the plugin is really disorienting. +we should just make it stop accepting new changes once it has the full patch ready and displayed to the user +any further changes should have to be done NEXT one-shot sync + +[syncback] +detect when the output file hash is the same, and dont write to it + +[sync] +for the automated git staging we do on sync, manually selection Studio should NOT automatically stage changes! + +[auto select studio/atlas] +when things get added AFTER the fact because we send the git history hashes on connect rather than continiously, it auto-selects Studio for things that are being edited in real-time in the sync dialog +how should we handle new files? because it could have been that someone just deleted it in studio. we can actually check if its a truly new file in Studio, like A but not staged! + +[merge visualizer] +we should make the outline green or something to show when everything is ready to go. maybe the accept button diff --git a/src/syncback/file_names.rs b/src/syncback/file_names.rs index 076feef9..56237f8a 100644 --- a/src/syncback/file_names.rs +++ b/src/syncback/file_names.rs @@ -197,6 +197,9 @@ pub fn name_needs_slugify(name: &str) -> bool { return true; } } + if name_lower == "init" { + return true; + } false } @@ -259,6 +262,9 @@ pub fn slugify_name(name: &str) -> String { break; } } + if result_lower == "init" { + result.push('_'); + } // If the result is empty or all underscores, use a fallback if result.is_empty() || result.chars().all(|c| c == '_') { @@ -465,6 +471,13 @@ mod tests { assert_eq!(slugify_name("LPT1 "), "LPT1_"); } + #[test] + fn slugify_init_reserved() { + assert_eq!(slugify_name("init"), "init_"); + assert_eq!(slugify_name("Init"), "Init_"); + assert_eq!(slugify_name("INIT"), "INIT_"); + } + #[test] fn slugify_trailing_dot() { // Trailing dots are stripped (invalid on Windows) @@ -668,6 +681,14 @@ mod tests { assert!(name_needs_slugify("NUL")); } + #[test] + fn needs_slugify_init_reserved() { + assert!(name_needs_slugify("init")); + assert!(name_needs_slugify("Init")); + assert!(name_needs_slugify("INIT")); + assert!(!name_needs_slugify("init_")); + } + #[test] fn needs_slugify_leading_or_trailing_space() { assert!(name_needs_slugify("hello ")); // trailing @@ -981,6 +1002,37 @@ mod tests { assert!(m); } + // ── Init reserved name through name_for_inst ───────────────────── + + #[test] + fn nfi_init_module_script() { + let (f, m) = nfi("init", Middleware::ModuleScript, &[]); + assert_eq!(f, "init_.luau"); + assert!(m, "init is reserved, needs meta name"); + } + + #[test] + fn nfi_init_server_script() { + let (f, m) = nfi("init", Middleware::ServerScript, &[]); + assert_eq!(f, "init_.server.luau"); + assert!(m); + } + + #[test] + fn nfi_init_dir() { + let (f, m) = nfi("init", Middleware::Dir, &[]); + assert_eq!(f, "init_"); + assert!(m); + } + + #[test] + #[allow(non_snake_case)] + fn nfi_init_case_insensitive_Init() { + let (f, m) = nfi("Init", Middleware::ModuleScript, &[]); + assert_eq!(f, "Init_.luau"); + assert!(m); + } + // ── Safe dots pass through ─────────────────────────────────────── #[test]