Alex Crichton
8127b5b42d
Add support for `--target web`
...
This commit adds support for the new `--web` flag in `wasm-bindgen`
under the flag name `--target web`. To ensure that it was plubmed around
the stringly-typed `target` type was switched to an `enum Target` to
ensure that all cases it's looked at are handled appropriately for the
new `web` target.
6 years ago
Ashley Williams
cde16f1b22
fix(manifest): LICENSE and README don't need to be whitelisted
6 years ago
Ashley Williams
b0f47b960e
fix(style): appease cargo fmt
6 years ago
Nick Fitzgerald
5637b07577
tests: Port all of our tests to use `assert_cmd`
6 years ago
rhysd
835ce11023
add test case for copying 'homepage' field from Cargo.toml to package.json
6 years ago
rhysd
e724b01365
add tests to check README and licenses are in 'files' field
6 years ago
Jesper Håkansson
c39410c81e
feat: Use levenshtein function to warn about wasm-pack typos
7 years ago
Jesper Håkansson
203cf6996c
test: Add test case for `parse_crate_data`
7 years ago
Nick Fitzgerald
64d52d8735
Add three build profiles and infrastructure for their toml configuration
...
Fixes #153
Fixes #160
7 years ago
Jesper Håkansson
99b9602d31
chore: Run latest rustfmt
7 years ago
Jesper Håkansson
b47dfa3009
chore: Run latest rustfmt
7 years ago
Alex Crichton
35fe250d09
Fix wasm-bindgen if lib is renamed via `lib.name`
...
This commit fixes an issue where if a library is renamed via the `name`
key in the `[lib]` section of the manifest then `wasm-pack` would try to
generate bindings for an noexistent wasm-file, generating an error.
The fix was to internally use `cargo_metadata` more aggressively and
move around where this data is generated. This ended up refactoring a
few locations, but this should also bring improved error messages for
`cargo metadata` as well as caching the resulting data more aggressively
to avoid recalculating it too much.
Closes #339
7 years ago
Nick Fitzgerald
098eb33cea
Run cargo fmt
7 years ago
Nick Fitzgerald
6d3e9dfebb
Refactor: make `check_crate_config` a method of `CargoManifest`
7 years ago
Nick Fitzgerald
25490301e0
Refactor: make `get_crate_name` a method of `CargoManifest`
7 years ago
Nick Fitzgerald
0e09b3fd3c
Refactor: make `write_package_json` a method on `CargoManifest`
7 years ago
Nick Fitzgerald
511e6c29a0
Refactor: replace `manifest::read_cargo_toml` with a constructor
7 years ago
Nick Fitzgerald
4e6abcfd1d
Only read the `Cargo.toml` manifest once
...
And then keep reusing what we read, instead of re-reading it again.
Fixes #25
7 years ago
Jesper Håkansson
65d060cfc4
chore: Run latest rustfmt
7 years ago
Nick Fitzgerald
182c3931c3
Run cargo fmt
7 years ago
Nick Fitzgerald
e1c8ca825d
cargo fmt
7 years ago
data-pup
dd87211323
feat(lockfiles): Use `Cargo.lock` to identify wasm-bindgen versions
...
This lets us leverage `cargo` for semver finding and then ensure that we get the
exact same version of the CLI that cargo selected. It also lets us support fuzzy
dependencies like "0.2" instead of exact dependencies like "0.2.21" again.
7 years ago
Ashley Williams
286bed9c27
test(no-modules): no-modules works
7 years ago
Nick Fitzgerald
fa61f90909
tests: Make tests run faster by using Fixture builders
...
Instead of copying directories, just build the fixtures directly in the
temporary directory.
7 years ago
Ashley Williams
069f7ede2e
fix(manifest:esm): snakecase to remove warning, test for sideeffects field
7 years ago
Ashley Williams
354f038a1a
fix(style): remove printlns and appease cargo fmt
7 years ago
Ashley Williams
fc7c2d1593
test(manifest): update tests to reflect new pkgjsons
7 years ago
Nick Fitzgerald
577d1b33e6
feature(test): Add a `wasm-pack test` subcommand
...
This uses `wasm-bindgen-test` under the hood.
Fixes #248
7 years ago
Mackenzie Clark
40b0291715
add out dir cli parameter
7 years ago
Nick Fitzgerald
b480674df4
fix: Handle both underscores and hypthens as separators in "wasm-bindgen" dependencies
7 years ago
csmoe
15fdec2c0b
Split fixture, rename readme to file
7 years ago
csmoe
022b787a2f
cmd(init/build): deprecate init
7 years ago
Nick Fitzgerald
ccd8edbae1
tests: Copy fixtures into unique temporary directories
...
If a test is going to do a potentially destructive operation, instead of
mutating shared fixtures, it should copy the fixture to its own unique directory
and then mutate that copy (doesn't this sound like Rust's borrowing and
ownership rules?! ^.^)
7 years ago
Ashley Williams
58eaed1550
fix(depcheck): add failing test to repro bug
7 years ago
Mackiovello
1067f215be
Use PathBuf instead of String to handle paths
...
For #213
7 years ago
Ashley Williams
4d5c7b8b3a
fix(style): appease cargo fmt
7 years ago
Ashley Williams
180c2386ad
test(skip_types): check files key for pkgjsons that skip types
7 years ago
Ashley Williams
5004517bf0
fix(files): set files correctly for node and cleanup tests
7 years ago
Ian McIntyre
e4d7048c10
One more rustfmt run!
7 years ago
Ian McIntyre
8eb01dd4a3
Add additional asserts for JS main manifest files
7 years ago
Ian McIntyre
6061eb5595
Run rustfmt
7 years ago
Ian McIntyre
b04c3a8f53
Add additional asserts for package.json files
7 years ago
Ian McIntyre
e9b05b2181
Use sets to compare package.json files content
...
Order doesn't matter!
7 years ago
Ian McIntyre
bf222549af
Include the wasm-bindgen JS bridge file in files
7 years ago
ashley williams
35fc9e048b
Revert "fix(mainfest): missing _bg.js file in package.json"
7 years ago
LongYinan
729d543802
fix(mainfest): missing _bg.js file in package.json
7 years ago
Ashley Williams
ca0f469356
refactor(command): modularize command.rs
7 years ago
kohensu
09046aa40b
Add --skip-build flag for init command
...
This flag skips:
adding target
compiling to wasm
installing wasm-bindgen
running wasm-bindgen
7 years ago
Roberto Huertas
92b18f05bb
feat(wasm_bindgen): checks wasm-bindgen declaration in Cargo.toml
7 years ago
Noah Lemen
cad30f42ce
check that crate type includes cdylib
7 years ago