diff --git a/.editorconfig b/.editorconfig index aa7f61e97..42639a347 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,4 +23,7 @@ insert_final_newline = true insert_final_newline = true [*.lua] +indent_style = tab + +[*.luau] indent_style = tab \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8021fac9d..ba305c506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,12 @@ ## Unreleased Changes * Improved the visualization for array properties like Tags ([#829]) -* Significantly improved performance of `rojo serve`, `rojo build --watch`, and `rojo sourcemap --watch` on macOS. [#830] +* Significantly improved performance of `rojo serve`, `rojo build --watch`, and `rojo sourcemap --watch` on macOS. ([#830]) +* Changed *.lua files that init command generates to *.luau ([#831]) [#829]: https://github.com/rojo-rbx/rojo/pull/829 [#830]: https://github.com/rojo-rbx/rojo/pull/830 +[#831]: https://github.com/rojo-rbx/rojo/pull/831 ## [7.4.0-rc3] - October 25, 2023 * Changed `sourcemap --watch` to only generate the sourcemap when it's necessary ([#800]) diff --git a/assets/default-model-project/src-init.lua b/assets/default-model-project/src-init.luau similarity index 100% rename from assets/default-model-project/src-init.lua rename to assets/default-model-project/src-init.luau diff --git a/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap b/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap index 5858d5e01..2bbda0731 100644 --- a/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap +++ b/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap @@ -7,7 +7,7 @@ expression: contents server_init 0 - return "From folder/init.server.lua" + return "From folder/init.server.luau" diff --git a/rojo-test/build-tests/client_in_folder/folder/localScript.client.lua b/rojo-test/build-tests/client_in_folder/folder/localScript.client.luau similarity index 100% rename from rojo-test/build-tests/client_in_folder/folder/localScript.client.lua rename to rojo-test/build-tests/client_in_folder/folder/localScript.client.luau diff --git a/rojo-test/build-tests/nested_runcontext/folder1/test.server.lua b/rojo-test/build-tests/nested_runcontext/folder1/test.server.luau similarity index 100% rename from rojo-test/build-tests/nested_runcontext/folder1/test.server.lua rename to rojo-test/build-tests/nested_runcontext/folder1/test.server.luau diff --git a/rojo-test/build-tests/nested_runcontext/folder2/folder3/test.server.lua b/rojo-test/build-tests/nested_runcontext/folder2/folder3/test.server.luau similarity index 100% rename from rojo-test/build-tests/nested_runcontext/folder2/folder3/test.server.lua rename to rojo-test/build-tests/nested_runcontext/folder2/folder3/test.server.luau diff --git a/rojo-test/build-tests/script_meta_disabled/folder/hello.server.lua b/rojo-test/build-tests/script_meta_disabled/folder/hello.server.luau similarity index 100% rename from rojo-test/build-tests/script_meta_disabled/folder/hello.server.lua rename to rojo-test/build-tests/script_meta_disabled/folder/hello.server.luau diff --git a/rojo-test/build-tests/server_in_folder/folder/serverScript.server.lua b/rojo-test/build-tests/server_in_folder/folder/serverScript.server.luau similarity index 100% rename from rojo-test/build-tests/server_in_folder/folder/serverScript.server.lua rename to rojo-test/build-tests/server_in_folder/folder/serverScript.server.luau diff --git a/rojo-test/build-tests/server_init/folder/init.server.lua b/rojo-test/build-tests/server_init/folder/init.server.lua deleted file mode 100644 index 30d3d49a1..000000000 --- a/rojo-test/build-tests/server_init/folder/init.server.lua +++ /dev/null @@ -1 +0,0 @@ -return "From folder/init.server.lua" \ No newline at end of file diff --git a/rojo-test/build-tests/server_init/folder/init.server.luau b/rojo-test/build-tests/server_init/folder/init.server.luau new file mode 100644 index 000000000..196105d7a --- /dev/null +++ b/rojo-test/build-tests/server_init/folder/init.server.luau @@ -0,0 +1 @@ +return "From folder/init.server.luau" \ No newline at end of file diff --git a/src/cli/init.rs b/src/cli/init.rs index 48d513b1e..5f861470b 100644 --- a/src/cli/init.rs +++ b/src/cli/init.rs @@ -13,7 +13,7 @@ use super::resolve_path; static MODEL_PROJECT: &str = include_str!("../../assets/default-model-project/default.project.json"); static MODEL_README: &str = include_str!("../../assets/default-model-project/README.md"); -static MODEL_INIT: &str = include_str!("../../assets/default-model-project/src-init.lua"); +static MODEL_INIT: &str = include_str!("../../assets/default-model-project/src-init.luau"); static MODEL_GIT_IGNORE: &str = include_str!("../../assets/default-model-project/gitignore.txt"); static PLACE_PROJECT: &str = @@ -116,17 +116,17 @@ fn init_place(base_path: &Path, project_params: ProjectParams) -> anyhow::Result fs::create_dir_all(src.join(&src_client))?; write_if_not_exists( - &src_shared.join("Hello.lua"), + &src_shared.join("Hello.luau"), "return function()\n\tprint(\"Hello, world!\")\nend", )?; write_if_not_exists( - &src_server.join("init.server.lua"), + &src_server.join("init.server.luau"), "print(\"Hello world, from server!\")", )?; write_if_not_exists( - &src_client.join("init.client.lua"), + &src_client.join("init.client.luau"), "print(\"Hello world, from client!\")", )?; @@ -149,7 +149,7 @@ fn init_model(base_path: &Path, project_params: ProjectParams) -> anyhow::Result fs::create_dir_all(&src)?; let init = project_params.render_template(MODEL_INIT); - write_if_not_exists(&src.join("init.lua"), &init)?; + write_if_not_exists(&src.join("init.luau"), &init)?; let git_ignore = project_params.render_template(MODEL_GIT_IGNORE); try_git_init(base_path, &git_ignore)?; @@ -170,7 +170,7 @@ fn init_plugin(base_path: &Path, project_params: ProjectParams) -> anyhow::Resul fs::create_dir_all(&src)?; write_if_not_exists( - &src.join("init.server.lua"), + &src.join("init.server.luau"), "print(\"Hello world, from plugin!\")\n", )?; diff --git a/test-projects/plugins/default.project.json b/test-projects/plugins/default.project.json index 02387e7e3..4ca44a88f 100644 --- a/test-projects/plugins/default.project.json +++ b/test-projects/plugins/default.project.json @@ -4,6 +4,6 @@ "$path": "src" }, "plugins": [ - "test-plugin.lua" + "test-plugin.luau" ] } \ No newline at end of file diff --git a/test-projects/plugins/test-plugin.lua b/test-projects/plugins/test-plugin.luau similarity index 100% rename from test-projects/plugins/test-plugin.lua rename to test-projects/plugins/test-plugin.luau