From 51d020b9778c1a2ddae3dc231cbee10814d1cdb8 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 20 Jan 2026 20:06:18 +0100 Subject: [PATCH 1/3] Remove dev, create-sourcedirs & build -w --- rewatch/src/cli.rs | 54 ----------------------------------------- rewatch/src/main.rs | 58 +++------------------------------------------ 2 files changed, 3 insertions(+), 109 deletions(-) diff --git a/rewatch/src/cli.rs b/rewatch/src/cli.rs index c59fd3918b..2de59bce94 100644 --- a/rewatch/src/cli.rs +++ b/rewatch/src/cli.rs @@ -194,21 +194,6 @@ pub struct AfterBuildArg { pub after_build: Option, } -#[derive(Args, Debug, Clone, Copy)] -pub struct CreateSourceDirsArg { - /// Deprecated: source_dirs.json is now always created. - #[arg(short, long, num_args = 0..=1, default_missing_value = "true", hide = true)] - pub create_sourcedirs: Option, -} - -#[derive(Args, Debug, Clone, Copy)] -pub struct DevArg { - /// Deprecated: Build development dependencies - /// This is the flag no longer does anything and will be removed in future versions. - #[arg(long, default_value_t = false, num_args = 0..=1, hide = true)] - pub dev: bool, -} - #[derive(Args, Debug, Clone)] pub struct WarnErrorArg { /// Override warning configuration from rescript.json. @@ -228,22 +213,12 @@ pub struct BuildArgs { #[command(flatten)] pub after_build: AfterBuildArg, - #[command(flatten)] - pub create_sourcedirs: CreateSourceDirsArg, - - #[command(flatten)] - pub dev: DevArg, - #[command(flatten)] pub warn_error: WarnErrorArg, /// Disable output timing #[arg(short, long, default_value_t = false, num_args = 0..=1)] pub no_timing: bool, - - /// Watch mode (deprecated, use `rescript watch` instead) - #[arg(short, default_value_t = false, num_args = 0..=1, hide = true)] - pub watch: bool, } #[cfg(test)] @@ -395,12 +370,6 @@ pub struct WatchArgs { #[command(flatten)] pub after_build: AfterBuildArg, - #[command(flatten)] - pub create_sourcedirs: CreateSourceDirsArg, - - #[command(flatten)] - pub dev: DevArg, - #[command(flatten)] pub warn_error: WarnErrorArg, } @@ -411,8 +380,6 @@ impl From for WatchArgs { folder: build_args.folder, filter: build_args.filter, after_build: build_args.after_build, - create_sourcedirs: build_args.create_sourcedirs, - dev: build_args.dev, warn_error: build_args.warn_error, } } @@ -428,9 +395,6 @@ pub enum Command { Clean { #[command(flatten)] folder: FolderArg, - - #[command(flatten)] - dev: DevArg, }, /// Format ReScript files. Format { @@ -451,9 +415,6 @@ pub enum Command { /// Files to format. If no files are provided, all files are formatted. #[arg(group = "format_input_mode")] files: Vec, - - #[command(flatten)] - dev: DevArg, }, /// Print the compiler arguments for a ReScript source file. CompilerArgs { @@ -487,21 +448,6 @@ impl Deref for AfterBuildArg { } } -impl CreateSourceDirsArg { - /// Returns true if the flag was explicitly passed on the command line. - pub fn was_explicitly_set(&self) -> bool { - self.create_sourcedirs.is_some() - } -} - -impl Deref for DevArg { - type Target = bool; - - fn deref(&self) -> &Self::Target { - &self.dev - } -} - impl Deref for WarnErrorArg { type Target = Option; diff --git a/rewatch/src/main.rs b/rewatch/src/main.rs index 65b1ff5b64..c27c21e959 100644 --- a/rewatch/src/main.rs +++ b/rewatch/src/main.rs @@ -29,15 +29,6 @@ fn main() -> Result<()> { })) .expect("Failed to initialize logger"); - let mut command = cli.command; - - if let cli::Command::Build(build_args) = &command - && build_args.watch - { - log::warn!("`rescript build -w` is deprecated. Please use `rescript watch` instead."); - command = cli::Command::Watch(build_args.clone().into()); - } - let is_tty: bool = Term::stdout().is_term() && Term::stderr().is_term(); let plain_output = !is_tty; @@ -45,7 +36,7 @@ fn main() -> Result<()> { // level, we should never show that. let show_progress = log_level_filter == LevelFilter::Info; - match command { + match cli.command { cli::Command::CompilerArgs { path } => { println!("{}", build::get_compiler_args(Path::new(&path))?); std::process::exit(0); @@ -53,18 +44,6 @@ fn main() -> Result<()> { cli::Command::Build(build_args) => { let _lock = get_lock(&build_args.folder); - if build_args.dev.dev { - log::warn!( - "`--dev no longer has any effect. Please remove it from your command. It will be removed in a future version." - ); - } - - if build_args.create_sourcedirs.was_explicitly_set() { - log::warn!( - "`--create-sourcedirs` is deprecated: source_dirs.json is now always created. Please remove this flag from your command." - ); - } - match build::build( &build_args.filter, Path::new(&build_args.folder as &str), @@ -89,18 +68,6 @@ fn main() -> Result<()> { cli::Command::Watch(watch_args) => { let _lock = get_lock(&watch_args.folder); - if *watch_args.dev { - log::warn!( - "`--dev no longer has any effect. Please remove it from your command. It will be removed in a future version." - ); - } - - if watch_args.create_sourcedirs.was_explicitly_set() { - log::warn!( - "`--create-sourcedirs` is deprecated: source_dirs.json is now always created. Please remove this flag from your command." - ); - } - match watcher::start( &watch_args.filter, show_progress, @@ -117,30 +84,11 @@ fn main() -> Result<()> { Ok(_) => Ok(()), } } - cli::Command::Clean { folder, dev } => { + cli::Command::Clean { folder } => { let _lock = get_lock(&folder); - - if dev.dev { - log::warn!( - "`--dev no longer has any effect. Please remove it from your command. It will be removed in a future version." - ); - } - build::clean::clean(Path::new(&folder as &str), show_progress, plain_output) } - cli::Command::Format { - stdin, - check, - files, - dev, - } => { - if dev.dev { - log::warn!( - "`--dev no longer has any effect. Please remove it from your command. It will be removed in a future version." - ); - } - format::format(stdin, check, files) - } + cli::Command::Format { stdin, check, files } => format::format(stdin, check, files), } } From be7b429979cbf5fb0e1a4d4e89e8eada3f6fab92 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 20 Jan 2026 20:09:23 +0100 Subject: [PATCH 2/3] Add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c09fdf36ce..73e8e0fe88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - `js-post-build` command now runs in the directory containing the `rescript.json` where it is defined, instead of the unpredictable build invocation directory. This provides consistent behavior in monorepos. https://github.com/rescript-lang/rescript/pull/8195 - Remove support for deprecated `bs-dependencies`, `bs-dev-dependencies`, and `bsc-flags` configuration options. Use `dependencies`, `dev-dependencies`, and `compiler-flags` instead. https://github.com/rescript-lang/rescript/pull/8196 - `bsc`: remove legacy `-uncurried` flag. https://github.com/rescript-lang/rescript/pull/8201 +- Remove deprecated cli flags `--dev`, `--create-sourcedirs` and `build -w`. https://github.com/rescript-lang/rescript/pull/8202 #### :eyeglasses: Spec Compliance From 3e1550b6c47521f881118a1631a00d777b27615c Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 20 Jan 2026 20:52:55 +0100 Subject: [PATCH 3/3] Update cli_help test --- tests/build_tests/cli_help/input.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/build_tests/cli_help/input.js b/tests/build_tests/cli_help/input.js index 8c7828e34e..5a1dd513da 100755 --- a/tests/build_tests/cli_help/input.js +++ b/tests/build_tests/cli_help/input.js @@ -113,14 +113,6 @@ await test(["build", "--help"], { status: 0, }); -await test(["build", "-w", "--help"], { - stdout: buildHelp, - stderr: "", - status: 0, -}); - -await test(["-w", "--help"], { stdout: cliHelp, stderr: "", status: 0 }); - // Shows cli help with --help arg even if there are invalid arguments after it await test(["--help", "-w"], { stdout: cliHelp, stderr: "", status: 0 });