Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support license-file field in Cargo.toml #527

Merged
merged 3 commits into from
Jan 28, 2019

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented Jan 26, 2019

Make sure these boxes are checked! πŸ“¦βœ…

  • You have the latest version of rustfmt installed
$ rustup component add rustfmt-preview --toolchain nightly
  • You ran cargo fmt on the code base before submitting
  • You reference which issue is being closed in the PR text
    • I checked issues list. No issue was found.

In my package, no license field is provided in Cargo.toml, but license-file is provided. I noticed wasm-pack does not copy license file specified in license-file field.

https://doc.rust-lang.org/cargo/reference/manifest.html

This patch supports license-file field by following two additions:

  • wasm-pack copies file specified in license-file in Cargo.toml into pkg directory
  • Set "SEE LICENSE IN <filename>" to license field of package.json. This is standard way documented in official npm document: https://docs.npmjs.com/files/package.json#license

I added one new test case to check my implementation works fine.

✨✨ πŸ˜„ Thanks so much for contributing to wasm-pack! πŸ˜„ ✨✨

πŸ‘

…nse field in Cargo.toml

In 'license' field of package.json, it's ok to say 'license is written in
some file' as follows:

```
{ "license" : "SEE LICENSE IN <filename>" }
```

This notation is useful when 'license' field is missing in `Cargo.toml`
but `license-file` field is provided.

Ref:
https://docs.npmjs.com/files/package.json#license
'license-file' field is provided in Cargo.toml for providing path of
license file.

https://doc.rust-lang.org/cargo/reference/manifest.html
@ashleygwilliams ashleygwilliams added this to the 0.7.0 milestone Jan 28, 2019
Copy link
Member

@ashleygwilliams ashleygwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, holding on merge until i get 0.6.1 out, this will be merged for 0.7.0

@ashleygwilliams
Copy link
Member

actually- this can go into 0.6.1, merging now

@ashleygwilliams ashleygwilliams merged commit f829bae into rustwasm:master Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants