1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00

chore: rename do-not-use-publish (#21854)

This commit is contained in:
Ryan Dahl 2024-01-08 15:07:36 -05:00 committed by Bartek Iwańczuk
parent fb651776e4
commit 4d83471e58
No known key found for this signature in database
GPG key ID: 0C6BCDDC3B3AD750
2 changed files with 7 additions and 9 deletions

View file

@ -357,7 +357,6 @@ pub enum DenoSubcommand {
Types, Types,
Upgrade(UpgradeFlags), Upgrade(UpgradeFlags),
Vendor(VendorFlags), Vendor(VendorFlags),
// TODO:
Publish(PublishFlags), Publish(PublishFlags),
} }
@ -942,8 +941,7 @@ pub fn flags_from_vec(args: Vec<String>) -> clap::error::Result<Flags> {
"uninstall" => uninstall_parse(&mut flags, &mut m), "uninstall" => uninstall_parse(&mut flags, &mut m),
"upgrade" => upgrade_parse(&mut flags, &mut m), "upgrade" => upgrade_parse(&mut flags, &mut m),
"vendor" => vendor_parse(&mut flags, &mut m), "vendor" => vendor_parse(&mut flags, &mut m),
// TODO: "publish" => publish_parse(&mut flags, &mut m),
"do-not-use-publish" => publish_parse(&mut flags, &mut m),
_ => unreachable!(), _ => unreachable!(),
} }
} else { } else {
@ -2372,9 +2370,9 @@ Remote modules and multiple modules may also be specified:
} }
fn publish_subcommand() -> Command { fn publish_subcommand() -> Command {
Command::new("do-not-use-publish") Command::new("publish")
.hide(true) .hide(true)
.about("Publish a package to the Deno registry") .about("Unstable preview feature: Publish a package")
// TODO: .long_about() // TODO: .long_about()
.defer(|cmd| { .defer(|cmd| {
cmd.arg( cmd.arg(
@ -2382,6 +2380,7 @@ fn publish_subcommand() -> Command {
.help( .help(
"The directory to the package, or workspace of packages to publish", "The directory to the package, or workspace of packages to publish",
) )
.default_missing_value(".")
.value_hint(ValueHint::DirPath) .value_hint(ValueHint::DirPath)
.required(true), .required(true),
) )

View file

@ -10,21 +10,20 @@ pub fn env_vars_for_registry() -> Vec<(String, String)> {
} }
itest!(no_token { itest!(no_token {
args: "do-not-use-publish publish/missing_deno_json", args: "publish publish/missing_deno_json",
output: "publish/no_token.out", output: "publish/no_token.out",
exit_code: 1, exit_code: 1,
}); });
itest!(missing_deno_json { itest!(missing_deno_json {
args: args: "publish --token 'sadfasdf' $TESTDATA/publish/missing_deno_json",
"do-not-use-publish --token 'sadfasdf' $TESTDATA/publish/missing_deno_json",
output: "publish/missing_deno_json.out", output: "publish/missing_deno_json.out",
exit_code: 1, exit_code: 1,
temp_cwd: true, temp_cwd: true,
}); });
itest!(successful { itest!(successful {
args: "do-not-use-publish --token 'sadfasdf' $TESTDATA/publish/successful", args: "publish --token 'sadfasdf' $TESTDATA/publish/successful",
output: "publish/successful.out", output: "publish/successful.out",
envs: env_vars_for_registry(), envs: env_vars_for_registry(),
http_server: true, http_server: true,