Changed file extensions of init command from lua to luau (#831)

This commit is contained in:
Barış
2024-01-06 03:00:49 +03:00
committed by GitHub
parent 6adc5eb9fb
commit 269272983b
14 changed files with 15 additions and 10 deletions

View File

@@ -23,4 +23,7 @@ insert_final_newline = true
insert_final_newline = true insert_final_newline = true
[*.lua] [*.lua]
indent_style = tab
[*.luau]
indent_style = tab indent_style = tab

View File

@@ -2,10 +2,12 @@
## Unreleased Changes ## Unreleased Changes
* Improved the visualization for array properties like Tags ([#829]) * 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 [#829]: https://github.com/rojo-rbx/rojo/pull/829
[#830]: https://github.com/rojo-rbx/rojo/pull/830 [#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 ## [7.4.0-rc3] - October 25, 2023
* Changed `sourcemap --watch` to only generate the sourcemap when it's necessary ([#800]) * Changed `sourcemap --watch` to only generate the sourcemap when it's necessary ([#800])

View File

@@ -7,7 +7,7 @@ expression: contents
<Properties> <Properties>
<string name="Name">server_init</string> <string name="Name">server_init</string>
<token name="RunContext">0</token> <token name="RunContext">0</token>
<string name="Source">return "From folder/init.server.lua"</string> <string name="Source">return "From folder/init.server.luau"</string>
</Properties> </Properties>
</Item> </Item>
</roblox> </roblox>

View File

@@ -1 +0,0 @@
return "From folder/init.server.lua"

View File

@@ -0,0 +1 @@
return "From folder/init.server.luau"

View File

@@ -13,7 +13,7 @@ use super::resolve_path;
static MODEL_PROJECT: &str = static MODEL_PROJECT: &str =
include_str!("../../assets/default-model-project/default.project.json"); include_str!("../../assets/default-model-project/default.project.json");
static MODEL_README: &str = include_str!("../../assets/default-model-project/README.md"); 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 MODEL_GIT_IGNORE: &str = include_str!("../../assets/default-model-project/gitignore.txt");
static PLACE_PROJECT: &str = 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))?; fs::create_dir_all(src.join(&src_client))?;
write_if_not_exists( write_if_not_exists(
&src_shared.join("Hello.lua"), &src_shared.join("Hello.luau"),
"return function()\n\tprint(\"Hello, world!\")\nend", "return function()\n\tprint(\"Hello, world!\")\nend",
)?; )?;
write_if_not_exists( write_if_not_exists(
&src_server.join("init.server.lua"), &src_server.join("init.server.luau"),
"print(\"Hello world, from server!\")", "print(\"Hello world, from server!\")",
)?; )?;
write_if_not_exists( write_if_not_exists(
&src_client.join("init.client.lua"), &src_client.join("init.client.luau"),
"print(\"Hello world, from client!\")", "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)?; fs::create_dir_all(&src)?;
let init = project_params.render_template(MODEL_INIT); 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); let git_ignore = project_params.render_template(MODEL_GIT_IGNORE);
try_git_init(base_path, &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)?; fs::create_dir_all(&src)?;
write_if_not_exists( write_if_not_exists(
&src.join("init.server.lua"), &src.join("init.server.luau"),
"print(\"Hello world, from plugin!\")\n", "print(\"Hello world, from plugin!\")\n",
)?; )?;

View File

@@ -4,6 +4,6 @@
"$path": "src" "$path": "src"
}, },
"plugins": [ "plugins": [
"test-plugin.lua" "test-plugin.luau"
] ]
} }