Refactor TODO list and enhance slugification for reserved names

- Updated the TODO list to consolidate and clarify tasks, removing outdated entries while retaining relevant ones.
- Enhanced the slugification logic to treat "init" and its case variations as reserved names, ensuring they are properly suffixed with an underscore.
- Added tests to verify the slugification behavior for reserved names, improving code reliability.

These changes aim to streamline task management and ensure consistent handling of reserved names in the application.
This commit is contained in:
Joe 2026-03-01 06:41:29 -06:00
parent d2f739ece6
commit a15f4f1aa8
2 changed files with 67 additions and 13 deletions

View file

@ -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

View file

@ -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]