0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

feat: Deprecate 'deno bundle' subcommand (#17695)

This commit adds a deprecation warning when using "deno bundle"
subcommand and removes it from the output of "deno help".
This commit is contained in:
Bartek Iwańczuk 2023-02-14 02:13:44 +01:00 committed by GitHub
parent bd6ddd9b46
commit 0f1349bca8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 2 deletions

View file

@ -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)

View file

@ -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 ^^");

View file

@ -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

View file

@ -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;