feat(pkg): support license, repo

master
Ashley Williams 7 years ago
parent cf76d3cde0
commit c9d9ef1776
  1. 3
      Cargo.toml
  2. 15
      src/lib.rs

@ -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