Skip to content

Commit

Permalink
Remove luau option, and make it standard behavior. Closes #66
Browse files Browse the repository at this point in the history
  • Loading branch information
jackTabsCode committed Jun 25, 2024
1 parent 466ddd0 commit 95bfcdc
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 21 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ write_dir = "src/shared/"

[codegen]
typescript = true
luau = true
style = "flat"
output_name = "assets"

Expand Down Expand Up @@ -93,8 +92,6 @@ id = 9670971

- `typescript`: boolean (optional)
- Generate a Typescript definition file.
- `luau`: boolean (optional)
- Use the `luau` file extension.
- `style`: "flat" | "nested" (optional)
- 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`.
- `output_name`: string (optional)
Expand Down
7 changes: 0 additions & 7 deletions src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ pub async fn init() -> anyhow::Result<()> {
.prompt()
.unwrap_or_else(|_| exit(1));

let luau = Confirm::new(".luau extension")
.with_help_message("Use .luau extension for Lua files.")
.with_default(false)
.prompt()
.unwrap_or_else(|_| exit(1));

let codegen_style = Select::new("Style", vec![CodegenStyle::Flat, CodegenStyle::Nested])
.with_help_message("The style to use for generated code.")
.prompt()
Expand All @@ -83,7 +77,6 @@ pub async fn init() -> anyhow::Result<()> {
codegen: CodegenConfig {
output_name,
typescript: Some(typescript),
luau: Some(luau),
style: Some(codegen_style),
strip_extension: Some(strip_extension),
},
Expand Down
1 change: 0 additions & 1 deletion src/commands/sync/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ pub struct ExistingAsset {
pub struct CodegenConfig {
pub output_name: Option<String>,
pub typescript: Option<bool>,
pub luau: Option<bool>,
pub style: Option<CodegenStyle>,
pub strip_extension: Option<bool>,
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pub async fn sync(args: SyncArgs, existing_lockfile: LockFile) -> anyhow::Result
)
}));

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

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

if state.typescript {
let ts_filename = format!("{}.d.ts", state.output_name);
Expand Down
8 changes: 0 additions & 8 deletions src/commands/sync/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pub struct SyncState {

pub typescript: bool,
pub output_name: String,
pub lua_extension: String,
pub style: CodegenStyle,
pub strip_extension: bool,

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

let lua_extension = String::from(if config.codegen.luau.unwrap_or(false) {
"luau"
} else {
"lua"
});

let strip_extension = config.codegen.strip_extension.unwrap_or(false);

let mut font_db = Database::new();
Expand All @@ -129,7 +122,6 @@ impl SyncState {
creator,
typescript,
output_name,
lua_extension,
style,
strip_extension,
font_db,
Expand Down

0 comments on commit 95bfcdc

Please sign in to comment.