Closed dlight closed 1 year ago
cargo-local-install
does actually look pretty cool, but as stated before I can't publish to crates.io. I see that they support using git dependencies but I don't want to commit to it just yet, I've got some ideas that may involve customising the generators themselves.
Right now it's recommended to include prisma as a workspace crate, and a cli binary is not provided in crates.io because
cargo install
is a global installation, instead of being per project.But there is a tool called cargo local-install that installs tools locally for each project (similar to node's npx). You specify each package in
Cargo.toml
metadata alongside its version, like this:A great benefit is that it builds a single time for each version of the binary and reuses it across many projects, creating a symlink in the
bin
directory at the root of your project (thus it makes sense to add thisbin
directory to.gitignore
)A limitation is that
cargo local-install
doesn't create the appropriate alias on~/.cargo/config.toml
, and it should be created manually. However, the alias is being created manually today too.