Ashley Williams
cde16f1b22
fix(manifest): LICENSE and README don't need to be whitelisted
7 years ago
Nick Fitzgerald
5637b07577
tests: Port all of our tests to use `assert_cmd`
7 years ago
rhysd
bae98ef92a
copy 'homepage' field from Cargo.toml to package.json
...
- Cargo.toml
- https://doc.rust-lang.org/cargo/reference/manifest.html
- package.json
- https://docs.npmjs.com/files/package.json#homepage
7 years ago
rhysd
6dbcba22e8
include README.md and license files in 'files' field of package.json
7 years ago
rhysd
5f515dcf68
add a test case for non-standard license file field
7 years ago
rhysd
9fa5139caf
be aware of license-file field as source of license
...
'license-file' field is provided in Cargo.toml for providing path of
license file.
https://doc.rust-lang.org/cargo/reference/manifest.html
7 years ago
rhysd
fee93bc965
use license-file field for license field of package.json when no license field in Cargo.toml
...
In 'license' field of package.json, it's ok to say 'license is written in
some file' as follows:
```
{ "license" : "SEE LICENSE IN <filename>" }
```
This notation is useful when 'license' field is missing in `Cargo.toml`
but `license-file` field is provided.
Ref:
https://docs.npmjs.com/files/package.json#license
7 years ago
Mason Stallmo
d84aae3b64
Refactor: fix clippy warnings
7 years ago
Mason Stallmo
272ef97bef
Refactor: make `crate_license` a method of CrateData.
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
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
Jesper Håkansson
9404c1496d
chore: Run rustfmt
7 years ago
Jesper Håkansson
0be4905e31
refactor: Return failure::Error instead of wasm_pack::error::Error
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
e1c8ca825d
cargo fmt
7 years ago
Alex Crichton
3d1f528fc9
Make tests more future-proof with wasm-bindgen
...
This way when future wasm-bindgen version are published the tests will
continue working!
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
120236f1a9
fix(style): appease cargo fmt
7 years ago
Ashley Williams
d79349e1f5
feat(manifest): build no_modules npmpkg
7 years ago
Ashley Williams
f5eaad2d77
refactor(manifest): make check optional deps a method
7 years ago
Ashley Williams
8b9ad63985
refactor(manifest:types): clean up code duplication
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
e607eda95c
refactor(manifest): move optional field warn checks to function
7 years ago
Ashley Williams
195c4e1cd6
feat(manifest:npm:esm): add sideeffects key, set to false
7 years ago
Ashley Williams
20239ecba3
feat(manifest): whitelist js file in es6 mod packagejson
7 years ago
Ashley Williams
7f38eb9b0c
fix(manifest:npm): s/es6/esmodules
7 years ago
Ashley Williams
f06f3cca0d
refactor(manifest/npm): break into mods
7 years ago
Ashley Williams
13d77ef539
feat(manifest): seralize into diff packagejsons based on target
7 years ago
Ashley Williams
33eccd33d8
refactor(manifest): refactor npm package into own mod
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
Tyler Wilcock
45136e3642
Provide single quote separators around missing Cargo.toml field to improve readability
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
data-pup
8301613278
Coordinate wasm-bindgen versions.
7 years ago
Erick Tryzelaar
5df8749154
Skip serializing empty or None values to package.json
7 years ago
Nick Fitzgerald
7fff2b6a15
Better error message when running wasm-pack in a non-crate directory
7 years ago