Skip to content

Commit 95bfcdc

Browse files
committed
Remove luau option, and make it standard behavior. Closes #66
1 parent 466ddd0 commit 95bfcdc

File tree

5 files changed

+2
-21
lines changed

5 files changed

+2
-21
lines changed

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ write_dir = "src/shared/"
5555

5656
[codegen]
5757
typescript = true
58-
luau = true
5958
style = "flat"
6059
output_name = "assets"
6160

@@ -93,8 +92,6 @@ id = 9670971
9392

9493
- `typescript`: boolean (optional)
9594
- Generate a Typescript definition file.
96-
- `luau`: boolean (optional)
97-
- Use the `luau` file extension.
9895
- `style`: "flat" | "nested" (optional)
9996
- The code-generation style to use. Defaults to `flat`. If you would like to have an experience similar to [Tarmac](https://github.com/rojo-rbx/tarmac), use `nested`.
10097
- `output_name`: string (optional)

src/commands/init.rs

-7
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ pub async fn init() -> anyhow::Result<()> {
5858
.prompt()
5959
.unwrap_or_else(|_| exit(1));
6060

61-
let luau = Confirm::new(".luau extension")
62-
.with_help_message("Use .luau extension for Lua files.")
63-
.with_default(false)
64-
.prompt()
65-
.unwrap_or_else(|_| exit(1));
66-
6761
let codegen_style = Select::new("Style", vec![CodegenStyle::Flat, CodegenStyle::Nested])
6862
.with_help_message("The style to use for generated code.")
6963
.prompt()
@@ -83,7 +77,6 @@ pub async fn init() -> anyhow::Result<()> {
8377
codegen: CodegenConfig {
8478
output_name,
8579
typescript: Some(typescript),
86-
luau: Some(luau),
8780
style: Some(codegen_style),
8881
strip_extension: Some(strip_extension),
8982
},

src/commands/sync/config.rs

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ pub struct ExistingAsset {
5454
pub struct CodegenConfig {
5555
pub output_name: Option<String>,
5656
pub typescript: Option<bool>,
57-
pub luau: Option<bool>,
5857
pub style: Option<CodegenStyle>,
5958
pub strip_extension: Option<bool>,
6059
}

src/commands/sync/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub async fn sync(args: SyncArgs, existing_lockfile: LockFile) -> anyhow::Result
146146
)
147147
}));
148148

149-
let lua_filename = format!("{}.{}", state.output_name, state.lua_extension);
149+
let lua_filename = format!("{}.{}", state.output_name, "luau");
150150
let lua_output = generate_lua(
151151
&state.new_lockfile,
152152
asset_dir_str,
@@ -156,7 +156,7 @@ pub async fn sync(args: SyncArgs, existing_lockfile: LockFile) -> anyhow::Result
156156

157157
write(Path::new(&state.write_dir).join(lua_filename), lua_output?)
158158
.await
159-
.context("Failed to write output Lua file")?;
159+
.context("Failed to write output Luau file")?;
160160

161161
if state.typescript {
162162
let ts_filename = format!("{}.d.ts", state.output_name);

src/commands/sync/state.rs

-8
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ pub struct SyncState {
5050

5151
pub typescript: bool,
5252
pub output_name: String,
53-
pub lua_extension: String,
5453
pub style: CodegenStyle,
5554
pub strip_extension: bool,
5655

@@ -99,12 +98,6 @@ impl SyncState {
9998
let typescript = config.codegen.typescript.unwrap_or(false);
10099
let style = config.codegen.style.unwrap_or(CodegenStyle::Flat);
101100

102-
let lua_extension = String::from(if config.codegen.luau.unwrap_or(false) {
103-
"luau"
104-
} else {
105-
"lua"
106-
});
107-
108101
let strip_extension = config.codegen.strip_extension.unwrap_or(false);
109102

110103
let mut font_db = Database::new();
@@ -129,7 +122,6 @@ impl SyncState {
129122
creator,
130123
typescript,
131124
output_name,
132-
lua_extension,
133125
style,
134126
strip_extension,
135127
font_db,

0 commit comments

Comments
 (0)