Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Warning about no README when readme = false #1215

Closed
heaths opened this issue Jan 20, 2023 · 1 comment · Fixed by #1216 or #1298
Closed

Warning about no README when readme = false #1215

heaths opened this issue Jan 20, 2023 · 1 comment · Fixed by #1216 or #1298

Comments

@heaths
Copy link
Contributor

heaths commented Jan 20, 2023

🐛 Bug description

I have some crates nested as subdirectories, one of which is the crate I'm using with wasm-pack. When building it, it reports:

[WARN]: :-) origin crate has no README

It similarly warned about having no license until I changed my Cargo.toml to the following (relevant to both points above):

[package]
readme = false
license-file = "../../LICENSE.txt"

This stopped the complaints about the missing license, at least, which I have only in my repo/workspace root.

🤔 Expected Behavior

While not a critical problem, it would be nice if the Cargo-standard setting of package.readme = false meant that wasm-pack didn't try looking for it.

👟 Steps to reproduce

My repo (simplified) is set up like this:

README.md
LICENSE.txt
Cargo.toml <- workspace.members = [ "crates/foo", "crates/bar" ]
crates/
  foo/
    Cargo.toml <- package.readme = false, package.license-file = "../../LICENSE.txt"
  bar/ <- the wasm project
    Cargo.toml <- package.readme = false, package.license-file = "../../LICENSE.txt"

🌍 Your environment

wasm-pack version: 0.10.3
rustc version: 1.66.1 (90743e729 2023-01-10)

heaths added a commit to heaths/wasm-pack that referenced this issue Jan 21, 2023
Fixes rustwasm#1215 by honoring how package.readme is authored in Cargo.toml, if authored. This could be a path or a boolean to disable searching for the path.

Also fixes the existing `it_copies_a_readme_provided_path` test which was an exact copy - just with fewer empty lines - of `it_copies_a_readme_default_path` and wasn't honoring any authored path since there was no way to get the authored path.
@heaths
Copy link
Contributor Author

heaths commented Jan 21, 2023

For triage / discussion purposes, I wanted to mention here in the issue that the 2 tests for readme.rs were doing exactly the same thing, so I also fixed that. This revealed that wasm-pack wasn't actually honoring an authored package.readme location. So this change fixes both that, as well as allowing for a boolean value per documentation.

heaths added a commit to heaths/wasm-pack that referenced this issue May 30, 2023
Fixes rustwasm#1215 by honoring how package.readme is authored in Cargo.toml, if authored. This could be a path or a boolean to disable searching for the path.

Also fixes the existing `it_copies_a_readme_provided_path` test which was an exact copy - just with fewer empty lines - of `it_copies_a_readme_default_path` and wasn't honoring any authored path since there was no way to get the authored path.
heaths added a commit to heaths/wasm-pack that referenced this issue Jun 16, 2023
Fixes rustwasm#1215 by honoring how package.readme is authored in Cargo.toml, if authored. This could be a path or a boolean to disable searching for the path.

Also fixes the existing `it_copies_a_readme_provided_path` test which was an exact copy - just with fewer empty lines - of `it_copies_a_readme_default_path` and wasn't honoring any authored path since there was no way to get the authored path.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
1 participant