diff --git a/cli/args/flags.rs b/cli/args/flags.rs index ee8ec2563a..21a940dc51 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -767,6 +767,7 @@ glob {*_,*.,}bench.{js,mjs,ts,mts,jsx,tsx}: fn bundle_subcommand<'a>() -> Command<'a> { compile_args(Command::new("bundle")) + .hide(true) .arg( Arg::new("source_file") .takes_value(true) diff --git a/cli/tests/integration/watcher_tests.rs b/cli/tests/integration/watcher_tests.rs index 5ba16cd5e4..99d5a57279 100644 --- a/cli/tests/integration/watcher_tests.rs +++ b/cli/tests/integration/watcher_tests.rs @@ -402,6 +402,8 @@ fn bundle_js_watch() { let (_stdout_lines, mut stderr_lines) = child_lines(&mut deno); + assert_contains!(stderr_lines.next().unwrap(), "Warning"); + assert_contains!(stderr_lines.next().unwrap(), "deno_emit"); assert_contains!(stderr_lines.next().unwrap(), "Check"); let next_line = stderr_lines.next().unwrap(); assert_contains!(&next_line, "Bundle started"); @@ -455,8 +457,9 @@ fn bundle_watch_not_exit() { .unwrap(); let (_stdout_lines, mut stderr_lines) = child_lines(&mut deno); - let next_line = stderr_lines.next().unwrap(); - assert_contains!(&next_line, "Bundle started"); + assert_contains!(stderr_lines.next().unwrap(), "Warning"); + assert_contains!(stderr_lines.next().unwrap(), "deno_emit"); + assert_contains!(stderr_lines.next().unwrap(), "Bundle started"); assert_contains!(stderr_lines.next().unwrap(), "error:"); assert_eq!(stderr_lines.next().unwrap(), ""); assert_eq!(stderr_lines.next().unwrap(), " syntax error ^^"); diff --git a/cli/tests/testdata/bundle/shebang_file.bundle.out b/cli/tests/testdata/bundle/shebang_file.bundle.out index df425f6566..978fe6d97d 100644 --- a/cli/tests/testdata/bundle/shebang_file.bundle.out +++ b/cli/tests/testdata/bundle/shebang_file.bundle.out @@ -1,3 +1,5 @@ +Warning "deno bundle" is deprecated and will be removed in the future. +Use alternative bundlers like "deno_emit", "esbuild" or "rollup" instead. Bundle file:///[WILDCARD]/subdir/shebang_file.js #!/usr/bin/env -S deno run --allow-read // deno-fmt-ignore-file diff --git a/cli/tools/bundle.rs b/cli/tools/bundle.rs index 86b28828b8..6a9019cd86 100644 --- a/cli/tools/bundle.rs +++ b/cli/tools/bundle.rs @@ -25,6 +25,15 @@ pub async fn bundle( bundle_flags: BundleFlags, ) -> Result<(), AnyError> { let cli_options = Arc::new(CliOptions::from_flags(flags)?); + + log::info!( + "{} \"deno bundle\" is deprecated and will be removed in the future.", + colors::yellow("Warning"), + ); + log::info!( + "Use alternative bundlers like \"deno_emit\", \"esbuild\" or \"rollup\" instead." + ); + let resolver = |_| { let cli_options = cli_options.clone(); let source_file1 = &bundle_flags.source_file;