invertase / melos

🌋 A tool for managing Dart projects with multiple packages. With IntelliJ and Vscode IDE support. Supports automated versioning, changelogs & publishing via Conventional Commits.
https://melos.invertase.dev/~melos-latest
Apache License 2.0
1.12k stars 199 forks source link

fix: Replacing self hosted publish_to path #576

Open cs-daniel opened 1 year ago

cs-daniel commented 1 year ago

Is there an existing issue for this?

Version

3.0.0

Description

When publishing packages that have a custom publish_to url that contains a path (e.g. www.customurl.com/custom/path/), reading the current versions of the packages from the repository/registry does not work. As far as I can tell code around line no. ~901 in package.dart is the reason.

final pubHosted = publishTo ?? pubUrl;

final url = pubHosted.replace(path: '/api/packages/$name');

Is there any reason that path is not just appended instead of replacing?

Steps to reproduce

  1. Create a package with a publish_to url that has a path in it
  2. Publish a version
  3. Make changes and try to publish another version
  4. Reading the registry version will fail

Expected behavior

Show the proper registry versions no matter what the package's publish_to url is.

Screenshots

No response

Additional context and comments

No response