Skip to content

Commit

Permalink
Changed file extensions of init command from lua to luau (rojo-rbx#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barocena authored Jan 6, 2024
1 parent 6adc5eb commit 2692729
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ insert_final_newline = true
insert_final_newline = true

[*.lua]
indent_style = tab

[*.luau]
indent_style = tab
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ expression: contents
<Properties>
<string name="Name">server_init</string>
<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>
</Item>
</roblox>
1 change: 0 additions & 1 deletion rojo-test/build-tests/server_init/folder/init.server.lua

This file was deleted.

1 change: 1 addition & 0 deletions rojo-test/build-tests/server_init/folder/init.server.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return "From folder/init.server.luau"
12 changes: 6 additions & 6 deletions src/cli/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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!\")",
)?;

Expand All @@ -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)?;
Expand All @@ -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",
)?;

Expand Down
2 changes: 1 addition & 1 deletion test-projects/plugins/default.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"$path": "src"
},
"plugins": [
"test-plugin.lua"
"test-plugin.luau"
]
}
File renamed without changes.

0 comments on commit 2692729

Please sign in to comment.