cargo-dist

Version 0.14.0 (2024-05-06)

v0.14.0 May 6 2024 at 16:24 UTC

This is a BIG release for installers, with every installer getting big bugfixes and reworks.

  • shell installers:
    • support cascading install-path rules like "install to $MY_APP_HOME, or ~/.my-app if that's not set"
    • can install aliases for your binaries (symlink on unix, hardlink on windows)
    • properly setup PATH for fish shell
    • have more robust platform-support fallbacks
  • npm installers:
    • can be automatically published to npm
    • support multiple binaries
    • can install aliases for your binaries (additional bin commands on the package)
    • can have a different name from their parent cargo package
    • have more robust platform-support fallbacks
    • have all new docs
  • homebrew installers
    • can install aliases for your binaries (builtin homebrew aliases)
    • have more idiomatic install-hints
    • have all new docs

Features

npm installer rewrite

The npm installer has been rewritten to remove almost every limitation it has.

Notably, you can now have multiple binaries in an npm package without any issue. You can even make aliases for commands with the new bin-aliases setting.

Although for the best user experience, ensuring your package unambiguously has one true command is ideal. To help with this, the npm-package setting was added, allowing you to rename your npm package (which is one of the disambiguators for the primary command of an npm package).

You can also now automatically publish your npm packages by setting publish-jobs = ["npm"]!

install-path cascades

The install-path setting that's used by the shell and powershell installers can now be an array of options to try in sequence. This is mostly useful for checking if special environment variables are set before falling back to some hardcoded subdir of $HOME.

For instance, if you set:

install-dir = ["$MY_APP_HOME/bin", "~/.my-app/bin"]

Then your shell and powershell installers will first check if $MY_APP_HOME is defined and install to $MY_APP_HOME/bin if it is. If it's not defined then it will use the more hardcoded $HOME/.my-app/bin.

binary aliases

The shell, powershell, npm, and homebrew installers all now support aliases for binaries with the new bin-aliases setting. These are not included in your downloadable archives, and are setup in an installer-specific way:

publish github releases to other repo

If you need to publish your GitHub Releases to a different repo than the one you run your release workflow on, you can use the new github-releases-repo setting to specify this.

disable alternative source tarballs

You can now disable the backup source tarballs uploaded by cargo-dist with the new source-tarball setting.

Fixes