8000 alejandra binary crate not published on crates.io · Issue #449 · kamadorueda/alejandra · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
alejandra binary crate not published on crates.io #449
Open
@proski

Description

@proski

The alejandra crate published on crates.io is just the library. The command line utility is not included. It can be seen on the docs.rs page for the crate, on the Sources tab: https://docs.rs/crate/alejandra/3.1.0/source/

The sources correspond to the src/alejandra directory in this repository. By the way, that's why README.md is missing - it's missing from that directory.

That's also why I cannot use cargo to install alejandra:

$ cargo install alejandra
    Updating crates.io index
error: there is nothing to install in `alejandra v3.1.0`, because it has no binaries
`cargo install` is only for installing programs, and can't be used with libraries.
To use a library crate, add it as a dependency to a Cargo project with `cargo add`.

The simplest fix would be to publish the alejandra_cli crate. This approach is taken e.g. by taplo, the TOML formatter.

Another approach would be to add CLI to the alejandra crate, i.e. merge alejandra_cli into alejandra. That would be more user-friendly. This approach is taken by most crates that provide binaries, e.g. rpigrep, fd-find, stylua, stgit to name a few.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0