From e944298e2ae61beb9d9b577e781b851dcb2fa7d3 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 14 Mar 2019 08:38:15 -0700 Subject: [PATCH] Update prerequisites documentation A few assorted improvements to the prerequisites documentation: * Rust nightly/beta requirements are removed * Wording indicating that `wasm-pack` requires `npm` has been clarified * The dedicated Rust page was removed as it's largely just "install Rust" nowadays * The heading of the NPM page in the sidebar now includes `(optional)` to clarify that it's not required. --- docs/src/SUMMARY.md | 3 +-- docs/src/prerequisites/index.md | 21 ++++++++++++++------ docs/src/prerequisites/rust.md | 35 --------------------------------- 3 files changed, 16 insertions(+), 43 deletions(-) delete mode 100644 docs/src/prerequisites/rust.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 25e2e4fa..5b7b3233 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -1,8 +1,7 @@ # Summary - [Prerequisites](./prerequisites/index.md) - - [Rust](./prerequisites/rust.md) - - [npm](./prerequisites/npm.md) + - [npm (optional)](./prerequisites/npm.md) - [Project Setup](./project-setup/index.md) - [Using a Template](./project-setup/using-a-template.md) - [Manual Setup](./project-setup/manual-setup.md) diff --git a/docs/src/prerequisites/index.md b/docs/src/prerequisites/index.md index b56901ab..b42e2b73 100644 --- a/docs/src/prerequisites/index.md +++ b/docs/src/prerequisites/index.md @@ -1,10 +1,19 @@ # Prerequisites -To run `wasm-pack` you'll need to have both Rust and npm installed and configured. +First you'll want to [install the `wasm-pack` CLI][wasm-pack], and `wasm-pack +-V` should print the version that you just installed. -- [Rust](/wasm-pack/book/prerequisites/rust.html) -- [npm](/wasm-pack/book/prerequisites/npm.html) +[wasm-pack]: https://rustwasm.github.io/wasm-pack/installer/ -In the future, we intend to rewrite the npm registry client bits so that the need -for a Node runtime is eliminated. If you're excited about that work- you should -reach out to the maintainers and get involved! +Next, since `wasm-pack` is a build tool, you'll want to make sure you have +[Rust][rust] installed. Make sure `rustc -V` prints out at least 1.30.0. + +[rust]: https://www.rust-lang.org/tools/install + +Finally, if you're using `wasm-pack` to install to publish to NPM, you'll want +to [install and configure `npm`][npm]. In the future, we intend to rewrite the +npm registry client bits so that the need for a Node runtime is eliminated. If +you're excited about that work- you should reach out to the maintainers and get +involved! + +[npm]: npm.html diff --git a/docs/src/prerequisites/rust.md b/docs/src/prerequisites/rust.md deleted file mode 100644 index e79a89bd..00000000 --- a/docs/src/prerequisites/rust.md +++ /dev/null @@ -1,35 +0,0 @@ -# Rust - -`wasm-pack` is a Command Line Interface tool written in Rust, and distributed with `cargo`. -As a result, you'll need Rust and `cargo` to use `wasm-pack`. - -### Installing Rust and Cargo - -To install Rust, visit this [page](https://www.rust-lang.org/en-US/install.html), which will -walk you through installing Rust and `cargo` on your machine using a tool called `rustup`. - -To confirm you have Rust and `cargo` installed, run: - -``` -rustc --version -cargo --version -``` - -### Rust Versions - -`wasm-pack` depends on a library called `wasm-bindgen`. `wasm-bindgen` requires that you use -Rust 1.30.0 or higher. This version is currently only available on the `nightly` or `beta` -channels. - -To get the correct version of Rust, you'll use `rustup` a Rust version manager that comes -bundled with Rust. Run this command to install the latest Rust on the `beta` channel: - -``` -rustup install beta -``` - -You can set your project directory to always use this version of Rust by running: - -``` -rustup override set beta -```