diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 00000000..57bf9533 --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,11 @@ +[profile.default] +# Set a 10 second timeout for all tests +slow-timeout = { period = "10s", terminate-after = 1 } + +# Fail fast on first test failure +fail-fast = true + +[profile.ci] +# CI profile with same timeout +slow-timeout = { period = "10s", terminate-after = 1 } +fail-fast = false diff --git a/assets/project-templates/model/default.project.json b/assets/project-templates/model/default.project.json5 similarity index 100% rename from assets/project-templates/model/default.project.json rename to assets/project-templates/model/default.project.json5 diff --git a/assets/project-templates/place/default.project.json b/assets/project-templates/place/default.project.json5 similarity index 100% rename from assets/project-templates/place/default.project.json rename to assets/project-templates/place/default.project.json5 diff --git a/assets/project-templates/plugin/default.project.json b/assets/project-templates/plugin/default.project.json5 similarity index 100% rename from assets/project-templates/plugin/default.project.json rename to assets/project-templates/plugin/default.project.json5 diff --git a/rojo-test/build-tests/client_init/folder/init.client.lua b/rojo-test/build-tests/client_init/folder/init.client.luau similarity index 100% rename from rojo-test/build-tests/client_init/folder/init.client.lua rename to rojo-test/build-tests/client_init/folder/init.client.luau diff --git a/rojo-test/build-tests/ignore_glob_inner/src/outer.spec.lua b/rojo-test/build-tests/ignore_glob_inner/src/outer.spec.luau similarity index 100% rename from rojo-test/build-tests/ignore_glob_inner/src/outer.spec.lua rename to rojo-test/build-tests/ignore_glob_inner/src/outer.spec.luau diff --git a/rojo-test/build-tests/ignore_glob_inner/subproject/default.project.json5 b/rojo-test/build-tests/ignore_glob_inner/subproject/default.project.json5 index 335a7161..27a35429 100644 --- a/rojo-test/build-tests/ignore_glob_inner/subproject/default.project.json5 +++ b/rojo-test/build-tests/ignore_glob_inner/subproject/default.project.json5 @@ -4,6 +4,6 @@ "$path": "src" }, "globIgnorePaths": [ - "**/*.spec.lua" + "**/*.spec.luau" ] } \ No newline at end of file diff --git a/rojo-test/build-tests/ignore_glob_inner/subproject/src/inner.lua b/rojo-test/build-tests/ignore_glob_inner/subproject/src/inner.luau similarity index 100% rename from rojo-test/build-tests/ignore_glob_inner/subproject/src/inner.lua rename to rojo-test/build-tests/ignore_glob_inner/subproject/src/inner.luau diff --git a/rojo-test/build-tests/ignore_glob_inner/subproject/src/inner.spec.lua b/rojo-test/build-tests/ignore_glob_inner/subproject/src/inner.spec.luau similarity index 100% rename from rojo-test/build-tests/ignore_glob_inner/subproject/src/inner.spec.lua rename to rojo-test/build-tests/ignore_glob_inner/subproject/src/inner.spec.luau diff --git a/rojo-test/build-tests/ignore_glob_nested/default.project.json5 b/rojo-test/build-tests/ignore_glob_nested/default.project.json5 index aab74f71..52b7d604 100644 --- a/rojo-test/build-tests/ignore_glob_nested/default.project.json5 +++ b/rojo-test/build-tests/ignore_glob_nested/default.project.json5 @@ -4,6 +4,6 @@ "$path": "subproject" }, "globIgnorePaths": [ - "**/*.spec.lua" + "**/*.spec.luau" ] } \ No newline at end of file diff --git a/rojo-test/build-tests/ignore_glob_nested/subproject/src/exclude.spec.lua b/rojo-test/build-tests/ignore_glob_nested/subproject/src/exclude.spec.luau similarity index 100% rename from rojo-test/build-tests/ignore_glob_nested/subproject/src/exclude.spec.lua rename to rojo-test/build-tests/ignore_glob_nested/subproject/src/exclude.spec.luau diff --git a/rojo-test/build-tests/ignore_glob_nested/subproject/src/include.lua b/rojo-test/build-tests/ignore_glob_nested/subproject/src/include.luau similarity index 100% rename from rojo-test/build-tests/ignore_glob_nested/subproject/src/include.lua rename to rojo-test/build-tests/ignore_glob_nested/subproject/src/include.luau diff --git a/rojo-test/build-tests/ignore_glob_spec/default.project.json5 b/rojo-test/build-tests/ignore_glob_spec/default.project.json5 index 6d6721c1..bf3a6a5d 100644 --- a/rojo-test/build-tests/ignore_glob_spec/default.project.json5 +++ b/rojo-test/build-tests/ignore_glob_spec/default.project.json5 @@ -4,6 +4,6 @@ "$path": "src" }, "globIgnorePaths": [ - "**/*.spec.lua" + "**/*.spec.luau" ] } \ No newline at end of file diff --git a/rojo-test/build-tests/ignore_glob_spec/src/shouldBeIncluded.lua b/rojo-test/build-tests/ignore_glob_spec/src/shouldBeIncluded.luau similarity index 100% rename from rojo-test/build-tests/ignore_glob_spec/src/shouldBeIncluded.lua rename to rojo-test/build-tests/ignore_glob_spec/src/shouldBeIncluded.luau diff --git a/rojo-test/build-tests/ignore_glob_spec/src/shouldBeRemoved.spec.lua b/rojo-test/build-tests/ignore_glob_spec/src/shouldBeRemoved.spec.luau similarity index 100% rename from rojo-test/build-tests/ignore_glob_spec/src/shouldBeRemoved.spec.lua rename to rojo-test/build-tests/ignore_glob_spec/src/shouldBeRemoved.spec.luau diff --git a/rojo-test/build-tests/infer_service_name/default.project.json5 b/rojo-test/build-tests/infer_service_name/default.project.json5 index 36d8906c..71efd0bd 100644 --- a/rojo-test/build-tests/infer_service_name/default.project.json5 +++ b/rojo-test/build-tests/infer_service_name/default.project.json5 @@ -4,7 +4,7 @@ "$className": "DataModel", "ReplicatedStorage": { "Main": { - "$path": "main.lua" + "$path": "main.luau" } }, "HttpService": { diff --git a/rojo-test/build-tests/infer_service_name/main.lua b/rojo-test/build-tests/infer_service_name/main.luau similarity index 100% rename from rojo-test/build-tests/infer_service_name/main.lua rename to rojo-test/build-tests/infer_service_name/main.luau diff --git a/rojo-test/build-tests/infer_starter_player/main.lua b/rojo-test/build-tests/infer_starter_player/main.luau similarity index 100% rename from rojo-test/build-tests/infer_starter_player/main.lua rename to rojo-test/build-tests/infer_starter_player/main.luau diff --git a/rojo-test/build-tests/init_with_children/src/init.lua b/rojo-test/build-tests/init_with_children/src/init.luau similarity index 100% rename from rojo-test/build-tests/init_with_children/src/init.lua rename to rojo-test/build-tests/init_with_children/src/init.luau diff --git a/rojo-test/build-tests/init_with_children/src/other.lua b/rojo-test/build-tests/init_with_children/src/other.luau similarity index 100% rename from rojo-test/build-tests/init_with_children/src/other.lua rename to rojo-test/build-tests/init_with_children/src/other.luau diff --git a/rojo-test/build-tests/issue_546/hello/init.client.lua b/rojo-test/build-tests/issue_546/hello/init.client.luau similarity index 100% rename from rojo-test/build-tests/issue_546/hello/init.client.lua rename to rojo-test/build-tests/issue_546/hello/init.client.luau diff --git a/rojo-test/build-tests/json_as_lua/default.project.json5 b/rojo-test/build-tests/json_as_lua/default.project.json5 index 1e984c68..8ba11664 100644 --- a/rojo-test/build-tests/json_as_lua/default.project.json5 +++ b/rojo-test/build-tests/json_as_lua/default.project.json5 @@ -1,6 +1,6 @@ { "name": "json_as_lua", "tree": { - "$path": "make-me-a-script.json" + "$path": "make-me-a-script.json5" } } \ No newline at end of file diff --git a/rojo-test/build-tests/json_as_lua/make-me-a-script.json b/rojo-test/build-tests/json_as_lua/make-me-a-script.json5 similarity index 100% rename from rojo-test/build-tests/json_as_lua/make-me-a-script.json rename to rojo-test/build-tests/json_as_lua/make-me-a-script.json5 diff --git a/rojo-test/build-tests/module_in_folder/folder/aModule.lua b/rojo-test/build-tests/module_in_folder/folder/aModule.luau similarity index 100% rename from rojo-test/build-tests/module_in_folder/folder/aModule.lua rename to rojo-test/build-tests/module_in_folder/folder/aModule.luau diff --git a/rojo-test/build-tests/module_init/folder/init.lua b/rojo-test/build-tests/module_init/folder/init.luau similarity index 100% rename from rojo-test/build-tests/module_init/folder/init.lua rename to rojo-test/build-tests/module_init/folder/init.luau diff --git a/rojo-test/serve-tests/edit_init/src/init.lua b/rojo-test/serve-tests/edit_init/src/init.luau similarity index 100% rename from rojo-test/serve-tests/edit_init/src/init.lua rename to rojo-test/serve-tests/edit_init/src/init.luau diff --git a/rojo-test/serve-tests/scripts/src/bar.server.lua b/rojo-test/serve-tests/scripts/src/bar.server.luau similarity index 100% rename from rojo-test/serve-tests/scripts/src/bar.server.lua rename to rojo-test/serve-tests/scripts/src/bar.server.luau diff --git a/rojo-test/serve-tests/scripts/src/foo.lua b/rojo-test/serve-tests/scripts/src/foo.luau similarity index 100% rename from rojo-test/serve-tests/scripts/src/foo.lua rename to rojo-test/serve-tests/scripts/src/foo.luau diff --git a/src/cli/syncback.rs b/src/cli/syncback.rs index 282d55c8..42d68934 100644 --- a/src/cli/syncback.rs +++ b/src/cli/syncback.rs @@ -27,7 +27,7 @@ const UNKNOWN_INPUT_KIND_ERR: &str = "Could not detect what kind of file was inp /// given. /// /// Syncback exists to convert Roblox files into a Rojo project automatically. -/// It uses the project.json file provided to traverse the Roblox file passed as +/// It uses the project.json5 file provided to traverse the Roblox file passed as /// to serialize Instances to the file system in a format that Rojo understands. /// /// To ease programmatic use, this command pipes all normal output to stderr. diff --git a/src/snapshot/metadata.rs b/src/snapshot/metadata.rs index eb82f8a5..bd2c222b 100644 --- a/src/snapshot/metadata.rs +++ b/src/snapshot/metadata.rs @@ -36,11 +36,11 @@ pub struct InstanceMetadata { /// /// A directory named bar/ might have these: /// - bar/ - /// - bar/init.meta.json - /// - bar/init.lua - /// - bar/init.server.lua - /// - bar/init.client.lua - /// - bar/default.project.json + /// - bar/init.meta.json5 + /// - bar/init.luau + /// - bar/init.server.luau + /// - bar/init.client.luau + /// - bar/default.project.json5 /// /// This path is used to make sure that file changes update all instances /// that may need updates. diff --git a/src/snapshot_middleware/dir.rs b/src/snapshot_middleware/dir.rs index 064e8ed5..c610824e 100644 --- a/src/snapshot_middleware/dir.rs +++ b/src/snapshot_middleware/dir.rs @@ -33,7 +33,7 @@ pub fn snapshot_dir( /// Snapshot a directory without applying meta files; useful for if the /// directory's ClassName will change before metadata should be applied. For -/// example, this can happen if the directory contains an `init.client.lua` +/// example, this can happen if the directory contains an `init.client.luau` /// file. pub fn snapshot_dir_no_meta( context: &InstanceContext, @@ -68,12 +68,11 @@ pub fn snapshot_dir_no_meta( // TODO: We shouldn't need to know about Lua existing in this // middleware. Should we figure out a way for that function to add // relevant paths to this middleware? - normalized_path.join("init.lua"), normalized_path.join("init.luau"), - normalized_path.join("init.server.lua"), normalized_path.join("init.server.luau"), - normalized_path.join("init.client.lua"), normalized_path.join("init.client.luau"), + normalized_path.join("init.local.luau"), + normalized_path.join("init.legacy.luau"), normalized_path.join("init.csv"), ]; diff --git a/src/snapshot_middleware/json.rs b/src/snapshot_middleware/json.rs index 1f38c681..ce08b7f9 100644 --- a/src/snapshot_middleware/json.rs +++ b/src/snapshot_middleware/json.rs @@ -75,7 +75,7 @@ mod test { fn instance_from_vfs() { let mut imfs = InMemoryFs::new(); imfs.load_snapshot( - "/foo.json", + "/foo.json5", VfsSnapshot::file( r#"{ "array": [1, 2, 3], @@ -98,7 +98,7 @@ mod test { let instance_snapshot = snapshot_json( &InstanceContext::default(), &vfs, - Path::new("/foo.json"), + Path::new("/foo.json5"), "foo", ) .unwrap() @@ -111,7 +111,7 @@ mod test { fn with_metadata() { let mut imfs = InMemoryFs::new(); imfs.load_snapshot( - "/foo.json", + "/foo.json5", VfsSnapshot::file( r#"{ "array": [1, 2, 3], @@ -136,7 +136,7 @@ mod test { let instance_snapshot = snapshot_json( &InstanceContext::default(), &vfs, - Path::new("/foo.json"), + Path::new("/foo.json5"), "foo", ) .unwrap() diff --git a/src/snapshot_middleware/json_model.rs b/src/snapshot_middleware/json_model.rs index 7ec2b8a0..4a037157 100644 --- a/src/snapshot_middleware/json_model.rs +++ b/src/snapshot_middleware/json_model.rs @@ -36,7 +36,7 @@ pub fn snapshot_json_model( })?; if let Some(top_level_name) = &instance.name { - let new_name = format!("{}.model.json", top_level_name); + let new_name = format!("{}.model.json5", top_level_name); log::warn!( "Model at path {} had a top-level Name field. \ @@ -229,7 +229,7 @@ mod test { fn model_from_vfs() { let mut imfs = InMemoryFs::new(); imfs.load_snapshot( - "/foo.model.json", + "/foo.model.json5", VfsSnapshot::file( r#" { @@ -254,7 +254,7 @@ mod test { let instance_snapshot = snapshot_json_model( &InstanceContext::default(), &vfs, - Path::new("/foo.model.json"), + Path::new("/foo.model.json5"), "foo", ) .unwrap() @@ -267,7 +267,7 @@ mod test { fn model_from_vfs_legacy() { let mut imfs = InMemoryFs::new(); imfs.load_snapshot( - "/foo.model.json", + "/foo.model.json5", VfsSnapshot::file( r#" { @@ -292,7 +292,7 @@ mod test { let instance_snapshot = snapshot_json_model( &InstanceContext::default(), &vfs, - Path::new("/foo.model.json"), + Path::new("/foo.model.json5"), "foo", ) .unwrap() diff --git a/src/snapshot_middleware/lua.rs b/src/snapshot_middleware/lua.rs index 8a6292e7..3fc31824 100644 --- a/src/snapshot_middleware/lua.rs +++ b/src/snapshot_middleware/lua.rs @@ -85,8 +85,8 @@ pub fn snapshot_lua( /// Attempts to snapshot an 'init' Lua script contained inside of a folder with /// the given name. /// -/// Scripts named `init.lua`, `init.server.lua`, `init.client.lua`, `init.local.lua`, -/// `init.legacy.lua`, or `init.plugin.lua` usurp their parents, which acts similarly +/// Scripts named `init.luau`, `init.server.luau`, `init.client.luau`, `init.local.luau`, +/// `init.legacy.luau`, or `init.plugin.luau` usurp their parents, which acts similarly /// to `__init__.py` from the Python world. pub fn snapshot_lua_init( context: &InstanceContext, diff --git a/src/snapshot_middleware/project.rs b/src/snapshot_middleware/project.rs index 6d6504b1..b08488c9 100644 --- a/src/snapshot_middleware/project.rs +++ b/src/snapshot_middleware/project.rs @@ -354,12 +354,12 @@ pub fn syncback_project<'sync>( ); } - // TODO handle meta.json files in this branch. Right now, we perform + // TODO handle meta.json5 files in this branch. Right now, we perform // syncback if a node has `$path` set but the Middleware aren't aware - // that the Instances they're running on originate in a project.json. - // As a result, the `meta.json` syncback code is hardcoded to not work + // that the Instances they're running on originate in a project.json5. + // As a result, the `meta.json5` syncback code is hardcoded to not work // if the Instance originates from a project file. However, we should - // ideally use a .meta.json over the project node if it exists already. + // ideally use a .meta.json5 over the project node if it exists already. if node.path.is_some() { // Since the node has a path, we have to run syncback on it. let node_path = node.path.as_ref().map(PathNode::path).expect( diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__csv__test__csv_init.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__csv__test__csv_init.snap index 6a15b7d3..99156828 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__csv__test__csv_init.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__csv__test__csv_init.snap @@ -9,12 +9,11 @@ metadata: Path: /root relevant_paths: - /root - - /root/init.lua - /root/init.luau - - /root/init.server.lua - /root/init.server.luau - - /root/init.client.lua - /root/init.client.luau + - /root/init.local.luau + - /root/init.legacy.luau - /root/init.csv - /root/init.meta.json5 context: diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__csv__test__csv_init_with_meta.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__csv__test__csv_init_with_meta.snap index cc915ba1..1a0ac9e3 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__csv__test__csv_init_with_meta.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__csv__test__csv_init_with_meta.snap @@ -9,12 +9,11 @@ metadata: Path: /root relevant_paths: - /root - - /root/init.lua - /root/init.luau - - /root/init.server.lua - /root/init.server.luau - - /root/init.client.lua - /root/init.client.luau + - /root/init.local.luau + - /root/init.legacy.luau - /root/init.csv - /root/init.meta.json5 context: diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__dir__test__empty_folder.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__dir__test__empty_folder.snap index 563ee633..c0fcbbd8 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__dir__test__empty_folder.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__dir__test__empty_folder.snap @@ -9,12 +9,11 @@ metadata: Path: /foo relevant_paths: - /foo - - /foo/init.lua - /foo/init.luau - - /foo/init.server.lua - /foo/init.server.luau - - /foo/init.client.lua - /foo/init.client.luau + - /foo/init.local.luau + - /foo/init.legacy.luau - /foo/init.csv - /foo/init.meta.json5 context: diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__dir__test__folder_in_folder.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__dir__test__folder_in_folder.snap index 6b281281..ee21a41a 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__dir__test__folder_in_folder.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__dir__test__folder_in_folder.snap @@ -9,12 +9,11 @@ metadata: Path: /foo relevant_paths: - /foo - - /foo/init.lua - /foo/init.luau - - /foo/init.server.lua - /foo/init.server.luau - - /foo/init.client.lua - /foo/init.client.luau + - /foo/init.local.luau + - /foo/init.legacy.luau - /foo/init.csv - /foo/init.meta.json5 context: @@ -33,12 +32,11 @@ children: Path: /foo/Child relevant_paths: - /foo/Child - - /foo/Child/init.lua - /foo/Child/init.luau - - /foo/Child/init.server.lua - /foo/Child/init.server.luau - - /foo/Child/init.client.lua - /foo/Child/init.client.luau + - /foo/Child/init.local.luau + - /foo/Child/init.legacy.luau - /foo/Child/init.csv - /foo/Child/init.meta.json5 context: diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json__test__instance_from_vfs.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json__test__instance_from_vfs.snap index bedcfcce..00114ed0 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json__test__instance_from_vfs.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json__test__instance_from_vfs.snap @@ -6,9 +6,9 @@ snapshot_id: "00000000000000000000000000000000" metadata: ignore_unknown_instances: false instigating_source: - Path: /foo.json + Path: /foo.json5 relevant_paths: - - /foo.json + - /foo.json5 - /foo.meta.json5 context: decode_windows_invalid_chars: true diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json__test__with_metadata.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json__test__with_metadata.snap index 2805fd71..99cc6fe4 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json__test__with_metadata.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json__test__with_metadata.snap @@ -6,9 +6,9 @@ snapshot_id: "00000000000000000000000000000000" metadata: ignore_unknown_instances: false instigating_source: - Path: /foo.json + Path: /foo.json5 relevant_paths: - - /foo.json + - /foo.json5 - /foo.meta.json5 context: decode_windows_invalid_chars: true diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json_model__test__model_from_vfs.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json_model__test__model_from_vfs.snap index 37da1388..13bb28ec 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json_model__test__model_from_vfs.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json_model__test__model_from_vfs.snap @@ -6,9 +6,9 @@ snapshot_id: "00000000000000000000000000000000" metadata: ignore_unknown_instances: false instigating_source: - Path: /foo.model.json + Path: /foo.model.json5 relevant_paths: - - /foo.model.json + - /foo.model.json5 context: decode_windows_invalid_chars: true specified_id: ~ diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json_model__test__model_from_vfs_legacy.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json_model__test__model_from_vfs_legacy.snap index 37da1388..13bb28ec 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json_model__test__model_from_vfs_legacy.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__json_model__test__model_from_vfs_legacy.snap @@ -6,9 +6,9 @@ snapshot_id: "00000000000000000000000000000000" metadata: ignore_unknown_instances: false instigating_source: - Path: /foo.model.json + Path: /foo.model.json5 relevant_paths: - - /foo.model.json + - /foo.model.json5 context: decode_windows_invalid_chars: true specified_id: ~ diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__init_module_from_vfs.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__init_module_from_vfs.snap index b66511f7..29cc22c0 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__init_module_from_vfs.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__init_module_from_vfs.snap @@ -9,12 +9,11 @@ metadata: Path: /root/init.luau relevant_paths: - /root - - /root/init.lua - /root/init.luau - - /root/init.server.lua - /root/init.server.luau - - /root/init.client.lua - /root/init.client.luau + - /root/init.local.luau + - /root/init.legacy.luau - /root/init.csv - /root/init.meta.json5 context: diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__init_module_from_vfs_with_meta.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__init_module_from_vfs_with_meta.snap index 1d3f1ded..1645dca6 100644 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__init_module_from_vfs_with_meta.snap +++ b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__init_module_from_vfs_with_meta.snap @@ -9,12 +9,11 @@ metadata: Path: /root/init.luau relevant_paths: - /root - - /root/init.lua - /root/init.luau - - /root/init.server.lua - /root/init.server.luau - - /root/init.client.lua - /root/init.client.luau + - /root/init.local.luau + - /root/init.legacy.luau - /root/init.csv - /root/init.meta.json5 context: diff --git a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__plugin_module_from_vfs.snap b/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__plugin_module_from_vfs.snap deleted file mode 100644 index 75afc0dc..00000000 --- a/src/snapshot_middleware/snapshots/librojo__snapshot_middleware__lua__test__plugin_module_from_vfs.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/snapshot_middleware/lua.rs -expression: instance_snapshot ---- -snapshot_id: "00000000000000000000000000000000" -metadata: - ignore_unknown_instances: false - instigating_source: - Path: /foo.plugin.lua - relevant_paths: - - /foo.plugin.lua - - /foo.meta.json - - /foo.meta.jsonc - - /foo.meta.json5 - context: - emit_legacy_scripts: false - decode_windows_invalid_chars: false - specified_id: ~ - middleware: ~ - schema: ~ -name: foo -class_name: Script -properties: - RunContext: - Enum: 3 - Source: - String: Hello there! -children: [] diff --git a/src/web/api.rs b/src/web/api.rs index da23f2fd..2b32fac0 100644 --- a/src/web/api.rs +++ b/src/web/api.rs @@ -2236,8 +2236,6 @@ mod tests { // Comprehensive RunContext Configuration Tests // ========================================================================= mod run_context_comprehensive_tests { - use super::*; - /// Helper to get RunContext enum value by name fn get_run_context_value(name: &str) -> Option { rbx_reflection_database::get() @@ -2947,8 +2945,6 @@ mod tests { // Syncback Configuration Matrix Tests // ========================================================================= mod syncback_configuration_matrix { - use super::*; - /// Test matrix for all script class + RunContext combinations #[test] fn test_configuration_matrix() { diff --git a/test-projects/attributes/default.project.json b/test-projects/attributes/default.project.json5 similarity index 100% rename from test-projects/attributes/default.project.json rename to test-projects/attributes/default.project.json5 diff --git a/test-projects/bad_classname_path_conflict/default.project.json b/test-projects/bad_classname_path_conflict/default.project.json5 similarity index 100% rename from test-projects/bad_classname_path_conflict/default.project.json rename to test-projects/bad_classname_path_conflict/default.project.json5 diff --git a/test-projects/bad_json_model/default.project.json b/test-projects/bad_json_model/default.project.json5 similarity index 100% rename from test-projects/bad_json_model/default.project.json rename to test-projects/bad_json_model/default.project.json5 diff --git a/test-projects/bad_json_model/src/bad-model.model.json b/test-projects/bad_json_model/src/bad-model.model.json5 similarity index 100% rename from test-projects/bad_json_model/src/bad-model.model.json rename to test-projects/bad_json_model/src/bad-model.model.json5 diff --git a/test-projects/bad_meta_lua_classname/default.project.json b/test-projects/bad_meta_lua_classname/default.project.json5 similarity index 100% rename from test-projects/bad_meta_lua_classname/default.project.json rename to test-projects/bad_meta_lua_classname/default.project.json5 diff --git a/test-projects/bad_meta_lua_classname/src/foo.lua b/test-projects/bad_meta_lua_classname/src/foo.luau similarity index 100% rename from test-projects/bad_meta_lua_classname/src/foo.lua rename to test-projects/bad_meta_lua_classname/src/foo.luau diff --git a/test-projects/bad_meta_lua_classname/src/foo.meta.json b/test-projects/bad_meta_lua_classname/src/foo.meta.json5 similarity index 100% rename from test-projects/bad_meta_lua_classname/src/foo.meta.json rename to test-projects/bad_meta_lua_classname/src/foo.meta.json5 diff --git a/test-projects/bad_meta_rbxmx_properties/default.project.json b/test-projects/bad_meta_rbxmx_properties/default.project.json5 similarity index 100% rename from test-projects/bad_meta_rbxmx_properties/default.project.json rename to test-projects/bad_meta_rbxmx_properties/default.project.json5 diff --git a/test-projects/bad_meta_rbxmx_properties/src/RobloxInstance.meta.json b/test-projects/bad_meta_rbxmx_properties/src/RobloxInstance.meta.json5 similarity index 100% rename from test-projects/bad_meta_rbxmx_properties/src/RobloxInstance.meta.json rename to test-projects/bad_meta_rbxmx_properties/src/RobloxInstance.meta.json5 diff --git a/test-projects/bad_missing_files/default.project.json b/test-projects/bad_missing_files/default.project.json5 similarity index 100% rename from test-projects/bad_missing_files/default.project.json rename to test-projects/bad_missing_files/default.project.json5 diff --git a/test-projects/bad_no_classname/default.project.json b/test-projects/bad_no_classname/default.project.json5 similarity index 100% rename from test-projects/bad_no_classname/default.project.json rename to test-projects/bad_no_classname/default.project.json5 diff --git a/test-projects/benchmark_small_place/default.project.json b/test-projects/benchmark_small_place/default.project.json5 similarity index 100% rename from test-projects/benchmark_small_place/default.project.json rename to test-projects/benchmark_small_place/default.project.json5 diff --git a/test-projects/benchmark_small_place/src/client/init.client.lua b/test-projects/benchmark_small_place/src/client/init.client.luau similarity index 100% rename from test-projects/benchmark_small_place/src/client/init.client.lua rename to test-projects/benchmark_small_place/src/client/init.client.luau diff --git a/test-projects/benchmark_small_place/src/client/module-1.lua b/test-projects/benchmark_small_place/src/client/module-1.luau similarity index 100% rename from test-projects/benchmark_small_place/src/client/module-1.lua rename to test-projects/benchmark_small_place/src/client/module-1.luau diff --git a/test-projects/benchmark_small_place/src/client/module-2.lua b/test-projects/benchmark_small_place/src/client/module-2.luau similarity index 100% rename from test-projects/benchmark_small_place/src/client/module-2.lua rename to test-projects/benchmark_small_place/src/client/module-2.luau diff --git a/test-projects/benchmark_small_place/src/client/module-3.lua b/test-projects/benchmark_small_place/src/client/module-3.luau similarity index 100% rename from test-projects/benchmark_small_place/src/client/module-3.lua rename to test-projects/benchmark_small_place/src/client/module-3.luau diff --git a/test-projects/benchmark_small_place/src/client/module-4.lua b/test-projects/benchmark_small_place/src/client/module-4.luau similarity index 100% rename from test-projects/benchmark_small_place/src/client/module-4.lua rename to test-projects/benchmark_small_place/src/client/module-4.luau diff --git a/test-projects/benchmark_small_place/src/common/init.lua b/test-projects/benchmark_small_place/src/common/init.luau similarity index 100% rename from test-projects/benchmark_small_place/src/common/init.lua rename to test-projects/benchmark_small_place/src/common/init.luau diff --git a/test-projects/benchmark_small_place/src/common/module-1.lua b/test-projects/benchmark_small_place/src/common/module-1.luau similarity index 100% rename from test-projects/benchmark_small_place/src/common/module-1.lua rename to test-projects/benchmark_small_place/src/common/module-1.luau diff --git a/test-projects/benchmark_small_place/src/common/module-2.lua b/test-projects/benchmark_small_place/src/common/module-2.luau similarity index 100% rename from test-projects/benchmark_small_place/src/common/module-2.lua rename to test-projects/benchmark_small_place/src/common/module-2.luau diff --git a/test-projects/benchmark_small_place/src/common/module-3.lua b/test-projects/benchmark_small_place/src/common/module-3.luau similarity index 100% rename from test-projects/benchmark_small_place/src/common/module-3.lua rename to test-projects/benchmark_small_place/src/common/module-3.luau diff --git a/test-projects/benchmark_small_place/src/common/module-4.lua b/test-projects/benchmark_small_place/src/common/module-4.luau similarity index 100% rename from test-projects/benchmark_small_place/src/common/module-4.lua rename to test-projects/benchmark_small_place/src/common/module-4.luau diff --git a/test-projects/benchmark_small_place/src/server/init.server.lua b/test-projects/benchmark_small_place/src/server/init.server.luau similarity index 100% rename from test-projects/benchmark_small_place/src/server/init.server.lua rename to test-projects/benchmark_small_place/src/server/init.server.luau diff --git a/test-projects/benchmark_small_place/src/server/module-1.lua b/test-projects/benchmark_small_place/src/server/module-1.luau similarity index 100% rename from test-projects/benchmark_small_place/src/server/module-1.lua rename to test-projects/benchmark_small_place/src/server/module-1.luau diff --git a/test-projects/benchmark_small_place/src/server/module-2.lua b/test-projects/benchmark_small_place/src/server/module-2.luau similarity index 100% rename from test-projects/benchmark_small_place/src/server/module-2.lua rename to test-projects/benchmark_small_place/src/server/module-2.luau diff --git a/test-projects/benchmark_small_place/src/server/module-3.lua b/test-projects/benchmark_small_place/src/server/module-3.luau similarity index 100% rename from test-projects/benchmark_small_place/src/server/module-3.lua rename to test-projects/benchmark_small_place/src/server/module-3.luau diff --git a/test-projects/benchmark_small_place/src/server/module-4.lua b/test-projects/benchmark_small_place/src/server/module-4.luau similarity index 100% rename from test-projects/benchmark_small_place/src/server/module-4.lua rename to test-projects/benchmark_small_place/src/server/module-4.luau diff --git a/test-projects/composing_models/default.project.json b/test-projects/composing_models/default.project.json5 similarity index 100% rename from test-projects/composing_models/default.project.json rename to test-projects/composing_models/default.project.json5 diff --git a/test-projects/composing_models/src/Remotes.model.json b/test-projects/composing_models/src/Remotes.model.json5 similarity index 100% rename from test-projects/composing_models/src/Remotes.model.json rename to test-projects/composing_models/src/Remotes.model.json5 diff --git a/test-projects/empty/default.project.json b/test-projects/empty/default.project.json5 similarity index 100% rename from test-projects/empty/default.project.json rename to test-projects/empty/default.project.json5 diff --git a/test-projects/empty_folder/default.project.json b/test-projects/empty_folder/default.project.json5 similarity index 100% rename from test-projects/empty_folder/default.project.json rename to test-projects/empty_folder/default.project.json5 diff --git a/test-projects/enums/default.project.json b/test-projects/enums/default.project.json5 similarity index 100% rename from test-projects/enums/default.project.json rename to test-projects/enums/default.project.json5 diff --git a/test-projects/json_model/default.project.json b/test-projects/json_model/default.project.json5 similarity index 100% rename from test-projects/json_model/default.project.json rename to test-projects/json_model/default.project.json5 diff --git a/test-projects/json_model/src/children.model.json b/test-projects/json_model/src/children.model.json5 similarity index 100% rename from test-projects/json_model/src/children.model.json rename to test-projects/json_model/src/children.model.json5 diff --git a/test-projects/json_model/src/explicit.model.json b/test-projects/json_model/src/explicit.model.json5 similarity index 100% rename from test-projects/json_model/src/explicit.model.json rename to test-projects/json_model/src/explicit.model.json5 diff --git a/test-projects/json_model/src/implicit.model.json b/test-projects/json_model/src/implicit.model.json5 similarity index 100% rename from test-projects/json_model/src/implicit.model.json rename to test-projects/json_model/src/implicit.model.json5 diff --git a/test-projects/legacy-0.5.x-reserved-names/default.project.json b/test-projects/legacy-0.5.x-reserved-names/default.project.json5 similarity index 100% rename from test-projects/legacy-0.5.x-reserved-names/default.project.json rename to test-projects/legacy-0.5.x-reserved-names/default.project.json5 diff --git a/test-projects/legacy-0.5.x-unknown-names/default.project.json b/test-projects/legacy-0.5.x-unknown-names/default.project.json5 similarity index 100% rename from test-projects/legacy-0.5.x-unknown-names/default.project.json rename to test-projects/legacy-0.5.x-unknown-names/default.project.json5 diff --git a/test-projects/meta_files/default.project.json b/test-projects/meta_files/default.project.json5 similarity index 100% rename from test-projects/meta_files/default.project.json rename to test-projects/meta_files/default.project.json5 diff --git a/test-projects/meta_files/src/A/init.meta.json b/test-projects/meta_files/src/A/init.meta.json5 similarity index 100% rename from test-projects/meta_files/src/A/init.meta.json rename to test-projects/meta_files/src/A/init.meta.json5 diff --git a/test-projects/meta_files/src/DisableMe.meta.json b/test-projects/meta_files/src/DisableMe.meta.json5 similarity index 100% rename from test-projects/meta_files/src/DisableMe.meta.json rename to test-projects/meta_files/src/DisableMe.meta.json5 diff --git a/test-projects/meta_files/src/DisableMe.server.lua b/test-projects/meta_files/src/DisableMe.server.luau similarity index 100% rename from test-projects/meta_files/src/DisableMe.server.lua rename to test-projects/meta_files/src/DisableMe.server.luau diff --git a/test-projects/meta_files/src/LocalizationTable.meta.json b/test-projects/meta_files/src/LocalizationTable.meta.json5 similarity index 100% rename from test-projects/meta_files/src/LocalizationTable.meta.json rename to test-projects/meta_files/src/LocalizationTable.meta.json5 diff --git a/test-projects/meta_files/src/RobloxInstance.meta.json b/test-projects/meta_files/src/RobloxInstance.meta.json5 similarity index 100% rename from test-projects/meta_files/src/RobloxInstance.meta.json rename to test-projects/meta_files/src/RobloxInstance.meta.json5 diff --git a/test-projects/meta_files/src/Script/init.meta.json b/test-projects/meta_files/src/Script/init.meta.json5 similarity index 100% rename from test-projects/meta_files/src/Script/init.meta.json rename to test-projects/meta_files/src/Script/init.meta.json5 diff --git a/test-projects/meta_files/src/Script/init.server.lua b/test-projects/meta_files/src/Script/init.server.luau similarity index 100% rename from test-projects/meta_files/src/Script/init.server.lua rename to test-projects/meta_files/src/Script/init.server.luau diff --git a/test-projects/meta_files/src/StringValue.meta.json b/test-projects/meta_files/src/StringValue.meta.json5 similarity index 100% rename from test-projects/meta_files/src/StringValue.meta.json rename to test-projects/meta_files/src/StringValue.meta.json5 diff --git a/test-projects/meta_files/src/init.meta.json b/test-projects/meta_files/src/init.meta.json5 similarity index 100% rename from test-projects/meta_files/src/init.meta.json rename to test-projects/meta_files/src/init.meta.json5 diff --git a/test-projects/multi_partition_game/a/main.lua b/test-projects/multi_partition_game/a/main.luau similarity index 100% rename from test-projects/multi_partition_game/a/main.lua rename to test-projects/multi_partition_game/a/main.luau diff --git a/test-projects/multi_partition_game/b/something.lua b/test-projects/multi_partition_game/b/something.luau similarity index 100% rename from test-projects/multi_partition_game/b/something.lua rename to test-projects/multi_partition_game/b/something.luau diff --git a/test-projects/multi_partition_game/default.project.json b/test-projects/multi_partition_game/default.project.json5 similarity index 100% rename from test-projects/multi_partition_game/default.project.json rename to test-projects/multi_partition_game/default.project.json5 diff --git a/test-projects/nested_partitions/default.project.json b/test-projects/nested_partitions/default.project.json5 similarity index 100% rename from test-projects/nested_partitions/default.project.json rename to test-projects/nested_partitions/default.project.json5 diff --git a/test-projects/nested_partitions/inner/hello.lua b/test-projects/nested_partitions/inner/hello.luau similarity index 100% rename from test-projects/nested_partitions/inner/hello.lua rename to test-projects/nested_partitions/inner/hello.luau diff --git a/test-projects/nested_partitions/outer/world.lua b/test-projects/nested_partitions/outer/world.luau similarity index 100% rename from test-projects/nested_partitions/outer/world.lua rename to test-projects/nested_partitions/outer/world.luau diff --git a/test-projects/plugins/default.project.json b/test-projects/plugins/default.project.json5 similarity index 100% rename from test-projects/plugins/default.project.json rename to test-projects/plugins/default.project.json5 diff --git a/test-projects/script-unwritable/default.project.json b/test-projects/script-unwritable/default.project.json5 similarity index 100% rename from test-projects/script-unwritable/default.project.json rename to test-projects/script-unwritable/default.project.json5 diff --git a/test-projects/single_partition_game/default.project.json b/test-projects/single_partition_game/default.project.json5 similarity index 100% rename from test-projects/single_partition_game/default.project.json rename to test-projects/single_partition_game/default.project.json5 diff --git a/test-projects/single_partition_game/lib/main.lua b/test-projects/single_partition_game/lib/main.luau similarity index 100% rename from test-projects/single_partition_game/lib/main.lua rename to test-projects/single_partition_game/lib/main.luau diff --git a/test-projects/single_partition_model/default.project.json b/test-projects/single_partition_model/default.project.json5 similarity index 100% rename from test-projects/single_partition_model/default.project.json rename to test-projects/single_partition_model/default.project.json5 diff --git a/test-projects/single_partition_model/src/main.server.lua b/test-projects/single_partition_model/src/main.server.luau similarity index 100% rename from test-projects/single_partition_model/src/main.server.lua rename to test-projects/single_partition_model/src/main.server.luau diff --git a/test-projects/single_partition_model/src/other.lua b/test-projects/single_partition_model/src/other.luau similarity index 100% rename from test-projects/single_partition_model/src/other.lua rename to test-projects/single_partition_model/src/other.luau diff --git a/test-projects/slice-center-gh-201/default.project.json b/test-projects/slice-center-gh-201/default.project.json5 similarity index 100% rename from test-projects/slice-center-gh-201/default.project.json rename to test-projects/slice-center-gh-201/default.project.json5 diff --git a/test-projects/spawn_location/default.project.json b/test-projects/spawn_location/default.project.json5 similarity index 100% rename from test-projects/spawn_location/default.project.json rename to test-projects/spawn_location/default.project.json5 diff --git a/test-projects/tags/default.project.json b/test-projects/tags/default.project.json5 similarity index 100% rename from test-projects/tags/default.project.json rename to test-projects/tags/default.project.json5 diff --git a/test-projects/terrain/default.project.json b/test-projects/terrain/default.project.json5 similarity index 100% rename from test-projects/terrain/default.project.json rename to test-projects/terrain/default.project.json5 diff --git a/test-projects/transmute_partition/ReplicatedStorage/hello.lua b/test-projects/transmute_partition/ReplicatedStorage/hello.luau similarity index 100% rename from test-projects/transmute_partition/ReplicatedStorage/hello.lua rename to test-projects/transmute_partition/ReplicatedStorage/hello.luau diff --git a/test-projects/transmute_partition/default.project.json b/test-projects/transmute_partition/default.project.json5 similarity index 100% rename from test-projects/transmute_partition/default.project.json rename to test-projects/transmute_partition/default.project.json5 diff --git a/test-projects/txt_file/default.project.json b/test-projects/txt_file/default.project.json5 similarity index 100% rename from test-projects/txt_file/default.project.json rename to test-projects/txt_file/default.project.json5 diff --git a/test-projects/unions/default.project.json b/test-projects/unions/default.project.json5 similarity index 100% rename from test-projects/unions/default.project.json rename to test-projects/unions/default.project.json5 diff --git a/tests/rojo_test/serve_util.rs b/tests/rojo_test/serve_util.rs index 2035c4b7..2ffe2322 100644 --- a/tests/rojo_test/serve_util.rs +++ b/tests/rojo_test/serve_util.rs @@ -180,8 +180,15 @@ impl TestServeSession { let (mut socket, _response) = connect(url)?; - // Wait for messages with a timeout + // Set a read timeout on the underlying TCP stream to prevent blocking forever. + // Without this, socket.read() blocks indefinitely if no data arrives. let timeout = Duration::from_secs(10); + if let hyper_tungstenite::tungstenite::stream::MaybeTlsStream::Plain(ref stream) = + socket.get_ref() + { + stream.set_read_timeout(Some(Duration::from_millis(100)))?; + } + let start = std::time::Instant::now(); loop { @@ -208,10 +215,10 @@ impl TestServeSession { continue; } Err(hyper_tungstenite::tungstenite::Error::Io(e)) - if e.kind() == std::io::ErrorKind::WouldBlock => + if e.kind() == std::io::ErrorKind::WouldBlock + || e.kind() == std::io::ErrorKind::TimedOut => { - // No data available yet, sleep a bit and try again - thread::sleep(Duration::from_millis(100)); + // No data available yet or read timed out, try again continue; } Err(e) => { diff --git a/tests/tests/serve.rs b/tests/tests/serve.rs index ee0528e1..b8f7bf92 100644 --- a/tests/tests/serve.rs +++ b/tests/tests/serve.rs @@ -42,7 +42,7 @@ fn scripts() { ); }); - fs::write(session.path().join("src/foo.lua"), "Updated foo!").unwrap(); + fs::write(session.path().join("src/foo.luau"), "Updated foo!").unwrap(); let socket_packet = session .get_api_socket_packet(SocketPacketType::Messages, 0) @@ -140,7 +140,7 @@ fn edit_init() { read_response.intern_and_redact(&mut redactions, root_id) ); - fs::write(session.path().join("src/init.lua"), b"-- Edited contents").unwrap(); + fs::write(session.path().join("src/init.luau"), b"-- Edited contents").unwrap(); let socket_packet = session .get_api_socket_packet(SocketPacketType::Messages, 0)