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
Dan Reeves
953cf738f0
add the typescript definition to the published files
7 years ago
OJ Kwon
e6b5ca557f
test(manifest): update test cases
7 years ago
Ashley Williams
7da29b27b4
fix(bindgen): don't rename to index
7 years ago
Ashley Williams
6a2a20dd07
feat(test): clean up tests, test new main/files
7 years ago
Ashley Williams
e374314a32
feat(manifest): add main entry
7 years ago
Andy Bell
07d9001b59
feat(refactor): Furthers previous refactor, by moving
...
Functions to new module. Tidies up reused code into
private function.
Throws warning due to line 11 in command.rs - unused import
Import is used for the StructOpt derive macro, so is needed
but still throws this warning
7 years ago