From e483924b7598056c3b16555a904afd0a0589060f Mon Sep 17 00:00:00 2001 From: crowlkats Date: Tue, 13 Feb 2024 22:02:06 +0100 Subject: [PATCH 1/3] feat(publish): define config in publish url --- cli/tools/registry/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index cfdec04c560823..0cef943fae7505 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -68,6 +68,7 @@ struct PreparedPublishPackage { package: String, version: String, tarball: PublishableTarball, + config: String, } impl PreparedPublishPackage { @@ -158,6 +159,7 @@ async fn prepare_publish( package: package_name.to_string(), version: version.to_string(), tarball, + config: config_path.file_name().unwrap().to_string_lossy().to_string(), })) } @@ -541,8 +543,8 @@ async fn publish_package( ); let url = format!( - "{}scopes/{}/packages/{}/versions/{}", - registry_api_url, package.scope, package.package, package.version + "{}scopes/{}/packages/{}/versions/{}?config=/{}", + registry_api_url, package.scope, package.package, package.version, package.config ); let response = client From ac65c01501f1109f9cf5b06830dc328eef2c9e27 Mon Sep 17 00:00:00 2001 From: crowlkats Date: Tue, 13 Feb 2024 22:08:08 +0100 Subject: [PATCH 2/3] add comment --- cli/tools/registry/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index 0cef943fae7505..499e882596d06f 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -159,6 +159,8 @@ async fn prepare_publish( package: package_name.to_string(), version: version.to_string(), tarball, + // the config file is always at the root of a publishing dir, + // so getting the file name is always correct config: config_path.file_name().unwrap().to_string_lossy().to_string(), })) } From 56f2af030ff9256ea608ea37466a2905646c327c Mon Sep 17 00:00:00 2001 From: crowlkats Date: Tue, 13 Feb 2024 22:09:46 +0100 Subject: [PATCH 3/3] fmt --- cli/tools/registry/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index 499e882596d06f..0cd50e46dd2a04 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -161,7 +161,11 @@ async fn prepare_publish( tarball, // the config file is always at the root of a publishing dir, // so getting the file name is always correct - config: config_path.file_name().unwrap().to_string_lossy().to_string(), + config: config_path + .file_name() + .unwrap() + .to_string_lossy() + .to_string(), })) } @@ -546,7 +550,11 @@ async fn publish_package( let url = format!( "{}scopes/{}/packages/{}/versions/{}?config=/{}", - registry_api_url, package.scope, package.package, package.version, package.config + registry_api_url, + package.scope, + package.package, + package.version, + package.config ); let response = client