Ingvar Stepanyan
d788b80583
Generate self-.gitignore as part of pkg folder
7 years ago
Mason Stallmo
272ef97bef
Refactor: make `crate_license` a method of CrateData.
7 years ago
Mason Stallmo
1c704b7b7c
Reword WTFPL and add punctuation to license not found message.
7 years ago
Mason Stallmo
2d837f795c
Copy license file(s) to out directory
...
Check the Cagro.toml for a license and if one is found glob for LICENSE* files to copy to the out directory
7 years ago
Jesper Håkansson
07d813f606
fix: Print the possible misspelled key so the user doesnt have to guess
7 years ago
Jesper Håkansson
c39410c81e
feat: Use levenshtein function to warn about wasm-pack typos
7 years ago
Jesper Håkansson
6894e63110
chore: Fix typo
7 years ago
Jesper Håkansson
2ed3d01541
refactor: Move parsing and warning code into two new functions
7 years ago
Jesper Håkansson
59039e4118
feat: Catch types in Cargo.toml and warn about them
7 years ago
Nick Fitzgerald
64d52d8735
Add three build profiles and infrastructure for their toml configuration
...
Fixes #153
Fixes #160
7 years ago
Mackenzie Clark
b3d62e1649
do not canonicalize the crate path
7 years ago
Jesper Håkansson
99b9602d31
chore: Run latest rustfmt
7 years ago
Alex Crichton
fe48dbd15a
Don't require cdylib crate-type for testing
...
The `cdylib` crate type output isn't actually necessary for the
`wasm-pack test` stage because `wasm-bindgen` isn't run over a wasm
file. This commit removes the checks during `wasm-pack test` that the
`cdylib` crate type is configured.
7 years ago
Jesper Håkansson
489d3e84c2
refactor: Rename binary-install to wasm-pack-binary-install
7 years ago
Jesper Håkansson
50e472de05
chore: Remove unused crates and error variants
7 years ago
Alex Crichton
11beac3736
Replace internal `Error` with `failure::Error`
...
This commit removes the internal `Error` type in favor of exclusively
using the `failure::Error` type, simplifying error construction in a
number of locations and reducing the number of error types in play.
7 years ago
Nick Fitzgerald
3575a0a5fc
Rename `--debug` to `--dev` to match `cargo`
...
See #437
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
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
Alex Crichton
f986edf4c7
Move test synchronization to tests, not in `wasm-pack`
...
In `wasm-pack` it can't do cross-process synchronization, and in tests
there's now multiple processes which need to be synchronized.
7 years ago
Alex Crichton
c664cfddd1
Use a global cache for all downloaded binaries
...
This commit switches wasm-pack to using a global cache for all download
binaries, living typically in a user's home directory. The intention
here is to aovid creating a `bin` folder in all wasm-pack projects and
additionally share downloads between projects to ensure that you're
downloading a minimal number of binaries from the network.
Along the way the downloading code was restructured to support a global
cache, but everything should largely be as it was before!
Closes #292
7 years ago
Nick Fitzgerald
1bbc966240
Don't print stdout/stderr in error messages because we already pipe that to console when running the child process
...
Fixes #422
7 years ago
Nick Fitzgerald
b16660375e
Add "Error:" prefix to error messages
7 years ago
Nick Fitzgerald
352b47d732
Provide better error context for `cargo build`
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
965ae35933
Add no-modules to --target flag's help text
...
Fixes #416
7 years ago
huangjj27
c713477ac8
change for cargo_metadata
7 years ago
huangjj27
ee9116d2e0
bugfix(bindgen-target-dir): use PathBuf to join
...
the old code are hard coded path with "/", which may cause error
on windows, thus changing to use PathBuf.join.
fixing #414
7 years ago
Jesper Håkansson
a4b29a9293
refactor: Move binary installation to it's own crate
7 years ago
Jesper Håkansson
9404c1496d
chore: Run rustfmt
7 years ago
Jesper Håkansson
b7a84200a6
chore: Run rustfmt
7 years ago
Jesper Håkansson
0be4905e31
refactor: Return failure::Error instead of wasm_pack::error::Error
7 years ago
Jesper Håkansson
899f5e0ffc
refactor: Import self and use full module path for failure
...
Use full module path for failure to be consistent since
it's used like that in other modules.
7 years ago
Jesper Håkansson
e9e0fb3cba
refactor: Return failure::Error instead of wasm_pack::error::Error
7 years ago
Nick Fitzgerald
e9276e0aab
error: Add stdout to the `Error::Cli` variant
7 years ago
Nick Fitzgerald
1621d18072
child: Always print everything to our output
...
Also don't buffer the child's stdout and stderr.
7 years ago
Mason Stallmo
78117ef4a1
Fix bad formating
7 years ago
Mason Stallmo
b82fa7db65
Combine filed missing messages into one INFO line
7 years ago
Mason Stallmo
e47af81f8f
Change to INFO when alerting users about missing fields in Cargo.toml
7 years ago
Nick Fitzgerald
2fa961d97d
Use `child::run` for spawning child processes everywhere
7 years ago
Nick Fitzgerald
6e8e8a6cb2
Create a module for running child processes
7 years ago
konstin
514e5c6032
Add exit_status to cli error to fix #291
7 years ago
Alex Crichton
17b385060f
Remove lingering forced nightly usages
...
These look to have been removed elsewhere, so seem to be left in by
mistake!
7 years ago
Nick Fitzgerald
e1c8ca825d
cargo fmt
7 years ago
Nick Fitzgerald
15defe9038
test: fix crate dependency suggestion
...
Fixes #377
7 years ago