pub-dev icon indicating copy to clipboard operation
pub-dev copied to clipboard

Way to check if package name is available

Open JHubi1 opened this issue 1 year ago • 4 comments

Already happened a few times that I found a name that seemingly is free, so showing a 404 on pubdev. I develop my package, polish it, get it ready for shipment. But when I try publishing, pubdev blocks it, because another package with a similar name already exists.

How am I supposed to know? "Rebranding" a package is not always easy. It would be very good if there was a way of checking avaliability. A small message on the 404 that reads along the lines of "did you mean xyz", or something integrated into the CLI, as described in dart-lang/pub#3966

JHubi1 avatar Dec 10 '24 15:12 JHubi1

@JHubi1: could you please give us some example names that were in conflict with the existing ones?

isoos avatar Dec 10 '24 15:12 isoos

I guess one problem is our "similarity detection". So https://pub.dev/packages/retrys is 404, but you cannot publish it anyways.

Also our moderated/deleted packages packages result in 404, but we have tombstones that block publishing

sigurdm avatar Dec 10 '24 15:12 sigurdm

Exactly, plurals or underscores block the package name with no effective way of knowing whether the name would work or not, until you try publishing

I encouraged this with my licenses_dart package. Originally wanted to publish to licenses, but couldn't because of license.

I'm not complaining about the existence of the system, but there not being a way to check beforehand is problematic

JHubi1 avatar Dec 10 '24 15:12 JHubi1

We could probably have a simple form that checks if the package name is available. As this is a server-side check specific to pub.dev (and may be absent on private or third-party servers), the pub client wouldn't know about it up until the actual publish attempt is made.

isoos avatar Dec 12 '24 08:12 isoos