-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from Mackiovello/issue/189
Improve UX for pack and publish path expectations
- Loading branch information
Showing
8 changed files
with
85 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# pack and publish | ||
|
||
The `publish` and `pack` commands interact with the pkg directory that's | ||
created when you run `wasm-pack init`. The `pack` command creates a tarball | ||
from the pkg directory and the `publish` command creates a tarball from the | ||
pkg directory __and__ publishes it to the NPM registry. | ||
|
||
Underneath, these commands use `npm pack` and `npm publish`. You can read | ||
more about these in the NPM documentation: | ||
|
||
- [`npm pack`](https://docs.npmjs.com/cli/pack) | ||
- [`npm publish`](https://docs.npmjs.com/cli/publish) | ||
|
||
Both these commands take the path to the pkg directory as the first argument. | ||
You can either set the argument directly to the pkg directory or to the parent | ||
of the pkg directory: | ||
|
||
``` | ||
$ wasm-pack pack myproject/pkg | ||
| 🎒 packed up your package! | ||
$ wasm-pack pack myproject | ||
| 🎒 packed up your package! | ||
``` | ||
|
||
If you try to call `pack` or `publish` on another directory, you get an error: | ||
|
||
``` | ||
$ wasm-pack pack myproject/src/ | ||
Unable to find the pkg directory at path 'myproject/src/', or in a child directory of 'myproject/src/' | ||
``` | ||
|
||
If you don't set a path, they use the current directory as the path. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters