Merge pull request #6 from ashleygwilliams/all-the-attrs

feat(pkg): support license, repo
master
ashley williams 7 years ago committed by GitHub
commit a57d5b460e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .travis.yml
  2. 3
      Cargo.toml
  3. 15
      src/lib.rs

@ -4,13 +4,8 @@ cache:
cargo
rust:
- stable
- beta
- nightly
script:
- cargo test
- rustup component add rustfmt-preview
- cargo fmt -- --write-mode diff
matrix:
allow_failures:
- rust: nightly

@ -3,6 +3,9 @@ name = "wasm-pack"
description = "pack up the wasm and publish it to npm!"
version = "0.1.0"
authors = ["Ashley Williams <ashley666ashley@gmail.com>"]
repository = "https://github.com/ashleygwilliams/wasm-pack.git"
license = "MIT/Apache-2.0"
readme = "README.md"
[dependencies]
failure = "0.1.1"

@ -20,6 +20,8 @@ struct CargoPackage {
name: String,
description: String,
version: String,
license: String,
repository: String,
}
#[derive(Serialize)]
@ -27,6 +29,14 @@ struct NpmPackage {
name: String,
description: String,
version: String,
license: String,
repository: Repository,
}
#[derive(Serialize)]
struct Repository {
#[serde(rename = "type")] ty: String,
url: String,
}
fn read_cargo_toml() -> Result<CargoManifest, Error> {
@ -43,6 +53,11 @@ impl CargoManifest {
name: self.package.name,
description: self.package.description,
version: self.package.version,
license: self.package.license,
repository: Repository {
ty: "git".to_string(),
url: self.package.repository,
},
}
}
}

Loading…
Cancel
Save