Skip to content

Commit

Permalink
feat(manifest): add main entry
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleygwilliams committed Apr 19, 2018
1 parent 5641d5c commit e374314
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct NpmPackage {
license: Option<String>,
repository: Option<Repository>,
files: Vec<String>,
main: String,
}

#[derive(Serialize)]
Expand Down Expand Up @@ -68,7 +69,8 @@ impl CargoManifest {
ty: "git".to_string(),
url: repo_url,
}),
files: vec![js_file, wasm_file],
files: vec![js_file.clone(), wasm_file],
main: js_file,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/manifest/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn it_creates_a_package_json_default_path() {
"https://github.com/ashleygwilliams/wasm-pack.git"
);
assert_eq!(pkg.files, ["wasm_pack.js", "wasm_pack_bg.wasm"]);
assert_eq!(pkg.main, "wasm_pack.js");
}

#[test]
Expand Down
1 change: 1 addition & 0 deletions tests/manifest/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct NpmPackage {
pub license: String,
pub repository: Repository,
pub files: Vec<String>,
pub main: String,
}

#[derive(Deserialize)]
Expand Down

0 comments on commit e374314

Please sign in to comment.