Compare commits

..

No commits in common. '32e52ca893e26c97bbf478c57ae1e9abed23c449' and '7522a8cea638904a9fabe1404e22464d6b4621da' have entirely different histories.

  1. 2
      .github/workflows/release.yml
  2. 38
      CHANGELOG.md
  3. 473
      Cargo.lock
  4. 2
      Cargo.toml
  5. 6
      docs/index.html
  6. 6
      docs/src/cargo-toml-configuration.md
  7. 2
      npm/package.json
  8. 46
      npm/yarn.lock
  9. 8
      src/bindgen.rs
  10. 3
      src/build/mod.rs
  11. 31
      src/command/build.rs
  12. 2
      src/install/mod.rs
  13. 42
      src/manifest/mod.rs
  14. 2
      src/test/webdriver/geckodriver.rs
  15. 15
      tests/all/build.rs
  16. 52
      tests/all/utils/fixture.rs

@ -100,7 +100,7 @@ jobs:
run: 7z a -ttar -so -an ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.target }} | 7z a -si ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
- name: Upload Zip
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.target }}
path: ./${{ env.RELEASE_DIR }}

@ -2,44 +2,6 @@
## 🤍 Unreleased
## ☀ 0.13.1
- ### ✨ Features
- **Requests using proxy settings from env - [jjyr], [pull/1438]**
This enables ureq to use proxy settings from env, it solves lots of pain in network restricted environments.
[pull/1438]: https://github.com/rustwasm/wasm-pack/pull/1438
[jjyr]: https://github.com/jjyr
- ### 🤕 Fixes
- **Update binary-install to v0.4.1 - [drager], [pull/1407]**
Release v0.4.0 of binary-install introduced a regression that caused failures on some platforms. This release fixes that regression.
[pull/1407]: https://github.com/rustwasm/wasm-pack/pull/1407
[drager]: https://github.com/drager
- ** Allow npm binary upgrades - [net], [pull/1439]**
Fixes an issue where upgrading `wasm-pack` via NPM would not update the underlying binary.
Previously, the binary was stored in the `binary-install` package's directory without versioning, causing version upgrades to silently fail as the old binary continued to be used.
The binary is now stored in `node_modules/wasm-pack/binary/`, ensuring proper version updates when upgrading the package.
**Before:** Upgrading from `0.12.1` to `0.13.0` would continue using the `0.12.1` binary
**After:** Each `wasm-pack` version manages its own binary, enabling proper version upgrades
[pull/1439]: https://github.com/rustwasm/wasm-pack/pull/1439
[net]: https://github.com/net
- ### 🛠 Maintenance
- ** Remove unmaintained dependency atty in favor of stdlib - [mariusvniekerk], [pull/1436]**
[pull/1436]: https://github.com/rustwasm/wasm-pack/pull/1436
[mariusvniekerk]: https://github.com/mariusvniekerk
## ☀ 0.13.0
- ### ✨ Features

473
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
[package]
name = "wasm-pack"
description = "📦✨ your favorite rust -> wasm workflow tool!"
version = "0.13.1"
version = "0.13.0"
authors = ["Ashley Williams <ashley666ashley@gmail.com>", "Jesper Håkansson <jesper@jesperh.se>"]
repository = "https://github.com/rustwasm/wasm-pack.git"
license = "MIT OR Apache-2.0"

@ -42,9 +42,9 @@
<h2>📦✨ your favorite rust -> wasm workflow tool!</h2>
</div>
<div class="five columns" id="installer">
<a class="button button-primary" href="/wasm-pack/installer">✨ Install wasm-pack 0.13.1</a>
<p>29 Oct 2024 |
<a href="https://github.com/rustwasm/wasm-pack/releases/tag/v0.13.1">
<a class="button button-primary" href="/wasm-pack/installer">✨ Install wasm-pack 0.13.0</a>
<p>1 July 2024 |
<a href="https://github.com/rustwasm/wasm-pack/releases/tag/v0.13.0">
Release Notes
</a>
</p>

@ -18,10 +18,6 @@ The available configuration options and their default values are shown below:
# be set to an array of strings which are explicit arguments to pass to
# `wasm-opt`. For example `['-Os']` would optimize for size while `['-O4']`
# would execute very expensive optimizations passes
#
# In most cases, the `-O[X]` flag is enough. However, if you require extreme
# optimizations, see the full list of `wasm-opt` optimization flags
# https://github.com/WebAssembly/binaryen/blob/version_117/test/lit/help/wasm-opt.test
wasm-opt = ['-O']
[package.metadata.wasm-pack.profile.dev.wasm-bindgen]
@ -33,8 +29,6 @@ demangle-name-section = true
dwarf-debug-info = false
# Should we omit the default import path?
omit-default-module-path = false
# Controls whether wasm-bindgen will split linked modules out into their own files. Enabling this is recommended, because it allows lazy-loading the linked modules and setting a stricter Content Security Policy. Only available in wasm-bindgen 0.2.95 and later.
split-linked-modules = false
[package.metadata.wasm-pack.profile.profiling]
wasm-opt = ['-O']

@ -1,6 +1,6 @@
{
"name": "wasm-pack",
"version": "0.13.1",
"version": "0.13.0",
"description": "📦✨ your favorite rust -> wasm workflow tool!",
"main": "binary.js",
"scripts": {

@ -15,9 +15,9 @@ balanced-match@^1.0.0:
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
binary-install@^1.0.1:
version "1.1.0"
resolved "https://registry.npmjs.org/binary-install/-/binary-install-1.1.0.tgz"
integrity sha512-rkwNGW+3aQVSZoD0/o3mfPN6Yxh3Id0R/xzTVBVVpGNlVz8EGwusksxRlbk/A5iKTZt9zkMn3qIqmAt3vpfbzg==
version "1.0.6"
resolved "https://registry.yarnpkg.com/binary-install/-/binary-install-1.0.6.tgz#7d603003da4f890d13d3e887773e86776e0d24a3"
integrity sha512-h3K4jaC4jEauK3csXI9GxGBJldkpuJlHCIBv8i+XBNhPuxnlERnD1PWVczQYDqvhJfv0IHUbB3lhDrZUMHvSgw==
dependencies:
axios "^0.26.1"
rimraf "^3.0.2"
@ -39,12 +39,12 @@ chownr@^2.0.0:
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
follow-redirects@^1.14.8:
version "1.15.9"
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz"
integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==
version "1.15.6"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==
fs-minipass@^2.0.0:
version "2.1.0"
@ -56,24 +56,24 @@ fs-minipass@^2.0.0:
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
glob@^7.1.3:
version "7.2.3"
resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
version "7.2.0"
resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz"
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.1.1"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz"
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
dependencies:
once "^1.3.0"
wrappy "1"
@ -83,23 +83,23 @@ inherits@2:
resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
minimatch@^3.1.1:
minimatch@^3.0.4:
version "3.1.2"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"
minipass@^3.0.0:
version "3.3.6"
resolved "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz"
integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==
version "3.1.6"
resolved "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz"
integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==
dependencies:
yallist "^4.0.0"
minipass@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d"
integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==
minizlib@^2.1.1:
@ -118,14 +118,14 @@ mkdirp@^1.0.3:
once@^1.3.0:
version "1.4.0"
resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz"
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
rimraf@^3.0.2:
version "3.0.2"
@ -136,7 +136,7 @@ rimraf@^3.0.2:
tar@^6.1.11:
version "6.2.1"
resolved "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
dependencies:
chownr "^2.0.0"
@ -149,7 +149,7 @@ tar@^6.1.11:
wrappy@1:
version "1.0.2"
resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
yallist@^4.0.0:
version "4.0.0"

@ -23,10 +23,9 @@ pub fn wasm_bindgen_build(
profile: BuildProfile,
extra_options: &Vec<String>,
) -> Result<()> {
let profile_name = match profile.clone() {
let release_or_debug = match profile {
BuildProfile::Release | BuildProfile::Profiling => "release",
BuildProfile::Dev => "debug",
BuildProfile::Custom(profile_name) => &profile_name.clone(),
};
let out_dir = out_dir.to_str().unwrap();
@ -42,7 +41,7 @@ pub fn wasm_bindgen_build(
let wasm_path = target_directory
.join("wasm32-unknown-unknown")
.join(profile_name)
.join(release_or_debug)
.join(data.crate_name())
.with_extension("wasm");
@ -92,9 +91,6 @@ pub fn wasm_bindgen_build(
if profile.wasm_bindgen_omit_default_module_path() {
cmd.arg("--omit-default-module-path");
}
if profile.wasm_bindgen_split_linked_modules() {
cmd.arg("--split-linked-modules");
}
child::run(cmd, "wasm-bindgen").context("Running the wasm-bindgen CLI")?;
Ok(())

@ -104,9 +104,6 @@ pub fn cargo_build_wasm(
// Plain cargo builds use the dev cargo profile, which includes
// debug info by default.
}
BuildProfile::Custom(arg) => {
cmd.arg("--profile").arg(arg);
}
}
cmd.arg("--target").arg("wasm32-unknown-unknown");

@ -100,7 +100,7 @@ impl FromStr for Target {
/// The build profile controls whether optimizations, debug info, and assertions
/// are enabled or disabled.
#[derive(Clone, Debug)]
#[derive(Clone, Copy, Debug)]
pub enum BuildProfile {
/// Enable assertions and debug info. Disable optimizations.
Dev,
@ -108,8 +108,6 @@ pub enum BuildProfile {
Release,
/// Enable optimizations and debug info. Disable assertions.
Profiling,
/// User-defined profile with --profile flag
Custom(String),
}
/// Everything required to configure and run the `wasm-pack build` command.
@ -162,10 +160,6 @@ pub struct BuildOptions {
/// Create a profiling build. Enable optimizations and debug info.
pub profiling: bool,
#[clap(long = "profile")]
/// User-defined profile with --profile flag
pub profile: Option<String>,
#[clap(long = "out-dir", short = 'd', default_value = "pkg")]
/// Sets the output directory with a relative path.
pub out_dir: String,
@ -202,7 +196,6 @@ impl Default for BuildOptions {
no_opt: false,
release: false,
profiling: false,
profile: None,
out_dir: String::new(),
out_name: None,
extra_options: Vec::new(),
@ -228,19 +221,13 @@ impl Build {
let out_dir = crate_path.join(PathBuf::from(build_opts.out_dir)).clean();
let dev = build_opts.dev || build_opts.debug;
let profile = match (
dev,
build_opts.release,
build_opts.profiling,
build_opts.profile,
) {
(false, false, false, None) | (false, true, false, None) => BuildProfile::Release,
(true, false, false, None) => BuildProfile::Dev,
(false, false, true, None) => BuildProfile::Profiling,
(false, false, false, Some(profile)) => BuildProfile::Custom(profile),
let profile = match (dev, build_opts.release, build_opts.profiling) {
(false, false, false) | (false, true, false) => BuildProfile::Release,
(true, false, false) => BuildProfile::Dev,
(false, false, true) => BuildProfile::Profiling,
// Unfortunately, `clap` doesn't expose clap's `conflicts_with`
// functionality yet, so we have to implement it ourselves.
_ => bail!("Can only supply one of the --dev, --release, --profiling, or --profile 'name' flags"),
_ => bail!("Can only supply one of the --dev, --release, or --profiling flags"),
};
Ok(Build {
@ -368,7 +355,7 @@ impl Build {
fn step_build_wasm(&mut self) -> Result<()> {
info!("Building wasm...");
build::cargo_build_wasm(&self.crate_path, self.profile.clone(), &self.extra_options)?;
build::cargo_build_wasm(&self.crate_path, self.profile, &self.extra_options)?;
info!(
"wasm built at {:#?}.",
@ -443,7 +430,7 @@ impl Build {
self.weak_refs,
self.reference_types,
self.target,
self.profile.clone(),
self.profile,
&self.extra_options,
)?;
info!("wasm bindings were built at {:#?}.", &self.out_dir);
@ -453,7 +440,7 @@ impl Build {
fn step_run_wasm_opt(&mut self) -> Result<()> {
let mut args = match self
.crate_data
.configured_profile(self.profile.clone())
.configured_profile(self.profile)
.wasm_opt_args()
{
Some(args) => args,

@ -203,7 +203,7 @@ pub fn prebuilt_url_for(tool: &Tool, version: &str, arch: &Arch, os: &Os) -> Res
Tool::WasmOpt => {
Ok(format!(
"https://github.com/WebAssembly/binaryen/releases/download/{vers}/binaryen-{vers}-{target}.tar.gz",
vers = "version_117", // Make sure to update the version in docs/src/cargo-toml-configuration.md as well
vers = "version_117",
target = target,
))
}

@ -85,12 +85,6 @@ struct CargoWasmPackProfiles {
deserialize_with = "CargoWasmPackProfile::deserialize_profiling"
)]
profiling: CargoWasmPackProfile,
#[serde(
default = "CargoWasmPackProfile::default_custom",
deserialize_with = "CargoWasmPackProfile::deserialize_custom"
)]
custom: CargoWasmPackProfile,
}
impl Default for CargoWasmPackProfiles {
@ -99,7 +93,6 @@ impl Default for CargoWasmPackProfiles {
dev: CargoWasmPackProfile::default_dev(),
release: CargoWasmPackProfile::default_release(),
profiling: CargoWasmPackProfile::default_profiling(),
custom: CargoWasmPackProfile::default_custom(),
}
}
}
@ -127,9 +120,6 @@ struct CargoWasmPackProfileWasmBindgen {
#[serde(default, rename = "omit-default-module-path")]
omit_default_module_path: Option<bool>,
#[serde(default, rename = "split-linked-modules")]
split_linked_modules: Option<bool>,
}
/// Struct for storing information received from crates.io
@ -286,7 +276,6 @@ impl CargoWasmPackProfile {
demangle_name_section: Some(true),
dwarf_debug_info: Some(false),
omit_default_module_path: Some(false),
split_linked_modules: Some(false),
},
wasm_opt: None,
}
@ -299,7 +288,6 @@ impl CargoWasmPackProfile {
demangle_name_section: Some(true),
dwarf_debug_info: Some(false),
omit_default_module_path: Some(false),
split_linked_modules: Some(false),
},
wasm_opt: Some(CargoWasmPackProfileWasmOpt::Enabled(true)),
}
@ -312,20 +300,6 @@ impl CargoWasmPackProfile {
demangle_name_section: Some(true),
dwarf_debug_info: Some(false),
omit_default_module_path: Some(false),
split_linked_modules: Some(false),
},
wasm_opt: Some(CargoWasmPackProfileWasmOpt::Enabled(true)),
}
}
fn default_custom() -> Self {
CargoWasmPackProfile {
wasm_bindgen: CargoWasmPackProfileWasmBindgen {
debug_js_glue: Some(false),
demangle_name_section: Some(true),
dwarf_debug_info: Some(false),
omit_default_module_path: Some(false),
split_linked_modules: Some(false),
},
wasm_opt: Some(CargoWasmPackProfileWasmOpt::Enabled(true)),
}
@ -358,15 +332,6 @@ impl CargoWasmPackProfile {
Ok(profile)
}
fn deserialize_custom<'de, D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let mut profile = <Option<Self>>::deserialize(deserializer)?.unwrap_or_default();
profile.update_with_defaults(&Self::default_custom());
Ok(profile)
}
fn update_with_defaults(&mut self, defaults: &Self) {
macro_rules! d {
( $( $path:ident ).* ) => {
@ -377,7 +342,6 @@ impl CargoWasmPackProfile {
d!(wasm_bindgen.demangle_name_section);
d!(wasm_bindgen.dwarf_debug_info);
d!(wasm_bindgen.omit_default_module_path);
d!(wasm_bindgen.split_linked_modules);
if self.wasm_opt.is_none() {
self.wasm_opt = defaults.wasm_opt.clone();
@ -404,11 +368,6 @@ impl CargoWasmPackProfile {
self.wasm_bindgen.omit_default_module_path.unwrap()
}
/// Get this profile's configured `[wasm-bindgen.split-linked-modules]` value.
pub fn wasm_bindgen_split_linked_modules(&self) -> bool {
self.wasm_bindgen.split_linked_modules.unwrap()
}
/// Get this profile's configured arguments for `wasm-opt`, if enabled.
pub fn wasm_opt_args(&self) -> Option<Vec<String>> {
match self.wasm_opt.as_ref()? {
@ -531,7 +490,6 @@ impl CrateData {
BuildProfile::Dev => &self.manifest.package.metadata.wasm_pack.profile.dev,
BuildProfile::Profiling => &self.manifest.package.metadata.wasm_pack.profile.profiling,
BuildProfile::Release => &self.manifest.package.metadata.wasm_pack.profile.release,
BuildProfile::Custom(_) => &self.manifest.package.metadata.wasm_pack.profile.custom,
}
}

@ -9,7 +9,7 @@ use std::path::PathBuf;
// Keep it up to date with each `wasm-pack` release.
// https://github.com/mozilla/geckodriver/releases/latest
const DEFAULT_GECKODRIVER_VERSION: &str = "v0.35.0";
const DEFAULT_GECKODRIVER_VERSION: &str = "v0.34.0";
const DEFAULT_WINDOWS_GECKODRIVER_VERSION: &str = "v0.24.0";
const GECKODRIVER_LAST_UPDATED_STAMP: &str = "geckodriver_last_updated";

@ -212,21 +212,6 @@ fn build_different_profiles() {
}
}
#[test]
fn build_custom_profile() {
let profile_name = "my-custom-profile";
let fixture = utils::fixture::js_hello_world_with_custom_profile(profile_name);
fixture.install_local_wasm_bindgen();
fixture
.wasm_pack()
.arg("build")
.arg("--profile")
.arg(profile_name)
.assert()
.success();
}
#[test]
fn build_with_and_without_wasm_bindgen_debug() {
for debug in [true, false].iter().cloned() {

@ -154,49 +154,6 @@ impl Fixture {
)
}
/// Add a `Cargo.toml` with a correctly configured `wasm-bindgen`
/// dependency, `wasm-bindgen-test` dev-dependency, and `crate-type =
/// ["cdylib"]`.
///
/// `name` is the crate's name.
/// `profile` is the custom profile name.
pub fn cargo_toml_with_custom_profile(&self, name: &str, profile_name: &str) -> &Self {
self.file(
"Cargo.toml",
&format!(
r#"
[package]
authors = ["The wasm-pack developers"]
description = "so awesome rust+wasm package"
license = "WTFPL"
name = "{}"
repository = "https://github.com/rustwasm/wasm-pack.git"
version = "0.1.0"
[lib]
crate-type = ["cdylib"]
[dependencies]
# Note that this uses and `=` dependency because there are
# various tests which assert that the version of wasm
# bindgen downloaded is what we expect, and if `=` is
# removed then it will download whatever the newest version
# of wasm-bindgen is which may not be what's listed here.
wasm-bindgen = "=0.2.74"
[dev-dependencies]
wasm-bindgen-test = "0.3"
[profile.{}]
inherits = "release"
opt-level = 'z'
lto = true
"#,
name, profile_name
),
)
}
/// Add a `Cargo.toml` with a correctly configured `wasm-bindgen`
/// dependency, `wasm-bindgen-test` dev-dependency, and `crate-type =
/// ["cdylib"]`.
@ -447,15 +404,6 @@ pub fn js_hello_world() -> Fixture {
fixture
}
pub fn js_hello_world_with_custom_profile(profile_name: &str) -> Fixture {
let fixture = Fixture::new();
fixture
.readme()
.cargo_toml_with_custom_profile("js-hello-world", profile_name)
.hello_world_src_lib();
fixture
}
pub fn no_cdylib() -> Fixture {
let fixture = Fixture::new();
fixture.readme().hello_world_src_lib().file(

Loading…
Cancel
Save