Skip to content

Commit

Permalink
Remove codegen rescript format (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh authored Jul 26, 2024
1 parent f8b3dc0 commit 6ea788d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
21 changes: 4 additions & 17 deletions codegenerator/cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ pub mod rescript {
execute_command("pnpm", args, path).await
}

pub async fn format(path: &PathBuf) -> Result<std::process::ExitStatus> {
let args = vec!["rescript", "format", "-all"];
execute_command("pnpm", args, path).await
}
pub async fn build(path: &PathBuf) -> Result<std::process::ExitStatus> {
let args = vec!["rescript"];
execute_command("pnpm", args, path).await
Expand Down Expand Up @@ -112,38 +108,29 @@ pub mod codegen {
async fn run_post_codegen_command_sequence(
project_paths: &ParsedProjectPaths,
) -> anyhow::Result<std::process::ExitStatus> {
println!("installing packages... ");
println!("Installing packages... ");
let exit1 = pnpm_install(project_paths).await?;
if !exit1.success() {
return Ok(exit1);
}

println!("clean build directory");
println!("Clean build directory");
let exit2 = rescript::clean(&project_paths.generated)
.await
.context("Failed running rescript clean")?;
if !exit2.success() {
return Ok(exit2);
}

//NOTE: Runing format before build was causing freezing on some
//cases
println!("building code");
println!("Building code");
let exit3 = rescript::build(&project_paths.generated)
.await
.context("Failed running rescript build")?;
if !exit3.success() {
return Ok(exit3);
}

//NOTE: Runing format before build was causing freezing on some
//cases
println!("formatting code");
let last_exit = rescript::format(&project_paths.generated)
.await
.context("Failed running rescript format")?;

Ok(last_exit)
Ok(exit3)
}

pub async fn npx_codegen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"clean": "rescript clean",
"build": "rescript",
"watch": "rescript -w",
"format": "rescript format -all",
"db-up": "node -e 'require(`./src/db/Migrations.bs.js`).runUpMigrations(true)'",
"db-down": "node -e 'require(`./src/db/Migrations.bs.js`).runDownMigrations(true, true)'",
"db-setup": "node -e 'require(`./src/db/Migrations.bs.js`).setupDb(true)'",
Expand Down

0 comments on commit 6ea788d

Please sign in to comment.