From 6ea788dd3a947b39bf806d28ccf36f478c450510 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 26 Jul 2024 16:45:43 +0400 Subject: [PATCH] Remove codegen rescript format (#89) --- codegenerator/cli/src/commands.rs | 21 ++++--------------- .../dynamic/codegen/package.json.hbs | 1 + 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/codegenerator/cli/src/commands.rs b/codegenerator/cli/src/commands.rs index ad2034dd9..91e083232 100644 --- a/codegenerator/cli/src/commands.rs +++ b/codegenerator/cli/src/commands.rs @@ -39,10 +39,6 @@ pub mod rescript { execute_command("pnpm", args, path).await } - pub async fn format(path: &PathBuf) -> Result { - let args = vec!["rescript", "format", "-all"]; - execute_command("pnpm", args, path).await - } pub async fn build(path: &PathBuf) -> Result { let args = vec!["rescript"]; execute_command("pnpm", args, path).await @@ -112,13 +108,13 @@ pub mod codegen { async fn run_post_codegen_command_sequence( project_paths: &ParsedProjectPaths, ) -> anyhow::Result { - 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")?; @@ -126,9 +122,7 @@ pub mod codegen { 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")?; @@ -136,14 +130,7 @@ pub mod codegen { 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( diff --git a/codegenerator/cli/templates/dynamic/codegen/package.json.hbs b/codegenerator/cli/templates/dynamic/codegen/package.json.hbs index 89449e525..0da7cf2a0 100644 --- a/codegenerator/cli/templates/dynamic/codegen/package.json.hbs +++ b/codegenerator/cli/templates/dynamic/codegen/package.json.hbs @@ -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)'",