#path #git #intended #depend #nothing #overridden

cratesio-placeholder-package

A placeholder package intended to be overridden by path = or git = dependencies

17 releases

Uses old Rust 2015

0.0.3 Apr 28, 2022
0.0.2 Apr 28, 2022
0.0.1 Apr 26, 2022
0.0.0 Apr 26, 2022

#47 in #depend

Download history 574/week @ 2024-07-21 479/week @ 2024-07-28 426/week @ 2024-08-04 503/week @ 2024-08-11 595/week @ 2024-08-18 587/week @ 2024-08-25 1208/week @ 2024-09-01 1073/week @ 2024-09-08 619/week @ 2024-09-15 1250/week @ 2024-09-22 544/week @ 2024-09-29 160/week @ 2024-10-06 80/week @ 2024-10-13 41/week @ 2024-10-20 39/week @ 2024-10-27 52/week @ 2024-11-03

218 downloads per month
Used in safer-ffi

CC0 license

6KB

::cratesio-placeholder-package

If there is nothing in a crate, then a fortiori, there is nothing wrong with it either!

If you depend on a crate and it is empty, did you really depend on that crate?

Rationale

Sometimes you may want to publish a crate having a private / git / local dependency, which is useful for local or experimental development stuff, but which prevents your crate from being published.

In that case, you can use this hack empty placeholder package in its stead:

# Cargo.toml

[dependencies.your-crate-proxy]
# What public / crates.io users will see/use:
package = "cratesio-placeholder-package"
version = "=0.0.0"

# What `path` dependents will use
path = "path/to/your-crate-proxy"

and then have a your-crate-proxy crate, at version 0.0.0, somewhere in your private project layout, which correctly depends on the other private stuff you may need.

# path/to/your-crate-proxy/Cargo.toml

[package]
name = "cratesio-placeholder-package"
version = "0.0.0"

[dependencies]
# the real private dependency(ies)
your-crate.path = "private/your-crate"

Feature: proxying Cargo features

Sometimes, you may also want to proxy features from the frontend to your private dependency / to transitively enable feature from the private dependency.

In order to do that, such features will need to be proxied through this cratesio-placeholder-package

Hence why this package also features a total of 26 placeholder features (placeholder-feature-a, placeholder-feature-b, …, placeholder-feature-z) which you can use to achieve proper feature transitivity:

# Cargo.toml
[features]
foo = ["your-crate-proxy/placeholder-feature-a"]

[dependencies.your-crate-proxy]
# What public / crates.io users will see/use:
package = "cratesio-placeholder-package"
version = "=0.0.0"

# What `path` dependents will use
path = "path/to/your-crate-proxy"

+

# path/to/your-crate-proxy/Cargo.toml
[package]
name = "cratesio-placeholder-package"
version = "0.0.0"

[dependencies]
# the real private dependency(ies)
your-crate.path = "private/your-crate"

[features]
placeholder-feature-a = ["your-crate/foo"]

No runtime deps

Features