From 4d83471e58a2637c3525a5b66415547ef9ae39ac Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 8 Jan 2024 15:07:36 -0500 Subject: [PATCH] chore: rename do-not-use-publish (#21854) --- cli/args/flags.rs | 9 ++++----- cli/tests/integration/publish_tests.rs | 7 +++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index a05d31ce14..b5f99ac244 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -357,7 +357,6 @@ pub enum DenoSubcommand { Types, Upgrade(UpgradeFlags), Vendor(VendorFlags), - // TODO: Publish(PublishFlags), } @@ -942,8 +941,7 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { "uninstall" => uninstall_parse(&mut flags, &mut m), "upgrade" => upgrade_parse(&mut flags, &mut m), "vendor" => vendor_parse(&mut flags, &mut m), - // TODO: - "do-not-use-publish" => publish_parse(&mut flags, &mut m), + "publish" => publish_parse(&mut flags, &mut m), _ => unreachable!(), } } else { @@ -2372,9 +2370,9 @@ Remote modules and multiple modules may also be specified: } fn publish_subcommand() -> Command { - Command::new("do-not-use-publish") + Command::new("publish") .hide(true) - .about("Publish a package to the Deno registry") + .about("Unstable preview feature: Publish a package") // TODO: .long_about() .defer(|cmd| { cmd.arg( @@ -2382,6 +2380,7 @@ fn publish_subcommand() -> Command { .help( "The directory to the package, or workspace of packages to publish", ) + .default_missing_value(".") .value_hint(ValueHint::DirPath) .required(true), ) diff --git a/cli/tests/integration/publish_tests.rs b/cli/tests/integration/publish_tests.rs index c974113d2a..5465c08388 100644 --- a/cli/tests/integration/publish_tests.rs +++ b/cli/tests/integration/publish_tests.rs @@ -10,21 +10,20 @@ pub fn env_vars_for_registry() -> Vec<(String, String)> { } itest!(no_token { - args: "do-not-use-publish publish/missing_deno_json", + args: "publish publish/missing_deno_json", output: "publish/no_token.out", exit_code: 1, }); itest!(missing_deno_json { - args: - "do-not-use-publish --token 'sadfasdf' $TESTDATA/publish/missing_deno_json", + args: "publish --token 'sadfasdf' $TESTDATA/publish/missing_deno_json", output: "publish/missing_deno_json.out", exit_code: 1, temp_cwd: true, }); itest!(successful { - args: "do-not-use-publish --token 'sadfasdf' $TESTDATA/publish/successful", + args: "publish --token 'sadfasdf' $TESTDATA/publish/successful", output: "publish/successful.out", envs: env_vars_for_registry(), http_server: true,