fix(publish): print files that will be published (#22495)

This commit is contained in:
Luca Casonato 2024-02-20 13:30:34 +01:00 committed by GitHub
parent 8fdd655562
commit 54a3eb585d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 0 deletions

View File

@ -828,6 +828,16 @@ pub async fn publish(
}
if publish_flags.dry_run {
for (_, package) in prepared_data.package_by_name {
log::info!(
"{} of {} with files:",
colors::green_bold("Simulating publish"),
colors::gray(package.display_name()),
);
for file in &package.tarball.files {
log::info!(" {} ({})", file.specifier, human_size(file.size as f64),);
}
}
log::warn!("{} Aborting due to --dry-run", colors::yellow("Warning"));
return Ok(());
}

View File

@ -160,6 +160,8 @@ pub fn create_gzipped_tarball(
write!(&mut hash, "{:02x}", byte).unwrap();
}
files.sort_by(|a, b| a.specifier.cmp(&b.specifier));
Ok(PublishableTarball {
files,
hash,

View File

@ -1,3 +1,7 @@
Checking for slow types in the public API...
Check [WILDCARD]
Simulating publish of @foo/bar@1.0.0 with files:
[WILDCARD]deno.json (140B)
[WILDCARD]mod.ts (114B)
[WILDCARD]std_http.ts (119B)
Warning Aborting due to --dry-run

View File

@ -8,4 +8,7 @@ warning[unsupported-file-type]: unsupported file type 'symlink'
info: the file was ignored and will not be published
docs: https://jsr.io/go/unsupported-file-type
Simulating publish of @foo/bar@1.0.0 with files:
[WILDCARD]deno.json (87B)
[WILDCARD]mod.ts (56B)
Warning Aborting due to --dry-run